sinzmise-cetastories 2.0.0-1731680903874 → 2.0.0-1732422813543
Sign up to get free protection for your applications and to get access to all the features.
- package/404/index.html +1 -1
- package/404.html +1 -0
- package/about/index.html +1 -1
- package/album/index.html +1 -1
- package/archives/2021/12/index.html +1 -1
- package/archives/2021/index.html +1 -1
- package/archives/2022/12/index.html +1 -1
- package/archives/2022/index.html +1 -1
- package/archives/2023/01/index.html +1 -1
- package/archives/2023/02/index.html +1 -1
- package/archives/2023/03/index.html +1 -1
- package/archives/2023/04/index.html +1 -1
- package/archives/2023/07/index.html +1 -1
- package/archives/2023/08/index.html +1 -1
- package/archives/2023/09/index.html +1 -1
- package/archives/2023/10/index.html +1 -1
- package/archives/2023/11/index.html +1 -1
- package/archives/2023/12/index.html +1 -1
- package/archives/2023/index.html +1 -1
- package/archives/2023/page/2/index.html +1 -1
- package/archives/2023/page/3/index.html +1 -1
- package/archives/2024/01/index.html +1 -1
- package/archives/2024/02/index.html +1 -1
- package/archives/2024/03/index.html +1 -1
- package/archives/2024/04/index.html +1 -1
- package/archives/2024/05/index.html +1 -1
- package/archives/2024/06/index.html +1 -1
- package/archives/2024/07/index.html +1 -1
- package/archives/2024/08/index.html +1 -1
- package/archives/2024/09/index.html +1 -1
- package/archives/2024/10/index.html +1 -1
- package/archives/2024/11/index.html +1 -0
- package/archives/2024/index.html +1 -1
- package/archives/2024/page/2/index.html +1 -1
- package/archives/index.html +1 -1
- package/archives/page/2/index.html +1 -1
- package/archives/page/3/index.html +1 -1
- package/archives/page/4/index.html +1 -1
- package/archives/page/5/index.html +1 -1
- package/atom.xml +211 -332
- package/baidusitemap.xml +175 -0
- package/bbs/bbs.html +1 -1
- package/bbs/bbs.js +12 -2
- package/bbs/index.html +1 -1
- package/categories/index.html +1 -1
- package/categories//344/270/252/344/272/272/345/260/217/350/256/260/index.html +1 -1
- package/categories//344/270/252/344/272/272/345/260/217/350/256/260/page/2/index.html +1 -1
- package/categories//344/270/252/344/272/272/345/260/217/350/256/260/page/3/index.html +1 -0
- package/categories//346/255/214/346/233/262/346/224/266/351/233/206/index.html +1 -1
- package/categories//346/270/270/346/210/217/347/233/270/345/205/263/index.html +1 -1
- package/categories//347/253/231/347/202/271/346/212/230/350/205/276/index.html +1 -1
- package/categories//347/253/231/347/202/271/346/212/230/350/205/276/page/2/index.html +1 -1
- package/categories//351/241/271/347/233/256/346/212/230/350/205/276/index.html +1 -1
- package/charts/index.html +1 -1
- package/comments/index.html +1 -1
- package/config.yaml +36 -2
- package/content.json +1 -1
- package/css/coin.css +1 -0
- package/css/custom2.css +1 -2
- package/css/hbe.style.css +1 -0
- package/css/index.css +1 -0
- package/css/kslink.css +1 -0
- package/css/pace/big-counter.css +1 -2
- package/css/pace/corner-indicator.css +1 -2
- package/css/pace/flash.css +1 -2
- package/css/pace/mac-osx.css +1 -2
- package/css/pace/pace.css +1 -2
- package/css/plane.css +1 -2
- package/css/tags.css +1 -2
- package/css/var.css +0 -0
- package/cw.js +1 -0
- package/essay/index.html +1 -1
- package/fcircle/index.html +1 -1
- package/friend.json +1 -1
- package/images/icon.png +0 -0
- package/images/siteicon/android/android-launchericon-144-144.png +0 -0
- package/images/siteicon/android/android-launchericon-192-192.png +0 -0
- package/images/siteicon/android/android-launchericon-48-48.png +0 -0
- package/images/siteicon/android/android-launchericon-512-512.png +0 -0
- package/images/siteicon/android/android-launchericon-72-72.png +0 -0
- package/images/siteicon/android/android-launchericon-96-96.png +0 -0
- package/images/siteicon/apple-touch-icon.png +0 -0
- package/images/siteicon/favicon-96x96.png +0 -0
- package/images/siteicon/favicon.ico +0 -0
- package/images/siteicon/favicon.svg +1 -1
- package/images/siteicon/ios/100.png +0 -0
- package/images/siteicon/ios/1024.png +0 -0
- package/images/siteicon/ios/114.png +0 -0
- package/images/siteicon/ios/120.png +0 -0
- package/images/siteicon/ios/128.png +0 -0
- package/images/siteicon/ios/144.png +0 -0
- package/images/siteicon/ios/152.png +0 -0
- package/images/siteicon/ios/16.png +0 -0
- package/images/siteicon/ios/167.png +0 -0
- package/images/siteicon/ios/180.png +0 -0
- package/images/siteicon/ios/192.png +0 -0
- package/images/siteicon/ios/20.png +0 -0
- package/images/siteicon/ios/256.png +0 -0
- package/images/siteicon/ios/29.png +0 -0
- package/images/siteicon/ios/32.png +0 -0
- package/images/siteicon/ios/40.png +0 -0
- package/images/siteicon/ios/50.png +0 -0
- package/images/siteicon/ios/512.png +0 -0
- package/images/siteicon/ios/57.png +0 -0
- package/images/siteicon/ios/58.png +0 -0
- package/images/siteicon/ios/60.png +0 -0
- package/images/siteicon/ios/64.png +0 -0
- package/images/siteicon/ios/72.png +0 -0
- package/images/siteicon/ios/76.png +0 -0
- package/images/siteicon/ios/80.png +0 -0
- package/images/siteicon/ios/87.png +0 -0
- package/images/siteicon/web-app-manifest-192x192.png +0 -0
- package/images/siteicon/web-app-manifest-512x512.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-100.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-125.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-150.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-200.png +0 -0
- package/images/siteicon/windows11/LargeTile.scale-400.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-100.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-125.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-150.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-200.png +0 -0
- package/images/siteicon/windows11/SmallTile.scale-400.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-100.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-125.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-150.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-200.png +0 -0
- package/images/siteicon/windows11/SplashScreen.scale-400.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-100.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-125.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-150.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-200.png +0 -0
- package/images/siteicon/windows11/Square150x150Logo.scale-400.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-16.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-20.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-24.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-256.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-30.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-32.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-36.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-40.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-44.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-48.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-60.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-72.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-80.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-lightunplated_targetsize-96.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-16.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-20.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-24.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-256.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-30.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-32.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-36.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-40.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-44.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-48.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-60.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-64.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-72.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-80.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.altform-unplated_targetsize-96.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-100.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-125.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-150.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-200.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.scale-400.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-16.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-20.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-24.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-256.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-30.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-32.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-36.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-40.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-44.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-48.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-60.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-64.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-72.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-80.png +0 -0
- package/images/siteicon/windows11/Square44x44Logo.targetsize-96.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-100.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-125.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-150.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-200.png +0 -0
- package/images/siteicon/windows11/StoreLogo.scale-400.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-100.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-125.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-150.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-200.png +0 -0
- package/images/siteicon/windows11/Wide310x150Logo.scale-400.png +0 -0
- package/img/404.jpg +0 -0
- package/img/favicon.png +0 -0
- package/index.html +1 -1
- package/js/Gold-ingot.js +1 -0
- package/js/autoload.js +1 -2
- package/js/bibi.js +1 -0
- package/js/census.js +1 -0
- package/js/clock.js +1 -2
- package/js/coin.js +1 -0
- package/js/fomal.js +1 -0
- package/js/kslink.js +1 -2
- package/js/main.js +1 -0
- package/js/newyear.js +1 -2
- package/js/plane.js +1 -2
- package/js/search/algolia.js +1 -2
- package/js/search/local-search.js +1 -0
- package/js/tw_cn.js +1 -0
- package/js/txmap.js +1 -2
- package/js/utils.js +1 -0
- package/lib/hbe.js +1 -0
- package/link/index.html +1 -1
- package/load.html +1 -1
- package/music/index.html +1 -1
- package/package.json +1 -1
- package/page/2/index.html +1 -1
- package/page/3/index.html +1 -1
- package/page/4/index.html +1 -1
- package/page/5/index.html +1 -1
- package/posts/10021/index.html +1 -5
- package/posts/10045/index.html +1 -1
- package/posts/10733/index.html +1 -1
- package/posts/10996/index.html +1 -5
- package/posts/12779/index.html +1 -1
- package/posts/13624/index.html +1 -1
- package/posts/15688/index.html +1 -1
- package/posts/15748/index.html +1 -5
- package/posts/15799/index.html +1 -1
- package/posts/15842/index.html +1 -5
- package/posts/16107/index.html +1 -1
- package/posts/18063/index.html +1 -1
- package/posts/20412/index.html +1 -1
- package/posts/21375/index.html +1 -1
- package/posts/22945/index.html +1 -4
- package/posts/23021/index.html +1 -1
- package/posts/27531/index.html +1 -5
- package/posts/27762/index.html +1 -0
- package/posts/28536/index.html +1 -1
- package/posts/28733/index.html +1 -1
- package/posts/29196/index.html +1 -1
- package/posts/38917/index.html +1 -1
- package/posts/38964/index.html +1 -1
- package/posts/42487/index.html +1 -1
- package/posts/42580/index.html +1 -1
- package/posts/45875/index.html +1 -1
- package/posts/46640/index.html +1 -1
- package/posts/48762/index.html +1 -1
- package/posts/50710/index.html +1 -1
- package/posts/52677/index.html +1 -1
- package/posts/53662/index.html +1 -1
- package/posts/54386/index.html +1 -1
- package/posts/54481/index.html +1 -1
- package/posts/54787/index.html +1 -5
- package/posts/56467/index.html +1 -1
- package/posts/57692/index.html +1 -1
- package/posts/58203/index.html +1 -1
- package/posts/61417/index.html +1 -1
- package/posts/61712/index.html +1 -1
- package/posts/61713/index.html +1 -0
- package/posts/646/index.html +1 -1
- package/posts/64856/index.html +1 -1
- package/posts/64935/index.html +1 -1
- package/search.xml +1034 -1159
- package/seas/index.html +1 -1
- package/sitemap.xml +706 -0
- package/sw-dom.js +54 -0
- package/sw.js +1 -2
- package/tags/Flash/347/233/270/345/205/263/index.html +1 -1
- package/tags/Steam/346/270/270/346/210/217/index.html +1 -1
- package/tags/Windows/350/275/257/344/273/266/index.html +1 -1
- package/tags/index.html +1 -1
- package/tags//344/270/252/344/272/272/345/260/217/350/256/260/index.html +1 -1
- package/tags//344/270/252/344/272/272/345/260/217/350/256/260/page/2/index.html +1 -1
- package/tags//344/270/252/344/272/272/345/260/217/350/256/260/page/3/index.html +1 -0
- package/tags//345/205/266/345/256/203/346/270/270/346/210/217/index.html +1 -1
- package/tags//345/212/240/350/275/275/345/212/250/347/224/273/index.html +1 -1
- package/tags//346/202/254/346/265/256/345/256/240/347/211/251-/347/234/213/346/235/277/345/250/230/index.html +1 -1
- package/tags//346/255/214/346/233/262/346/224/266/351/233/206/index.html +1 -1
- package/tags//346/270/270/346/210/217/347/233/270/345/205/263/index.html +1 -1
- package/tags//347/253/231/347/202/271/345/272/225/351/203/250/351/255/224/346/224/271/index.html +1 -1
- package/tags//347/253/231/347/202/271/346/212/230/350/205/276/index.html +1 -1
- package/tags//347/253/231/347/202/271/346/212/230/350/205/276/page/2/index.html +1 -1
- package/tags//350/207/252/345/273/272/351/203/250/347/275/262/index.html +1 -1
- package/tags//351/241/265/351/235/242/351/255/224/346/224/271/index.html +1 -1
- package/tags//351/241/271/347/233/256/346/212/230/350/205/276/index.html +1 -1
- package/update/index.html +1 -1
- package/weichuncai/css/style.css +1 -2
- package/weichuncai/js/common.js +1 -2
- package/weichuncai/js/jquery.js +1 -2
- package/weichuncai/wcc-config.js +1 -2
- package/assets/algolia/algoliasearch.js +0 -11
- package/assets/algolia/algoliasearch.min.js +0 -4
- package/assets/algolia/algoliasearchLite.js +0 -11
- package/assets/algolia/algoliasearchLite.min.js +0 -3
- package/css/first.css +0 -2
- package/css/style.css +0 -2
- package/games +0 -4455
- package/images/siteicon/favicon-16x16.png +0 -0
- package/images/siteicon/favicon-32x32.png +0 -0
- package/images/siteicon/favicon-48x48.png +0 -0
- package/js/app.js +0 -2
- package/js/ceta/fancybox.css +0 -2
- package/js/ceta/fancybox.umd.js +0 -2
- package/js/ceta/iconfontInkss.js +0 -2
- package/js/ceta/lazyload.min.js +0 -1
- package/js/ceta/message.css +0 -2
- package/js/ceta/message.js +0 -2
- package/js/ceta/pjax.min.js +0 -1
- package/js/plugins/aplayer.js +0 -2
- package/js/plugins/parallax.js +0 -2
- package/js/plugins/rightMenus.js +0 -2
- package/js/plugins/tags/contributors.js +0 -2
- package/js/plugins/tags/friends.js +0 -2
- package/js/plugins/tags/sites.js +0 -2
- package/js/search/hexo.js +0 -2
- package/js/search/meilisearch.js +0 -2
- package/maps/assets/algolia/algoliasearch.js.map +0 -1
- package/maps/assets/algolia/algoliasearchLite.js.map +0 -1
- package/maps/bbs/bbs.js.map +0 -1
- package/maps/css/custom2.css.map +0 -1
- package/maps/css/first.css.map +0 -1
- package/maps/css/pace/big-counter.css.map +0 -1
- package/maps/css/pace/corner-indicator.css.map +0 -1
- package/maps/css/pace/flash.css.map +0 -1
- package/maps/css/pace/mac-osx.css.map +0 -1
- package/maps/css/pace/pace.css.map +0 -1
- package/maps/css/plane.css.map +0 -1
- package/maps/css/style.css.map +0 -1
- package/maps/css/tags.css.map +0 -1
- package/maps/js/app.js.map +0 -1
- package/maps/js/autoload.js.map +0 -1
- package/maps/js/ceta/fancybox.css.map +0 -1
- package/maps/js/ceta/fancybox.umd.js.map +0 -1
- package/maps/js/ceta/iconfontInkss.js.map +0 -1
- package/maps/js/ceta/message.css.map +0 -1
- package/maps/js/ceta/message.js.map +0 -1
- package/maps/js/clock.js.map +0 -1
- package/maps/js/kslink.js.map +0 -1
- package/maps/js/newyear.js.map +0 -1
- package/maps/js/plane.js.map +0 -1
- package/maps/js/plugins/aplayer.js.map +0 -1
- package/maps/js/plugins/parallax.js.map +0 -1
- package/maps/js/plugins/rightMenus.js.map +0 -1
- package/maps/js/plugins/tags/contributors.js.map +0 -1
- package/maps/js/plugins/tags/friends.js.map +0 -1
- package/maps/js/plugins/tags/sites.js.map +0 -1
- package/maps/js/search/algolia.js.map +0 -1
- package/maps/js/search/hexo.js.map +0 -1
- package/maps/js/search/meilisearch.js.map +0 -1
- package/maps/js/txmap.js.map +0 -1
- package/maps/sw.js.map +0 -1
- package/maps/weichuncai/css/style.css.map +0 -1
- package/maps/weichuncai/js/common.js.map +0 -1
- package/maps/weichuncai/js/jquery.js.map +0 -1
- package/maps/weichuncai/wcc-config.js.map +0 -1
package/js/plane.js
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
(function(window){var JSONP=function(){var t,e,s,i=0,n=this;return{get:function(a,o,h){for(s in e="?",o=o||{})o.hasOwnProperty(s)&&(e+=encodeURIComponent(s)+"="+encodeURIComponent(o[s])+"&");var r="json"+ ++i;return n[r]=function(t){h(t);try{delete n[r]}catch(t){}n[r]=null},function(e){var s=document.createElement("script"),i=!1;s.src=e,s.async=!0,s.onload=s.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,s.onload=s.onreadystatechange=null,s&&s.parentNode&&s.parentNode.removeChild(s))},t||(t=document.getElementsByTagName("head")[0])||(t=document.body),t.appendChild(s)}(a+e+"callback="+r),r}}}(),CORS={request:function(t,e,s){if(this.calledByExtension())return this._callbacks[this._callbackId++]=s,void window.postMessage(JSON.stringify({from:"kickassapp-page",url:t,type:"callApi",params:e}),"*");e=e||{};var i="?";for(key in e)e.hasOwnProperty(key)&&(i+=encodeURIComponent(key)+"="+encodeURIComponent(e[key])+"&");var n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&s(JSON.parse(n.responseText))},n.open("GET",t+i),n.withCredentials=!0,n.setRequestHeader("Content-Type","application/json"),n.send()},calledByExtension:function(){return!!document.getElementById("kickass-has-been-initialized-yes-yes-yes")},_callbacks:{},_callbackId:0};function getGlobalNamespace(){return window&&window.INSTALL_SCOPE?window.INSTALL_SCOPE:window}CORS.calledByExtension()&&window.addEventListener("message",(function(t){var e;try{e=JSON.parse(t.data)}catch(t){return}if("kickassapp-extension"===e.from&&"kickassapp-extension-version1"===e.sanityCheck){var s=e.payload;"response"===s.type?(CORS._callbacks[s.requestId](s.body),delete CORS._callbacks[s.requestId]):"destroy"===s.type&&window.KICKASSGAME.destroy()}}),!1);var Class=function(t){var e=function(){return e.$prototyping?this:"function"==typeof this.initialize?this.initialize.apply(this,arguments):void 0};for(var s in t.Extends&&(e.parent=t.Extends,t.Extends.$prototyping=!0,e.prototype=new t.Extends,t.Extends.$prototyping=!1),t)t.hasOwnProperty(s)&&(e.prototype[s]=t[s]);return e};"undefined"!=typeof exports&&(exports.Class=Class);var Vector=new Class({initialize:function(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)},cp:function(){return new Vector(this.x,this.y)},mul:function(t){return this.x*=t,this.y*=t,this},mulNew:function(t){return new Vector(this.x*t,this.y*t)},div:function(t){return this.x/=t,this.y/=t,this},divNew:function(t){return new Vector(this.x/t,this.y/t)},add:function(t){return this.x+=t.x,this.y+=t.y,this},addNew:function(t){return new Vector(this.x+t.x,this.y+t.y)},sub:function(t){return this.x-=t.x,this.y-=t.y,this},subNew:function(t){return new Vector(this.x-t.x,this.y-t.y)},rotate:function(t){var e=this.x,s=this.y;return this.x=e*Math.cos(t)-Math.sin(t)*s,this.y=e*Math.sin(t)+Math.cos(t)*s,this},rotateNew:function(t){return this.cp().rotate(t)},setAngle:function(t){var e=this.len();return this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},setAngleNew:function(t){return this.cp().setAngle(t)},setLength:function(t){var e=this.len();return e?this.mul(t/e):this.x=this.y=t,this},setLengthNew:function(t){return this.cp().setLength(t)},normalize:function(){var t=this.len();return 0==t||(this.x/=t,this.y/=t),this},normalizeNew:function(){return this.cp().normalize()},angle:function(){return Math.atan2(this.y,this.x)},collidesWith:function(t){return this.x>t.x&&this.y>t.y&&this.x<t.x+t.width&&this.y<t.y+t.height},len:function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);return t<.005&&t>-.005?0:t},is:function(t){return"object"==typeof t&&this.x==t.x&&this.y==t.y},dot:function(t){return this.x*t.x+this.y*t.y},inTriangle:function(t,e,s){var i=s.subNew(t),n=e.subNew(t),a=p.subNew(t),o=i.dot(i),h=i.dot(n),r=i.dot(a),l=n.dot(n),c=n.dot(a),d=1/(o*l-h*h),u=(l*r-h*c)*d,m=(o*c-h*r)*d;return u>0&&m>0&&u+m<1},distanceFrom:function(t){return Math.sqrt(Math.pow(this.x-t.x,2),Math.pow(this.y-t.y,2))},toString:function(){return"[Vector("+this.x+", "+this.y+") angle: "+this.angle()+", length: "+this.len()+"]"}});"undefined"!=typeof exports&&(exports.Vector=Vector);var Rect=new Class({initialize:function(t,e,s,i){this.pos=new Vector(t,e),this.size={width:s,height:i}},hasPoint:function(t){return t.x>this.getLeft()&&t.x<this.getRight()&&t.y>this.getTop()&&t.y<this.getBottom()},setLeft:function(t){this.pos.x=t+this.size.width/2},setTop:function(t){this.pos.y=t+this.size.height/2},getLeft:function(){return this.pos.x-this.size.width/2},getTop:function(){return this.pos.y-this.size.height/2},getRight:function(){return this.pos.x+this.size.width/2},getBottom:function(){return this.pos.y+this.size.height/2},cp:function(){return new Rect(this.pos.x,this.pos.y,this.size.width,this.size.height)}});"undefined"!=typeof exports&&(exports.Rect=Rect);var Fx=new Class({initialize:function(){this.listeners=[],this.tweens={},this.running={}},addListener:function(t){this.listeners.push(t)},add:function(t,e){if((e=e||{}).duration=e.duration||500,e.transition=e.transition||Tween.Linear,e.repeats=void 0!==e.repeats&&e.repeats,!e.tweens){var s=e.start||0,i=void 0===e.end?1:e.end;e.tweens=[[s,i]]}this.tweens[t]=e},update:function(t){for(var e in t="number"==typeof t?t:now(),this.tweens)if(this.tweens.hasOwnProperty(e)){if(!this.running[e]){this.tweenStart(e,t);continue}var s=this.tweens[e],i=t-this.running[e].startTime;if(i>s.duration){this.tweenFinished(s,e);continue}for(var n,a=s.transition(i/s.duration),o=[],h=0;n=s.tweens[h];h++){var r=a*(n[1]-n[0])+n[0];o.push(r)}this.fire(e,o,a)}},tweenStart:function(t,e){this.running[t]={startTime:e};for(var s,i=[],n=0;s=this.tweens[t].tweens[n];n++)i.push(s[0]);this.fire(t,i,0)},tweenFinished:function(t,e){for(var s,i=[],n=0;s=t.tweens[n];n++)i.push(s[1]);if(this.fire(e,i,1),!t.repeats)return delete this.running[e],void delete this.tweens[e];this.tweenStart(e,now())},fire:function(t,e,s){for(var i,n=0;i=this.listeners[n];n++)i.set.call(i,t,e,s)}}),Tween={Linear:function(t){return t},Quadratic:function(t){return t*t},Quintic:function(t){return t*t*t},Shake:function(t){return Math.sin(t)}},GameGlobals={FPS:60,useAnimationFrame:!0,boids:{flockRadius:400,size:100},path:function(){return"https://kickassapp.com/"+Array.prototype.slice.call(arguments).join("")},hasCanvas:void 0!==document.createElement("canvas").getContext,bulletColor:"black"};function now(){return(new Date).getTime()}function bind(t,e){return function(){return e.apply(t,arguments)}}function each(t,e,s){if("function"==typeof t.forEach)return t.forEach(e,s),t;for(var i in t)t.hasOwnProperty(i)&&e.call(s||window,t[i],i);return t}function addEvent(t,e,s){t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent&&(t["e"+e+s]=s,t[e+s]=function(){return t["e"+e+s](window.event)},t.attachEvent("on"+e,t[e+s]))}function removeEvent(t,e,s){t.removeEventListener?t.removeEventListener(e,s,!1):t.detachEvent&&(t.detachEvent("on"+e,t[e+s]),t[e+s]=null,t["e"+e+s]=null)}function stopEvent(t){t.stopPropogation&&t.stopPropogation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function elementIsContainedIn(t,e){return element.contains?t.contains(e):!!(16&t.compareDocumentPosition(e))}function code(t){var e={38:"up",40:"down",37:"left",39:"right",27:"esc"};return e[t]?e[t]:String.fromCharCode(t)}function random(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function getRect(t){if("function"==typeof t.getBoundingClientRect){var e=t.getBoundingClientRect(),s=window.pageXOffset,i=window.pageYOffset;return{width:e.width,height:e.height,left:e.left+s,top:e.top+i}}e={width:t.offsetWidth,height:t.offsetHeight,left:0,top:0};for(var n=t;n;)e.left+=n.offsetLeft,e.top+=n.offsetTop,n=n.offsetParent;return e}function getCompatElement(){var t=document;return t.compatMode&&"CSS1Compat"!=t.compatMode?t.body:t.documentElement}function getScrollSize(){var t=getCompatElement(),e={x:t.clientWidth,y:t.clientHeight},s=document.body;return{x:Math.max(t.scrollWidth,s.scrollWidth,e.x),y:Math.max(t.scrollHeight,s.scrollHeight,e.y)}}function getStyle(t,e){return t.style[e]?t.style[e]:t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function setStyles(t,e){for(var s in e)if(e.hasOwnProperty(s)){var i=e[s];"number"==typeof i&&"opacity"!==s&&"zIndex"!==s&&(i+="px"),t.style[s]=i}}function hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function addClass(t,e){hasClass(t,e)||(t.className+=" "+e)}function removeClass(t,e){if(hasClass(t,e)){var s=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(s," ")}}function cloneElement(t){return t.cloneNode(!0)}function newElement(t,e){var s=document.createElement(t);for(var i in e)e.hasOwnProperty(i)&&("styles"===i?setStyles(s,e[i]):s[i]=e[i]);return s}window.GameGlobals=GameGlobals,Array.prototype.indexOf||(Array.prototype.indexOf=function(t){if(null==this)throw new TypeError;var e=Object(this),s=e.length>>>0;if(0===s)return-1;var i=0;if(arguments.length>0&&((i=Number(arguments[1]))!=i?i=0:0!==i&&i!==1/0&&i!==-1/0&&(i=(i>0||-1)*Math.floor(Math.abs(i)))),i>=s)return-1;for(var n=i>=0?i:Math.max(s-Math.abs(i),0);n<s;n++)if(n in e&&e[n]===t)return n;return-1});var requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){window.setTimeout(t,1e3/60)};function delay(t,e,s){return setTimeout(bind(s,e),t)}var KickAss=new Class({initialize:function(t){t&&t.mySite&&(this.mySite=t.mySite),this.players=[],this.elements=[],this.weaponClass=Weapons[1].cannonClass,this.scrollPos=new Vector(0,0),this.scrollSize=new Vector(0,0),this.windowSize={width:0,height:0},this.updateWindowInfo(),this.bulletManager=new BulletManager(this),this.bulletManager.updateEnemyIndex(),this.explosionManager=new ExplosionManager(this),this.ui=new UIManager(this),this.bombManager=new BombManager(this),this.menuManager=new MenuManager(this),this.menuManager.create(),void 0!==StatisticsManager&&(this.statisticsManager=new StatisticsManager(this)),this.sessionManager=new SessionManager(this),this.lastUpdate=now(),this.keyMap={},this.keydownEvent=bind(this,this.keydown),this.keyupEvent=bind(this,this.keyup),this.multiplier=10,this.isCampaign()?this.audioManager={explosion:new AudioManager(GameGlobals.path("static/sounds/game/explosion"),["mp3","ogg"]),shot:new AudioManager(GameGlobals.path("static/sounds/game/shot"),["mp3","ogg"])}:this.audioManager={},window.KickAssStyle&&"white"===window.KickAssStyle&&(GameGlobals.bulletColor="white"),addEvent(document,"keydown",this.keydownEvent),addEvent(document,"keyup",this.keyupEvent),addEvent(document,"keypress",this.keydownEvent)},begin:function(){this.addPlayer(),this.sessionManager.isPlaying=!0,GameGlobals.useAnimationFrame||(this.loopTimer=window.setInterval(bind(this,this.loop),1e3/GameGlobals.FPS)),GameGlobals.useAnimationFrame&&requestAnimFrame(bind(this,this.loop))},keydown:function(t){var e=code(t.keyCode);switch(this.keyMap[e]=!0,e){case"left":case"right":case"up":case"down":case"esc":case" ":stopEvent(t)}if("esc"===e)this.destroy()},keyup:function(t){var e=code(t.keyCode);switch(this.keyMap[e]=!1,e){case"left":case"right":case"up":case"down":case"esc":case" ":t.stopPropogation&&t.stopPropogation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}},loop:function(){var t=now(),e=(t-this.lastUpdate)/1e3;this.updateWindowInfo();for(var s,i=0;s=this.players[i];i++)s.update(e);this.bulletManager.update(e),this.bombManager.update(e),this.explosionManager.update(e),this.ui.update(e),this.statisticsManager&&this.statisticsManager.update(e),this.sessionManager.update(e),this.lastUpdate=t,GameGlobals.useAnimationFrame&&requestAnimFrame(bind(this,this.loop))},addPlayer:function(){var t=Ships.Standard;window.KICKASSSHIP&&window.KICKASSSHIP.points&&(t=KICKASSSHIP),this.mySite&&this.mySite.getShipConfig()&&(t=this.mySite.getShipConfig());var e=new Player(this);e.setShip(t),this.players.push(e),this.explosionManager.addExplosion(e.pos)},registerElement:function(t){if(!t)throw new Error("Can't register unexisting element.");this.elements.push(t)},unregisterElement:function(t){this.elements.splice(this.elements.indexOf(t),1)},isKickAssElement:function(t){for(var e,s=0;e=this.elements[s];s++)if(t===e||elementIsContainedIn(e,t))return!0;return!1},isKeyPressed:function(t){return!!this.keyMap[t]},updateWindowInfo:function(){var t=!!window.ActiveXObject&&"BackCompat"==document.compatMode;this.windowSize={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},t&&(this.windowSize.width=document.body.clientWidth,this.windowSize.height=document.body.clientHeight),this.menuManager&&this.menuManager.isVisible()&&(this.windowSize.height-=this.menuManager.getHeight()),this.scrollPos.x=window.pageXOffset||document.documentElement.scrollLeft,this.scrollPos.y=window.pageYOffset||document.documentElement.scrollTop,this.scrollSize=getScrollSize()},hideAll:function(){for(var t,e=0;t=this.elements[e];e++)t.style.visibility="hidden"},showAll:function(){for(var t,e=0;t=this.elements[e];e++)t.style.visibility="visible"},updateShips:function(t,e){e||this.ui.showMessage("You're now flying<br /><em>"+t.name+"<em>!!");for(var s,i=0;s=this.players[i];i++)s.setShip(t)},changeWeapon:function(t,e){this.weaponClass=t.cannonClass,e||this.ui.showMessage("Changed to "+t.name.toUpperCase()+"!!!!");for(var s,i=0;s=this.players[i];i++)s.setCannons(t.cannonClass)},changeWeaponById:function(t,e){Weapons[t]&&this.changeWeapon(Weapons[t],e)},flyOutPlayers:function(t,e){for(var s,i=0;s=this.players[i];i++)s.flyTo(t,-s.size.height),s.isBound=!1},flyInPlayers:function(){for(var t,e=0;t=this.players[e];e++)t.flyTo(t.pos.x,100,(function(){this.isBound=!0}))},newRank:function(t){this.ui.showMessage("OMG. You leveled up to: <strong>"+t+"</strong>!<br /><small>Be sure to check what cool new stuff you get in the menu.</small>")},fireBomb:function(){this.bombManager.blow()},destroy:function(){removeEvent(document,"keydown",this.keydownEvent),removeEvent(document,"keypress",this.keydownEvent),removeEvent(document,"keyup",this.keyupEvent);for(var t,e=0;t=this.players[e];e++)t.destroy();this.bulletManager.destroy(),this.explosionManager.destroy(),this.menuManager.destroy(),GameGlobals.useAnimationFrame||clearInterval(this.loopTimer),getGlobalNamespace().KICKASSGAME=!1,this.isCampaign()&&document.location.reload()},isCampaign:function(){return getGlobalNamespace().IS_CLOUDFLARE_GAME},isMySite:function(){return!!getGlobalNamespace().KICKASS_SITE_KEY},shouldShowAd:function(){return!this.mySite&&!this.isCampaign()},shouldShowMenu:function(){return!this.mySite&&!this.isCampaign()},shouldShowHowToImage:function(){return this.mySite||this.isCampaign()}});window.KickAss=KickAss;var StatisticsManager=new Class({initialize:function(t){this.game=t,this.data={},this.data.startedPlaying=now(),this.data.elementsDestroyed=0,this.data.shotsFired=0,this.data.distanceFlownInPixels=0,this.data.totalPointsThisSession=0,this.data.usedThrusters=0,this.lastUpdate=0},usedThrusters:function(){this.data.usedThrusters=1},increaseDistanceWithPixels:function(t){this.data.distanceFlownInPixels+=t},increasePointsGainedWithPoints:function(t){this.data.totalPointsThisSession+=t},addShotFired:function(){this.data.shotsFired++,this.game.audioManager.shot&&this.game.audioManager.shot.play()},addElementsDestroyed:function(){this.data.elementsDestroyed++},update:function(t){this.lastUpdate+=t,this.lastUpdate>.25&&(this.syncWithServer(),this.lastUpdate=0)},syncWithServer:function(){var t=[];for(var e in this.data)this.data.hasOwnProperty(e)&&t.push(e+":"+this.data[e]);this.game.menuManager.sendMessageToMenu("stats:!"+t.join("|"))}}),MySite=new Class({initialize:function(t){this.key=t},load:function(t){CORS.request(GameGlobals.path("mysite/api.json"),{site_key:this.key,url:document.location.toString()},bind(this,(function(e){e&&e.embed?(this.mySiteData=e.embed,t(!0)):t(!1)})))},install:function(){},getShipId:function(){return this.mySiteData&&this.mySiteData.settings.ship},getShipConfig:function(){return this.mySiteData&&this.mySiteData.settings.ship_config},getShareURL:function(){return this.mySiteData&&this.mySiteData.settings.share_url}}),Menu=new Class({initialize:function(t){this.game=t,this.size={height:300}},generate:function(t){this.container=document.createElement("div"),this.container.className="KICKASSELEMENT",this.container.id="kickass-profile-menu",t.appendChild(this.container);var e=getGlobalNamespace().KICKASSSHIPID||"";this.url=GameGlobals.path("intermediate_postmessage.html?url="+encodeURIComponent(getGlobalNamespace().KICKASSURL||document.location.href)+"&origin="+encodeURIComponent(document.location.href)+"&preship="+e+"&is_campaign="+(this.game.isCampaign()?"true":"")+"&is_mysite="+(this.game.isMySite()?"true":"")),this.isSocketReady=!1,this.socketIframe=document.createElement("iframe"),this.socketIframe.frameborder="0",this.socketIframe.className="KICKASSELEMENT",this.socketIframe.width="100%",this.socketIframe.height=this.size.height+"px",this.container.appendChild(this.socketIframe),this.menuOrigin="https://kickassapp.com/".replace(/\/$/,""),this.socketIframe.src=this.url,this.onMessage=bind(this,(function(t){if(t.origin===this.menuOrigin||t.origin===this.menuOrigin.replace("http://","https://")){var e=t.data;if("ready"!==e){var s=e.split(":!");if(2===s.length){var i=s.shift().replace(/^./g,(function(t){return t.charAt(0).toUpperCase()}));"function"==typeof this["messageType"+i]&&this["messageType"+i](s.join(":!"))}}else this.onGameReady()}else console.log("ignoring event from",t.origin)})),window.addEventListener("message",this.onMessage,!1),this.game.registerElement(this.container)},socketPostMessage:function(t){this.socketIframe.contentWindow.postMessage(t,this.menuOrigin)},onGameReady:function(){this.isSocketReady=!0,this.game.registerElement(this.container.getElementsByTagName("iframe")[0]),this.socketPostMessage("url:!"+(getGlobalNamespace().KICKASSURL||document.location.href)),this.game.statisticsManager&&this.game.statisticsManager.syncWithServer(),this.game.menuManager.onGameReady()},sendMessage:function(t){if(this.isSocketReady&&t!=this.lastMessage){try{this.socketPostMessage(t)}catch(t){}this.lastMessage=t}},messageTypeChangeShip:function(t){var e=(t=t.split(","))[0],s=(t[1],"initial"===t[2]);this.shipId!==e&&(s&&getGlobalNamespace().KICKASSSHIP||(this.shipId=e,CORS.request(GameGlobals.path("designer/ship/"+e+"/construction.json"),{ship_id:e,is_initial:s?"1":"0"},bind(this,(function(t){this.game.updateShips(t.data,s);try{window.focus()}catch(t){}}))),s||this.parent.hideMenu()))},messageTypeChangeWeapon:function(t,e){this.game.changeWeaponById(t,e)},messageTypeSetMultiplier:function(t){t=parseInt(t,10),!isNaN(t)&&t&&(this.game.multiplier=t)},messageTypeNewRank:function(t){this.game.newRank(t)},messageTypePlayerMessage:function(t){this.game.ui.showMessage(t)},destroy:function(){this.game.unregisterElement(this.container),this.game.unregisterElement(this.iframe),window.removeEventListener("message",this.onMessage,!1),this.container.parentNode.removeChild(this.container)}}),MenuManager=new Class({initialize:function(t){this.game=t,this.numPoints=0,getGlobalNamespace().KICKASS_INLINE_CSS||this.includeCSS(GameGlobals.path("css/menustyles.css"))},generateDefaults:function(){for(var t in Weapons)Weapons.hasOwnProperty(t)&&this.addWeapon(Weapons[t],t);this.hideBombMenu()},create:function(){this.container=document.createElement("div"),this.container.className="KICKASSELEMENT KICKASShidden "+(this.game.shouldShowMenu()?"":"KICKASSNOMENU"),this.container.id="kickass-menu",this.game.shouldShowMenu()?(this.container.style.bottom="-250px",this.container.style.display="none"):removeClass(this.container,"KICKASShidden"),getAppContainerElement().appendChild(this.container);this.container.innerHTML='<div id="kickass-howto-image" class="KICKASSELEMENT kickass-howto-invisible"></div><div id="kickass-pointstab" style="width: 200px;" class="KICKASSELEMENT"><div id="kickass-bomb-menu" class="KICKASSELEMENT KICKASShidden"><ul id="kickass-bomb-list" class="KICKASSELEMENT"></ul></div><div id="kickass-weapons-menu" class="KICKASSELEMENT KICKASShidden" style="display:none"><ul id="kickass-weapons-list" class="KICKASSELEMENT"></ul></div><div id="kickass-pointstab-wrapper" class="KICKASSELEMENT"><div id="kickass-points" class="KICKASSELEMENT">'+this.numPoints+'</div><div id="kickass-esctoquit" class="KICKASSELEMENT">Press esc to quit</div>'+this.getShareHTML()+"</div></div>",this.pointsTab=document.getElementById("kickass-pointstab"),this.pointsTabWrapper=document.getElementById("kickass-pointstab-wrapper"),this.points=document.getElementById("kickass-points"),this.escToQuit=document.getElementById("kickass-esctoquit"),this.howToImage=document.getElementById("kickass-howto-image"),this.weaponsMenu=document.getElementById("kickass-weapons-menu"),this.weaponsList=document.getElementById("kickass-weapons-list"),this.bombLink=document.getElementById("kickass-bomb-menu");for(var t=this.container.getElementsByTagName("*"),e=0;e<t.length;e++)this.game.registerElement(t[e]);this.game.registerElement(this.container),this.game.shouldShowMenu()?(this.menu=new Menu(this.game),this.menu.parent=this,this.menu.generate(this.container)):setTimeout(function(){this.onGameReady()}.bind(this),100),addEvent(this.bombLink,"click",bind(this,(function(t){stopEvent(t),this.game.fireBomb()}))),addEvent(this.pointsTabWrapper,"click",bind(this,this.toggleMenu)),addEvent(this.weaponsMenu,"click",bind(this,this.toggleWeaponsMenu)),this.generateDefaults()},getShareHTML:function(){return""},onGameReady:function(){this.container.style.display="block",this.game.shouldShowHowToImage()&&(setTimeout(bind(this,(function(){removeClass(this.howToImage,"kickass-howto-invisible")})),10),setTimeout(bind(this,(function(){addClass(this.howToImage,"kickass-howto-invisible")})),4e3))},navigateTo:function(t,e){e||this.showMenu(),this.menu&&this.menu.socketPostMessage("navigate:!"+t)},toggleMenu:function(){this.game.shouldShowMenu()?hasClass(this.container,"KICKASShidden")?this.showMenu():this.hideMenu():this.showMenu()},toggleWeaponsMenu:function(){hasClass(this.weaponsMenu,"KICKASShidden")?this.showWeaponsMenu():this.hideWeaponsMenu()},hideWeaponsMenu:function(){this.weaponsMenu.style.width="",addClass(this.weaponsMenu,"KICKASShidden")},showWeaponsMenu:function(){var t=this.weaponsMenu.getElementsByTagName("li");t=t[t.length-1],this.weaponsMenu.style.width=t.offsetLeft+t.offsetWidth-47+"px",removeClass(this.weaponsMenu,"KICKASShidden")},showMenu:function(){this.game.shouldShowMenu()&&(this.container.style.bottom="",removeClass(this.container,"KICKASShidden"))},hideMenu:function(){this.container.style.bottom="",addClass(this.container,"KICKASShidden")},showBombMenu:function(){this.bombLink.style.width=""},hideBombMenu:function(){this.bombLink.style.width="0px"},getHeight:function(){return this.container.clientHeight},isVisible:function(){return!hasClass(this.container,"KICKASShidden")},addPoints:function(t,e){var s=t*this.game.multiplier;this.numPoints+=s,this.points.innerHTML=this.numPoints,this.game.statisticsManager&&this.game.statisticsManager.increasePointsGainedWithPoints(s),this.game.ui.addPointsBubbleAt(e,s)},includeCSS:function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,(document.head||document.body).appendChild(e)},sendMessageToMenu:function(t){this.menu&&this.menu.sendMessage(t)},addWeapon:function(t,e){var s=document.createElement("li");s.className="KICKASSELEMENT kickass-weapon-item",s.weapon=t,s.style.backgroundImage="url("+GameGlobals.path("css/gfx/kickass/weap-"+t.id+".png")+")",s.innerHTML='<span class="KICKASSELEMENT">'+t.name+"</span>",this.weaponsList.appendChild(s),addEvent(s,"click",bind(this,(function(s){stopEvent(s),this.changeWeapon(t),this.sendMessageToMenu("changeWeapon:!"+e)})))},changeWeapon:function(t){this.game.changeWeapon(t)},destroy:function(){for(var t=this.container.getElementsByTagName("*"),e=0;e<t.length;e++)this.game.unregisterElement(t[e]);this.game.unregisterElement(this.container),this.menu&&this.menu.destroy(),this.container.parentNode.removeChild(this.container)}}),UIManager=new Class({initialize:function(t){this.UNIQID=0,this.game=t,this.pointBubbles={},this.messages={},this.fx=new Fx,this.fx.addListener(this)},update:function(t){this.fx.update()},set:function(t,e,s){var i=t.split("-")[0],n=t.split("-")[1];if(this.pointBubbles[n]){var a=this.pointBubbles[n];a.style.top=e[0]+"px",a.style.opacity=e[1],1==s&&a.parentNode&&(a.parentNode.removeChild(a),delete this.pointBubbles[n])}else if(this.messages[n]&&"messagedown"==i){(o=this.messages[n]).style.top=e[0]+"px",1==s&&setTimeout(bind(this,(function(){this.fx.add("messageup-"+n,{tweens:[[e[0],-100]],transition:Tween.Quadratic,duration:300})})),o.staytime||4e3)}else if(this.messages[n]&&"messageup"==i){var o;(o=this.messages[n]).style.top=e[0]+"px",1==s&&(o.parentNode.removeChild(o),delete this.messages[n])}},addPointsBubbleAt:function(t,e){var s="bubble"+this.UNIQID++,i=this.game.scrollPos.y+t.y,n=newElement("span",{innerHTML:e,className:"KICKASSELEMENT",styles:{position:"absolute",font:"20px Arial",fontWeight:"bold",opacity:"1",color:"black",textShadow:"#fff 1px 1px 3px",top:i,zIndex:"10000000"}});n.style.left=t.x-n.offsetWidth/2+"px",getAppContainerElement().appendChild(n),this.pointBubbles[s]=n,this.fx.add("bubble-"+s,{tweens:[[i,i-15],[1,0]]})},showMessage:function(t,e){e=e||!1;var s=this.UNIQID++,i=newElement("div",{innerHTML:t,className:"KICKASSELEMENT",id:"kickass-message-"+s,styles:{position:"fixed",top:-100,left:"50%",marginLeft:-150,width:300,background:"#222",opacity:.8,padding:"10px",color:"#fff",textAlign:"center",borderRadius:15,font:"20px Arial",fontWeight:"bold",zIndex:"10000000"}});i.staytime=e,getAppContainerElement().appendChild(i);var n=this.getLowestBubbleY();return i.kickassto=n,this.fx.add("messagedown-"+s,{duration:300,tweens:[[-100,n]],transition:Tween.Quadratic}),this.messages[s]=i,i},getLowestBubbleY:function(){var t=100;for(var e in this.messages)this.messages.hasOwnProperty(e)&&(t=Math.max(this.messages[e].kickassto+this.messages[e].offsetHeight+10,t));return t}}),AudioManager=new Class({initialize:function(t,e){if(this.src=t,this.formats=e,channels=8,this.supportsAudio=void 0!==document.createElement("audio").play,this.supportsAudio){this.numChannels=channels,this.channels=[];for(var s=0;s<this.numChannels;s++)this.channels.push({isPlaying:!1,element:this.prepareElement(this.buildAudioElement())})}},buildAudioElement:function(){for(var t,e={ogg:"audio/ogg",mp3:"audio/mpeg"},s=document.createElement("audio"),i=0;t=this.formats[i];i++){var n=document.createElement("source");n.src=this.src+"."+t,n.type=e[t],s.appendChild(n)}return s},prepareElement:function(t){if(void 0===t.addEventListener)return t;var e=this;return t.addEventListener("ended",(function(s){e.audioEnded(t)}),!1),t},audioEnded:function(t){for(var e,s=0;e=this.channels[s];s++)e.element===t&&(e.isPlaying=!1)},play:function(){if(this.supportsAudio)for(var t,e=0;t=this.channels[e];e++)if(!t.isPlaying)return t.isPlaying=!0,void("function"==typeof t.element.play&&t.element.play())}}),Ships={Standard:{points:[[-10,10],[0,-15],[10,10]],thrusters:[{s:{w:20,h:7},p:{x:0,y:14},a:0}],cannons:[{p:{x:0,y:-15},a:0}]}},PLAYERIDS=0,Player=new Class({initialize:function(t){this.id=PLAYERIDS++,this.game=t,this.tween=!1,this.isBound=!0,this.pos=new Vector(1630,217),this.vel=new Vector(0,0),this.acc=new Vector(0,0),this.dir=new Vector(0,1),this.currentRotation=0,this.isBroken=!1,this.lineOffsets=[],this.deadTime=0,this.friction=.95,this.terminalVelocity=2e3,this.lastPos=new Vector(0,0)},setShip:function(t){this.ship=t,this.verts=[];for(var e,s=0;e=this.ship.points[s];s++)this.verts.push(new Vector(e[0],e[1]));this.verts.push(this.verts[0]),this.thrusters=[],this.cannons=[],this.addThrusters(this.ship.thrusters),this.addCannons(this.ship.cannons),this.size=this.getSizeFromVertsAndObjects(),this.bounds=this.calculateBounds(),this.sheet&&this.sheet.destroy(),this.sheet=new Sheet(new Rect(100,100,this.bounds.x,this.bounds.y)),this.forceRedraw=!0},setCannons:function(t){for(var e,s=[],i=0;e=this.cannons[i];i++){var n=new t(this,this.game,e.pos.x,e.pos.y,e.angle);s.push(n),e.destroy()}this.cannons=s},addThrusters:function(t){for(var e,s=0;e=t[s];s++){var i=new Thruster(e);this.thrusters.push(i)}},addCannons:function(t){for(var e,s=0;e=t[s];s++){var i=new(WeaponMap[e.m]||WeaponMap.cannon).cannonClass(this,this.game,e.p.x,e.p.y,e.a);i.player=this,i.game=this.game,this.cannons.push(i)}},update:function(t){if(this.isBroken){if(!this.lineOffsets.length)for(var e=0;e<this.verts.length-1;e++)this.lineOffsets[e]={pos:new Vector(0,0),dir:new Vector(1,1).setAngle(2*Math.PI*Math.random())};for(e=0;e<this.lineOffsets.length;e++)this.lineOffsets[e].pos.add(this.lineOffsets[e].dir.cp().setLength(50).mul(t));return this.sheet.clear(),this.sheet.setAngle(this.dir.angle()),this.sheet.setPosition(this.pos),this.sheet.drawBrokenPlayer(this.verts,this.lineOffsets),void(now()-this.deadTime>1e3&&(this.isBroken=!1,this.lineOffsets=[],this.randomPos()))}this.tween||(this.game.isKeyPressed("left")||this.game.isKeyPressed("right")?(this.game.isKeyPressed("left")&&this.rotateLeft(t),this.game.isKeyPressed("right")&&this.rotateRight(t)):this.stopRotate(),this.game.isKeyPressed("up")?this.activateThrusters():this.stopThrusters()),this.game.isKeyPressed(" ")?(this.isShooting=!0,this.isBroken||this.shootPressed()):this.isShooting&&(this.isShooting=!1,this.shootReleased()),this.currentRotation&&this.dir.setAngle(this.dir.angle()+this.currentRotation*t);var s=this.acc.mulNew(t).sub(this.vel.mulNew(t*this.friction));this.vel.add(s),this.vel.len()>this.terminalVelocity&&this.vel.setLength(this.terminalVelocity);var i=this.vel.mulNew(t);this.pos.add(i),this.game.statisticsManager&&this.game.statisticsManager.increaseDistanceWithPixels(i.len());var n=!this.acc.is({x:0,y:0});for(e=0;a=this.thrusters[e];e++)a.setIsShown(n),a.update(t);if(this.isBound&&this.checkBounds(),!this.lastPos.is(this.pos)||this.currentRotation||this.forceRedraw){if(this.forceRedraw=!1,this.sheet.clear(),this.sheet.setAngle(this.dir.angle()+Math.PI/2),this.sheet.setPosition(this.pos),n){var a;for(e=0;a=this.thrusters[e];e++)a.drawTo(this.sheet)}this.sheet.drawPlayer(this.verts),this.lastPos=this.pos.cp()}var o;for(e=0;o=this.cannons[e];e++)o.update(t)},randomPos:function(){var t=this.game.windowSize.width,e=this.game.windowSize.height;this.pos=new Vector(random(0,t),random(0,e))},checkBounds:function(){if(!this.tween){var t=this.game.windowSize.width,e=this.game.windowSize.height,s=this.pos.x+this.sheet.rect.size.width/2,i=this.pos.y+this.sheet.rect.size.height/2;s>t?(window.scrollTo(this.game.scrollPos.x+50,this.game.scrollPos.y),this.pos.x=0):this.pos.x<0&&(window.scrollTo(this.game.scrollPos.x-50,this.game.scrollPos.y),this.pos.x=t-this.sheet.rect.size.width/2),i>e?(window.scrollTo(this.game.scrollPos.x,this.game.scrollPos.y+.75*e),this.pos.y=0):this.pos.y<0&&(window.scrollTo(this.game.scrollPos.x,this.game.scrollPos.y-.75*e),this.pos.y=e-this.sheet.rect.size.height/2)}},inRect:function(t){for(var e,s=!1,i=0;e=this.verts[i];i++)t.hasPoint(new Vector(e.x+this.pos.x,e.y+this.pos.y))&&(s=!0);return s},hit:function(t){this.isBroken||(this.isBroken=!0,this.deadTime=now())},activateThrusters:function(){this.game.statisticsManager&&this.game.statisticsManager.usedThrusters(),this.acc=new Vector(500,0).setAngle(this.dir.angle())},stopThrusters:function(){this.acc=new Vector(0,0)},rotateLeft:function(t){this.currentRotation=Math.max(2*-Math.PI,this.currentRotation-10*Math.PI*t)},rotateRight:function(t){this.currentRotation=Math.min(2*Math.PI,this.currentRotation+10*Math.PI*t)},stopRotate:function(){this.currentRotation=0},getSizeFromVertsAndObjects:function(){for(var t,e=0,s=0;t=this.verts[s];s++)e=Math.max(e,new Vector(t).len());var i;for(s=0;i=this.thrusters[s];s++){var n=new Vector(i.pos.x-i.size.width/2,i.pos.y-i.size.height/2).rotate(i.angle),a=new Vector(i.pos.x+i.size.width/2,i.pos.y-i.size.height/2).rotate(i.angle),o=new Vector(i.pos.x-i.size.width/2,i.pos.y+i.size.height/2).rotate(i.angle),h=new Vector(i.pos.x+i.size.width/2,i.pos.y+i.size.height/2).rotate(i.angle);e=Math.max(e,n.len(),a.len(),o.len(),h.len())}return{width:2*e,height:2*e}},calculateBounds:function(){return{x:1*Math.max(this.size.width,this.size.height),y:1*Math.max(this.size.height,this.size.width)}},shootPressed:function(){for(var t,e=0;t=this.cannons[e];e++)t.shootPressed()},shootReleased:function(){for(var t,e=0;t=this.cannons[e];e++)t.shootReleased()},flyTo:function(t,e,s){this.tween={start:{pos:this.pos.cp(),dir:this.dir.cp()},to:new Vector(t,e),callback:s||function(){}},this.tween.time=this.getTimeforTween()},destroy:function(){this.sheet.destroy()}}),Thruster=new Class({initialize:function(t,e){this.pos=new Vector(t.p),this.size={width:t.s.w,height:t.s.h},this.angle=t.a||0,this.ship=e,this.isShown=!1,this.flameY=1,this.fx=new Fx,this.fx.addListener(this),this.flames={r:[],y:[]},this.lastFrameUpdate=0,this.generateFlames()},update:function(t){this.fx.update(),now()-this.lastFrameUpdate>1e3/60&&this.generateFlames()},set:function(t,e){if("flames"===t)this.flameY=e},setIsShown:function(t){!this.isShown&&t&&(this.flameY=0,this.generateFlames(),this.fx.add("flames",{start:this.flameY,end:1,duration:250,transition:Tween.Quintic})),this.isShown=t},drawTo:function(t){t.drawFlames(this.flames,this.angle)},generateFlames:function(){var t=this.size.width,e=.05*this.size.width,s=.8*this.size.width,i=.1*s,n=t/2,a=s/2,o=(this.size.height,this.pos.x),h=this.pos.y-this.size.height/2;function r(t,e){return new Vector(t,e)}this.flames.r=[r(-n+o,h)],this.flames.y=[r(-a+o,h)],this.flames.self=this;for(var l=0;l<t;l+=e)this.flames.r.push(r(l-n+o,this.flameY*random(.7*this.size.height,this.size.height)+h));this.flames.r.push(r(n+o,h));for(l=0;l<s;l+=i)this.flames.y.push(r(l-a+o,this.flameY*random(.4*this.size.height,.7*this.size.height)+h));this.flames.y.push(r(a+o,h)),this.lastFrameUpdate=now();for(var c=r(o,h),d=0;u=this.flames.r[d];d++)u.sub(c).rotate(this.angle).add(c);var u;for(d=0;u=this.flames.y[d];d++)u.sub(c).rotate(this.angle).add(c)}}),BombManager=new Class({initialize:function(t){this.game=t,this.bombShowDelay=30,this.nextBomb=this.bombShowDelay},update:function(t){this.game.isKeyPressed("F")&&this.isReady()&&this.blow(),-1!==this.nextBomb&&this.game.sessionManager.isPlaying&&(this.nextBomb-=t,this.nextBomb<0&&(this.game.menuManager.showBombMenu(),this.nextBomb=-1,this.game.ui.showMessage("BOMB IS READY<br />(lower right corner or F)")))},blow:function(){var t=this.game.ui.showMessage("3...",5e3);delay(1e3,(function(){t.innerHTML="2..."}),this),delay(2e3,(function(){t.innerHTML="1..."}),this),delay(3e3,(function(){t.innerHTML="boom"}),this),delay(3e3,this.blowStuffUp,this),this.nextBomb=this.bombShowDelay},blowStuffUp:function(){this.game.bulletManager.updateEnemyIndex();for(var t,e=this.game.bulletManager.enemyIndex,s=0;(t=e[s])&&s<10;s++){var i=getRect(t),n=new Vector(i.left+i.width/2,i.top+i.height/2);this.game.explosionManager.addExplosion(n,t,MegaParticleExplosion),t.parentNode.removeChild(t)}this.game.menuManager.hideBombMenu(),this.nextBomb=this.bombShowDelay},isReady:function(){return-1===this.nextBomb}}),ELEMENTSTHATARENOTTOBEINCLUDED=["BR","SCRIPT","STYLE","TITLE","META","HEAD","OPTION","OPTGROUP","LINK"],ELEMENTSIZETHRESHOLD=5,BulletManager=new Class({initialize:function(t){this.game=t,this.lastBlink=0,this.blinkActive=!1,this.enemyIndex=[],this.updateDelay=2.5,this.nextUpdate=this.updateDelay},update:function(t){this.game.isKeyPressed("B")?this.blink():this.blinkActive&&this.endBlink(),this.nextUpdate-=t,this.nextUpdate<0&&this.updateEnemyIndex()},blink:function(){if(now()-this.lastBlink>250){for(var t,e=0;t=this.enemyIndex[e];e++)this.blinkActive?t.style.outline=t.KICKASSOLDBORDER:t.style.outline="1px solid red";this.blinkActive=!this.blinkActive,this.lastBlink=now(),this.blinkActive||this.updateEnemyIndex()}},endBlink:function(){for(var t,e=0;t=this.enemyIndex[e];e++)t.style.outline=t.KICKASSOLDBORDER;this.lastBlink=0,this.blinkActive=!1},updateEnemyIndex:function(){var t=document.getElementsByTagName("*");this.enemyIndex=[];for(var e,s=0;e=t[s];s++)this.isDestroyable(e)&&(this.enemyIndex.push(e),e.KICKASSOLDBORDER=e.style.outline||document.defaultView.getComputedStyle(e,null).outline);this.nextUpdate=this.updateDelay},isDestroyable:function(t,e){if(this.shouldIgnoreElement(t,e))return!1;for(var s,i=0;s=t.childNodes[i];i++)if(1===s.nodeType&&-1===ELEMENTSTHATARENOTTOBEINCLUDED.indexOf(s.tagName)&&s.offsetWidth>=ELEMENTSIZETHRESHOLD&&s.offsetHeight>=ELEMENTSIZETHRESHOLD&&"hidden"!==document.defaultView.getComputedStyle(s,null).visibility)return!1;return!0},isDestroyableFromCollision:function(t){return this.isDestroyable(t,!0)},shouldIgnoreElement:function(t,e){return 1!==t.nodeType||(t==document.documentElement||t==document.body||(-1!==ELEMENTSTHATARENOTTOBEINCLUDED.indexOf(t.tagName)||("hidden"==t.style.visibility||"none"==t.style.display||("string"==typeof t.className&&-1!=t.className.indexOf("KICKASSELEMENT")||(!e&&(t.offsetWidth<ELEMENTSIZETHRESHOLD||t.offsetHeight<ELEMENTSIZETHRESHOLD)||((t.offsetLeft<0||t.offsetTop<0)&&((s=getRect(t)).left+s.width<0||s.top+s.height<0)||(s||(s=getRect(t)),s.top>=this.game.scrollSize.y)))))));var s},destroy:function(){for(var t in this.bullets)if(this.bullets.hasOwnProperty(t))for(var e,s=0;e=this.bullets[t][s];s++)e.destroy();this.bullets={}}}),SessionManager=new Class({initialize:function(t){this.game=t,this.isPlaying=!1},update:function(t){this.isPlaying&&0==this.game.bulletManager.enemyIndex.length&&this.weHaveWon()},weHaveWon:function(){this.isPlaying=!1,this.game.ui.showMessage("You're done!"),this.game.isCampaign()?(this.game.menuManager.showMenu(),this.game.menuManager.navigateTo("highscores")):this.game.menuManager.showMenu(),this.game.menuManager.sendMessageToMenu("gameFinished:!")}}),ExplosionManager=new Class({initialize:function(t){this.game=t,this.explosions=[]},update:function(t){for(var e,s=now(),i=0;e=this.explosions[i];i++)s-e.bornAt>(e.ttl||500)?(e.destroy(),this.explosions.splice(i,1)):e.update(t)},addExplosion:function(t,e,s){var i=new(s=s||ParticleExplosion)(t,e);i.game=this.game,i.checkBounds(),this.explosions.push(i),this.game.audioManager.explosion&&this.game.audioManager.explosion.play()},destroy:function(){for(var t,e=0;t=this.explosions[e];e++)t.destroy();this.explosions=[]}}),Cannon=new Class({initialize:function(t,e,s,i,n){this.player=t,this.game=e,this.pos=new Vector(s,i),this.angle=n||0},shootPressed:function(){},shootReleased:function(){},checkCollisions:function(){},getExplosionClass:function(){return ParticleExplosion},update:function(t){this.game.hideAll(),this.checkCollisions(t),this.game.showAll()},checkCollision:function(t){var e=t.checkCollision();return!!e&&(this.game.explosionManager.addExplosion(t.pos,e,this.getExplosionClass()),this.game.menuManager.addPoints(Math.min(e.getElementsByTagName("*").length+1,100),t.pos),e.isShot||e.parentNode.removeChild(e),this.game.statisticsManager&&this.game.statisticsManager.addElementsDestroyed(),!0)},createBullet:function(t){var e=new t(this.getABulletPos(),this.getABulletDir());return e.game=this.game,e.manager=this,e.initCanvas(),e.vel.add(e.vel.cp().setLength(this.player.vel.len())),e},getABulletPos:function(){return this.player.pos.cp().add(this.pos.cp().rotate(this.player.dir.angle()+Math.PI/2))},getABulletDir:function(){return this.player.dir.cp().rotate(this.angle)},destroy:function(){}}),LaserCannon=new Class({Extends:Cannon,initialize:function(t,e,s,i,n){Cannon.prototype.initialize.apply(this,arguments),this.lasers=[]},getExplosionClass:function(){return SplitExplosion},update:function(t){this.lasers.length&&(this.removeOld(),Cannon.prototype.update.call(this,t))},checkCollisions:function(t){for(var e,s=0;e=this.lasers[s];s++)e.update(t),this.checkCollision(e)},removeOld:function(){for(var t,e=0;t=this.lasers[e];e++)t.outOfBounds&&(t.destroy(),this.lasers.splice(e,1))},shootPressed:function(){this.lasers.length>5||now()-this.lastFired<500||(this.lastFired=now(),this.game.statisticsManager&&this.game.statisticsManager.addShotFired(),this.lasers.push(this.createBullet(LaserBullet)))},destroy:function(){if(this.lasers.length){for(var t,e=0;t=this.lasers[e];e++)t.destroy();this.lasers=[]}}}),BallCannon=new Class({Extends:Cannon,initialize:function(){Cannon.prototype.initialize.apply(this,arguments),this.lastFired=0,this.bullets=[]},getExplosionClass:function(){return ParticleExplosion},update:function(t){this.bullets.length&&(this.removeOld(),Cannon.prototype.update.call(this,t))},removeOld:function(){for(var t,e=now(),s=0;t=this.bullets[s];s++)e-t.bornAt>2e3&&(t.destroy(),this.bullets.splice(s,1))},checkCollisions:function(t){for(var e,s=0;e=this.bullets[s];s++)e.update(t),this.checkCollision(e)&&(e.destroy(),this.bullets.splice(s,1))},shootPressed:function(){now()-this.lastFired<200||(this.lastFired=now(),this.addBullet(),this.game.statisticsManager&&this.game.statisticsManager.addShotFired())},addBullet:function(){this.bullets.length>7&&(this.bullets[0].destroy(),this.bullets.shift());var t=this.createBullet(Bullet);this.bullets.push(t)},destroy:function(){for(var t,e=0;t=this.bullets[e];e++)t.destroy();this.bullets=[]}}),Bullet=new Class({initialize:function(t,e){this.pos=t.cp(),this.dir=e,this.vel=new Vector(500,500),this.bornAt=now()},initCanvas:function(){this.sheet=new Sheet(new Rect(this.pos.x,this.pos.y,5,5)),this.sheet.drawBullet()},draw:function(){this.sheet.setPosition(this.pos)},update:function(t){this.pos.add(this.vel.setAngle(this.dir.angle()).mulNew(t)),this.checkBounds(),this.draw()},checkCollision:function(){var t=document.elementFromPoint(this.pos.x,this.pos.y);return t&&3==t.nodeType&&(t=t.parentNode),!(!t||!this.game.bulletManager.isDestroyableFromCollision(t))&&t},checkBounds:function(){var t=this.game.windowSize.width,e=this.game.windowSize.height,s=this.pos.x+this.sheet.rect.size.width/2,i=this.pos.y+this.sheet.rect.size.height/2;s>t?this.pos.x=0:this.pos.x<0&&(this.pos.x=t-this.sheet.rect.size.width/2),i>e?this.pos.y=0:this.pos.y<0&&(this.pos.y=e-this.sheet.rect.size.height/2)},destroy:function(){this.sheet.destroy()}}),LaserBullet=new Class({Extends:Bullet,initialize:function(){Bullet.prototype.initialize.apply(this,arguments),this.vel=new Vector(750,750),this.lastDrawPos=this.pos.cp()},initCanvas:function(){var t=Math.max(GameGlobals.laserImage.width,GameGlobals.laserImage.height);this.sheet=new Sheet(new Rect(0,0,t,t))},update:function(t){Bullet.prototype.update.apply(this,arguments)},draw:function(){this.sheet.drawLaser(this.pos,this.dir),this.lastDrawPos=this.pos.cp()},checkBounds:function(){var t=this.game.windowSize.width,e=this.game.windowSize.height,s=this.pos.x+this.sheet.rect.size.width/2,i=this.pos.y+this.sheet.rect.size.height/2;(s>t||this.pos.x<0)&&(this.outOfBounds=!0),(i>e||this.pos.y<0)&&(this.outOfBounds=!0)},destroy:function(){this.sheet.destroy()}});GameGlobals.laserImage=document.createElement("img"),GameGlobals.laserImage.src=GameGlobals.path("css/gfx/kickass/laser.png");var Explosion=new Class({initialize:function(t,e){this.bornAt=now(),this.pos=t.cp()},update:function(t){},checkBounds:function(){},destroy:function(){}}),ParticleExplosion=new Class({Extends:Explosion,initialize:function(t,e){Explosion.prototype.initialize.apply(this,arguments),this.particleVel=new Vector(150,0),this.particles=[],this.generateParticles(),this.sheet=new Sheet(new Rect(t.x,t.y,250,250))},update:function(t){for(var e,s=0;e=this.particles[s];s++)e.pos.add(e.vel.mulNew(t).mul(random(.5,1)).setAngle(e.dir.angle()));this.sheet.clear(),this.sheet.drawExplosion(this.particles)},generateParticles:function(){for(var t=0,e=GameGlobals.hasCanvas?40:10;t<e;t++)this.particles.push({dir:new Vector(random(0,20)-10,random(0,20)-10).normalize(),vel:this.particleVel.cp(),pos:new Vector(0,0),color:["yellow","red"][random(0,1)]})},checkBounds:function(){var t=this.sheet.rect.getRight(),e=this.sheet.rect.getBottom(),s=this.game.windowSize.width,i=this.game.windowSize.height;t>s&&(this.pos.x-=t-s),e>i&&(this.pos.y-=e-i),this.sheet.setPosition(this.pos)},destroy:function(){this.sheet.destroy()}}),MegaParticleExplosion=new Class({Extends:ParticleExplosion,initialize:function(t,e){Explosion.prototype.initialize.apply(this,arguments),this.particleVel=new Vector(200,0),this.particles=[],this.generateParticles(),this.sheet=new Sheet(new Rect(t.x,t.y,500,500)),this.ttl=2e3,this.generationDelay=.6,this.generationTimes=2,this.nextGenerate=this.generationDelay},update:function(t){this.nextGenerate-=t,this.nextGenerate<=0&&this.generationTimes>0&&(this.nextGenerate=this.generationDelay,this.generateParticles(),this.generationTimes--),ParticleExplosion.prototype.update.call(this,t)}}),SplitExplosion=new Class({Extends:Explosion,initialize:function(t,e){e&&(Explosion.prototype.initialize.apply(this,arguments),this.element=e,this.fx=new Fx,this.fx.addListener(this),this.start())},update:function(t){this.element&&this.fx.update()},set:function(t,e){},start:function(){var t=this.createClones(),e=t[0],s=t[1],i="rotate(-"+random(30,50)+"deg) translate(-100px, 40px)",n="rotate("+random(30,50)+"deg) translate(100px, 40px)";setStyles(e,{transform:i}),setStyles(s,{transform:n}),this.left=e,this.right=s,this.fx.add("opacity",{start:1,end:.5,duration:500})},createClones:function(){var t=getRect(this.element),e=this.createContainer(t),s=this.createContainer(t),i=cloneElement(this.element),n=cloneElement(this.element);addClass(i,"KICKASSELEMENT"),addClass(n,"KICKASSELEMENT");var a={margin:0,overflow:"hidden"};return setStyles(i,a),setStyles(n,a),e.appendChild(i),s.appendChild(n),s.style.left=t.left+t.width/2+"px",s.scrollLeft+=t.width/2,this.element.style.opacity=0,this.element.style.visibility="hidden",this.element.style.display="none",each([e,s],(function(t){t.style.transition="transform 500ms ease-in"}))},createContainer:function(t){var e=document.createElement("div");return setStyles(e,{position:"absolute",left:t.left,top:t.top,width:.5*t.width,height:t.height,overflow:"hidden"}),getAppContainerElement().appendChild(e),e},destroy:function(){try{this.left.parentNode.removeChild(this.left),this.right.parentNode.removeChild(this.right),this.element.parentNode.removeChild(this.element)}catch(t){}}}),Weapons={1:{name:"Cannon",id:"cannon",cannonClass:BallCannon},2:{name:"Laser",id:"laser",cannonClass:LaserCannon}},WeaponMap={cannon:Weapons[1],laser:Weapons[2]},SheetCanvas=new Class({initialize:function(rect){with(this.canvas=document.createElement("canvas"),this.canvas.className="KICKASSELEMENT",this.canvas.style)position="absolute",zIndex="1000000";GameGlobals.kickass.registerElement(this.canvas),this.canvas.getContext&&(this.ctx=this.canvas.getContext("2d")),this.rect=rect,this.angle=0,this.updateCanvas(),getAppContainerElement().appendChild(this.canvas)},tracePoly:function(t){if(t[0]){this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),this.ctx.rotate(this.angle),this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y);for(var e=0;e<t.length;e++)this.ctx.lineTo(t[e].x,t[e].y);this.ctx.restore()}},setAngle:function(t){this.angle=t},updateCanvas:function(){this.canvas.width!=this.rect.size.width&&(this.canvas.width=this.rect.size.width),this.canvas.height!=this.rect.size.height&&(this.canvas.height=this.rect.size.height),this.canvas.style.left=GameGlobals.kickass.scrollPos.x+(this.rect.pos.x-this.rect.size.width/2)+"px",this.canvas.style.top=GameGlobals.kickass.scrollPos.y+(this.rect.pos.y-this.rect.size.height/2)+"px"},drawLine:function(t,e,s,i){this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),this.ctx.beginPath(),this.ctx.moveTo(t,e),this.ctx.lineTo(s,i),this.ctx.closePath(),this.ctx.stroke(),this.ctx.restore()},drawCircle:function(t,e){e=e||{x:0,y:0},this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),e&&this.ctx.translate(e.x,e.y),this.ctx.beginPath(),this.ctx.arc(0,0,t,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.closePath(),this.ctx.restore()},drawRect:function(t,e,s,i){this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),this.ctx.translate(t,e),this.ctx.fillRect(t,e,s,i),this.ctx.restore(),this.ctx.fill()},drawImageFull:function(t){this.ctx.drawImage(t,0,0,this.rect.size.width,this.rect.size.height)},drawImage:function(t,e,s){this.ctx.save(),this.ctx.translate(this.rect.size.width/2+e,this.rect.size.height/2+s),this.ctx.rotate(this.angle),this.ctx.drawImage(t,0,-11),this.ctx.restore()},setFillColor:function(t){this.ctx.fillStyle=t},setStrokeColor:function(t){this.ctx.strokeStyle=t},setLineWidth:function(t){this.ctx.lineWidth=t},fillPath:function(){this.ctx.fill()},strokePath:function(){this.ctx.stroke()},clear:function(){this.ctx.clearRect(0,0,this.rect.size.width,this.rect.size.height)},destroy:function(){GameGlobals.kickass.unregisterElement(this.canvas),this.canvas.parentNode.removeChild(this.canvas)}}),Sheet=new Class({initialize:function(t){this.rect=t,this.drawer=new SheetCanvas(t)},clear:function(){this.drawer.clear()},setPosition:function(t){this.rect.pos=t.cp(),this.drawer.rect=this.rect,this.drawer.updateCanvas()},setAngle:function(t){this.drawer.setAngle(t)},drawPlayer:function(t){this.drawer.setFillColor("white"),this.drawer.setStrokeColor("black"),this.drawer.setLineWidth(1.5),this.drawer.tracePoly(t),this.drawer.fillPath(),this.drawer.tracePoly(t),this.drawer.strokePath()},drawBrokenPlayer:function(t,e){this.drawer.setStrokeColor("black"),this.drawer.setLineWidth(1.5);for(var s,i=1,n=t[0];s=t[i];i++,n=s){var a=e[i-1];this.drawer.drawLine(n.x+a.pos.x,n.x+a.pos.y,s.x+a.pos.x,s.y+a.pos.y)}},drawFlames:function(t,e){this.drawer.setLineWidth(1.5),this.drawer.setFillColor("red"),this.drawer.tracePoly(t.r),this.drawer.fillPath(),this.drawer.setFillColor("yellow"),this.drawer.tracePoly(t.y),this.drawer.fillPath()},drawBullet:function(){this.drawer.setFillColor(GameGlobals.bulletColor),this.drawer.drawCircle(2.5)},drawExplosion:function(t){for(var e,s=0;e=t[s];s++)this.drawer.setFillColor(e.color),this.drawer.drawRect(e.pos.x,e.pos.y,3,3)},drawFace:function(t){this.drawer.drawImageFull(t)},drawLaser:function(t,e){this.clear(),this.setPosition(t),this.drawer.setAngle(e.angle()),this.drawer.drawImage(GameGlobals.laserImage,0,0)},transformToSheetCoordinates:function(t){return t.cp().sub(new Vector(this.rect.size.width/2,this.rect.size.height/2))},destroy:function(){this.drawer.destroy()}}),namespace=getGlobalNamespace(),initKickAss=function(){if(namespace.KICKASSGAME)namespace.KICKASSGAME.addPlayer();else if(namespace.KICKASS_SITE_KEY){var t=new MySite(namespace.KICKASS_SITE_KEY);t.load((function(e){namespace.KICKASSGAME=GameGlobals.kickass=new KickAss({mySite:!!e&&t}),namespace.KICKASSGAME.begin()}))}else namespace.KICKASSGAME=GameGlobals.kickass=new KickAss,namespace.KICKASSGAME.begin()};function getAppContainerElement(){return namespace.KICKASS_CONTAINER_ELEMENT?document.getElementById(namespace.KICKASS_CONTAINER_ELEMENT):document.body}namespace.LAZYLOAD_KICKASS?window.startBrowserBlaster=initKickAss:initKickAss()})("undefined"!=typeof exports?exports:window);
|
2
|
-
//# sourceMappingURL=../maps/js/plane.js.map
|
1
|
+
(function(window){var JSONP=function(){var t,e,s,i=0,n=this;return{get:function(a,o,h){for(s in e="?",o=o||{})o.hasOwnProperty(s)&&(e+=encodeURIComponent(s)+"="+encodeURIComponent(o[s])+"&");var r="json"+ ++i;return n[r]=function(t){h(t);try{delete n[r]}catch(t){}n[r]=null},function(e){var s=document.createElement("script"),i=!1;s.src=e,s.async=!0,s.onload=s.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,s.onload=s.onreadystatechange=null,s&&s.parentNode&&s.parentNode.removeChild(s))},t||(t=document.getElementsByTagName("head")[0])||(t=document.body),t.appendChild(s)}(a+e+"callback="+r),r}}}(),CORS={request:function(t,e,s){if(this.calledByExtension())return this._callbacks[this._callbackId++]=s,void window.postMessage(JSON.stringify({from:"kickassapp-page",url:t,type:"callApi",params:e}),"*");e=e||{};var i="?";for(key in e)e.hasOwnProperty(key)&&(i+=encodeURIComponent(key)+"="+encodeURIComponent(e[key])+"&");var n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&s(JSON.parse(n.responseText))},n.open("GET",t+i),n.withCredentials=!0,n.setRequestHeader("Content-Type","application/json"),n.send()},calledByExtension:function(){return!!document.getElementById("kickass-has-been-initialized-yes-yes-yes")},_callbacks:{},_callbackId:0};function getGlobalNamespace(){return window&&window.INSTALL_SCOPE?window.INSTALL_SCOPE:window}CORS.calledByExtension()&&window.addEventListener("message",(function(t){var e;try{e=JSON.parse(t.data)}catch(t){return}if("kickassapp-extension"===e.from&&"kickassapp-extension-version1"===e.sanityCheck){var s=e.payload;"response"===s.type?(CORS._callbacks[s.requestId](s.body),delete CORS._callbacks[s.requestId]):"destroy"===s.type&&window.KICKASSGAME.destroy()}}),!1);var Class=function(t){var e=function(){return e.$prototyping?this:"function"==typeof this.initialize?this.initialize.apply(this,arguments):void 0};for(var s in t.Extends&&(e.parent=t.Extends,t.Extends.$prototyping=!0,e.prototype=new t.Extends,t.Extends.$prototyping=!1),t)t.hasOwnProperty(s)&&(e.prototype[s]=t[s]);return e};"undefined"!=typeof exports&&(exports.Class=Class);var Vector=new Class({initialize:function(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)},cp:function(){return new Vector(this.x,this.y)},mul:function(t){return this.x*=t,this.y*=t,this},mulNew:function(t){return new Vector(this.x*t,this.y*t)},div:function(t){return this.x/=t,this.y/=t,this},divNew:function(t){return new Vector(this.x/t,this.y/t)},add:function(t){return this.x+=t.x,this.y+=t.y,this},addNew:function(t){return new Vector(this.x+t.x,this.y+t.y)},sub:function(t){return this.x-=t.x,this.y-=t.y,this},subNew:function(t){return new Vector(this.x-t.x,this.y-t.y)},rotate:function(t){var e=this.x,s=this.y;return this.x=e*Math.cos(t)-Math.sin(t)*s,this.y=e*Math.sin(t)+Math.cos(t)*s,this},rotateNew:function(t){return this.cp().rotate(t)},setAngle:function(t){var e=this.len();return this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},setAngleNew:function(t){return this.cp().setAngle(t)},setLength:function(t){var e=this.len();return e?this.mul(t/e):this.x=this.y=t,this},setLengthNew:function(t){return this.cp().setLength(t)},normalize:function(){var t=this.len();return 0==t||(this.x/=t,this.y/=t),this},normalizeNew:function(){return this.cp().normalize()},angle:function(){return Math.atan2(this.y,this.x)},collidesWith:function(t){return this.x>t.x&&this.y>t.y&&this.x<t.x+t.width&&this.y<t.y+t.height},len:function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);return t<.005&&t>-.005?0:t},is:function(t){return"object"==typeof t&&this.x==t.x&&this.y==t.y},dot:function(t){return this.x*t.x+this.y*t.y},inTriangle:function(t,e,s){var i=s.subNew(t),n=e.subNew(t),a=p.subNew(t),o=i.dot(i),h=i.dot(n),r=i.dot(a),l=n.dot(n),c=n.dot(a),d=1/(o*l-h*h),u=(l*r-h*c)*d,m=(o*c-h*r)*d;return u>0&&m>0&&u+m<1},distanceFrom:function(t){return Math.sqrt(Math.pow(this.x-t.x,2),Math.pow(this.y-t.y,2))},toString:function(){return"[Vector("+this.x+", "+this.y+") angle: "+this.angle()+", length: "+this.len()+"]"}});"undefined"!=typeof exports&&(exports.Vector=Vector);var Rect=new Class({initialize:function(t,e,s,i){this.pos=new Vector(t,e),this.size={width:s,height:i}},hasPoint:function(t){return t.x>this.getLeft()&&t.x<this.getRight()&&t.y>this.getTop()&&t.y<this.getBottom()},setLeft:function(t){this.pos.x=t+this.size.width/2},setTop:function(t){this.pos.y=t+this.size.height/2},getLeft:function(){return this.pos.x-this.size.width/2},getTop:function(){return this.pos.y-this.size.height/2},getRight:function(){return this.pos.x+this.size.width/2},getBottom:function(){return this.pos.y+this.size.height/2},cp:function(){return new Rect(this.pos.x,this.pos.y,this.size.width,this.size.height)}});"undefined"!=typeof exports&&(exports.Rect=Rect);var Fx=new Class({initialize:function(){this.listeners=[],this.tweens={},this.running={}},addListener:function(t){this.listeners.push(t)},add:function(t,e){if((e=e||{}).duration=e.duration||500,e.transition=e.transition||Tween.Linear,e.repeats=void 0!==e.repeats&&e.repeats,!e.tweens){var s=e.start||0,i=void 0===e.end?1:e.end;e.tweens=[[s,i]]}this.tweens[t]=e},update:function(t){for(var e in t="number"==typeof t?t:now(),this.tweens)if(this.tweens.hasOwnProperty(e)){if(!this.running[e]){this.tweenStart(e,t);continue}var s=this.tweens[e],i=t-this.running[e].startTime;if(i>s.duration){this.tweenFinished(s,e);continue}for(var n,a=s.transition(i/s.duration),o=[],h=0;n=s.tweens[h];h++){var r=a*(n[1]-n[0])+n[0];o.push(r)}this.fire(e,o,a)}},tweenStart:function(t,e){this.running[t]={startTime:e};for(var s,i=[],n=0;s=this.tweens[t].tweens[n];n++)i.push(s[0]);this.fire(t,i,0)},tweenFinished:function(t,e){for(var s,i=[],n=0;s=t.tweens[n];n++)i.push(s[1]);if(this.fire(e,i,1),!t.repeats)return delete this.running[e],void delete this.tweens[e];this.tweenStart(e,now())},fire:function(t,e,s){for(var i,n=0;i=this.listeners[n];n++)i.set.call(i,t,e,s)}}),Tween={Linear:function(t){return t},Quadratic:function(t){return t*t},Quintic:function(t){return t*t*t},Shake:function(t){return Math.sin(t)}},GameGlobals={FPS:60,useAnimationFrame:!0,boids:{flockRadius:400,size:100},path:function(){return"https://kickassapp.com/"+Array.prototype.slice.call(arguments).join("")},hasCanvas:void 0!==document.createElement("canvas").getContext,bulletColor:"black"};function now(){return(new Date).getTime()}function bind(t,e){return function(){return e.apply(t,arguments)}}function each(t,e,s){if("function"==typeof t.forEach)return t.forEach(e,s),t;for(var i in t)t.hasOwnProperty(i)&&e.call(s||window,t[i],i);return t}function addEvent(t,e,s){t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent&&(t["e"+e+s]=s,t[e+s]=function(){return t["e"+e+s](window.event)},t.attachEvent("on"+e,t[e+s]))}function removeEvent(t,e,s){t.removeEventListener?t.removeEventListener(e,s,!1):t.detachEvent&&(t.detachEvent("on"+e,t[e+s]),t[e+s]=null,t["e"+e+s]=null)}function stopEvent(t){t.stopPropogation&&t.stopPropogation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function elementIsContainedIn(t,e){return element.contains?t.contains(e):!!(16&t.compareDocumentPosition(e))}function code(t){var e={38:"up",40:"down",37:"left",39:"right",27:"esc"};return e[t]?e[t]:String.fromCharCode(t)}function random(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function getRect(t){if("function"==typeof t.getBoundingClientRect){var e=t.getBoundingClientRect(),s=window.pageXOffset,i=window.pageYOffset;return{width:e.width,height:e.height,left:e.left+s,top:e.top+i}}e={width:t.offsetWidth,height:t.offsetHeight,left:0,top:0};for(var n=t;n;)e.left+=n.offsetLeft,e.top+=n.offsetTop,n=n.offsetParent;return e}function getCompatElement(){var t=document;return t.compatMode&&"CSS1Compat"!=t.compatMode?t.body:t.documentElement}function getScrollSize(){var t=getCompatElement(),e={x:t.clientWidth,y:t.clientHeight},s=document.body;return{x:Math.max(t.scrollWidth,s.scrollWidth,e.x),y:Math.max(t.scrollHeight,s.scrollHeight,e.y)}}function getStyle(t,e){return t.style[e]?t.style[e]:t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function setStyles(t,e){for(var s in e)if(e.hasOwnProperty(s)){var i=e[s];"number"==typeof i&&"opacity"!==s&&"zIndex"!==s&&(i+="px"),t.style[s]=i}}function hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function addClass(t,e){hasClass(t,e)||(t.className+=" "+e)}function removeClass(t,e){if(hasClass(t,e)){var s=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(s," ")}}function cloneElement(t){return t.cloneNode(!0)}function newElement(t,e){var s=document.createElement(t);for(var i in e)e.hasOwnProperty(i)&&("styles"===i?setStyles(s,e[i]):s[i]=e[i]);return s}window.GameGlobals=GameGlobals,Array.prototype.indexOf||(Array.prototype.indexOf=function(t){if(null==this)throw new TypeError;var e=Object(this),s=e.length>>>0;if(0===s)return-1;var i=0;if(arguments.length>0&&((i=Number(arguments[1]))!=i?i=0:0!==i&&i!==1/0&&i!==-1/0&&(i=(i>0||-1)*Math.floor(Math.abs(i)))),i>=s)return-1;for(var n=i>=0?i:Math.max(s-Math.abs(i),0);n<s;n++)if(n in e&&e[n]===t)return n;return-1});var requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){window.setTimeout(t,1e3/60)};function delay(t,e,s){return setTimeout(bind(s,e),t)}var KickAss=new Class({initialize:function(t){t&&t.mySite&&(this.mySite=t.mySite),this.players=[],this.elements=[],this.weaponClass=Weapons[1].cannonClass,this.scrollPos=new Vector(0,0),this.scrollSize=new Vector(0,0),this.windowSize={width:0,height:0},this.updateWindowInfo(),this.bulletManager=new BulletManager(this),this.bulletManager.updateEnemyIndex(),this.explosionManager=new ExplosionManager(this),this.ui=new UIManager(this),this.bombManager=new BombManager(this),this.menuManager=new MenuManager(this),this.menuManager.create(),void 0!==StatisticsManager&&(this.statisticsManager=new StatisticsManager(this)),this.sessionManager=new SessionManager(this),this.lastUpdate=now(),this.keyMap={},this.keydownEvent=bind(this,this.keydown),this.keyupEvent=bind(this,this.keyup),this.multiplier=10,this.isCampaign()?this.audioManager={explosion:new AudioManager(GameGlobals.path("static/sounds/game/explosion"),["mp3","ogg"]),shot:new AudioManager(GameGlobals.path("static/sounds/game/shot"),["mp3","ogg"])}:this.audioManager={},window.KickAssStyle&&"white"===window.KickAssStyle&&(GameGlobals.bulletColor="white"),addEvent(document,"keydown",this.keydownEvent),addEvent(document,"keyup",this.keyupEvent),addEvent(document,"keypress",this.keydownEvent)},begin:function(){this.addPlayer(),this.sessionManager.isPlaying=!0,GameGlobals.useAnimationFrame||(this.loopTimer=window.setInterval(bind(this,this.loop),1e3/GameGlobals.FPS)),GameGlobals.useAnimationFrame&&requestAnimFrame(bind(this,this.loop))},keydown:function(t){var e=code(t.keyCode);switch(this.keyMap[e]=!0,e){case"left":case"right":case"up":case"down":case"esc":case" ":stopEvent(t)}if("esc"===e)this.destroy()},keyup:function(t){var e=code(t.keyCode);switch(this.keyMap[e]=!1,e){case"left":case"right":case"up":case"down":case"esc":case" ":t.stopPropogation&&t.stopPropogation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}},loop:function(){var t=now(),e=(t-this.lastUpdate)/1e3;this.updateWindowInfo();for(var s,i=0;s=this.players[i];i++)s.update(e);this.bulletManager.update(e),this.bombManager.update(e),this.explosionManager.update(e),this.ui.update(e),this.statisticsManager&&this.statisticsManager.update(e),this.sessionManager.update(e),this.lastUpdate=t,GameGlobals.useAnimationFrame&&requestAnimFrame(bind(this,this.loop))},addPlayer:function(){var t=Ships.Standard;window.KICKASSSHIP&&window.KICKASSSHIP.points&&(t=KICKASSSHIP),this.mySite&&this.mySite.getShipConfig()&&(t=this.mySite.getShipConfig());var e=new Player(this);e.setShip(t),this.players.push(e),this.explosionManager.addExplosion(e.pos)},registerElement:function(t){if(!t)throw new Error("Can't register unexisting element.");this.elements.push(t)},unregisterElement:function(t){this.elements.splice(this.elements.indexOf(t),1)},isKickAssElement:function(t){for(var e,s=0;e=this.elements[s];s++)if(t===e||elementIsContainedIn(e,t))return!0;return!1},isKeyPressed:function(t){return!!this.keyMap[t]},updateWindowInfo:function(){var t=!!window.ActiveXObject&&"BackCompat"==document.compatMode;this.windowSize={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},t&&(this.windowSize.width=document.body.clientWidth,this.windowSize.height=document.body.clientHeight),this.menuManager&&this.menuManager.isVisible()&&(this.windowSize.height-=this.menuManager.getHeight()),this.scrollPos.x=window.pageXOffset||document.documentElement.scrollLeft,this.scrollPos.y=window.pageYOffset||document.documentElement.scrollTop,this.scrollSize=getScrollSize()},hideAll:function(){for(var t,e=0;t=this.elements[e];e++)t.style.visibility="hidden"},showAll:function(){for(var t,e=0;t=this.elements[e];e++)t.style.visibility="visible"},updateShips:function(t,e){e||this.ui.showMessage("You're now flying<br /><em>"+t.name+"<em>!!");for(var s,i=0;s=this.players[i];i++)s.setShip(t)},changeWeapon:function(t,e){this.weaponClass=t.cannonClass,e||this.ui.showMessage("Changed to "+t.name.toUpperCase()+"!!!!");for(var s,i=0;s=this.players[i];i++)s.setCannons(t.cannonClass)},changeWeaponById:function(t,e){Weapons[t]&&this.changeWeapon(Weapons[t],e)},flyOutPlayers:function(t,e){for(var s,i=0;s=this.players[i];i++)s.flyTo(t,-s.size.height),s.isBound=!1},flyInPlayers:function(){for(var t,e=0;t=this.players[e];e++)t.flyTo(t.pos.x,100,(function(){this.isBound=!0}))},newRank:function(t){this.ui.showMessage("OMG. You leveled up to: <strong>"+t+"</strong>!<br /><small>Be sure to check what cool new stuff you get in the menu.</small>")},fireBomb:function(){this.bombManager.blow()},destroy:function(){removeEvent(document,"keydown",this.keydownEvent),removeEvent(document,"keypress",this.keydownEvent),removeEvent(document,"keyup",this.keyupEvent);for(var t,e=0;t=this.players[e];e++)t.destroy();this.bulletManager.destroy(),this.explosionManager.destroy(),this.menuManager.destroy(),GameGlobals.useAnimationFrame||clearInterval(this.loopTimer),getGlobalNamespace().KICKASSGAME=!1,this.isCampaign()&&document.location.reload()},isCampaign:function(){return getGlobalNamespace().IS_CLOUDFLARE_GAME},isMySite:function(){return!!getGlobalNamespace().KICKASS_SITE_KEY},shouldShowAd:function(){return!this.mySite&&!this.isCampaign()},shouldShowMenu:function(){return!this.mySite&&!this.isCampaign()},shouldShowHowToImage:function(){return this.mySite||this.isCampaign()}});window.KickAss=KickAss;var StatisticsManager=new Class({initialize:function(t){this.game=t,this.data={},this.data.startedPlaying=now(),this.data.elementsDestroyed=0,this.data.shotsFired=0,this.data.distanceFlownInPixels=0,this.data.totalPointsThisSession=0,this.data.usedThrusters=0,this.lastUpdate=0},usedThrusters:function(){this.data.usedThrusters=1},increaseDistanceWithPixels:function(t){this.data.distanceFlownInPixels+=t},increasePointsGainedWithPoints:function(t){this.data.totalPointsThisSession+=t},addShotFired:function(){this.data.shotsFired++,this.game.audioManager.shot&&this.game.audioManager.shot.play()},addElementsDestroyed:function(){this.data.elementsDestroyed++},update:function(t){this.lastUpdate+=t,this.lastUpdate>.25&&(this.syncWithServer(),this.lastUpdate=0)},syncWithServer:function(){var t=[];for(var e in this.data)this.data.hasOwnProperty(e)&&t.push(e+":"+this.data[e]);this.game.menuManager.sendMessageToMenu("stats:!"+t.join("|"))}}),MySite=new Class({initialize:function(t){this.key=t},load:function(t){CORS.request(GameGlobals.path("mysite/api.json"),{site_key:this.key,url:document.location.toString()},bind(this,(function(e){e&&e.embed?(this.mySiteData=e.embed,t(!0)):t(!1)})))},install:function(){},getShipId:function(){return this.mySiteData&&this.mySiteData.settings.ship},getShipConfig:function(){return this.mySiteData&&this.mySiteData.settings.ship_config},getShareURL:function(){return this.mySiteData&&this.mySiteData.settings.share_url}}),Menu=new Class({initialize:function(t){this.game=t,this.size={height:300}},generate:function(t){this.container=document.createElement("div"),this.container.className="KICKASSELEMENT",this.container.id="kickass-profile-menu",t.appendChild(this.container);var e=getGlobalNamespace().KICKASSSHIPID||"";this.url=GameGlobals.path("intermediate_postmessage.html?url="+encodeURIComponent(getGlobalNamespace().KICKASSURL||document.location.href)+"&origin="+encodeURIComponent(document.location.href)+"&preship="+e+"&is_campaign="+(this.game.isCampaign()?"true":"")+"&is_mysite="+(this.game.isMySite()?"true":"")),this.isSocketReady=!1,this.socketIframe=document.createElement("iframe"),this.socketIframe.frameborder="0",this.socketIframe.className="KICKASSELEMENT",this.socketIframe.width="100%",this.socketIframe.height=this.size.height+"px",this.container.appendChild(this.socketIframe),this.menuOrigin="https://kickassapp.com/".replace(/\/$/,""),this.socketIframe.src=this.url,this.onMessage=bind(this,(function(t){if(t.origin===this.menuOrigin||t.origin===this.menuOrigin.replace("http://","https://")){var e=t.data;if("ready"!==e){var s=e.split(":!");if(2===s.length){var i=s.shift().replace(/^./g,(function(t){return t.charAt(0).toUpperCase()}));"function"==typeof this["messageType"+i]&&this["messageType"+i](s.join(":!"))}}else this.onGameReady()}else console.log("ignoring event from",t.origin)})),window.addEventListener("message",this.onMessage,!1),this.game.registerElement(this.container)},socketPostMessage:function(t){this.socketIframe.contentWindow.postMessage(t,this.menuOrigin)},onGameReady:function(){this.isSocketReady=!0,this.game.registerElement(this.container.getElementsByTagName("iframe")[0]),this.socketPostMessage("url:!"+(getGlobalNamespace().KICKASSURL||document.location.href)),this.game.statisticsManager&&this.game.statisticsManager.syncWithServer(),this.game.menuManager.onGameReady()},sendMessage:function(t){if(this.isSocketReady&&t!=this.lastMessage){try{this.socketPostMessage(t)}catch(t){}this.lastMessage=t}},messageTypeChangeShip:function(t){var e=(t=t.split(","))[0],s=(t[1],"initial"===t[2]);this.shipId!==e&&(s&&getGlobalNamespace().KICKASSSHIP||(this.shipId=e,CORS.request(GameGlobals.path("designer/ship/"+e+"/construction.json"),{ship_id:e,is_initial:s?"1":"0"},bind(this,(function(t){this.game.updateShips(t.data,s);try{window.focus()}catch(t){}}))),s||this.parent.hideMenu()))},messageTypeChangeWeapon:function(t,e){this.game.changeWeaponById(t,e)},messageTypeSetMultiplier:function(t){t=parseInt(t,10),!isNaN(t)&&t&&(this.game.multiplier=t)},messageTypeNewRank:function(t){this.game.newRank(t)},messageTypePlayerMessage:function(t){this.game.ui.showMessage(t)},destroy:function(){this.game.unregisterElement(this.container),this.game.unregisterElement(this.iframe),window.removeEventListener("message",this.onMessage,!1),this.container.parentNode.removeChild(this.container)}}),MenuManager=new Class({initialize:function(t){this.game=t,this.numPoints=0,getGlobalNamespace().KICKASS_INLINE_CSS||this.includeCSS(GameGlobals.path("css/menustyles.css"))},generateDefaults:function(){for(var t in Weapons)Weapons.hasOwnProperty(t)&&this.addWeapon(Weapons[t],t);this.hideBombMenu()},create:function(){this.container=document.createElement("div"),this.container.className="KICKASSELEMENT KICKASShidden "+(this.game.shouldShowMenu()?"":"KICKASSNOMENU"),this.container.id="kickass-menu",this.game.shouldShowMenu()?(this.container.style.bottom="-250px",this.container.style.display="none"):removeClass(this.container,"KICKASShidden"),getAppContainerElement().appendChild(this.container);this.container.innerHTML='<div id="kickass-howto-image" class="KICKASSELEMENT kickass-howto-invisible"></div><div id="kickass-pointstab" style="width: 200px;" class="KICKASSELEMENT"><div id="kickass-bomb-menu" class="KICKASSELEMENT KICKASShidden"><ul id="kickass-bomb-list" class="KICKASSELEMENT"></ul></div><div id="kickass-weapons-menu" class="KICKASSELEMENT KICKASShidden" style="display:none"><ul id="kickass-weapons-list" class="KICKASSELEMENT"></ul></div><div id="kickass-pointstab-wrapper" class="KICKASSELEMENT"><div id="kickass-points" class="KICKASSELEMENT">'+this.numPoints+'</div><div id="kickass-esctoquit" class="KICKASSELEMENT">Press esc to quit</div>'+this.getShareHTML()+"</div></div>",this.pointsTab=document.getElementById("kickass-pointstab"),this.pointsTabWrapper=document.getElementById("kickass-pointstab-wrapper"),this.points=document.getElementById("kickass-points"),this.escToQuit=document.getElementById("kickass-esctoquit"),this.howToImage=document.getElementById("kickass-howto-image"),this.weaponsMenu=document.getElementById("kickass-weapons-menu"),this.weaponsList=document.getElementById("kickass-weapons-list"),this.bombLink=document.getElementById("kickass-bomb-menu");for(var t=this.container.getElementsByTagName("*"),e=0;e<t.length;e++)this.game.registerElement(t[e]);this.game.registerElement(this.container),this.game.shouldShowMenu()?(this.menu=new Menu(this.game),this.menu.parent=this,this.menu.generate(this.container)):setTimeout(function(){this.onGameReady()}.bind(this),100),addEvent(this.bombLink,"click",bind(this,(function(t){stopEvent(t),this.game.fireBomb()}))),addEvent(this.pointsTabWrapper,"click",bind(this,this.toggleMenu)),addEvent(this.weaponsMenu,"click",bind(this,this.toggleWeaponsMenu)),this.generateDefaults()},getShareHTML:function(){return""},onGameReady:function(){this.container.style.display="block",this.game.shouldShowHowToImage()&&(setTimeout(bind(this,(function(){removeClass(this.howToImage,"kickass-howto-invisible")})),10),setTimeout(bind(this,(function(){addClass(this.howToImage,"kickass-howto-invisible")})),4e3))},navigateTo:function(t,e){e||this.showMenu(),this.menu&&this.menu.socketPostMessage("navigate:!"+t)},toggleMenu:function(){this.game.shouldShowMenu()?hasClass(this.container,"KICKASShidden")?this.showMenu():this.hideMenu():this.showMenu()},toggleWeaponsMenu:function(){hasClass(this.weaponsMenu,"KICKASShidden")?this.showWeaponsMenu():this.hideWeaponsMenu()},hideWeaponsMenu:function(){this.weaponsMenu.style.width="",addClass(this.weaponsMenu,"KICKASShidden")},showWeaponsMenu:function(){var t=this.weaponsMenu.getElementsByTagName("li");t=t[t.length-1],this.weaponsMenu.style.width=t.offsetLeft+t.offsetWidth-47+"px",removeClass(this.weaponsMenu,"KICKASShidden")},showMenu:function(){this.game.shouldShowMenu()&&(this.container.style.bottom="",removeClass(this.container,"KICKASShidden"))},hideMenu:function(){this.container.style.bottom="",addClass(this.container,"KICKASShidden")},showBombMenu:function(){this.bombLink.style.width=""},hideBombMenu:function(){this.bombLink.style.width="0px"},getHeight:function(){return this.container.clientHeight},isVisible:function(){return!hasClass(this.container,"KICKASShidden")},addPoints:function(t,e){var s=t*this.game.multiplier;this.numPoints+=s,this.points.innerHTML=this.numPoints,this.game.statisticsManager&&this.game.statisticsManager.increasePointsGainedWithPoints(s),this.game.ui.addPointsBubbleAt(e,s)},includeCSS:function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,(document.head||document.body).appendChild(e)},sendMessageToMenu:function(t){this.menu&&this.menu.sendMessage(t)},addWeapon:function(t,e){var s=document.createElement("li");s.className="KICKASSELEMENT kickass-weapon-item",s.weapon=t,s.style.backgroundImage="url("+GameGlobals.path("css/gfx/kickass/weap-"+t.id+".png")+")",s.innerHTML='<span class="KICKASSELEMENT">'+t.name+"</span>",this.weaponsList.appendChild(s),addEvent(s,"click",bind(this,(function(s){stopEvent(s),this.changeWeapon(t),this.sendMessageToMenu("changeWeapon:!"+e)})))},changeWeapon:function(t){this.game.changeWeapon(t)},destroy:function(){for(var t=this.container.getElementsByTagName("*"),e=0;e<t.length;e++)this.game.unregisterElement(t[e]);this.game.unregisterElement(this.container),this.menu&&this.menu.destroy(),this.container.parentNode.removeChild(this.container)}}),UIManager=new Class({initialize:function(t){this.UNIQID=0,this.game=t,this.pointBubbles={},this.messages={},this.fx=new Fx,this.fx.addListener(this)},update:function(t){this.fx.update()},set:function(t,e,s){var i=t.split("-")[0],n=t.split("-")[1];if(this.pointBubbles[n]){var a=this.pointBubbles[n];a.style.top=e[0]+"px",a.style.opacity=e[1],1==s&&a.parentNode&&(a.parentNode.removeChild(a),delete this.pointBubbles[n])}else if(this.messages[n]&&"messagedown"==i){(o=this.messages[n]).style.top=e[0]+"px",1==s&&setTimeout(bind(this,(function(){this.fx.add("messageup-"+n,{tweens:[[e[0],-100]],transition:Tween.Quadratic,duration:300})})),o.staytime||4e3)}else if(this.messages[n]&&"messageup"==i){var o;(o=this.messages[n]).style.top=e[0]+"px",1==s&&(o.parentNode.removeChild(o),delete this.messages[n])}},addPointsBubbleAt:function(t,e){var s="bubble"+this.UNIQID++,i=this.game.scrollPos.y+t.y,n=newElement("span",{innerHTML:e,className:"KICKASSELEMENT",styles:{position:"absolute",font:"20px Arial",fontWeight:"bold",opacity:"1",color:"black",textShadow:"#fff 1px 1px 3px",top:i,zIndex:"10000000"}});n.style.left=t.x-n.offsetWidth/2+"px",getAppContainerElement().appendChild(n),this.pointBubbles[s]=n,this.fx.add("bubble-"+s,{tweens:[[i,i-15],[1,0]]})},showMessage:function(t,e){e=e||!1;var s=this.UNIQID++,i=newElement("div",{innerHTML:t,className:"KICKASSELEMENT",id:"kickass-message-"+s,styles:{position:"fixed",top:-100,left:"50%",marginLeft:-150,width:300,background:"#222",opacity:.8,padding:"10px",color:"#fff",textAlign:"center",borderRadius:15,font:"20px Arial",fontWeight:"bold",zIndex:"10000000"}});i.staytime=e,getAppContainerElement().appendChild(i);var n=this.getLowestBubbleY();return i.kickassto=n,this.fx.add("messagedown-"+s,{duration:300,tweens:[[-100,n]],transition:Tween.Quadratic}),this.messages[s]=i,i},getLowestBubbleY:function(){var t=100;for(var e in this.messages)this.messages.hasOwnProperty(e)&&(t=Math.max(this.messages[e].kickassto+this.messages[e].offsetHeight+10,t));return t}}),AudioManager=new Class({initialize:function(t,e){if(this.src=t,this.formats=e,channels=8,this.supportsAudio=void 0!==document.createElement("audio").play,this.supportsAudio){this.numChannels=channels,this.channels=[];for(var s=0;s<this.numChannels;s++)this.channels.push({isPlaying:!1,element:this.prepareElement(this.buildAudioElement())})}},buildAudioElement:function(){for(var t,e={ogg:"audio/ogg",mp3:"audio/mpeg"},s=document.createElement("audio"),i=0;t=this.formats[i];i++){var n=document.createElement("source");n.src=this.src+"."+t,n.type=e[t],s.appendChild(n)}return s},prepareElement:function(t){if(void 0===t.addEventListener)return t;var e=this;return t.addEventListener("ended",(function(s){e.audioEnded(t)}),!1),t},audioEnded:function(t){for(var e,s=0;e=this.channels[s];s++)e.element===t&&(e.isPlaying=!1)},play:function(){if(this.supportsAudio)for(var t,e=0;t=this.channels[e];e++)if(!t.isPlaying)return t.isPlaying=!0,void("function"==typeof t.element.play&&t.element.play())}}),Ships={Standard:{points:[[-10,10],[0,-15],[10,10]],thrusters:[{s:{w:20,h:7},p:{x:0,y:14},a:0}],cannons:[{p:{x:0,y:-15},a:0}]}},PLAYERIDS=0,Player=new Class({initialize:function(t){this.id=PLAYERIDS++,this.game=t,this.tween=!1,this.isBound=!0,this.pos=new Vector(1630,217),this.vel=new Vector(0,0),this.acc=new Vector(0,0),this.dir=new Vector(0,1),this.currentRotation=0,this.isBroken=!1,this.lineOffsets=[],this.deadTime=0,this.friction=.95,this.terminalVelocity=2e3,this.lastPos=new Vector(0,0)},setShip:function(t){this.ship=t,this.verts=[];for(var e,s=0;e=this.ship.points[s];s++)this.verts.push(new Vector(e[0],e[1]));this.verts.push(this.verts[0]),this.thrusters=[],this.cannons=[],this.addThrusters(this.ship.thrusters),this.addCannons(this.ship.cannons),this.size=this.getSizeFromVertsAndObjects(),this.bounds=this.calculateBounds(),this.sheet&&this.sheet.destroy(),this.sheet=new Sheet(new Rect(100,100,this.bounds.x,this.bounds.y)),this.forceRedraw=!0},setCannons:function(t){for(var e,s=[],i=0;e=this.cannons[i];i++){var n=new t(this,this.game,e.pos.x,e.pos.y,e.angle);s.push(n),e.destroy()}this.cannons=s},addThrusters:function(t){for(var e,s=0;e=t[s];s++){var i=new Thruster(e);this.thrusters.push(i)}},addCannons:function(t){for(var e,s=0;e=t[s];s++){var i=new(WeaponMap[e.m]||WeaponMap.cannon).cannonClass(this,this.game,e.p.x,e.p.y,e.a);i.player=this,i.game=this.game,this.cannons.push(i)}},update:function(t){if(this.isBroken){if(!this.lineOffsets.length)for(var e=0;e<this.verts.length-1;e++)this.lineOffsets[e]={pos:new Vector(0,0),dir:new Vector(1,1).setAngle(2*Math.PI*Math.random())};for(e=0;e<this.lineOffsets.length;e++)this.lineOffsets[e].pos.add(this.lineOffsets[e].dir.cp().setLength(50).mul(t));return this.sheet.clear(),this.sheet.setAngle(this.dir.angle()),this.sheet.setPosition(this.pos),this.sheet.drawBrokenPlayer(this.verts,this.lineOffsets),void(now()-this.deadTime>1e3&&(this.isBroken=!1,this.lineOffsets=[],this.randomPos()))}this.tween||(this.game.isKeyPressed("left")||this.game.isKeyPressed("right")?(this.game.isKeyPressed("left")&&this.rotateLeft(t),this.game.isKeyPressed("right")&&this.rotateRight(t)):this.stopRotate(),this.game.isKeyPressed("up")?this.activateThrusters():this.stopThrusters()),this.game.isKeyPressed(" ")?(this.isShooting=!0,this.isBroken||this.shootPressed()):this.isShooting&&(this.isShooting=!1,this.shootReleased()),this.currentRotation&&this.dir.setAngle(this.dir.angle()+this.currentRotation*t);var s=this.acc.mulNew(t).sub(this.vel.mulNew(t*this.friction));this.vel.add(s),this.vel.len()>this.terminalVelocity&&this.vel.setLength(this.terminalVelocity);var i=this.vel.mulNew(t);this.pos.add(i),this.game.statisticsManager&&this.game.statisticsManager.increaseDistanceWithPixels(i.len());var n=!this.acc.is({x:0,y:0});for(e=0;a=this.thrusters[e];e++)a.setIsShown(n),a.update(t);if(this.isBound&&this.checkBounds(),!this.lastPos.is(this.pos)||this.currentRotation||this.forceRedraw){if(this.forceRedraw=!1,this.sheet.clear(),this.sheet.setAngle(this.dir.angle()+Math.PI/2),this.sheet.setPosition(this.pos),n){var a;for(e=0;a=this.thrusters[e];e++)a.drawTo(this.sheet)}this.sheet.drawPlayer(this.verts),this.lastPos=this.pos.cp()}var o;for(e=0;o=this.cannons[e];e++)o.update(t)},randomPos:function(){var t=this.game.windowSize.width,e=this.game.windowSize.height;this.pos=new Vector(random(0,t),random(0,e))},checkBounds:function(){if(!this.tween){var t=this.game.windowSize.width,e=this.game.windowSize.height,s=this.pos.x+this.sheet.rect.size.width/2,i=this.pos.y+this.sheet.rect.size.height/2;s>t?(window.scrollTo(this.game.scrollPos.x+50,this.game.scrollPos.y),this.pos.x=0):this.pos.x<0&&(window.scrollTo(this.game.scrollPos.x-50,this.game.scrollPos.y),this.pos.x=t-this.sheet.rect.size.width/2),i>e?(window.scrollTo(this.game.scrollPos.x,this.game.scrollPos.y+.75*e),this.pos.y=0):this.pos.y<0&&(window.scrollTo(this.game.scrollPos.x,this.game.scrollPos.y-.75*e),this.pos.y=e-this.sheet.rect.size.height/2)}},inRect:function(t){for(var e,s=!1,i=0;e=this.verts[i];i++)t.hasPoint(new Vector(e.x+this.pos.x,e.y+this.pos.y))&&(s=!0);return s},hit:function(t){this.isBroken||(this.isBroken=!0,this.deadTime=now())},activateThrusters:function(){this.game.statisticsManager&&this.game.statisticsManager.usedThrusters(),this.acc=new Vector(500,0).setAngle(this.dir.angle())},stopThrusters:function(){this.acc=new Vector(0,0)},rotateLeft:function(t){this.currentRotation=Math.max(2*-Math.PI,this.currentRotation-10*Math.PI*t)},rotateRight:function(t){this.currentRotation=Math.min(2*Math.PI,this.currentRotation+10*Math.PI*t)},stopRotate:function(){this.currentRotation=0},getSizeFromVertsAndObjects:function(){for(var t,e=0,s=0;t=this.verts[s];s++)e=Math.max(e,new Vector(t).len());var i;for(s=0;i=this.thrusters[s];s++){var n=new Vector(i.pos.x-i.size.width/2,i.pos.y-i.size.height/2).rotate(i.angle),a=new Vector(i.pos.x+i.size.width/2,i.pos.y-i.size.height/2).rotate(i.angle),o=new Vector(i.pos.x-i.size.width/2,i.pos.y+i.size.height/2).rotate(i.angle),h=new Vector(i.pos.x+i.size.width/2,i.pos.y+i.size.height/2).rotate(i.angle);e=Math.max(e,n.len(),a.len(),o.len(),h.len())}return{width:2*e,height:2*e}},calculateBounds:function(){return{x:1*Math.max(this.size.width,this.size.height),y:1*Math.max(this.size.height,this.size.width)}},shootPressed:function(){for(var t,e=0;t=this.cannons[e];e++)t.shootPressed()},shootReleased:function(){for(var t,e=0;t=this.cannons[e];e++)t.shootReleased()},flyTo:function(t,e,s){this.tween={start:{pos:this.pos.cp(),dir:this.dir.cp()},to:new Vector(t,e),callback:s||function(){}},this.tween.time=this.getTimeforTween()},destroy:function(){this.sheet.destroy()}}),Thruster=new Class({initialize:function(t,e){this.pos=new Vector(t.p),this.size={width:t.s.w,height:t.s.h},this.angle=t.a||0,this.ship=e,this.isShown=!1,this.flameY=1,this.fx=new Fx,this.fx.addListener(this),this.flames={r:[],y:[]},this.lastFrameUpdate=0,this.generateFlames()},update:function(t){this.fx.update(),now()-this.lastFrameUpdate>1e3/60&&this.generateFlames()},set:function(t,e){if("flames"===t)this.flameY=e},setIsShown:function(t){!this.isShown&&t&&(this.flameY=0,this.generateFlames(),this.fx.add("flames",{start:this.flameY,end:1,duration:250,transition:Tween.Quintic})),this.isShown=t},drawTo:function(t){t.drawFlames(this.flames,this.angle)},generateFlames:function(){var t=this.size.width,e=.05*this.size.width,s=.8*this.size.width,i=.1*s,n=t/2,a=s/2,o=(this.size.height,this.pos.x),h=this.pos.y-this.size.height/2;function r(t,e){return new Vector(t,e)}this.flames.r=[r(-n+o,h)],this.flames.y=[r(-a+o,h)],this.flames.self=this;for(var l=0;l<t;l+=e)this.flames.r.push(r(l-n+o,this.flameY*random(.7*this.size.height,this.size.height)+h));this.flames.r.push(r(n+o,h));for(l=0;l<s;l+=i)this.flames.y.push(r(l-a+o,this.flameY*random(.4*this.size.height,.7*this.size.height)+h));this.flames.y.push(r(a+o,h)),this.lastFrameUpdate=now();for(var c=r(o,h),d=0;u=this.flames.r[d];d++)u.sub(c).rotate(this.angle).add(c);var u;for(d=0;u=this.flames.y[d];d++)u.sub(c).rotate(this.angle).add(c)}}),BombManager=new Class({initialize:function(t){this.game=t,this.bombShowDelay=30,this.nextBomb=this.bombShowDelay},update:function(t){this.game.isKeyPressed("F")&&this.isReady()&&this.blow(),-1!==this.nextBomb&&this.game.sessionManager.isPlaying&&(this.nextBomb-=t,this.nextBomb<0&&(this.game.menuManager.showBombMenu(),this.nextBomb=-1,this.game.ui.showMessage("BOMB IS READY<br />(lower right corner or F)")))},blow:function(){var t=this.game.ui.showMessage("3...",5e3);delay(1e3,(function(){t.innerHTML="2..."}),this),delay(2e3,(function(){t.innerHTML="1..."}),this),delay(3e3,(function(){t.innerHTML="boom"}),this),delay(3e3,this.blowStuffUp,this),this.nextBomb=this.bombShowDelay},blowStuffUp:function(){this.game.bulletManager.updateEnemyIndex();for(var t,e=this.game.bulletManager.enemyIndex,s=0;(t=e[s])&&s<10;s++){var i=getRect(t),n=new Vector(i.left+i.width/2,i.top+i.height/2);this.game.explosionManager.addExplosion(n,t,MegaParticleExplosion),t.parentNode.removeChild(t)}this.game.menuManager.hideBombMenu(),this.nextBomb=this.bombShowDelay},isReady:function(){return-1===this.nextBomb}}),ELEMENTSTHATARENOTTOBEINCLUDED=["BR","SCRIPT","STYLE","TITLE","META","HEAD","OPTION","OPTGROUP","LINK"],ELEMENTSIZETHRESHOLD=5,BulletManager=new Class({initialize:function(t){this.game=t,this.lastBlink=0,this.blinkActive=!1,this.enemyIndex=[],this.updateDelay=2.5,this.nextUpdate=this.updateDelay},update:function(t){this.game.isKeyPressed("B")?this.blink():this.blinkActive&&this.endBlink(),this.nextUpdate-=t,this.nextUpdate<0&&this.updateEnemyIndex()},blink:function(){if(now()-this.lastBlink>250){for(var t,e=0;t=this.enemyIndex[e];e++)this.blinkActive?t.style.outline=t.KICKASSOLDBORDER:t.style.outline="1px solid red";this.blinkActive=!this.blinkActive,this.lastBlink=now(),this.blinkActive||this.updateEnemyIndex()}},endBlink:function(){for(var t,e=0;t=this.enemyIndex[e];e++)t.style.outline=t.KICKASSOLDBORDER;this.lastBlink=0,this.blinkActive=!1},updateEnemyIndex:function(){var t=document.getElementsByTagName("*");this.enemyIndex=[];for(var e,s=0;e=t[s];s++)this.isDestroyable(e)&&(this.enemyIndex.push(e),e.KICKASSOLDBORDER=e.style.outline||document.defaultView.getComputedStyle(e,null).outline);this.nextUpdate=this.updateDelay},isDestroyable:function(t,e){if(this.shouldIgnoreElement(t,e))return!1;for(var s,i=0;s=t.childNodes[i];i++)if(1===s.nodeType&&-1===ELEMENTSTHATARENOTTOBEINCLUDED.indexOf(s.tagName)&&s.offsetWidth>=ELEMENTSIZETHRESHOLD&&s.offsetHeight>=ELEMENTSIZETHRESHOLD&&"hidden"!==document.defaultView.getComputedStyle(s,null).visibility)return!1;return!0},isDestroyableFromCollision:function(t){return this.isDestroyable(t,!0)},shouldIgnoreElement:function(t,e){return 1!==t.nodeType||(t==document.documentElement||t==document.body||(-1!==ELEMENTSTHATARENOTTOBEINCLUDED.indexOf(t.tagName)||("hidden"==t.style.visibility||"none"==t.style.display||("string"==typeof t.className&&-1!=t.className.indexOf("KICKASSELEMENT")||(!e&&(t.offsetWidth<ELEMENTSIZETHRESHOLD||t.offsetHeight<ELEMENTSIZETHRESHOLD)||((t.offsetLeft<0||t.offsetTop<0)&&((s=getRect(t)).left+s.width<0||s.top+s.height<0)||(s||(s=getRect(t)),s.top>=this.game.scrollSize.y)))))));var s},destroy:function(){for(var t in this.bullets)if(this.bullets.hasOwnProperty(t))for(var e,s=0;e=this.bullets[t][s];s++)e.destroy();this.bullets={}}}),SessionManager=new Class({initialize:function(t){this.game=t,this.isPlaying=!1},update:function(t){this.isPlaying&&0==this.game.bulletManager.enemyIndex.length&&this.weHaveWon()},weHaveWon:function(){this.isPlaying=!1,this.game.ui.showMessage("You're done!"),this.game.isCampaign()?(this.game.menuManager.showMenu(),this.game.menuManager.navigateTo("highscores")):this.game.menuManager.showMenu(),this.game.menuManager.sendMessageToMenu("gameFinished:!")}}),ExplosionManager=new Class({initialize:function(t){this.game=t,this.explosions=[]},update:function(t){for(var e,s=now(),i=0;e=this.explosions[i];i++)s-e.bornAt>(e.ttl||500)?(e.destroy(),this.explosions.splice(i,1)):e.update(t)},addExplosion:function(t,e,s){var i=new(s=s||ParticleExplosion)(t,e);i.game=this.game,i.checkBounds(),this.explosions.push(i),this.game.audioManager.explosion&&this.game.audioManager.explosion.play()},destroy:function(){for(var t,e=0;t=this.explosions[e];e++)t.destroy();this.explosions=[]}}),Cannon=new Class({initialize:function(t,e,s,i,n){this.player=t,this.game=e,this.pos=new Vector(s,i),this.angle=n||0},shootPressed:function(){},shootReleased:function(){},checkCollisions:function(){},getExplosionClass:function(){return ParticleExplosion},update:function(t){this.game.hideAll(),this.checkCollisions(t),this.game.showAll()},checkCollision:function(t){var e=t.checkCollision();return!!e&&(this.game.explosionManager.addExplosion(t.pos,e,this.getExplosionClass()),this.game.menuManager.addPoints(Math.min(e.getElementsByTagName("*").length+1,100),t.pos),e.isShot||e.parentNode.removeChild(e),this.game.statisticsManager&&this.game.statisticsManager.addElementsDestroyed(),!0)},createBullet:function(t){var e=new t(this.getABulletPos(),this.getABulletDir());return e.game=this.game,e.manager=this,e.initCanvas(),e.vel.add(e.vel.cp().setLength(this.player.vel.len())),e},getABulletPos:function(){return this.player.pos.cp().add(this.pos.cp().rotate(this.player.dir.angle()+Math.PI/2))},getABulletDir:function(){return this.player.dir.cp().rotate(this.angle)},destroy:function(){}}),LaserCannon=new Class({Extends:Cannon,initialize:function(t,e,s,i,n){Cannon.prototype.initialize.apply(this,arguments),this.lasers=[]},getExplosionClass:function(){return SplitExplosion},update:function(t){this.lasers.length&&(this.removeOld(),Cannon.prototype.update.call(this,t))},checkCollisions:function(t){for(var e,s=0;e=this.lasers[s];s++)e.update(t),this.checkCollision(e)},removeOld:function(){for(var t,e=0;t=this.lasers[e];e++)t.outOfBounds&&(t.destroy(),this.lasers.splice(e,1))},shootPressed:function(){this.lasers.length>5||now()-this.lastFired<500||(this.lastFired=now(),this.game.statisticsManager&&this.game.statisticsManager.addShotFired(),this.lasers.push(this.createBullet(LaserBullet)))},destroy:function(){if(this.lasers.length){for(var t,e=0;t=this.lasers[e];e++)t.destroy();this.lasers=[]}}}),BallCannon=new Class({Extends:Cannon,initialize:function(){Cannon.prototype.initialize.apply(this,arguments),this.lastFired=0,this.bullets=[]},getExplosionClass:function(){return ParticleExplosion},update:function(t){this.bullets.length&&(this.removeOld(),Cannon.prototype.update.call(this,t))},removeOld:function(){for(var t,e=now(),s=0;t=this.bullets[s];s++)e-t.bornAt>2e3&&(t.destroy(),this.bullets.splice(s,1))},checkCollisions:function(t){for(var e,s=0;e=this.bullets[s];s++)e.update(t),this.checkCollision(e)&&(e.destroy(),this.bullets.splice(s,1))},shootPressed:function(){now()-this.lastFired<200||(this.lastFired=now(),this.addBullet(),this.game.statisticsManager&&this.game.statisticsManager.addShotFired())},addBullet:function(){this.bullets.length>7&&(this.bullets[0].destroy(),this.bullets.shift());var t=this.createBullet(Bullet);this.bullets.push(t)},destroy:function(){for(var t,e=0;t=this.bullets[e];e++)t.destroy();this.bullets=[]}}),Bullet=new Class({initialize:function(t,e){this.pos=t.cp(),this.dir=e,this.vel=new Vector(500,500),this.bornAt=now()},initCanvas:function(){this.sheet=new Sheet(new Rect(this.pos.x,this.pos.y,5,5)),this.sheet.drawBullet()},draw:function(){this.sheet.setPosition(this.pos)},update:function(t){this.pos.add(this.vel.setAngle(this.dir.angle()).mulNew(t)),this.checkBounds(),this.draw()},checkCollision:function(){var t=document.elementFromPoint(this.pos.x,this.pos.y);return t&&3==t.nodeType&&(t=t.parentNode),!(!t||!this.game.bulletManager.isDestroyableFromCollision(t))&&t},checkBounds:function(){var t=this.game.windowSize.width,e=this.game.windowSize.height,s=this.pos.x+this.sheet.rect.size.width/2,i=this.pos.y+this.sheet.rect.size.height/2;s>t?this.pos.x=0:this.pos.x<0&&(this.pos.x=t-this.sheet.rect.size.width/2),i>e?this.pos.y=0:this.pos.y<0&&(this.pos.y=e-this.sheet.rect.size.height/2)},destroy:function(){this.sheet.destroy()}}),LaserBullet=new Class({Extends:Bullet,initialize:function(){Bullet.prototype.initialize.apply(this,arguments),this.vel=new Vector(750,750),this.lastDrawPos=this.pos.cp()},initCanvas:function(){var t=Math.max(GameGlobals.laserImage.width,GameGlobals.laserImage.height);this.sheet=new Sheet(new Rect(0,0,t,t))},update:function(t){Bullet.prototype.update.apply(this,arguments)},draw:function(){this.sheet.drawLaser(this.pos,this.dir),this.lastDrawPos=this.pos.cp()},checkBounds:function(){var t=this.game.windowSize.width,e=this.game.windowSize.height,s=this.pos.x+this.sheet.rect.size.width/2,i=this.pos.y+this.sheet.rect.size.height/2;(s>t||this.pos.x<0)&&(this.outOfBounds=!0),(i>e||this.pos.y<0)&&(this.outOfBounds=!0)},destroy:function(){this.sheet.destroy()}});GameGlobals.laserImage=document.createElement("img"),GameGlobals.laserImage.src=GameGlobals.path("css/gfx/kickass/laser.png");var Explosion=new Class({initialize:function(t,e){this.bornAt=now(),this.pos=t.cp()},update:function(t){},checkBounds:function(){},destroy:function(){}}),ParticleExplosion=new Class({Extends:Explosion,initialize:function(t,e){Explosion.prototype.initialize.apply(this,arguments),this.particleVel=new Vector(150,0),this.particles=[],this.generateParticles(),this.sheet=new Sheet(new Rect(t.x,t.y,250,250))},update:function(t){for(var e,s=0;e=this.particles[s];s++)e.pos.add(e.vel.mulNew(t).mul(random(.5,1)).setAngle(e.dir.angle()));this.sheet.clear(),this.sheet.drawExplosion(this.particles)},generateParticles:function(){for(var t=0,e=GameGlobals.hasCanvas?40:10;t<e;t++)this.particles.push({dir:new Vector(random(0,20)-10,random(0,20)-10).normalize(),vel:this.particleVel.cp(),pos:new Vector(0,0),color:["yellow","red"][random(0,1)]})},checkBounds:function(){var t=this.sheet.rect.getRight(),e=this.sheet.rect.getBottom(),s=this.game.windowSize.width,i=this.game.windowSize.height;t>s&&(this.pos.x-=t-s),e>i&&(this.pos.y-=e-i),this.sheet.setPosition(this.pos)},destroy:function(){this.sheet.destroy()}}),MegaParticleExplosion=new Class({Extends:ParticleExplosion,initialize:function(t,e){Explosion.prototype.initialize.apply(this,arguments),this.particleVel=new Vector(200,0),this.particles=[],this.generateParticles(),this.sheet=new Sheet(new Rect(t.x,t.y,500,500)),this.ttl=2e3,this.generationDelay=.6,this.generationTimes=2,this.nextGenerate=this.generationDelay},update:function(t){this.nextGenerate-=t,this.nextGenerate<=0&&this.generationTimes>0&&(this.nextGenerate=this.generationDelay,this.generateParticles(),this.generationTimes--),ParticleExplosion.prototype.update.call(this,t)}}),SplitExplosion=new Class({Extends:Explosion,initialize:function(t,e){e&&(Explosion.prototype.initialize.apply(this,arguments),this.element=e,this.fx=new Fx,this.fx.addListener(this),this.start())},update:function(t){this.element&&this.fx.update()},set:function(t,e){},start:function(){var t=this.createClones(),e=t[0],s=t[1],i="rotate(-"+random(30,50)+"deg) translate(-100px, 40px)",n="rotate("+random(30,50)+"deg) translate(100px, 40px)";setStyles(e,{transform:i}),setStyles(s,{transform:n}),this.left=e,this.right=s,this.fx.add("opacity",{start:1,end:.5,duration:500})},createClones:function(){var t=getRect(this.element),e=this.createContainer(t),s=this.createContainer(t),i=cloneElement(this.element),n=cloneElement(this.element);addClass(i,"KICKASSELEMENT"),addClass(n,"KICKASSELEMENT");var a={margin:0,overflow:"hidden"};return setStyles(i,a),setStyles(n,a),e.appendChild(i),s.appendChild(n),s.style.left=t.left+t.width/2+"px",s.scrollLeft+=t.width/2,this.element.style.opacity=0,this.element.style.visibility="hidden",this.element.style.display="none",each([e,s],(function(t){t.style.transition="transform 500ms ease-in"}))},createContainer:function(t){var e=document.createElement("div");return setStyles(e,{position:"absolute",left:t.left,top:t.top,width:.5*t.width,height:t.height,overflow:"hidden"}),getAppContainerElement().appendChild(e),e},destroy:function(){try{this.left.parentNode.removeChild(this.left),this.right.parentNode.removeChild(this.right),this.element.parentNode.removeChild(this.element)}catch(t){}}}),Weapons={1:{name:"Cannon",id:"cannon",cannonClass:BallCannon},2:{name:"Laser",id:"laser",cannonClass:LaserCannon}},WeaponMap={cannon:Weapons[1],laser:Weapons[2]},SheetCanvas=new Class({initialize:function(rect){with(this.canvas=document.createElement("canvas"),this.canvas.className="KICKASSELEMENT",this.canvas.style)position="absolute",zIndex="1000000";GameGlobals.kickass.registerElement(this.canvas),this.canvas.getContext&&(this.ctx=this.canvas.getContext("2d")),this.rect=rect,this.angle=0,this.updateCanvas(),getAppContainerElement().appendChild(this.canvas)},tracePoly:function(t){if(t[0]){this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),this.ctx.rotate(this.angle),this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y);for(var e=0;e<t.length;e++)this.ctx.lineTo(t[e].x,t[e].y);this.ctx.restore()}},setAngle:function(t){this.angle=t},updateCanvas:function(){this.canvas.width!=this.rect.size.width&&(this.canvas.width=this.rect.size.width),this.canvas.height!=this.rect.size.height&&(this.canvas.height=this.rect.size.height),this.canvas.style.left=GameGlobals.kickass.scrollPos.x+(this.rect.pos.x-this.rect.size.width/2)+"px",this.canvas.style.top=GameGlobals.kickass.scrollPos.y+(this.rect.pos.y-this.rect.size.height/2)+"px"},drawLine:function(t,e,s,i){this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),this.ctx.beginPath(),this.ctx.moveTo(t,e),this.ctx.lineTo(s,i),this.ctx.closePath(),this.ctx.stroke(),this.ctx.restore()},drawCircle:function(t,e){e=e||{x:0,y:0},this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),e&&this.ctx.translate(e.x,e.y),this.ctx.beginPath(),this.ctx.arc(0,0,t,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.closePath(),this.ctx.restore()},drawRect:function(t,e,s,i){this.ctx.save(),this.ctx.translate(this.rect.size.width/2,this.rect.size.height/2),this.ctx.translate(t,e),this.ctx.fillRect(t,e,s,i),this.ctx.restore(),this.ctx.fill()},drawImageFull:function(t){this.ctx.drawImage(t,0,0,this.rect.size.width,this.rect.size.height)},drawImage:function(t,e,s){this.ctx.save(),this.ctx.translate(this.rect.size.width/2+e,this.rect.size.height/2+s),this.ctx.rotate(this.angle),this.ctx.drawImage(t,0,-11),this.ctx.restore()},setFillColor:function(t){this.ctx.fillStyle=t},setStrokeColor:function(t){this.ctx.strokeStyle=t},setLineWidth:function(t){this.ctx.lineWidth=t},fillPath:function(){this.ctx.fill()},strokePath:function(){this.ctx.stroke()},clear:function(){this.ctx.clearRect(0,0,this.rect.size.width,this.rect.size.height)},destroy:function(){GameGlobals.kickass.unregisterElement(this.canvas),this.canvas.parentNode.removeChild(this.canvas)}}),Sheet=new Class({initialize:function(t){this.rect=t,this.drawer=new SheetCanvas(t)},clear:function(){this.drawer.clear()},setPosition:function(t){this.rect.pos=t.cp(),this.drawer.rect=this.rect,this.drawer.updateCanvas()},setAngle:function(t){this.drawer.setAngle(t)},drawPlayer:function(t){this.drawer.setFillColor("white"),this.drawer.setStrokeColor("black"),this.drawer.setLineWidth(1.5),this.drawer.tracePoly(t),this.drawer.fillPath(),this.drawer.tracePoly(t),this.drawer.strokePath()},drawBrokenPlayer:function(t,e){this.drawer.setStrokeColor("black"),this.drawer.setLineWidth(1.5);for(var s,i=1,n=t[0];s=t[i];i++,n=s){var a=e[i-1];this.drawer.drawLine(n.x+a.pos.x,n.x+a.pos.y,s.x+a.pos.x,s.y+a.pos.y)}},drawFlames:function(t,e){this.drawer.setLineWidth(1.5),this.drawer.setFillColor("red"),this.drawer.tracePoly(t.r),this.drawer.fillPath(),this.drawer.setFillColor("yellow"),this.drawer.tracePoly(t.y),this.drawer.fillPath()},drawBullet:function(){this.drawer.setFillColor(GameGlobals.bulletColor),this.drawer.drawCircle(2.5)},drawExplosion:function(t){for(var e,s=0;e=t[s];s++)this.drawer.setFillColor(e.color),this.drawer.drawRect(e.pos.x,e.pos.y,3,3)},drawFace:function(t){this.drawer.drawImageFull(t)},drawLaser:function(t,e){this.clear(),this.setPosition(t),this.drawer.setAngle(e.angle()),this.drawer.drawImage(GameGlobals.laserImage,0,0)},transformToSheetCoordinates:function(t){return t.cp().sub(new Vector(this.rect.size.width/2,this.rect.size.height/2))},destroy:function(){this.drawer.destroy()}}),namespace=getGlobalNamespace(),initKickAss=function(){if(namespace.KICKASSGAME)namespace.KICKASSGAME.addPlayer();else if(namespace.KICKASS_SITE_KEY){var t=new MySite(namespace.KICKASS_SITE_KEY);t.load((function(e){namespace.KICKASSGAME=GameGlobals.kickass=new KickAss({mySite:!!e&&t}),namespace.KICKASSGAME.begin()}))}else namespace.KICKASSGAME=GameGlobals.kickass=new KickAss,namespace.KICKASSGAME.begin()};function getAppContainerElement(){return namespace.KICKASS_CONTAINER_ELEMENT?document.getElementById(namespace.KICKASS_CONTAINER_ELEMENT):document.body}namespace.LAZYLOAD_KICKASS?window.startBrowserBlaster=initKickAss:initKickAss()})("undefined"!=typeof exports?exports:window);
|
package/js/search/algolia.js
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
//# sourceMappingURL=../../maps/js/search/algolia.js.map
|
1
|
+
window.addEventListener("load",(()=>{const e=()=>{const e=document.body.style;e.width="100%",e.overflow="hidden",btf.animateIn(document.getElementById("search-mask"),"to_show 0.5s"),btf.animateIn(document.querySelector("#algolia-search .search-dialog"),"titleScale 0.5s"),setTimeout((()=>{document.querySelector("#algolia-search .ais-SearchBox-input").focus()}),100),document.addEventListener("keydown",(function e(a){"Escape"===a.code&&(t(),document.removeEventListener("keydown",e))}))},t=()=>{const e=document.body.style;e.width="",e.overflow="",btf.animateOut(document.querySelector("#algolia-search .search-dialog"),"search_close .5s"),btf.animateOut(document.getElementById("search-mask"),"to_hide 0.5s")},a=()=>{document.querySelector("#search-button > .search").addEventListener("click",e)},n=e=>{if(""===e)return"";const t=e.indexOf("<mark>");let a=t-30,n=t+120,i="",s="";a<=0?(a=0,n=140):i="...",n>e.length?n=e.length:s="...";return i+e.substring(a,n)+s},i=GLOBAL_CONFIG.algolia;if(!(i.appId&&i.apiKey&&i.indexName))return console.error("Algolia setting is invalid!");const s=instantsearch({indexName:i.indexName,searchClient:algoliasearch(i.appId,i.apiKey),searchFunction(e){e.state.query&&e.search()}}),o=instantsearch.widgets.configure({hitsPerPage:5}),l=instantsearch.widgets.searchBox({container:"#algolia-search-input",showReset:!1,showSubmit:!1,placeholder:GLOBAL_CONFIG.algolia.languages.input_placeholder,showLoadingIndicator:!0}),r=instantsearch.widgets.hits({container:"#algolia-hits",templates:{item(e){const t=e.permalink?e.permalink:GLOBAL_CONFIG.root+e.path,a=e._highlightResult,i=a.contentStripTruncate?n(a.contentStripTruncate.value):a.contentStrip?n(a.contentStrip.value):a.content?n(a.content.value):"";return`\n <a href="${t}" class="algolia-hit-item-link">\n ${a.title.value||"no-title"}\n </a>\n <p class="algolia-hit-item-content">${i}</p>`},empty:function(e){return'<div id="algolia-hits-empty">'+GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/,e.query)+"</div>"}}}),c=instantsearch.widgets.stats({container:"#algolia-info > .algolia-stats",templates:{text:function(e){return`<hr>${GLOBAL_CONFIG.algolia.languages.hits_stats.replace(/\$\{hits}/,e.nbHits).replace(/\$\{time}/,e.processingTimeMS)}`}}}),d=instantsearch.widgets.poweredBy({container:"#algolia-info > .algolia-poweredBy"}),g=instantsearch.widgets.pagination({container:"#algolia-pagination",totalPages:5,templates:{first:'<i class="fas fa-angle-double-left"></i>',last:'<i class="fas fa-angle-double-right"></i>',previous:'<i class="fas fa-angle-left"></i>',next:'<i class="fas fa-angle-right"></i>'}});s.addWidgets([o,l,r,c,d,g]),s.start(),a(),document.getElementById("search-mask").addEventListener("click",t),document.querySelector("#algolia-search .search-close-button").addEventListener("click",t),window.addEventListener("pjax:complete",(()=>{"block"===getComputedStyle(document.querySelector("#algolia-search .search-dialog")).display&&t(),a()})),window.pjax&&s.on("render",(()=>{window.pjax.refresh(document.getElementById("algolia-hits"))}))}));
|
@@ -0,0 +1 @@
|
|
1
|
+
window.addEventListener("load",(()=>{let e=!1,t=[];const n=document.getElementById("search-mask"),a=()=>{const t=document.body.style;t.width="100%",t.overflow="hidden",btf.animateIn(n,"to_show 0.5s"),btf.animateIn(document.querySelector("#local-search .search-dialog"),"titleScale 0.5s"),setTimeout((()=>{document.querySelector("#local-search-input input").focus()}),100),e||(o(),e=!0),document.addEventListener("keydown",(function e(t){"Escape"===t.code&&(l(),document.removeEventListener("keydown",e))}))},l=()=>{const e=document.body.style;e.width="",e.overflow="",btf.animateOut(document.querySelector("#local-search .search-dialog"),"search_close .5s"),btf.animateOut(n,"to_hide 0.5s")},r=()=>{document.querySelector("#search-button > .search").addEventListener("click",a)},c=async e=>{let t=[];const n=await fetch(e);if(/\.json$/.test(e))t=await n.json();else{const e=await n.text(),a=await(new window.DOMParser).parseFromString(e,"text/xml");t=[...(await a).querySelectorAll("entry")].map((e=>({title:e.querySelector("title").textContent,content:e.querySelector("content")&&e.querySelector("content").textContent,url:e.querySelector("url").textContent})))}if(n.ok){const e=document.getElementById("loading-database");e.nextElementSibling.style.display="block",e.remove()}return t},o=()=>{GLOBAL_CONFIG.localSearch.preload||(t=c(GLOBAL_CONFIG.localSearch.path));const e=document.querySelector("#local-search-input input"),n=document.getElementById("local-search-results"),a=document.getElementById("loading-status");e.addEventListener("input",(function(){const e=this.value.trim().toLowerCase().split(/[\s]+/);if(""===e[0])return void(n.innerHTML="");a.innerHTML='<i class="fas fa-spinner fa-pulse"></i>';let l='<div class="search-result-list">';if(e.length<=0)return;let r=0;t.then((t=>{t.forEach((t=>{let n=!0,a=t.title?t.title.trim().toLowerCase():"";const c=t.content?t.content.trim().replace(/<[^>]+>/g,"").toLowerCase():"",o=t.url.startsWith("/")?t.url:GLOBAL_CONFIG.root+t.url;let s=-1,i=-1,d=-1;if(""!==a||""!==c?e.forEach(((e,t)=>{s=a.indexOf(e),i=c.indexOf(e),s<0&&i<0?n=!1:(i<0&&(i=0),0===t&&(d=i))})):n=!1,n){if(d>=0){let t=d-30,n=d+100,s="",i="";t<0&&(t=0),0===t?n=100:s="...",n>c.length?n=c.length:i="...";let u=c.substring(t,n);e.forEach((e=>{u=u.replaceAll(e,'<span class="search-keyword">'+e+"</span>"),a=a.replaceAll(e,'<span class="search-keyword">'+e+"</span>")})),l+='<div class="local-search__hit-item"><a href="'+o+'"><span class="search-result-title">'+a+"</span>",r+=1,""!==c&&(l+='<p class="search-result">'+s+u+i+"</p>")}l+="</a></div>"}})),0===r&&(l+='<div id="local-search__hits-empty">'+GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/,this.value.trim())+"</div>"),l+="</div>",n.innerHTML=l,""!==e[0]&&(a.innerHTML=""),window.pjax&&window.pjax.refresh(n)}))}))};r(),document.querySelector("#local-search .search-close-button").addEventListener("click",l),n.addEventListener("click",l),GLOBAL_CONFIG.localSearch.preload&&(t=c(GLOBAL_CONFIG.localSearch.path)),window.addEventListener("pjax:complete",(()=>{!btf.isHidden(n)&&l(),r()}))}));
|
package/js/tw_cn.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
document.addEventListener("DOMContentLoaded",(function(){const t=GLOBAL_CONFIG.translate,e=GLOBAL_CONFIG.Snackbar,n=t.defaultEncoding,a=t.translateDelay,l=t.msgToTraditionalChinese,c=t.msgToSimplifiedChinese;let o=n;const d="translate-chn-cht";let r,i=void 0===saveToLocal.get(d)?n:Number(saveToLocal.get("translate-chn-cht"));const h=void 0!==GLOBAL_CONFIG.Snackbar;function s(t){return""===t||null==t?"":1===o&&2===i?function(t){let e="";const n="万与丑专业丛东丝丢两严丧个丬丰临为丽举么义乌乐乔习乡书买乱争于亏云亘亚产亩亲亵亸亿仅从仑仓仪们价众优伙会伛伞伟传伤伥伦伧伪伫体余佣佥侠侣侥侦侧侨侩侪侬俣俦俨俩俪俭债倾偬偻偾偿傥傧储傩儿兑兖党兰关兴兹养兽冁内冈册写军农冢冯冲决况冻净凄凉凌减凑凛几凤凫凭凯击凼凿刍划刘则刚创删别刬刭刽刿剀剂剐剑剥剧劝办务劢动励劲劳势勋勐勚匀匦匮区医华协单卖卢卤卧卫却卺厂厅历厉压厌厍厕厢厣厦厨厩厮县参叆叇双发变叙叠叶号叹叽吁后吓吕吗吣吨听启吴呒呓呕呖呗员呙呛呜咏咔咙咛咝咤咴咸哌响哑哒哓哔哕哗哙哜哝哟唛唝唠唡唢唣唤唿啧啬啭啮啰啴啸喷喽喾嗫呵嗳嘘嘤嘱噜噼嚣嚯团园囱围囵国图圆圣圹场坂坏块坚坛坜坝坞坟坠垄垅垆垒垦垧垩垫垭垯垱垲垴埘埙埚埝埯堑堕塆墙壮声壳壶壸处备复够头夸夹夺奁奂奋奖奥妆妇妈妩妪妫姗姜娄娅娆娇娈娱娲娴婳婴婵婶媪嫒嫔嫱嬷孙学孪宁宝实宠审宪宫宽宾寝对寻导寿将尔尘尧尴尸尽层屃屉届属屡屦屿岁岂岖岗岘岙岚岛岭岳岽岿峃峄峡峣峤峥峦崂崃崄崭嵘嵚嵛嵝嵴巅巩巯币帅师帏帐帘帜带帧帮帱帻帼幂幞干并广庄庆庐庑库应庙庞废庼廪开异弃张弥弪弯弹强归当录彟彦彻径徕御忆忏忧忾怀态怂怃怄怅怆怜总怼怿恋恳恶恸恹恺恻恼恽悦悫悬悭悯惊惧惨惩惫惬惭惮惯愍愠愤愦愿慑慭憷懑懒懔戆戋戏戗战戬户扎扑扦执扩扪扫扬扰抚抛抟抠抡抢护报担拟拢拣拥拦拧拨择挂挚挛挜挝挞挟挠挡挢挣挤挥挦捞损捡换捣据捻掳掴掷掸掺掼揸揽揿搀搁搂搅携摄摅摆摇摈摊撄撑撵撷撸撺擞攒敌敛数斋斓斗斩断无旧时旷旸昙昼昽显晋晒晓晔晕晖暂暧札术朴机杀杂权条来杨杩杰极构枞枢枣枥枧枨枪枫枭柜柠柽栀栅标栈栉栊栋栌栎栏树栖样栾桊桠桡桢档桤桥桦桧桨桩梦梼梾检棂椁椟椠椤椭楼榄榇榈榉槚槛槟槠横樯樱橥橱橹橼檐檩欢欤欧歼殁殇残殒殓殚殡殴毁毂毕毙毡毵氇气氢氩氲汇汉污汤汹沓沟没沣沤沥沦沧沨沩沪沵泞泪泶泷泸泺泻泼泽泾洁洒洼浃浅浆浇浈浉浊测浍济浏浐浑浒浓浔浕涂涌涛涝涞涟涠涡涢涣涤润涧涨涩淀渊渌渍渎渐渑渔渖渗温游湾湿溃溅溆溇滗滚滞滟滠满滢滤滥滦滨滩滪漤潆潇潋潍潜潴澜濑濒灏灭灯灵灾灿炀炉炖炜炝点炼炽烁烂烃烛烟烦烧烨烩烫烬热焕焖焘煅煳熘爱爷牍牦牵牺犊犟状犷犸犹狈狍狝狞独狭狮狯狰狱狲猃猎猕猡猪猫猬献獭玑玙玚玛玮环现玱玺珉珏珐珑珰珲琎琏琐琼瑶瑷璇璎瓒瓮瓯电画畅畲畴疖疗疟疠疡疬疮疯疱疴痈痉痒痖痨痪痫痴瘅瘆瘗瘘瘪瘫瘾瘿癞癣癫癯皑皱皲盏盐监盖盗盘眍眦眬着睁睐睑瞒瞩矫矶矾矿砀码砖砗砚砜砺砻砾础硁硅硕硖硗硙硚确硷碍碛碜碱碹磙礼祎祢祯祷祸禀禄禅离秃秆种积称秽秾稆税稣稳穑穷窃窍窑窜窝窥窦窭竖竞笃笋笔笕笺笼笾筑筚筛筜筝筹签简箓箦箧箨箩箪箫篑篓篮篱簖籁籴类籼粜粝粤粪粮糁糇紧絷纟纠纡红纣纤纥约级纨纩纪纫纬纭纮纯纰纱纲纳纴纵纶纷纸纹纺纻纼纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绖绗绘给绚绛络绝绞统绠绡绢绣绤绥绦继绨绩绪绫绬续绮绯绰绱绲绳维绵绶绷绸绹绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缊缋缌缍缎缏缐缑缒缓缔缕编缗缘缙缚缛缜缝缞缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵罂网罗罚罢罴羁羟羡翘翙翚耢耧耸耻聂聋职聍联聩聪肃肠肤肷肾肿胀胁胆胜胧胨胪胫胶脉脍脏脐脑脓脔脚脱脶脸腊腌腘腭腻腼腽腾膑臜舆舣舰舱舻艰艳艹艺节芈芗芜芦苁苇苈苋苌苍苎苏苘苹茎茏茑茔茕茧荆荐荙荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭荮药莅莜莱莲莳莴莶获莸莹莺莼萚萝萤营萦萧萨葱蒇蒉蒋蒌蓝蓟蓠蓣蓥蓦蔷蔹蔺蔼蕲蕴薮藁藓虏虑虚虫虬虮虽虾虿蚀蚁蚂蚕蚝蚬蛊蛎蛏蛮蛰蛱蛲蛳蛴蜕蜗蜡蝇蝈蝉蝎蝼蝾螀螨蟏衅衔补衬衮袄袅袆袜袭袯装裆裈裢裣裤裥褛褴襁襕见观觃规觅视觇览觉觊觋觌觍觎觏觐觑觞触觯詟誉誊讠计订讣认讥讦讧讨让讪讫训议讯记讱讲讳讴讵讶讷许讹论讻讼讽设访诀证诂诃评诅识诇诈诉诊诋诌词诎诏诐译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诪诫诬语诮误诰诱诲诳说诵诶请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谘谙谚谛谜谝谞谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豮贝贞负贠贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赑赒赓赔赕赖赗赘赙赚赛赜赝赞赟赠赡赢赣赪赵赶趋趱趸跃跄跖跞践跶跷跸跹跻踊踌踪踬踯蹑蹒蹰蹿躏躜躯车轧轨轩轪轫转轭轮软轰轱轲轳轴轵轶轷轸轹轺轻轼载轾轿辀辁辂较辄辅辆辇辈辉辊辋辌辍辎辏辐辑辒输辔辕辖辗辘辙辚辞辩辫边辽达迁过迈运还这进远违连迟迩迳迹适选逊递逦逻遗遥邓邝邬邮邹邺邻郁郄郏郐郑郓郦郧郸酝酦酱酽酾酿释里鉅鉴銮錾钆钇针钉钊钋钌钍钎钏钐钑钒钓钔钕钖钗钘钙钚钛钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钶钷钸钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铍铎铏铐铑铒铕铗铘铙铚铛铜铝铞铟铠铡铢铣铤铥铦铧铨铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铻铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锍锎锏锐锑锒锓锔锕锖锗错锚锜锞锟锠锡锢锣锤锥锦锨锩锫锬锭键锯锰锱锲锳锴锵锶锷锸锹锺锻锼锽锾锿镀镁镂镃镆镇镈镉镊镌镍镎镏镐镑镒镕镖镗镙镚镛镜镝镞镟镠镡镢镣镤镥镦镧镨镩镪镫镬镭镮镯镰镱镲镳镴镶长门闩闪闫闬闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾闿阀阁阂阃阄阅阆阇阈阉阊阋阌阍阎阏阐阑阒阓阔阕阖阗阘阙阚阛队阳阴阵阶际陆陇陈陉陕陧陨险随隐隶隽难雏雠雳雾霁霉霭靓静靥鞑鞒鞯鞴韦韧韨韩韪韫韬韵页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颋颌颍颎颏颐频颒颓颔颕颖颗题颙颚颛颜额颞颟颠颡颢颣颤颥颦颧风飏飐飑飒飓飔飕飖飗飘飙飚飞飨餍饤饥饦饧饨饩饪饫饬饭饮饯饰饱饲饳饴饵饶饷饸饹饺饻饼饽饾饿馀馁馂馃馄馅馆馇馈馉馊馋馌馍馎馏馐馑馒馓馔馕马驭驮驯驰驱驲驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骃骄骅骆骇骈骉骊骋验骍骎骏骐骑骒骓骔骕骖骗骘骙骚骛骜骝骞骟骠骡骢骣骤骥骦骧髅髋髌鬓魇魉鱼鱽鱾鱿鲀鲁鲂鲄鲅鲆鲇鲈鲉鲊鲋鲌鲍鲎鲏鲐鲑鲒鲓鲔鲕鲖鲗鲘鲙鲚鲛鲜鲝鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲪鲫鲬鲭鲮鲯鲰鲱鲲鲳鲴鲵鲶鲷鲸鲹鲺鲻鲼鲽鲾鲿鳀鳁鳂鳃鳄鳅鳆鳇鳈鳉鳊鳋鳌鳍鳎鳏鳐鳑鳒鳓鳔鳕鳖鳗鳘鳙鳛鳜鳝鳞鳟鳠鳡鳢鳣鸟鸠鸡鸢鸣鸤鸥鸦鸧鸨鸩鸪鸫鸬鸭鸮鸯鸰鸱鸲鸳鸴鸵鸶鸷鸸鸹鸺鸻鸼鸽鸾鸿鹀鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹍鹎鹏鹐鹑鹒鹓鹔鹕鹖鹗鹘鹚鹛鹜鹝鹞鹟鹠鹡鹢鹣鹤鹥鹦鹧鹨鹩鹪鹫鹬鹭鹯鹰鹱鹲鹳鹴鹾麦麸黄黉黡黩黪黾",a="萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉曬曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇癡癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿镟滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裏钜鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽";for(let l=0;l<t.length;l++)t.charCodeAt(l)>1e4&&-1!==a.indexOf(t.charAt(l))?e+=n.charAt(a.indexOf(t.charAt(l))):e+=t.charAt(l);return e}(t):2===o&&1===i?function(t){let e="";const n="万与丑专业丛东丝丢两严丧个丬丰临为丽举么义乌乐乔习乡书买乱争于亏云亘亚产亩亲亵亸亿仅从仑仓仪们价众优伙会伛伞伟传伤伥伦伧伪伫体余佣佥侠侣侥侦侧侨侩侪侬俣俦俨俩俪俭债倾偬偻偾偿傥傧储傩儿兑兖党兰关兴兹养兽冁内冈册写军农冢冯冲决况冻净凄凉凌减凑凛几凤凫凭凯击凼凿刍划刘则刚创删别刬刭刽刿剀剂剐剑剥剧劝办务劢动励劲劳势勋勐勚匀匦匮区医华协单卖卢卤卧卫却卺厂厅历厉压厌厍厕厢厣厦厨厩厮县参叆叇双发变叙叠叶号叹叽吁后吓吕吗吣吨听启吴呒呓呕呖呗员呙呛呜咏咔咙咛咝咤咴咸哌响哑哒哓哔哕哗哙哜哝哟唛唝唠唡唢唣唤唿啧啬啭啮啰啴啸喷喽喾嗫呵嗳嘘嘤嘱噜噼嚣嚯团园囱围囵国图圆圣圹场坂坏块坚坛坜坝坞坟坠垄垅垆垒垦垧垩垫垭垯垱垲垴埘埙埚埝埯堑堕塆墙壮声壳壶壸处备复够头夸夹夺奁奂奋奖奥妆妇妈妩妪妫姗姜娄娅娆娇娈娱娲娴婳婴婵婶媪嫒嫔嫱嬷孙学孪宁宝实宠审宪宫宽宾寝对寻导寿将尔尘尧尴尸尽层屃屉届属屡屦屿岁岂岖岗岘岙岚岛岭岳岽岿峃峄峡峣峤峥峦崂崃崄崭嵘嵚嵛嵝嵴巅巩巯币帅师帏帐帘帜带帧帮帱帻帼幂幞干并广庄庆庐庑库应庙庞废庼廪开异弃张弥弪弯弹强归当录彟彦彻径徕御忆忏忧忾怀态怂怃怄怅怆怜总怼怿恋恳恶恸恹恺恻恼恽悦悫悬悭悯惊惧惨惩惫惬惭惮惯愍愠愤愦愿慑慭憷懑懒懔戆戋戏戗战戬户扎扑扦执扩扪扫扬扰抚抛抟抠抡抢护报担拟拢拣拥拦拧拨择挂挚挛挜挝挞挟挠挡挢挣挤挥挦捞损捡换捣据捻掳掴掷掸掺掼揸揽揿搀搁搂搅携摄摅摆摇摈摊撄撑撵撷撸撺擞攒敌敛数斋斓斗斩断无旧时旷旸昙昼昽显晋晒晓晔晕晖暂暧札术朴机杀杂权条来杨杩杰极构枞枢枣枥枧枨枪枫枭柜柠柽栀栅标栈栉栊栋栌栎栏树栖样栾桊桠桡桢档桤桥桦桧桨桩梦梼梾检棂椁椟椠椤椭楼榄榇榈榉槚槛槟槠横樯樱橥橱橹橼檐檩欢欤欧歼殁殇残殒殓殚殡殴毁毂毕毙毡毵氇气氢氩氲汇汉污汤汹沓沟没沣沤沥沦沧沨沩沪沵泞泪泶泷泸泺泻泼泽泾洁洒洼浃浅浆浇浈浉浊测浍济浏浐浑浒浓浔浕涂涌涛涝涞涟涠涡涢涣涤润涧涨涩淀渊渌渍渎渐渑渔渖渗温游湾湿溃溅溆溇滗滚滞滟滠满滢滤滥滦滨滩滪漤潆潇潋潍潜潴澜濑濒灏灭灯灵灾灿炀炉炖炜炝点炼炽烁烂烃烛烟烦烧烨烩烫烬热焕焖焘煅煳熘爱爷牍牦牵牺犊犟状犷犸犹狈狍狝狞独狭狮狯狰狱狲猃猎猕猡猪猫猬献獭玑玙玚玛玮环现玱玺珉珏珐珑珰珲琎琏琐琼瑶瑷璇璎瓒瓮瓯电画畅畲畴疖疗疟疠疡疬疮疯疱疴痈痉痒痖痨痪痫痴瘅瘆瘗瘘瘪瘫瘾瘿癞癣癫癯皑皱皲盏盐监盖盗盘眍眦眬着睁睐睑瞒瞩矫矶矾矿砀码砖砗砚砜砺砻砾础硁硅硕硖硗硙硚确硷碍碛碜碱碹磙礼祎祢祯祷祸禀禄禅离秃秆种积称秽秾稆税稣稳穑穷窃窍窑窜窝窥窦窭竖竞笃笋笔笕笺笼笾筑筚筛筜筝筹签简箓箦箧箨箩箪箫篑篓篮篱簖籁籴类籼粜粝粤粪粮糁糇紧絷纟纠纡红纣纤纥约级纨纩纪纫纬纭纮纯纰纱纲纳纴纵纶纷纸纹纺纻纼纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绖绗绘给绚绛络绝绞统绠绡绢绣绤绥绦继绨绩绪绫绬续绮绯绰绱绲绳维绵绶绷绸绹绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缊缋缌缍缎缏缐缑缒缓缔缕编缗缘缙缚缛缜缝缞缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵罂网罗罚罢罴羁羟羡翘翙翚耢耧耸耻聂聋职聍联聩聪肃肠肤肷肾肿胀胁胆胜胧胨胪胫胶脉脍脏脐脑脓脔脚脱脶脸腊腌腘腭腻腼腽腾膑臜舆舣舰舱舻艰艳艹艺节芈芗芜芦苁苇苈苋苌苍苎苏苘苹茎茏茑茔茕茧荆荐荙荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭荮药莅莜莱莲莳莴莶获莸莹莺莼萚萝萤营萦萧萨葱蒇蒉蒋蒌蓝蓟蓠蓣蓥蓦蔷蔹蔺蔼蕲蕴薮藁藓虏虑虚虫虬虮虽虾虿蚀蚁蚂蚕蚝蚬蛊蛎蛏蛮蛰蛱蛲蛳蛴蜕蜗蜡蝇蝈蝉蝎蝼蝾螀螨蟏衅衔补衬衮袄袅袆袜袭袯装裆裈裢裣裤裥褛褴襁襕见观觃规觅视觇览觉觊觋觌觍觎觏觐觑觞触觯詟誉誊讠计订讣认讥讦讧讨让讪讫训议讯记讱讲讳讴讵讶讷许讹论讻讼讽设访诀证诂诃评诅识诇诈诉诊诋诌词诎诏诐译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诪诫诬语诮误诰诱诲诳说诵诶请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谘谙谚谛谜谝谞谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豮贝贞负贠贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赑赒赓赔赕赖赗赘赙赚赛赜赝赞赟赠赡赢赣赪赵赶趋趱趸跃跄跖跞践跶跷跸跹跻踊踌踪踬踯蹑蹒蹰蹿躏躜躯车轧轨轩轪轫转轭轮软轰轱轲轳轴轵轶轷轸轹轺轻轼载轾轿辀辁辂较辄辅辆辇辈辉辊辋辌辍辎辏辐辑辒输辔辕辖辗辘辙辚辞辩辫边辽达迁过迈运还这进远违连迟迩迳迹适选逊递逦逻遗遥邓邝邬邮邹邺邻郁郄郏郐郑郓郦郧郸酝酦酱酽酾酿释里鉅鉴銮錾钆钇针钉钊钋钌钍钎钏钐钑钒钓钔钕钖钗钘钙钚钛钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钶钷钸钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铍铎铏铐铑铒铕铗铘铙铚铛铜铝铞铟铠铡铢铣铤铥铦铧铨铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铻铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锍锎锏锐锑锒锓锔锕锖锗错锚锜锞锟锠锡锢锣锤锥锦锨锩锫锬锭键锯锰锱锲锳锴锵锶锷锸锹锺锻锼锽锾锿镀镁镂镃镆镇镈镉镊镌镍镎镏镐镑镒镕镖镗镙镚镛镜镝镞镟镠镡镢镣镤镥镦镧镨镩镪镫镬镭镮镯镰镱镲镳镴镶长门闩闪闫闬闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾闿阀阁阂阃阄阅阆阇阈阉阊阋阌阍阎阏阐阑阒阓阔阕阖阗阘阙阚阛队阳阴阵阶际陆陇陈陉陕陧陨险随隐隶隽难雏雠雳雾霁霉霭靓静靥鞑鞒鞯鞴韦韧韨韩韪韫韬韵页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颋颌颍颎颏颐频颒颓颔颕颖颗题颙颚颛颜额颞颟颠颡颢颣颤颥颦颧风飏飐飑飒飓飔飕飖飗飘飙飚飞飨餍饤饥饦饧饨饩饪饫饬饭饮饯饰饱饲饳饴饵饶饷饸饹饺饻饼饽饾饿馀馁馂馃馄馅馆馇馈馉馊馋馌馍馎馏馐馑馒馓馔馕马驭驮驯驰驱驲驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骃骄骅骆骇骈骉骊骋验骍骎骏骐骑骒骓骔骕骖骗骘骙骚骛骜骝骞骟骠骡骢骣骤骥骦骧髅髋髌鬓魇魉鱼鱽鱾鱿鲀鲁鲂鲄鲅鲆鲇鲈鲉鲊鲋鲌鲍鲎鲏鲐鲑鲒鲓鲔鲕鲖鲗鲘鲙鲚鲛鲜鲝鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲪鲫鲬鲭鲮鲯鲰鲱鲲鲳鲴鲵鲶鲷鲸鲹鲺鲻鲼鲽鲾鲿鳀鳁鳂鳃鳄鳅鳆鳇鳈鳉鳊鳋鳌鳍鳎鳏鳐鳑鳒鳓鳔鳕鳖鳗鳘鳙鳛鳜鳝鳞鳟鳠鳡鳢鳣鸟鸠鸡鸢鸣鸤鸥鸦鸧鸨鸩鸪鸫鸬鸭鸮鸯鸰鸱鸲鸳鸴鸵鸶鸷鸸鸹鸺鸻鸼鸽鸾鸿鹀鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹍鹎鹏鹐鹑鹒鹓鹔鹕鹖鹗鹘鹚鹛鹜鹝鹞鹟鹠鹡鹢鹣鹤鹥鹦鹧鹨鹩鹪鹫鹬鹭鹯鹰鹱鹲鹳鹴鹾麦麸黄黉黡黩黪黾",a="萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉曬曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇癡癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿镟滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裏钜鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽";for(let l=0;l<t.length;l++)t.charCodeAt(l)>1e4&&-1!==n.indexOf(t.charAt(l))?e+=a.charAt(n.indexOf(t.charAt(l))):e+=t.charAt(l);return e}(t):t}function u(t){let e;e="object"==typeof t?t.childNodes:document.body.childNodes;for(let t=0;t<e.length;t++){const n=e.item(t);"||BR|HR|".indexOf("|"+n.tagName+"|")>0||n===r||(""!==n.title&&null!=n.title&&(n.title=s(n.title)),""!==n.alt&&null!=n.alt&&(n.alt=s(n.alt)),""!==n.placeholder&&null!=n.placeholder&&(n.placeholder=s(n.placeholder)),"INPUT"===n.tagName&&""!==n.value&&"text"!==n.type&&"hidden"!==n.type&&(n.value=s(n.value)),3===n.nodeType?n.data=s(n.data):u(n))}}function f(){1===i?(o=1,i=2,r.innerHTML=l,saveToLocal.set(d,i,2),u(),h&&btf.snackbarShow(e.cht_to_chs)):2===i&&(o=2,i=1,r.innerHTML=c,saveToLocal.set(d,i,2),u(),h&&btf.snackbarShow(e.chs_to_cht))}function L(){r=document.getElementById("translateLink"),r&&(o!==i&&(setTimeout(u,a),r.innerHTML=1===i?c:l),r.addEventListener("click",f,!1))}L(),document.addEventListener("pjax:complete",L)}));
|
package/js/txmap.js
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
function getDistance(e,a,s,c){const{sin:r,cos:t,asin:o,PI:i,hypot:n}=Math;let b=(e,a)=>(e*=i/180,{x:t(a*=i/180)*t(e),y:t(a)*r(e),z:r(a)}),k=b(e,a),p=b(s,c),l=2*o(n(k.x-p.x,k.y-p.y,k.z-p.z)/2)*6371;return Math.round(l)}function showWelcome(){let e,a,s,c=getDistance(114.21416,22.576264,ipLocation.result.location.lng,ipLocation.result.location.lat),r=ipLocation.result.ad_info.nation;switch(ipLocation.result.ad_info.nation){case"日本":a="よろしく,一起去看樱花吗";break;case"美国":a="Let us live in peace!";break;case"英国":a="想同你一起夜乘伦敦眼";break;case"俄罗斯":a="干了这瓶伏特加!";break;case"法国":a="C'est La Vie";break;case"德国":a="Die Zeit verging im Fluge.";break;case"澳大利亚":a="一起去大堡礁吧!";break;case"加拿大":a="拾起一片枫叶赠予你";break;case"中国":switch(r=ipLocation.result.ad_info.province+" "+ipLocation.result.ad_info.city+" "+ipLocation.result.ad_info.district,e=ipLocation.result.ip,ipLocation.result.ad_info.province){case"北京市":a="北——京——欢迎你~~~";break;case"天津市":a="讲段相声吧";break;case"河北省":a="山势巍巍成壁垒,天下雄关铁马金戈由此向,无限江山";break;case"山西省":a="展开坐具长三尺,已占山河五百余";break;case"内蒙古自治区":a="天苍苍,野茫茫,风吹草低见牛羊";break;case"辽宁省":a="我想吃烤鸡架!";break;case"吉林省":a="状元阁就是东北烧烤之王";break;case"黑龙江省":a="很喜欢哈尔滨大剧院";break;case"上海市":a="众所周知,中国只有两个城市";break;case"江苏省":switch(ipLocation.result.ad_info.city){case"南京市":a="这是我挺想去的城市啦";break;case"苏州市":a="上有天堂,下有苏杭";break;default:a="散装是必须要散装的"}break;case"浙江省":a="东风渐绿西湖柳,雁已还人未南归";break;case"河南省":switch(ipLocation.result.ad_info.city){case"郑州市":a="豫州之域,天地之中";break;case"南阳市":a="臣本布衣,躬耕于南阳此南阳非彼南阳!";break;case"驻马店市":a="峰峰有奇石,石石挟仙气嵖岈山的花很美哦!";break;case"开封市":a="刚正不阿包青天";break;case"洛阳市":a="洛阳牡丹甲天下";break;default:a="可否带我品尝河南烩面啦?"}break;case"安徽省":a="蚌埠住了,芜湖起飞";break;case"福建省":a="井邑白云间,岩城远带山";break;case"江西省":a="落霞与孤鹜齐飞,秋水共长天一色";break;case"山东省":a="遥望齐州九点烟,一泓海水杯中泻";break;case"湖北省":if("黄冈市"===ipLocation.result.ad_info.city)a="红安将军县!辈出将才!";else a="来碗热干面~";break;case"湖南省":a="74751,长沙斯塔克";break;case"广东省":switch(ipLocation.result.ad_info.city){case"广州市":a="看小蛮腰,喝早茶了嘛~";break;case"深圳市":a="今天你逛商场了嘛~";break;case"阳江市":a="阳春合水!博主家乡~ 欢迎来玩~";break;default:a="来两斤福建人~"}break;case"广西壮族自治区":a="桂林山水甲天下";break;case"海南省":a="朝观日出逐白浪,夕看云起收霞光";break;case"四川省":a="康康川妹子";break;case"贵州省":a="茅台,学生,再塞200";break;case"云南省":a="玉龙飞舞云缠绕,万仞冰川直耸天";break;case"西藏自治区":a="躺在茫茫草原上,仰望蓝天";break;case"陕西省":a="来份臊子面加馍";break;case"甘肃省":a="羌笛何须怨杨柳,春风不度玉门关";break;case"青海省":a="牛肉干和老酸奶都好好吃";break;case"宁夏回族自治区":a="大漠孤烟直,长河落日圆";break;case"新疆维吾尔自治区":a="驼铃古道丝绸路,胡马犹闻唐汉风";break;case"台湾省":a="我在这头,大陆在那头";break;case"香港特别行政区":a="永定贼有残留地鬼嚎,迎击光非岁玉";break;case"澳门特别行政区":a="性感荷官,在线发牌";break;default:a="带我去你的城市逛逛吧!"}break;default:a="带我去你的国家逛逛吧"}let t=new Date;s=t.getHours()>=5&&t.getHours()<11?"<span>🌤️ 早上好,一日之计在于晨</span>":t.getHours()>=11&&t.getHours()<13?"<span>☀️ 中午好,记得午休喔~</span>":t.getHours()>=13&&t.getHours()<17?"<span>🕞 下午好,饮茶先啦!</span>":t.getHours()>=17&&t.getHours()<19?"<span>🚶♂️ 即将下班,记得按时吃饭~</span>":t.getHours()>=19&&t.getHours()<24?"<span>🌙 晚上好,夜生活嗨起来!</span>":"夜深了,早点休息,少熬夜",e.includes(":")&&(e="<br>好复杂,咱看不懂~(ipv6)");try{document.getElementById("welcome-info").innerHTML=`欢迎来自 <b><span style="color: var(--kouseki-ip-color);font-size: var(--kouseki-gl-size)">${r}</span></b> 的小友💖<br>${a}🍂<br>当前位置距博主约 <b><span style="color: var(--kouseki-ip-color)">${c}</span></b> 公里!<br>您的IP地址为:<b><span>${e}</span></b><br>${s} <br>`}catch(e){console.log("Pjax无法获取元素")}}$.ajax({type:"get",url:"https://apis.map.qq.com/ws/location/v1/ip",data:{key:"RIPBZ-MLQ64-A6WUR-KL2YV-O4KY5-DZFTC",output:"jsonp"},dataType:"jsonp",success:function(e){ipLocation=e}}),window.onload=showWelcome,document.addEventListener("pjax:complete",showWelcome);
|
2
|
-
//# sourceMappingURL=../maps/js/txmap.js.map
|
1
|
+
function getDistance(e,a,s,c){const{sin:r,cos:t,asin:o,PI:i,hypot:n}=Math;let b=(e,a)=>(e*=i/180,{x:t(a*=i/180)*t(e),y:t(a)*r(e),z:r(a)}),k=b(e,a),p=b(s,c),l=2*o(n(k.x-p.x,k.y-p.y,k.z-p.z)/2)*6371;return Math.round(l)}function showWelcome(){let e,a,s,c=getDistance(114.21416,22.576264,ipLocation.result.location.lng,ipLocation.result.location.lat),r=ipLocation.result.ad_info.nation;switch(ipLocation.result.ad_info.nation){case"日本":a="よろしく,一起去看樱花吗";break;case"美国":a="Let us live in peace!";break;case"英国":a="想同你一起夜乘伦敦眼";break;case"俄罗斯":a="干了这瓶伏特加!";break;case"法国":a="C'est La Vie";break;case"德国":a="Die Zeit verging im Fluge.";break;case"澳大利亚":a="一起去大堡礁吧!";break;case"加拿大":a="拾起一片枫叶赠予你";break;case"中国":switch(r=ipLocation.result.ad_info.province+" "+ipLocation.result.ad_info.city+" "+ipLocation.result.ad_info.district,e=ipLocation.result.ip,ipLocation.result.ad_info.province){case"北京市":a="北——京——欢迎你~~~";break;case"天津市":a="讲段相声吧";break;case"河北省":a="山势巍巍成壁垒,天下雄关铁马金戈由此向,无限江山";break;case"山西省":a="展开坐具长三尺,已占山河五百余";break;case"内蒙古自治区":a="天苍苍,野茫茫,风吹草低见牛羊";break;case"辽宁省":a="我想吃烤鸡架!";break;case"吉林省":a="状元阁就是东北烧烤之王";break;case"黑龙江省":a="很喜欢哈尔滨大剧院";break;case"上海市":a="众所周知,中国只有两个城市";break;case"江苏省":switch(ipLocation.result.ad_info.city){case"南京市":a="这是我挺想去的城市啦";break;case"苏州市":a="上有天堂,下有苏杭";break;default:a="散装是必须要散装的"}break;case"浙江省":a="东风渐绿西湖柳,雁已还人未南归";break;case"河南省":switch(ipLocation.result.ad_info.city){case"郑州市":a="豫州之域,天地之中";break;case"南阳市":a="臣本布衣,躬耕于南阳此南阳非彼南阳!";break;case"驻马店市":a="峰峰有奇石,石石挟仙气嵖岈山的花很美哦!";break;case"开封市":a="刚正不阿包青天";break;case"洛阳市":a="洛阳牡丹甲天下";break;default:a="可否带我品尝河南烩面啦?"}break;case"安徽省":a="蚌埠住了,芜湖起飞";break;case"福建省":a="井邑白云间,岩城远带山";break;case"江西省":a="落霞与孤鹜齐飞,秋水共长天一色";break;case"山东省":a="遥望齐州九点烟,一泓海水杯中泻";break;case"湖北省":if("黄冈市"===ipLocation.result.ad_info.city)a="红安将军县!辈出将才!";else a="来碗热干面~";break;case"湖南省":a="74751,长沙斯塔克";break;case"广东省":switch(ipLocation.result.ad_info.city){case"广州市":a="看小蛮腰,喝早茶了嘛~";break;case"深圳市":a="今天你逛商场了嘛~";break;case"阳江市":a="阳春合水!博主家乡~ 欢迎来玩~";break;default:a="来两斤福建人~"}break;case"广西壮族自治区":a="桂林山水甲天下";break;case"海南省":a="朝观日出逐白浪,夕看云起收霞光";break;case"四川省":a="康康川妹子";break;case"贵州省":a="茅台,学生,再塞200";break;case"云南省":a="玉龙飞舞云缠绕,万仞冰川直耸天";break;case"西藏自治区":a="躺在茫茫草原上,仰望蓝天";break;case"陕西省":a="来份臊子面加馍";break;case"甘肃省":a="羌笛何须怨杨柳,春风不度玉门关";break;case"青海省":a="牛肉干和老酸奶都好好吃";break;case"宁夏回族自治区":a="大漠孤烟直,长河落日圆";break;case"新疆维吾尔自治区":a="驼铃古道丝绸路,胡马犹闻唐汉风";break;case"台湾省":a="我在这头,大陆在那头";break;case"香港特别行政区":a="永定贼有残留地鬼嚎,迎击光非岁玉";break;case"澳门特别行政区":a="性感荷官,在线发牌";break;default:a="带我去你的城市逛逛吧!"}break;default:a="带我去你的国家逛逛吧"}let t=new Date;s=t.getHours()>=5&&t.getHours()<11?"<span>🌤️ 早上好,一日之计在于晨</span>":t.getHours()>=11&&t.getHours()<13?"<span>☀️ 中午好,记得午休喔~</span>":t.getHours()>=13&&t.getHours()<17?"<span>🕞 下午好,饮茶先啦!</span>":t.getHours()>=17&&t.getHours()<19?"<span>🚶♂️ 即将下班,记得按时吃饭~</span>":t.getHours()>=19&&t.getHours()<24?"<span>🌙 晚上好,夜生活嗨起来!</span>":"夜深了,早点休息,少熬夜",e.includes(":")&&(e="<br>好复杂,咱看不懂~(ipv6)");try{document.getElementById("welcome-info").innerHTML=`欢迎来自 <b><span style="color: var(--kouseki-ip-color);font-size: var(--kouseki-gl-size)">${r}</span></b> 的小友💖<br>${a}🍂<br>当前位置距博主约 <b><span style="color: var(--kouseki-ip-color)">${c}</span></b> 公里!<br>您的IP地址为:<b><span>${e}</span></b><br>${s} <br>`}catch(e){console.log("Pjax无法获取元素")}}$.ajax({type:"get",url:"https://apis.map.qq.com/ws/location/v1/ip",data:{key:"RIPBZ-MLQ64-A6WUR-KL2YV-O4KY5-DZFTC",output:"jsonp"},dataType:"jsonp",success:function(e){ipLocation=e}}),window.onload=showWelcome,document.addEventListener("pjax:complete",showWelcome);
|
package/js/utils.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const btf={debounce:function(t,e,n){let o;return function(){const i=this,a=arguments,r=n&&!o;clearTimeout(o),o=setTimeout((function(){o=null,n||t.apply(i,a)}),e),r&&t.apply(i,a)}},throttle:function(t,e,n){let o,i,a,r=0;n||(n={});const s=function(){r=!1===n.leading?0:(new Date).getTime(),o=null,t.apply(i,a),o||(i=a=null)};return function(){const l=(new Date).getTime();r||!1!==n.leading||(r=l);const c=e-(l-r);i=this,a=arguments,c<=0||c>e?(o&&(clearTimeout(o),o=null),r=l,t.apply(i,a),o||(i=a=null)):o||!1===n.trailing||(o=setTimeout(s,c))}},sidebarPaddingR:()=>{const t=window.innerWidth,e=document.body.clientWidth,n=t-e;t!==e&&(document.body.style.paddingRight=n+"px")},snackbarShow:(t,e=!1,n=2e3)=>{const{position:o,bgLight:i,bgDark:a}=GLOBAL_CONFIG.Snackbar,r="light"===document.documentElement.getAttribute("data-theme")?i:a;Snackbar.show({text:t,backgroundColor:r,showAction:e,duration:n,pos:o,customClass:"snackbar-css"})},diffDate:(t,e=!1)=>{const n=new Date,o=new Date(t),i=n.getTime()-o.getTime(),a=36e5,r=24*a;let s;if(e){const t=i/(30*r),e=i/r,n=i/a,l=i/6e4;s=t>12?o.toLocaleDateString().replace(/\//g,"-"):t>=1?parseInt(t)+" "+GLOBAL_CONFIG.date_suffix.month:e>=1?parseInt(e)+" "+GLOBAL_CONFIG.date_suffix.day:n>=1?parseInt(n)+" "+GLOBAL_CONFIG.date_suffix.hour:l>=1?parseInt(l)+" "+GLOBAL_CONFIG.date_suffix.min:GLOBAL_CONFIG.date_suffix.just}else s=parseInt(i/r);return s},loadComment:(t,e)=>{if("IntersectionObserver"in window){const n=new IntersectionObserver((t=>{t[0].isIntersecting&&(e(),n.disconnect())}),{threshold:[0]});n.observe(t)}else e()},scrollToDest:(t,e=500)=>{const n=window.pageYOffset;if(n>t&&(t-=70),"scrollBehavior"in document.documentElement.style)return void window.scrollTo({top:t,behavior:"smooth"});let o=null;t=+t,window.requestAnimationFrame((function i(a){o=o||a;const r=a-o;n<t?window.scrollTo(0,(t-n)*r/e+n):window.scrollTo(0,n-(n-t)*r/e),r<e?window.requestAnimationFrame(i):window.scrollTo(0,t)}))},animateIn:(t,e)=>{t.style.display="block",t.style.animation=e},animateOut:(t,e)=>{t.addEventListener("animationend",(function e(){t.style.display="",t.style.animation="",t.removeEventListener("animationend",e)})),t.style.animation=e},getParents:(t,e)=>{for(;t&&t!==document;t=t.parentNode)if(t.matches(e))return t;return null},siblings:(t,e)=>[...t.parentNode.children].filter((n=>e?n!==t&&n.matches(e):n!==t)),wrap:(t,e,n)=>{const o=document.createElement(e);for(const[t,e]of Object.entries(n))o.setAttribute(t,e);t.parentNode.insertBefore(o,t),o.appendChild(t)},unwrap:t=>{const e=t.parentNode;e!==document.body&&(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e))},isHidden:t=>0===t.offsetHeight&&0===t.offsetWidth,getEleTop:t=>{let e=t.offsetTop,n=t.offsetParent;for(;null!==n;)e+=n.offsetTop,n=n.offsetParent;return e},loadLightbox:t=>{const e=GLOBAL_CONFIG.lightbox;if("mediumZoom"===e){const e=mediumZoom(t);e.on("open",(t=>{const n="dark"===document.documentElement.getAttribute("data-theme")?"#121212":"#fff";e.update({background:n})}))}"fancybox"===e&&(t.forEach((t=>{if("A"!==t.parentNode.tagName){const e=t.dataset.lazySrc||t.src,n=t.title||t.alt||"";btf.wrap(t,"a",{href:e,"data-fancybox":"gallery","data-caption":n,"data-thumb":e})}})),window.fancyboxRun||(Fancybox.bind("[data-fancybox]",{Hash:!1,Thumbs:{autoStart:!1}}),window.fancyboxRun=!0))},initJustifiedGallery:function(t){t.forEach((function(t){btf.isHidden(t)||fjGallery(t,{itemSelector:".fj-gallery-item",rowHeight:220,gutter:4,onJustify:function(){this.$container.style.opacity="1"}})}))},updateAnchor:t=>{if(t!==window.location.hash){t||(t=location.pathname);const e=GLOBAL_CONFIG_SITE.title;window.history.replaceState({url:location.href,title:e},e,t)}}};
|
package/lib/hbe.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{"use strict";const e=window.crypto||window.msCrypto,t=window.localStorage,n="hexo-blog-encrypt:#"+window.location.pathname,r=y("hexo-blog-encrypt的作者们都是大帅比!"),o=y("hexo-blog-encrypt是地表最强Hexo加密插件!"),a=document.getElementById("hexo-blog-encrypt"),i=a.dataset.wpm,c=a.dataset.whm,s=a.getElementsByTagName("script").hbeData,l=s.innerText,d=s.dataset.hmacdigest;function u(e){return new Uint8Array(e.match(/[\da-f]{2}/gi).map((e=>parseInt(e,16))))}function y(e){for(var t=e.length,n=0,r=new Array,o=0;o<t;){var a=e.codePointAt(o);a<128?(r[n++]=a,o++):a>127&&a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128,o++):a>2047&&a<65536?(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128,o++):(r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128,o+=2)}return new Uint8Array(r)}function h(e){if("object"!=typeof e||null===e||"number"!=typeof e.byteLength)throw new TypeError("Expected input to be an ArrayBuffer");for(var t,n=new Uint8Array(e),r="",o=0;o<n.length;o++)r+=1===(t=n[o].toString(16)).length?"0"+t:t;return r}async function m(e){let t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("script").forEach((async e=>{e.replaceWith(await async function(e){let t=document.createElement("script");return["type","text","src","crossorigin","defer","referrerpolicy"].forEach((n=>{e[n]&&(t[n]=e[n])})),t}(e))})),t}async function f(t,r,o){let a=u(l);return await e.subtle.decrypt({name:"AES-CBC",iv:r},t,a.buffer).then((async t=>{const r=(new TextDecoder).decode(t);if(!r.startsWith("<hbe-prefix></hbe-prefix>"))throw"Decode successfully but not start with KnownPrefix.";const a=document.createElement("button");a.textContent="Encrypt again",a.type="button",a.classList.add("hbe-button"),a.addEventListener("click",(()=>{window.localStorage.removeItem(n),window.location.reload()})),document.getElementById("hexo-blog-encrypt").style.display="inline",document.getElementById("hexo-blog-encrypt").innerHTML="",document.getElementById("hexo-blog-encrypt").appendChild(await m(r)),document.getElementById("hexo-blog-encrypt").appendChild(a),document.querySelectorAll("img").forEach((e=>{e.getAttribute("data-src")&&!e.src&&(e.src=e.getAttribute("data-src"))})),window.NexT&&NexT.boot&&"function"==typeof NexT.boot.refresh&&NexT.boot.refresh();var i=document.getElementById("toc-div");i&&(i.style.display="inline");var s=document.getElementsByClassName("toc-div-class");if(s&&s.length>0)for(var l=0;l<s.length;l++)s[l].style.display="inline";var y=new Event("hexo-blog-decrypt");return window.dispatchEvent(y),await async function(t,n){const r=(new TextEncoder).encode(n);let o=u(d);const a=await e.subtle.verify({name:"HMAC",hash:"SHA-256"},t,o,r);return console.log(`Verification result: ${a}`),a||(alert(c),console.log(`${c}, got `,o," but proved wrong.")),a}(o,r)})).catch((e=>(alert(i),console.log(e),!1)))}!function(){const i=JSON.parse(t.getItem(n));if(i){console.log(`Password got from localStorage(${n}): `,i);const r=u(i.iv).buffer,o=i.dk,a=i.hmk;e.subtle.importKey("jwk",o,{name:"AES-CBC",length:256},!0,["decrypt"]).then((o=>{e.subtle.importKey("jwk",a,{name:"HMAC",hash:"SHA-256",length:256},!0,["verify"]).then((e=>{f(o,r,e).then((e=>{e||t.removeItem(n)}))}))}))}a.addEventListener("keydown",(async a=>{if(a.isComposing||13===a.keyCode){const a=document.getElementById("hbePass").value,i=await function(t){let n=new TextEncoder;return e.subtle.importKey("raw",n.encode(t),{name:"PBKDF2"},!1,["deriveKey","deriveBits"])}(a),c=await function(t){return e.subtle.deriveKey({name:"PBKDF2",hash:"SHA-256",salt:r.buffer,iterations:1024},t,{name:"HMAC",hash:"SHA-256",length:256},!0,["verify"])}(i),s=await function(t){return e.subtle.deriveKey({name:"PBKDF2",hash:"SHA-256",salt:r.buffer,iterations:1024},t,{name:"AES-CBC",length:256},!0,["decrypt"])}(i),l=await function(t){return e.subtle.deriveBits({name:"PBKDF2",hash:"SHA-256",salt:o.buffer,iterations:512},t,128)}(i);f(s,l,c).then((r=>{console.log(`Decrypt result: ${r}`),r&&e.subtle.exportKey("jwk",s).then((r=>{e.subtle.exportKey("jwk",c).then((e=>{const o={dk:r,iv:h(l),hmk:e};t.setItem(n,JSON.stringify(o))}))}))}))}}))}()})();
|