/*! * bowser@2.11.0 (MIT) * author: Dustin Diaz (http://dustindiaz.com) * url: git+https://github.com/lancedikson/bowser.git * contributors: * Denis Demchenko (http://twitter.com/lancedikson) * * Copyright 2015, Dustin Diaz (the "Original Author") * All rights reserved. * * MIT License * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * Distributions of all or part of the Software intended to be used * by the recipients as they would use the unmodified Software, * containing modifications that substantially alter, remove, or * disable functionality of the Software, outside of the documented * configuration mechanisms provided by the Software, shall be * modified such that the Original Author's bug reporting email * addresses and urls are either replaced with the contact information * of the parties responsible for the changes, or removed entirely. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * * Except where noted, this license applies to any and all software * programs and associated documentation files created by the * Original Author, when distributed with the Software. * * * * dayjs@1.11.7 (MIT) * author: iamkun * url: https://github.com/iamkun/dayjs.git * * MIT License * * Copyright (c) 2018-present, iamkun * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * * * mustache@4.2.0 (MIT) * author: mustache.js Authors * url: https://github.com/janl/mustache.js.git * * The MIT License * * Copyright (c) 2009 Chris Wanstrath (Ruby) * Copyright (c) 2010-2014 Jan Lehnardt (JavaScript) * Copyright (c) 2010-2015 The mustache.js community * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * whatwg-fetch@3.6.2 (MIT) * url: github/fetch * * Copyright (c) 2014-2016 GitHub, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * */ (()=>{var e={1206:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),s=Math.max(i,o),a=0,u=e.map([t,r],(function(t){var r=s-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(u[0][s]>u[1][s])return 1;if(u[0][s]===u[1][s]){if(s===a)return 0;s-=1}else if(u[0][s]1?i-1:0),s=1;s0){var s=Object.keys(r),u=a.default.find(s,(function(e){return t.isOS(e)}));if(u){var c=this.satisfies(r[u]);if(void 0!==c)return c}var d=a.default.find(s,(function(e){return t.isPlatform(e)}));if(d){var l=this.satisfies(r[d]);if(void 0!==l)return l}}if(o>0){var h=Object.keys(i),f=a.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=s,e.exports=t.default}})},7484:function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",o="minute",s="hour",a="day",u="week",c="month",d="quarter",l="year",h="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},v=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},y={s:v,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(i,2,"0")},m:function e(t,r){if(t.date()1)return e(s[0])}else{var a=t.name;w[a]=t,i=a}return!n&&i&&(b=i),i||!n&&b},M=function(e,t){if(_(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new A(r)},S=y;S.l=k,S.i=_,S.w=function(e,t){return M(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e)}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return S},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var r=M(e);return this.startOf(t)<=r&&r<=this.endOf(t)},v.isAfter=function(e,t){return M(e)=0&&(o[l]=parseInt(d,10))}var h=o[3],f=24===h?0:h,p=o[0]+"-"+o[1]+"-"+o[2]+" "+f+":"+o[4]+":"+o[5]+":000",m=+t;return(i.utc(p).valueOf()-(m-=m%1e3))/6e4},u=n.prototype;u.tz=function(e,t){void 0===e&&(e=o);var r=this.utcOffset(),n=this.toDate(),s=n.toLocaleString("en-US",{timeZone:e}),a=Math.round((n-new Date(s))/1e3/60),u=i(s).$set("millisecond",this.$ms).utcOffset(15*-Math.round(n.getTimezoneOffset()/15)-a,!0);if(t){var c=u.utcOffset();u=u.add(r-c,"minute")}return u.$x.$timezone=e,u},u.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),r=s(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return r&&r.value};var c=u.startOf;u.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var r=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(r,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,r){var n=r&&t,s=r||t||o,u=a(+i(),s);if("string"!=typeof e)return i(e).tz(s);var c=function(e,t,r){var n=e-60*t*1e3,i=a(n,r);if(t===i)return[n,t];var o=a(n-=60*(i-t)*1e3,r);return i===o?[n,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}(i.utc(e,n).valueOf(),u,s),d=c[0],l=c[1],h=i(d).utcOffset(l);return h.$x.$timezone=s,h},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){o=e}}}()},178:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var s=i.prototype;o.utc=function(e){return new i({date:e,utc:!0,args:arguments})},s.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},s.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var u=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=s.utcOffset;s.utcOffset=function(n,i){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],o=i[0],s=60*+i[1]+ +i[2];return 0===s?0:"+"===o?s:-s}(n),null===n))return this;var s=Math.abs(n)<=16?60*n:n,a=this;if(i)return a.$offset=s,a.$u=0===n,a;if(0!==n){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(s+u,e)).$offset=s,a.$x.$localOffset=u}else a=this.utc();return a};var d=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var l=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var h=s.diff;s.diff=function(e,t,r){if(e&&this.$u===e.$u)return h.call(this,e,t,r);var n=this.local(),i=o(e).local();return h.call(n,i,t,r)}}}()},466:function(e){e.exports=function(){"use strict";var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function r(e){return"function"==typeof e}function n(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function s(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test;function u(e,t){return a.call(e,t)}var c=/\S/;function d(e){return!u(c,e)}var l={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function h(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return l[e]}))}var f=/\s*/,p=/\s+/,m=/\s*=/,g=/\s*\}/,v=/#|\^|\/|>|\{|&|=|!/;function y(e,r){if(!e)return[];var n,o,s,a=!1,u=[],c=[],l=[],h=!1,y=!1,k="",M=0;function A(){if(h&&!y)for(;l.length;)delete c[l.pop()];else l=[];h=!1,y=!1}function O(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),s=new RegExp("\\s*"+i("}"+e[1]))}O(r||S.tags);for(var P,E,T,B,$,F,R=new _(e);!R.eos();){if(P=R.pos,T=R.scanUntil(n))for(var x=0,C=T.length;x0?i[i.length-1][4]:r;break;default:n.push(t)}return r}function _(e){this.string=e,this.tail=e,this.pos=0}function k(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function M(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}_.prototype.eos=function(){return""===this.tail},_.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},_.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},k.prototype.push=function(e){return new k(e,this)},k.prototype.lookup=function(e){var t,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var i,a,u,c=this,d=!1;c;){if(e.indexOf(".")>0)for(i=c.view,a=e.split("."),u=0;null!=i&&u"===s?a=this.renderPartial(o,t,r,i):"&"===s?a=this.unescapedValue(o,t):"name"===s?a=this.escapedValue(o,t,i):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(u+=a);return u},M.prototype.renderSection=function(e,n,i,o,s){var a=this,u="",c=n.lookup(e[1]);function d(e){return a.render(e,n,i,s)}if(c){if(t(c))for(var l=0,h=c.length;l0||!r)&&(i[o]=n+i[o]);return i.join("\n")},M.prototype.renderPartial=function(e,t,n,i){if(n){var o=this.getConfigTags(i),s=r(n)?n(e[1]):n[e[1]];if(null!=s){var a=e[6],u=e[5],c=e[4],d=s;0==u&&c&&(d=this.indentPartial(s,c,a));var l=this.parse(d,o);return this.renderTokens(l,t,n,d,i)}}},M.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return r},M.prototype.escapedValue=function(e,t,r){var n=this.getConfigEscape(r)||S.escape,i=t.lookup(e[1]);if(null!=i)return"number"==typeof i&&n===S.escape?String(i):n(i)},M.prototype.rawValue=function(e){return e[1]},M.prototype.getConfigTags=function(e){return t(e)?e:e&&"object"==typeof e?e.tags:void 0},M.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!t(e)?e.escape:void 0};var S={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){A.templateCache=e},get templateCache(){return A.templateCache}},A=new M;return S.clearCache=function(){return A.clearCache()},S.parse=function(e,t){return A.parse(e,t)},S.render=function(e,t,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return A.render(e,t,r,i)},S.escape=h,S.Scanner=_,S.Context=k,S.Writer=M,S}()},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}},2738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(7147);const n={accept:!0,"accept-language":!0,"content-language":!0,"content-type":!0};function i(e,t={}){return"cors"===t.mode?function(e,t={}){let r=t.headers||{};return Object.keys(r).forEach((e=>{const i=e.toLowerCase();n[i]||delete r[e],"GET"!==t.method&&"HEAD"!==t.method||"content-type"===i&&delete r[e]})),t.headers=r,t.mode="cors",t.credentials=t.credentials||"same-origin",o(e,t)}(e,t):function(e,t={}){return t.headers=t.headers||{},t.headers["X-Requested-With"]="XMLHttpRequest",t.mode="same-origin",t.credentials="same-origin",o(e,t)}(e,t)}function o(e,t){const r=Object.assign(Object.assign({},t),{headers:new Headers(t.headers)});return fetch(e,r).then((e=>{if(e.status<400)return e;throw e}))}function s(e){return function(t,r={}){return r.headers=r.headers||{},r.headers.Accept="application/json",r.headers["Content-Type"]="application/json",e(t,r).then((e=>204===e.status?{}:e.json()))}}function a(e,t={}){return t.method="GET",i(e,t)}function u(e,t={}){return t.method="POST",i(e,t)}function c(e,t={}){return t.method="PUT",i(e,t)}function d(e,t={}){return t.method="DELETE",i(e,t)}const l={get:a,post:u,put:c,delete:d,request:i,JSON:{get:s(a),post:s(u),put:s(c),delete:s(d),request:s(i)}};t.default=l},8160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Template=void 0;const n=r(466);t.Template=class{static render(e,t){if("TEMPLATE"===e.tagName)throw new Error(`Cannot use template tag: ${e.id}.`);const r=document.createElement("div");return r.innerHTML=n.render(e.innerHTML,t),Array.prototype.slice.call(r.childNodes)}static renderElement(e,t){const r=this.render(e,t).filter((e=>e.nodeType===Node.ELEMENT_NODE));if(1!==r.length)throw new Error("Must give single Element template to Template.renderElement");return r[0]}static renderTo(e,t,r){this.render(e,t).forEach((e=>r.appendChild(e)))}static renderArrayTo(e,t,r){const n=document.createDocumentFragment();t.map((t=>{this.render(e,t).forEach((e=>n.appendChild(e)))})),r.appendChild(n)}}},3274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDateTime=t.formatDateTimeInJST=t.formatDateTime=void 0;const n=r(7484),i=r(9387),o=r(178);n.extend(i),n.extend(o),t.formatDateTime=function(e,t){return n(e).format(t)},t.formatDateTimeInJST=function(e,t){return n.utc(e).tz("Asia/Tokyo").format(t)},t.parseDateTime=function(e){return n(e).toDate()}},194:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserRepository=void 0;const i=r(2738),o=r(8642),s=r(5468);class a extends o.Observable{constructor(){super(...arguments),this.B_ORIGIN=window.location.origin}static getInstance(){return this.instance||(this.instance=new a),this.instance}fetchMyProfile(){return i.default.JSON.get("/api/my/profile").then((e=>{this.fire("my_profile:fetched",e)})).catch((e=>this.fire("my_profile:fetch_failed",e)))}fetchMyFrequentTags(e,t){return i.default.JSON.get(`/api/my/frequent_tags?limit=${t}`).catch((e=>[]))}fetchMyRecommendedTags(e){return i.default.JSON.get(`/api/my/recommended_tags?url=${encodeURIComponent(e)}`).catch((e=>({recommended_tags:[],frequent_tags:[]})))}fetchExternalShareConfig(){return i.default.JSON.get("/api/my/external/share_config").then((e=>this.fire("my_share_config:fetched",{shareEnabled:e.share_enabled,shareDisabledReason:"my_bookmark_private"===e.share_disabled_reason?s.ShareDisabledReason.MyBookmarkPrivate:null,services:e.services}))).catch((e=>this.fire("my_share_config:fetched",{})))}fetchShareText(e,t){return n(this,void 0,void 0,(function*(){const r=new URL(`${this.B_ORIGIN}/api/my/bookmark/${encodeURIComponent(e)}/share`);return t&&r.searchParams.append("activity_pub_user_id",t),i.default.JSON.get(r.toString()).then((t=>this.fire("my_share_text:fetched",Object.assign({bookmarkedURL:e},t)))).catch((e=>{throw console.error(e),new Error("share url fetch failed.")}))}))}}t.UserRepository=a,a.instance=null},8642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;t.Observable=class{constructor(){this.WARN_ORPHAN_EVENT=!1,this.handler={}}on(e,t){return this.handler[e]=this.handler[e]||[],this.handler[e].push(t),this}exclusiveOn(e,t){return this.handler[e]=[],this.on(e,t)}fire(e,...t){this.WARN_ORPHAN_EVENT&&!this.handler[e]&&console.log("Orphan event: "+e),(this.handler[e]||[]).forEach((e=>{e.apply(this,t)}))}bubble(e,t){e.on(t,((...e)=>{this.fire(t,...e)}))}firing(e,...t){return()=>this.fire(e,...t)}}},2704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowserName=t.setActivityPubUserId=t.getActivityPubUserId=t.notEmpty=t.throttle=t.debounce=t.closest=t.delegate=t.toStringWithUserPostfix=t.isAndroid=t.isIOS=t.isMobileWidth=t.isMobile=t.countBookmarkComment=t.truncateText=t.escapeHTML=t.stringToArray=t.smallProfileImageURL=t.largeProfileImageURL=t.profileImageURL=t.serializeAsFormUrlEncoded=t.chunk=t.difference=t.merge=void 0;const n=r(1206);function i(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}function o(){return 480>=window.innerWidth}function s(e,t){return e.matches||(e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;--r>=0&&t.item(r)!==this;);return r>-1}),e.matches(t)}t.merge=function(...e){var t={};return e.forEach((e=>{null!==e&&Object.keys(e).forEach((r=>t[r]=e[r]))})),t},t.difference=function(e,t){if(0===t.length)return e;const r=new Set(t);return e.filter((e=>!r.has(e)))},t.chunk=function(e,t){const r=[];for(let n=0;n{const n=e[r];return Array.isArray(n)?n.map((e=>t(r,e))).join("&"):t(r,n)})).join("&")},t.profileImageURL=function(e){return`https://cdn.profile-image.st-hatena.com/users/${e}/profile.png`},t.largeProfileImageURL=function(e){return`https://cdn.profile-image.st-hatena.com/users/${e}/profile.png`},t.smallProfileImageURL=function(e){return`https://cdn.profile-image.st-hatena.com/users/${e}/profile_s.gif`},t.stringToArray=i,t.escapeHTML=function(e){return e&&/[&<>"']/.test(e)?e.replace(/[&<>"']/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return"'"}})):e},t.truncateText=function(e,t){let r=0,n="";const o=i(e);for(let e=0;et){n+="...";break}n+=o[e]}return n},t.countBookmarkComment=function(e){let t=0;const r=i(e);for(let e=0;e0?"MOBILE"===e:o()},t.isMobileWidth=o,t.isIOS=function(){const e=window.navigator.userAgent.toLowerCase();return/\b(?:iphone|ipad)\b/.test(e)},t.isAndroid=function(){const e=window.navigator.userAgent.toLowerCase();return/\bandroid\b/.test(e)},t.toStringWithUserPostfix=function(e){return e+(1===e?" user":" users")},t.delegate=function(e,t){return function(r){r&&r.target&&s(r.target,e+","+e+" *")&&t.apply(this,arguments)}},t.closest=function e(t,r){if(s(t,r))return t;const n=t.parentNode;return null!==n&&n!==document?e(n,r):void 0},t.debounce=function(e,t){let r;return function(){const n=this,i=arguments;window.clearTimeout(r),r=window.setTimeout((function(){r=void 0,e.apply(n,i)}),t)}},t.throttle=function(e,t){let r=0;return function(){const n=Date.now();n-r>=t&&(e.apply(this,arguments),r=n)}},t.notEmpty=function(e){return null!=e};const a="activity_pub_user_id";t.getActivityPubUserId=function(){return localStorage.getItem(a)},t.setActivityPubUserId=function(e){return e?localStorage.setItem(a,e):localStorage.removeItem(a)},t.getBrowserName=function(){return(0,n.getParser)(window.navigator.userAgent).getBrowserName().toLowerCase()}},9042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.View=t.Presenter=void 0;t.Presenter=class{constructor(e){this.view=e,this.lastError=null}setup(){}setError(e){this.lastError=e,this.view.updateError()}resetError(){this.setError(null)}};t.View=class{constructor(...e){this.initMembers(...e),this.presenter=this.createPresenter(),this.registerEvents(),this.presenter.setup()}initMembers(...e){}registerEvents(){}updateError(){}}},4831:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryListFollowingBookmarksController=void 0;t.EntryListFollowingBookmarksController=class{constructor(e,t){this.onFetched=e=>{this.views.forEach((t=>{const r=e[t.entryURL];r&&t.showFollowingBookmarks(r)}))},this.views=e,this.repository=t,this.repository.on("all_following_bookmarks:fetched",this.onFetched)}get entryURLs(){return this.views.map((e=>e.entryURL))}}},4269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.anchorPath=t.FollowingBookmark=t.BookmarkWithEntry=t.Bookmark=t.BookmarkComment=t.BookmarkStatus=void 0;const n=r(3274);!function(e){e.Public="public",e.Private="private"}(t.BookmarkStatus||(t.BookmarkStatus={}));class i{}t.BookmarkComment=i;class o extends i{}t.Bookmark=o;t.BookmarkWithEntry=class extends o{};t.FollowingBookmark=class{},t.anchorPath=function(e){return`/${e.user.name}/${(0,n.formatDateTimeInJST)(e.created,"YYYYMMDD")}#bookmark-${"locationId"in e?e.locationId:e.location_id}`}},960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Category=void 0;class r{static get uncategorized(){return new r({title:"\u672a\u5206\u985e",path:"uncategorized",top_page_path:"/"})}constructor(e){this.title=e.title,this.path=e.path,this.top_page_path=e.top_page_path}is_categorized(){return"uncategorized"!==this.path}}t.Category=r},5280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Entry=void 0;t.Entry=class{constructor(e){this.title=e.title,this.root_url=e.root_url,this.url=e.url,this.image=e.image,this.total_bookmarks=e.total_bookmarks,this.total_bookmarks_with_user_postfix=e.total_bookmarks_with_user_postfix,this.summary=e.summary,this.summary_with_keyword_links=e.summary_with_keyword_links,this.category=e.category?e.category:null,this.is_wiped=!!e.is_wiped&&e.is_wiped}faviconURL(){return`https://cdn-ak2.favicon.st-hatena.com/?url=${encodeURIComponent(this.url)}`}entryURL(){return function(e){const t=new URL(e),r=t.protocol;if("http:"!==r&&"https:"!==r)return"/entry/"+t.href;let n="";return""!==t.username&&(n=""!==t.password?`${t.username}:${t.password}@`:`${t.username}@`),`/entry/${"https:"===r?"s/":""}${n}${t.host}${t.pathname}${t.search}`}(this.url)}hostname(){return new URL(this.url).host||""}rootTitle(){const e=new URL(this.root_url);return(e.host||"")+e.pathname.replace(/\/$/,"")}siteSearchUrl(){const e=new URL(this.root_url),t=e.host;if(!t)return"/entrylist?url="+encodeURIComponent(this.root_url);return`/site/${t}${/\/$/.test(this.root_url)?e.pathname:e.pathname.replace(/\/$/,"")}`}}},5468:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShareDisabledReason=void 0,function(e){e.MyBookmarkPrivate="myBookmarkPrivate"}(t.ShareDisabledReason||(t.ShareDisabledReason={}))},3452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BookmarkRepository=t.STOCK_TAG=void 0;const n=r(2738),i=r(3274),o=r(2704),s=r(4269),a=r(960),u=r(5280);t.STOCK_TAG="\u3042\u3068\u3067\u8aad\u3080";class c{static getInstance(){return this.instance||(this.instance=new c),this.instance}constructor(){}add(e,t,r,i){const s={url:e,private:r?1:0,annotation:t.comment,tags:t.tagString,bookmark_stock:i?1:0};return n.default.post("/my/bookmark",{headers:{"Content-Type":"application/x-www-form-urlencoded"},body:(0,o.serializeAsFormUrlEncoded)(s)})}addToLegacyBookmark(e){const t={rks:e.user.rks,url:e.url,private:e.is_private?1:0,comment:e.annotation.toString(),post_twitter:e.post_twitter?1:0,with_status_op:1,from:e.from},r=`/${e.user.name}/add.edit.json`,i=e.source?`${r}?source=${encodeURIComponent(e.source)}`:r;return n.default.post(i,{headers:{"Content-Type":"application/x-www-form-urlencoded"},body:(0,o.serializeAsFormUrlEncoded)(t)}).then((e=>e.json())).then((t=>({user:e.user,url:e.url,locationId:t.eid,status:t.private?s.BookmarkStatus.Private:s.BookmarkStatus.Public,comment:e.annotation.comment,comment_expanded:t.comment_expanded,tags:e.annotation.tags,created:t.timestamp.replace(/\//g,"-")})))}delete(e){return n.default.post("/my/bookmark.delete",{headers:{"Content-Type":"application/x-www-form-urlencoded"},body:(0,o.serializeAsFormUrlEncoded)({url:e})})}deleteLegacy(e,t){return this.deleteBookmarkLegacy(e,{url:t,rks:e.rks})}deleteLegacyByLocationId(e,t){return this.deleteBookmarkLegacy(e,{location_id:t,rks:e.rks})}deleteBookmarkLegacy(e,t){return n.default.post(`/${e.name}/api.delete_bookmark.json`,{headers:{"Content-Type":"application/x-www-form-urlencoded"},body:(0,o.serializeAsFormUrlEncoded)(t)}).then((e=>new Promise(((t,r)=>{(window.dataLayer=window.dataLayer||[]).push({event:"boston:bookmark:delete"}),t(e)}))))}findMyBookmarkByUrl(e){const t=encodeURIComponent(e);return n.default.JSON.get(`/api/my/bookmark/${t}`).then((e=>{if(0===Object.keys(e).length)throw"Bookmark Not Found";return{user:e.user,url:e.url,locationId:e.location_id,status:e.status,comment:e.comment,comment_expanded:e.comment_expanded,tags:e.tags,created:e.created}}))}findAllBookmarksByUserName(e,t=1,r=[]){const i=r.length<=0?"":"&"+r.map((e=>`tag=${encodeURIComponent(e)}`)).join("&");return n.default.JSON.get(`/api/users/${e}/bookmarks?page=${t}${i}`).then((e=>e.bookmarks.map((e=>{const t=e.entry,r=e.entry.category;return{user:e.user,url:e.url,locationId:e.location_id,status:e.status,comment:e.comment,comment_expanded:e.comment_expanded,tags:e.tags,created:e.created,entry:new u.Entry({title:t.title,root_url:t.root_url,url:t.canonical_url,image:t.image,total_bookmarks:t.total_bookmarks,total_bookmarks_with_user_postfix:t.total_bookmarks_with_user_postfix,summary:t.summary,summary_with_keyword_links:t.summary_with_keyword_links,category:new a.Category({title:r.title,top_page_path:r.top_page_path,path:r.path})})}}))))}findAllBookmarksByUserNameAndDate(e,t){return n.default.JSON.get(`/api/users/${e}/bookmarks/${(0,i.formatDateTime)(t.toISOString(),"YYYYMMDD")}`).then((e=>({bookmarks:e.bookmarks.map((e=>{const t=e.entry,r=e.entry.category;return{user:e.user,url:e.url,locationId:e.location_id,status:e.status,comment:e.comment,comment_expanded:e.comment_expanded,tags:e.tags,created:e.created,entry:new u.Entry({title:t.title,root_url:t.root_url,url:t.canonical_url,image:t.image,total_bookmarks:t.total_bookmarks,total_bookmarks_with_user_postfix:t.total_bookmarks_with_user_postfix,summary:t.summary,summary_with_keyword_links:t.summary_with_keyword_links,category:new a.Category({title:r.title,top_page_path:r.top_page_path,path:r.path})})}})),nextCursor:e.next_cursor?new Date(e.next_cursor):null,previousCursor:e.previous_cursor?new Date(e.previous_cursor):null})))}findAllBookmarksByUrl(e,t=!1,r=500,i=!1,o){const s=encodeURIComponent(e),a=t?1:0,u=i?1:0;let c;return c=o?n.default.JSON.get(`/api/entry/${s}/bookmarks?cursor=${o}&limit=${r}&commented_only=${a}&exclude_owner=${u}`):n.default.JSON.get(`/api/entry/${s}/bookmarks?limit=${r}&commented_only=${a}&exclude_owner=${u}`),c.then((e=>({bookmarks:e.bookmarks.map((e=>({user:e.user,url:e.url,locationId:e.location_id,status:e.status,comment:e.comment,comment_expanded:e.comment_expanded,tags:e.tags,created:e.created}))),cursor:e.cursor})))}}t.BookmarkRepository=c,c.instance=null},7174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BookmarkStockRepository=void 0;const n=r(2505),i=r(2738),o=r(2704);class s{static getInstance(){return this.instance||(this.instance=new s),this.instance}constructor(){this.pendingTimer=null,this.pendingLocations=[],this.stockDeferreds={}}isStocked(e){if(this.stockDeferreds[e])return this.stockDeferreds[e].promise;const t=new n.default;return this.pendingLocations.push(e),this.stockDeferreds[e]=t,this.resolvePendingLocations(),t.promise}resolvePendingLocations(){0!==this.pendingLocations.length&&null===this.pendingTimer&&(this.pendingTimer=window.setTimeout(this.doResolve.bind(this),50))}doResolve(){if(0===this.pendingLocations.length)return;const e=this.pendingLocations;this.pendingLocations=[],i.default.JSON.post("/api/bookmark_stocks/resolve",{body:JSON.stringify({urls:e})}).then((t=>{const r=t.filter((e=>!e.is_read)).map((e=>e.url));r.forEach((e=>{const t=this.stockDeferreds[e];t&&t.resolve(!0)})),(0,o.difference)(e,r).forEach((e=>{const t=this.stockDeferreds[e];t&&t.resolve(!1)}))})).catch((t=>{e.forEach((e=>{const t=this.stockDeferreds[e];t&&t.reject()}))})).then((()=>{this.pendingTimer=null,this.resolvePendingLocations()}))}addToStock(e,t){return i.default.put(`/api/bookmark_stock/${encodeURIComponent(t)}`,{headers:{"X-HATENA-RKS":e.rks}}).then((()=>{delete this.stockDeferreds[t]})).catch((()=>Promise.reject()))}read(e,t){return i.default.post(`/api/bookmark_stock/${encodeURIComponent(t)}/read`,{headers:{"X-HATENA-RKS":e.rks}}).catch((()=>{}))}}t.BookmarkStockRepository=s,s.instance=null},7508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FollowingBookmarksRepository=void 0;const n=r(2738),i=r(8642),o=r(2704),s=r(5280);class a extends i.Observable{fetchFollowingFeed(e){const t="/api/my/following_feed"+(e?`?offset=${e}`:"");return n.default.JSON.get(t).then((e=>({items:e.items.map((e=>{const t=e.entry,r=e.own_bookmark,n=e.reaction,i=e.reactions,a=new URL(t.url),u=`${a.protocol||"http:"}//${a.host||""}/`;return{entry:new s.Entry({title:t.title,url:t.url,root_url:u,image:t.image_url,summary:t.content,summary_with_keyword_links:(0,o.escapeHTML)(t.content),total_bookmarks:t.count,total_bookmarks_with_user_postfix:(0,o.toStringWithUserPostfix)(t.count)}),ownBookmark:r,reaction:n,reactions:i}})),nextCursor:e.next_cursor})))}fetchRemote(e,t,r=!1){return this.fetchRemoteByURLs(e,[t],r).then((e=>{const r=e[t]?e[t]:[];return this.fire("following_bookmarks:fetched",r),r}))}fetchRemoteByURLs(e,t,r=!1){return t.length<=0?(this.fire("all_following_bookmarks:fetched",{}),Promise.resolve({})):n.default.JSON.post("/api/my/following_bookmarks",{body:JSON.stringify({urls:t,include_own_bookmarks:r})}).then((e=>(this.fire("all_following_bookmarks:fetched",e),Promise.resolve(e)))).catch((()=>({})))}}t.FollowingBookmarksRepository=a},6994:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BookmarkStockButtonView=t.BookmarkStockButtonPresenter=void 0;const i=r(9042),o=r(3452),s=r(7174);class a extends i.Presenter{constructor(e,t){super(e),this.visitor=t.visitor,this.location=t.location,this.isStocked=!1,this.isRequesting=!1}setup(){this.setupPromise=s.BookmarkStockRepository.getInstance().isStocked(this.location).then((e=>{this.isStocked=e,this.view.updateButtonIndicator()}))}handleClick(){return this.isRequesting?Promise.resolve():(this.resetError(),this.isStocked?this.view.confirmDelete((()=>this.deleteStock())):this.addStock())}addStock(){return this.isRequesting=!0,this.isStocked=!0,this.view.updateButtonIndicator(),s.BookmarkStockRepository.getInstance().addToStock(this.visitor,this.location).then((()=>{this.isStocked=!0})).catch((e=>{this.isStocked=!1,this.setError(new Error("\u3042\u3068\u3067\u8aad\u3080\u306e\u8ffd\u52a0\u306b\u5931\u6557\u3057\u307e\u3057\u305f"))})).then((()=>{this.isRequesting=!1,this.view.updateButtonIndicator()}))}deleteStock(){return this.isRequesting=!0,this.isStocked=!1,this.view.updateButtonIndicator(),o.BookmarkRepository.getInstance().deleteLegacy(this.visitor,this.location).then((()=>{this.isStocked=!1})).catch((e=>{this.isStocked=!0,this.setError(new Error("\u3042\u3068\u3067\u8aad\u3080\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f"))})).then((()=>{this.isRequesting=!1,this.view.updateButtonIndicator()}))}}t.BookmarkStockButtonPresenter=a;class u extends i.View{constructor(e,t){super(e,t),t.setAttribute("data-initialized",""),t.classList.remove("is-hidden")}initMembers(e,t){this.visitor=e,this.buttonPart=t,this.button=t.querySelector(".js-bookmark-stock-button-ready")}createPresenter(){return new a(this,{visitor:this.visitor,location:this.button.getAttribute("data-href")})}registerEvents(){this.button.addEventListener("click",this.onClickButton.bind(this))}onClickButton(e){return n(this,void 0,void 0,(function*(){yield this.presenter.handleClick()}))}confirmDelete(e){return confirm("\u672c\u5f53\u306b\u524a\u9664\u3057\u307e\u3059\u304b\u3002\n\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306b\u5bfe\u3059\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3082\u524a\u9664\u3055\u308c\u307e\u3059\u3002")?e():Promise.resolve()}updateButtonIndicator(){this.presenter.isStocked?(this.buttonPart.setAttribute("is-active",""),this.button.classList.add("is-active")):(this.buttonPart.removeAttribute("is-active"),this.button.classList.remove("is-active"))}updateError(){const e=this.presenter.lastError;e&&alert(e.message)}}t.BookmarkStockButtonView=u},5287:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FollowingBookmarksView=void 0;const n=r(8160),i=r(3274),o=r(8642),s=r(4269);class a extends o.Observable{get entryURL(){return this.url}constructor(e,t){super(),this.url=e.getAttribute("data-entry-url"),this.followingBookmarksList=e.querySelector(".js-following-bookmarks"),this.followingUserTemplate=t||e.querySelector("#template-following-bookmark")}showFollowingBookmarks(e){const t=document.createDocumentFragment();e.forEach((e=>{const r=n.Template.renderElement(this.followingUserTemplate,{user_name:e.user.name,comment:e.comment,tags:e.tags.map((e=>({label:e}))),profile_image_url:e.user.image.image_url,anchor_path:(0,s.anchorPath)(e),created:(0,i.formatDateTime)(e.created,"YYYY/MM/DD")});t.appendChild(r)})),this.followingBookmarksList.appendChild(t)}}t.FollowingBookmarksView=a},84:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeAds=void 0;const n=r(1430),i=r(9427);t.NativeAds=class{constructor(e){this.controllers=[],this.listenRiverEvents(),this.push.apply(this,e)}push(...e){return e.forEach((e=>e(this))),0}register(e){const t=new i.NativeAdGroupView(e.selector),r=new n.NativeAdGroupController(e,t);this.controllers.push(r);const o=r.start();return o.then((t=>this.watchCallback(e))),o}watch(e){this.watchCallback=e}listenRiverEvents(){window.riverAds=window.riverAds||[],window.riverAds.push((e=>{e.addEventListener("render:done",(e=>{this.controllers.forEach((t=>t.renderDone(e)))})),e.addEventListener("render:empty",(e=>{this.controllers.forEach((t=>t.renderEmpty(e)))})),e.addEventListener("render:error",(e=>{this.controllers.forEach((t=>t.renderError(e)))}))}))}}},1430:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeAdGroupController=void 0;const n=r(2505),i=r(8441);t.NativeAdGroupController=class{constructor(e,t){this.groupFailed=!1,this.configuration=e,this.view=t,this.deferred=new n.default,this.successedAds=[],this.failedAds=[]}start(){return window.setTimeout((()=>{this.view.show()}),2e3),this.configuration.header&&this.registerPlacement(this.configuration.header),this.registerPlacements(this.configuration.ads),this.deferred.promise}renderDone(e){if(this.groupFailed)return;const t=e.target.getAttribute("data-river-placement"),r=this.configuration.header;if(r&&r.placement===t)return void this.view.showHeader(e);const n=this.findPlacement(this.configuration.ads,t);void 0!==n&&this.fetchEntryInfo(e.detail).then((t=>{const r=e.target;this.view.fillEntryInfo(r,t),this.renderSuccessed(e,n)})).catch((t=>{this.renderFailed(e,n)}))}renderEmpty(e){if(this.groupFailed)return;const t=e.target.getAttribute("data-river-placement"),r=this.configuration.header;if(r&&r.placement===t)return void this.fail();const n=this.findPlacement(this.configuration.ads,t);void 0!==n&&this.renderFailed(e,n)}renderError(e){if(this.groupFailed)return;const t=e.target.getAttribute("data-river-placement"),r=this.configuration.header;if(r&&r.placement===t)return void this.fail();const n=this.findPlacement(this.configuration.ads,t);void 0!==n&&this.renderFailed(e,n)}get groupOptions(){return this.configuration.options||{}}get placementCount(){return this.configuration.ads.length}get finishedCount(){return this.successedAds.length+this.failedAds.length}registerPlacements(e){e.forEach((e=>this.registerPlacement(e)))}registerPlacement(e){window.riverAds=window.riverAds||[],window.riverAds.push((t=>{t.registerPlacement(e.placement).catch(t.muteEmpty)}))}findPlacement(e,t){let r;return e.forEach((e=>{e.placement===t&&(r=e)})),r}renderSuccessed(e,t){this.groupFailed||(this.successedAds.push({event:e,configuration:t}),this.finishedCount>=this.placementCount&&this.insertAds().then((()=>this.complete())).catch((()=>this.fail())))}renderFailed(e,t){this.groupFailed||(this.failedAds.push({event:e,configuration:t}),this.groupOptions.group?this.fail():this.finishedCount>=this.placementCount&&this.insertAds().then((()=>this.complete())).catch((()=>this.fail())))}complete(){this.deferred.resolve(this.successedAds.length)}fail(){this.groupFailed=!0,this.deferred.reject()}fetchEntryInfo(e){const t=e.creative.fields.content_url;return t?i.EntryInfoRepository.getInstance().fetch(t):Promise.reject("content url is not found")}insertAds(){return this.view.insertAds(this.successedAds,this.groupOptions)}}},8441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryInfoRepository=void 0;const n=r(2505),i=r(2738),o=r(2704);class s{static getInstance(){return this.instance||(this.instance=new s),this.instance}constructor(){this.request=()=>{const e=this.pendingURLs,t=Object.assign({},this.entryInfoDeferreds);this.entryInfoDeferreds={},this.doRequest(e).then((r=>{const n=Object.keys(r);(0,o.difference)(e,n).forEach((e=>{const r=t[e];r&&r.reject()})),n.forEach((e=>{const n=r[e],i=t[e];i&&n&&i.resolve(n)}))})).catch((r=>{e.forEach((e=>{const r=t[e];r&&r.reject()}))})).then((()=>{this.pendingTimer=null,this.scheduleRequesting()}))},this.pendingTimer=null,this.entryInfoDeferreds={}}fetch(e){if(this.entryInfoDeferreds[e]){return this.entryInfoDeferreds[e].promise}const t=new n.default;return this.entryInfoDeferreds[e]=t,this.scheduleRequesting(),t.promise}get pendingURLs(){return Object.keys(this.entryInfoDeferreds)}scheduleRequesting(){this.pendingURLs.length>0&&null===this.pendingTimer&&(this.pendingTimer=window.setTimeout(this.request,50))}doRequest(e){const t="/api/nativeads/entry_infos?"+e.map((e=>`url=${encodeURIComponent(e)}`)).join("&");return i.default.JSON.get(t)}}t.EntryInfoRepository=s,s.instance=null},9427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeAdGroupView=void 0;const n=r(2704);t.NativeAdGroupView=class{constructor(e){this.containerFetchingPromise=null,this.containerSelector=e}show(){this.fetchContainer().then((e=>e.classList.remove("is-nativeads-loading")))}fillEntryInfo(e,t){e.classList.add(t.category.css_class_name),e.classList.add("js-keyboard-selectable-item");const r=e.querySelector(".js-entrylist-contents-users > a > span");null!==r&&(r.textContent=`${t.total_bookmarks}`);const i=e.querySelector(".js-entrylist-contents-description");null!==i&&(i.textContent=(0,n.truncateText)(`${t.description}`,200));const o=e.querySelector(".js-entrylist-contents-category > a");null!==o&&(o.setAttribute("href",`${t.category.href}`),o.textContent=`${t.category.label}`);const s=e.querySelector(".js-entrylist-contents-domain > a");if(null!==s){s.setAttribute("href",`${t.domain.href}`),s.setAttribute("title",`${t.domain.title}`);const e=s.querySelector("span");null!==e&&(e.textContent=`${t.domain.label}`)}}showHeader(e){this.fetchContainer().then((t=>{const r=t.parentElement;if(r){const n=e.target;r.insertBefore(n,t)}t.classList.add("is-nativeads-header-loaded")}))}insertAds(e,t){return new Promise(((r,n)=>{this.fetchContainer().then((n=>{e.sort(((e,t)=>e.configuration.row-t.configuration.row)).forEach((e=>{const r=e.event.target,i=e.configuration;t.replace?this.insertAd_replace(n,r,i):t.truncate?this.insertAd_truncate(n,r,i):this.insertAd_insert(n,r,i)})),this.show(),r()})).catch((e=>n(e)))}))}insertAd_insert(e,t,r){const n=e.children[r.row-1];void 0!==n?e.insertBefore(t,n):e.appendChild(t)}insertAd_replace(e,t,r){const n=e.children[r.row-1];void 0!==n&&(e.insertBefore(t,n),e.removeChild(n))}insertAd_truncate(e,t,r){const n=e.children[r.row-1];if(void 0===n)e.appendChild(t);else{e.insertBefore(t,n);const r=e.children;e.removeChild(r[r.length-1])}}fetchContainer(){return null!==this.containerFetchingPromise||(this.containerFetchingPromise=new Promise(((e,t)=>{const r=()=>{const r=document.querySelector(this.containerSelector);null===r?t("native ad container is not found."):e(r)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()}))),this.containerFetchingPromise}}},7147:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMException:()=>_,Headers:()=>d,Request:()=>v,Response:()=>b,fetch:()=>k});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function f(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=l(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(f)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];b.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var _=n.DOMException;try{new _}catch(e){(_=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),_.prototype.constructor=_}function k(e,t){return new Promise((function(r,o){var s=new v(e,t);if(s.signal&&s.signal.aborted)return o(new _("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){r(new b(i,n))}),0)},a.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){o(new _("Aborted","AbortError"))}),0)},a.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&(i.blob?a.responseType="blob":i.arrayBuffer&&s.headers.get("Content-Type")&&-1!==s.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof d?s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,u(t.headers[e]))})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}k.polyfill=!0,n.fetch||(n.fetch=k,n.Headers=d,n.Request=v,n.Response=b)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};(()=>{"use strict";const e=r(194),t=r(2704),n=r(4831),i=r(7508),o=r(6994),s=r(5287),a=r(84);class u{constructor(){this.uidKey="bstn.river.uid"}fetch(){return localStorage.getItem(this.uidKey)}store(e){try{window.localStorage.setItem(this.uidKey,e)}catch(e){console.log("failed to update local storage")}}remove(){window.localStorage.removeItem(this.uidKey)}}window.nativeAds||(window.nativeAds=[]),window.nativeAds instanceof Array&&(window.nativeAds=new a.NativeAds(window.nativeAds));{const r=e.UserRepository.getInstance(),a=e=>{const r=document.createElement("script");r.setAttribute("id","river-js"),(0,t.isMobile)()?r.setAttribute("data-river-media-path","/hatena/bookmark_sp"):r.setAttribute("data-river-media-path","/hatena/bookmark_pc"),null!==e&&r.setAttribute("data-river-uid",e),r.setAttribute("async","async"),r.setAttribute("src","https://cdn.ad-hatena.com/js/river.js"),document.head.appendChild(r)},c=new u;a(c.fetch()),r.on("my_profile:fetched",(e=>{c.store(e.ads_uid);{const t=new i.FollowingBookmarksRepository,r=[];let a;const u=n=>{Array.prototype.push.apply(r,n),void 0===a&&r.length>0&&(a=window.setTimeout((()=>{t.fetchRemoteByURLs(e,r),a=void 0}),50))};window.nativeAds||(window.nativeAds=[]),window.nativeAds.push((r=>{r.watch((r=>{const i=document.querySelector(r.selector);if(i){i.querySelectorAll(".js-bookmark-stock-button:not([data-initialized])").forEach((t=>{new o.BookmarkStockButtonView(e,t)}));const r=document.getElementById("template-ad-following-bookmark");if(null!==r){let e;{const o=Array.from(i.querySelectorAll(".js-ad-following-bookmarks-container")).map((e=>new s.FollowingBookmarksView(e,r)));e=new n.EntryListFollowingBookmarksController(o,t)}u(e.entryURLs)}}}))}))}})),r.on("my_profile:fetch_failed",(e=>{c.remove()})),r.fetchMyProfile()}})()})();