cozy-bar 1.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/.eslintrc.json +7 -0
  2. package/.github/auto-merge.yml +7 -0
  3. package/.nvmrc +1 -0
  4. package/.transifexrc.tpl +4 -0
  5. package/.travis.yml +28 -0
  6. package/.tx/config +8 -0
  7. package/CHANGELOG.md +493 -0
  8. package/CODEOWNERS +2 -0
  9. package/CONTRIBUTING.md +135 -0
  10. package/LICENSE +21 -0
  11. package/README.md +172 -0
  12. package/babel.config.js +3 -0
  13. package/config/aliases/globalReact.js +1 -0
  14. package/config/aliases/globalReactDOM.js +1 -0
  15. package/config/webpack.config.analyzer.js +10 -0
  16. package/config/webpack.config.base.js +61 -0
  17. package/config/webpack.config.dev.js +16 -0
  18. package/config/webpack.config.extract.js +84 -0
  19. package/config/webpack.config.inline-styles.js +82 -0
  20. package/config/webpack.config.jsx.js +14 -0
  21. package/config/webpack.config.prod.js +18 -0
  22. package/config/webpack.js +31 -0
  23. package/config/webpack.vars.js +11 -0
  24. package/dist/cozy-bar.css +9445 -0
  25. package/dist/cozy-bar.css.map +1 -0
  26. package/dist/cozy-bar.js +122668 -0
  27. package/dist/cozy-bar.js.map +1 -0
  28. package/dist/cozy-bar.min.css +9 -0
  29. package/dist/cozy-bar.min.css.map +1 -0
  30. package/dist/cozy-bar.min.js +57 -0
  31. package/dist/cozy-bar.min.js.map +1 -0
  32. package/dist/cozy-bar.mobile.js +123719 -0
  33. package/dist/cozy-bar.mobile.js.map +1 -0
  34. package/dist/cozy-bar.mobile.min.js +57 -0
  35. package/dist/cozy-bar.mobile.min.js.map +1 -0
  36. package/docs/dev.md +20 -0
  37. package/examples/Procfile +3 -0
  38. package/examples/icon.png +0 -0
  39. package/examples/index.html +7 -0
  40. package/examples/index.jsx +122 -0
  41. package/examples/logs.js +3 -0
  42. package/package.json +163 -0
  43. package/postcss.config.js +23 -0
  44. package/public/fonts/Lato-Bold.woff2 +0 -0
  45. package/public/fonts/Lato-Regular.woff2 +0 -0
  46. package/public/fonts.css +13 -0
  47. package/public/icon-type-folder-32.png +0 -0
  48. package/public/index.html +63 -0
  49. package/renovate.json +5 -0
  50. package/src/assets/icons/16/icon-claudy.svg +5 -0
  51. package/src/assets/icons/16/icon-cozy-16.svg +1 -0
  52. package/src/assets/icons/16/icon-cube-16.svg +6 -0
  53. package/src/assets/icons/16/icon-logout-16.svg +3 -0
  54. package/src/assets/icons/16/icon-magnifier-16.svg +6 -0
  55. package/src/assets/icons/16/icon-people-16.svg +3 -0
  56. package/src/assets/icons/16/icon-phone-16.svg +3 -0
  57. package/src/assets/icons/16/icon-question-mark-16.svg +3 -0
  58. package/src/assets/icons/16/icon-storage-16.svg +3 -0
  59. package/src/assets/icons/24/icon-arrow-left.svg +3 -0
  60. package/src/assets/icons/32/icon-claudy.svg +1 -0
  61. package/src/assets/icons/apps/icon-collect.svg +25 -0
  62. package/src/assets/icons/apps/icon-drive.svg +17 -0
  63. package/src/assets/icons/apps/icon-market-soon.svg +25 -0
  64. package/src/assets/icons/apps/icon-photos.svg +19 -0
  65. package/src/assets/icons/apps/icon-soon.svg +21 -0
  66. package/src/assets/icons/apps/icon-store.svg +19 -0
  67. package/src/assets/icons/claudyActions/icon-bills.svg +6 -0
  68. package/src/assets/icons/claudyActions/icon-laptop.svg +7 -0
  69. package/src/assets/icons/claudyActions/icon-phone.svg +8 -0
  70. package/src/assets/icons/claudyActions/icon-question-mark.svg +6 -0
  71. package/src/assets/icons/comingsoon/icon-bank.svg +12 -0
  72. package/src/assets/icons/comingsoon/icon-sante.svg +12 -0
  73. package/src/assets/icons/comingsoon/icon-store.svg +6 -0
  74. package/src/assets/icons/icon-cozy.svg +3 -0
  75. package/src/assets/icons/icon-shield.svg +3 -0
  76. package/src/assets/icons/spinner.svg +4 -0
  77. package/src/assets/sprites/icon-apps.svg +1 -0
  78. package/src/assets/sprites/icon-cozy-home.svg +16 -0
  79. package/src/components/Apps/AppItem.jsx +117 -0
  80. package/src/components/Apps/AppItemPlaceholder.jsx +12 -0
  81. package/src/components/Apps/AppNavButtons.jsx +88 -0
  82. package/src/components/Apps/AppsContent.jsx +89 -0
  83. package/src/components/Apps/ButtonCozyHome.jsx +30 -0
  84. package/src/components/Apps/ButtonCozyHome.spec.jsx +53 -0
  85. package/src/components/Apps/IconCozyHome.jsx +24 -0
  86. package/src/components/Apps/index.jsx +81 -0
  87. package/src/components/Banner.jsx +41 -0
  88. package/src/components/Bar.jsx +293 -0
  89. package/src/components/Bar.spec.jsx +133 -0
  90. package/src/components/Claudy.jsx +81 -0
  91. package/src/components/Drawer.jsx +227 -0
  92. package/src/components/Drawer.spec.jsx +98 -0
  93. package/src/components/SearchBar.jsx +358 -0
  94. package/src/components/Settings/SettingsContent.jsx +145 -0
  95. package/src/components/Settings/StorageData.jsx +29 -0
  96. package/src/components/Settings/helper.js +8 -0
  97. package/src/components/Settings/index.jsx +218 -0
  98. package/src/components/SupportModal.jsx +59 -0
  99. package/src/components/__snapshots__/Bar.spec.jsx.snap +302 -0
  100. package/src/config/claudyActions.yaml +14 -0
  101. package/src/config/persistWhitelist.yaml +2 -0
  102. package/src/dom.js +80 -0
  103. package/src/index.jsx +235 -0
  104. package/src/index.spec.jsx +34 -0
  105. package/src/lib/api/helpers.js +13 -0
  106. package/src/lib/api/index.jsx +145 -0
  107. package/src/lib/exceptions.js +89 -0
  108. package/src/lib/expiringMemoize.js +13 -0
  109. package/src/lib/icon.js +77 -0
  110. package/src/lib/importIcons.js +14 -0
  111. package/src/lib/intents.js +16 -0
  112. package/src/lib/logger.js +6 -0
  113. package/src/lib/middlewares/appsI18n.js +57 -0
  114. package/src/lib/realtime.js +43 -0
  115. package/src/lib/reducers/apps.js +175 -0
  116. package/src/lib/reducers/apps.spec.js +59 -0
  117. package/src/lib/reducers/content.js +50 -0
  118. package/src/lib/reducers/context.js +83 -0
  119. package/src/lib/reducers/index.js +73 -0
  120. package/src/lib/reducers/locale.js +22 -0
  121. package/src/lib/reducers/settings.js +111 -0
  122. package/src/lib/reducers/theme.js +48 -0
  123. package/src/lib/reducers/unserializable.js +26 -0
  124. package/src/lib/stack-client.js +401 -0
  125. package/src/lib/stack.js +79 -0
  126. package/src/lib/store/index.js +54 -0
  127. package/src/locales/de.json +57 -0
  128. package/src/locales/en.json +57 -0
  129. package/src/locales/es.json +57 -0
  130. package/src/locales/fr.json +57 -0
  131. package/src/locales/it.json +57 -0
  132. package/src/locales/ja.json +57 -0
  133. package/src/locales/nl_NL.json +57 -0
  134. package/src/locales/pl.json +57 -0
  135. package/src/locales/ru.json +57 -0
  136. package/src/locales/sq.json +57 -0
  137. package/src/locales/zh_CN.json +57 -0
  138. package/src/proptypes/index.js +10 -0
  139. package/src/queries/index.js +16 -0
  140. package/src/styles/apps.css +248 -0
  141. package/src/styles/banner.css +64 -0
  142. package/src/styles/bar.css +106 -0
  143. package/src/styles/base.css +41 -0
  144. package/src/styles/claudy.css +99 -0
  145. package/src/styles/drawer.css +126 -0
  146. package/src/styles/index.styl +33 -0
  147. package/src/styles/indicators.css +58 -0
  148. package/src/styles/nav.css +81 -0
  149. package/src/styles/navigation_item.css +39 -0
  150. package/src/styles/searchbar.css +158 -0
  151. package/src/styles/settings.css +44 -0
  152. package/src/styles/storage.css +22 -0
  153. package/src/styles/supportModal.css +20 -0
  154. package/src/styles/theme.styl +25 -0
  155. package/test/__mocks__/fileMock.js +3 -0
  156. package/test/__snapshots__/index.spec.js.snap +41 -0
  157. package/test/components/AppItem.spec.jsx +113 -0
  158. package/test/components/AppsContent.spec.jsx +116 -0
  159. package/test/components/Settings/helper.spec.js +23 -0
  160. package/test/components/__snapshots__/AppsContent.spec.jsx.snap +90 -0
  161. package/test/index.spec.js +24 -0
  162. package/test/jestLib/I18n.js +15 -0
  163. package/test/jestLib/setup.js +14 -0
  164. package/test/lib/__snapshots__/api.spec.jsx.snap +67 -0
  165. package/test/lib/__snapshots__/stack.spec.js.snap +3 -0
  166. package/test/lib/api.spec.jsx +142 -0
  167. package/test/lib/mockStackClient.js +7 -0
  168. package/test/lib/stack-client/stack-client.appiconprops.spec.js +65 -0
  169. package/test/lib/stack-client/stack-client.compare.spec.js +20 -0
  170. package/test/lib/stack-client/stack-client.cozyfetchjson.spec.js +46 -0
  171. package/test/lib/stack-client/stack-client.cozyurl.spec.js +29 -0
  172. package/test/lib/stack-client/stack-client.getapp.spec.js +72 -0
  173. package/test/lib/stack-client/stack-client.getapps.spec.js +72 -0
  174. package/test/lib/stack-client/stack-client.getcontext.spec.js +96 -0
  175. package/test/lib/stack-client/stack-client.getstoragedata.spec.js +85 -0
  176. package/test/lib/stack-client/stack-client.init.spec.js +56 -0
  177. package/test/lib/stack-client/stack-client.intents.spec.js +27 -0
  178. package/test/lib/stack-client/stack-client.logout.spec.js +40 -0
  179. package/test/lib/stack.spec.js +60 -0
  180. package/test/store/__snapshots__/index.spec.js.snap +14 -0
  181. package/test/store/index.spec.js +41 -0
@@ -0,0 +1,57 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("bar",[],t):"object"==typeof exports?exports.bar=t():(e.cozy=e.cozy||{},e.cozy.bar=t())}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=673)}([function(e,t,n){e.exports=window.React||n(416)},function(e,t,n){e.exports=n(427)()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){e.exports=n(334)},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(152);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t){function n(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function u(e){n(a,o,i,u,c,"next",e)}function c(e){n(a,o,i,u,c,"throw",e)}u(void 0)}))}}},function(e,t,n){var r=n(196),o=n(11);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";var r=n(32),o=n(2),i=n.n(o),a=n(13),u=n.n(a),c=function(e){return Array.from(e)[e.size-1]},s=function(){return{left:new Map,center:new Map,right:new Map,search:new Map}},l=n(75),f=["default","primary"],p={},d={name:"default",overrides:p},h=function(){return d},y={webviewContext:void 0},v=n(5),g=n.n(v),m=n(9),b=n.n(m),w=n(21),x=n(321),_=n.n(x),k=function(e,t){return t.slug===e.appSlug},O=function(e){return{type:"RECEIVE_APP_LIST",apps:e}},S=function(e){return{type:"RECEIVE_HOME_APP",homeApp:e}},E=function(e){return function(){var t=b()(g.a.mark((function t(n){var r,o,i,a,u,c;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,w.b.get.context();case 3:if(r=t.sent,o=r.data&&r.data.attributes&&r.data.attributes.default_redirection,i=null,o?(a=/^([^/]+)\/.*/,u=o.match(a),c=u&&u[1],i=T(c,e)):("home",i=T("home",e)),!i){t.next=9;break}return t.abrupt("return",n(S(i)));case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.warn("Cozy-bar cannot fetch home app data: ".concat(t.t0.message));case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()},j={apps:[],homeApp:null,isFetching:!0,appName:null,appNamePrefix:null,appSlug:null,hasFetched:!1},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_APPS":return u()({},e,{isFetching:!0});case"FETCH_APPS_FAILURE":return u()({},e,{isFetching:!1});case"RECEIVE_APP":return u()({},e,{apps:_()(e.apps,[C(t.app)],(function(e,t){return e.slug===t.slug}))});case"RECEIVE_APP_LIST":var n=t.apps.map((function(t){return u()({},t,{isCurrentApp:k(e,t)})}));return u()({},e,{isFetching:!1,hasFetched:!0,apps:n});case"RECEIVE_HOME_APP":var r=t.homeApp;return k(e,r)?u()({},e,{homeApp:u()({},r,{isCurrentApp:!0})}):u()({},e,{homeApp:r});case"DELETE_APP":return u()({},e,{apps:e.apps.filter((function(e){return e.slug!==t.app.slug}))});case"SET_INFOS":return u()({},e,{appName:t.appName,appNamePrefix:t.appNamePrefix,appSlug:t.appSlug});default:return e}},C=function(e){return u()({},e,!!(t=e.attributes)&&Object.keys(t).reduce((function(e,n){return e[n.split("_").map((function(e,t){return t?e.charAt(0).toUpperCase()+e.slice(1):e})).join("")]=t[n],e}),{}),{href:e.links&&e.links.related});var t},T=function(e,t){return t.find((function(t){return t.slug===e}))},A=function(){return function(){var e=b()(g.a.mark((function e(t){var n;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,w.b.get.storageData();case 3:return n=e.sent,e.abrupt("return",t({type:"RECEIVE_STORAGE",storageData:n}));case 7:return e.prev=7,e.t0=e.catch(0),console.warn&&console.warn("Cannot get Cozy storage informations"),e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},D=function(){return function(){var e=b()(g.a.mark((function e(t,n){var r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n().settings.settingsAppURL){e.next=2;break}return e.abrupt("return",t({type:"RECEIVE_SETTINGS_URL",settingsAppURL:n().settings.settingsAppURL}));case 2:return e.prev=2,e.next=5,w.b.get.settingsAppURL();case 5:return r=e.sent,e.abrupt("return",t({type:"RECEIVE_SETTINGS_URL",settingsAppURL:r}));case 9:return e.prev=9,e.t0=e.catch(2),console.warn("Settings app is unavailable, settings links are disabled"),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},R={contextNotExist:!1,isFetching:!1,isBusy:!1,settingsAppURL:null,storageData:null},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_SETTINGS":return u()({},e,{isFetching:!0});case"FETCH_SETTINGS_BUSY":return u()({},e,{isBusy:!0});case"FETCH_SETTINGS_SUCCESS":return u()({},e,{isFetching:!1,isBusy:!1});case"RECEIVE_NO_CONTEXT":return u()({},e,{contextNotExist:!0});case"RECEIVE_STORAGE":return u()({},e,{storageData:t.storageData});case"RECEIVE_SETTINGS_URL":return u()({},e,{settingsAppURL:t.settingsAppURL});case"LOG_OUT":return R;default:return e}},N=n(190),z=n.n(N),M=function(e){return e.claudyActions},F={claudyActions:[],contextNotExist:!1,helpLink:null,isFetching:!1},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_CONTEXT":return u()({},e,{isFetching:!0});case"FETCH_CONTEXT_SUCCESS":var n=t.context&&t.context.data&&t.context.data.attributes,r=n&&n.claudy_actions||[],o=r.map((function(e){if(z.a.hasOwnProperty(e))return Object.assign({},z.a[e],{slug:e})})).filter((function(e){return e}));return u()({},e,{helpLink:n&&n.help_link||null,claudyActions:o,isFetching:!1,contextNotExist:!1});case"RECEIVE_NO_CONTEXT":return u()({},e,{contextNotExist:!0});case"LOG_OUT":return F;default:return e}};n.d(t,"u",(function(){return B})),n.d(t,"A",(function(){return q})),n.d(t,"w",(function(){return H})),n.d(t,"x",(function(){return W})),n.d(t,"y",(function(){return Q})),n.d(t,"a",(function(){return $})),n.d(t,"v",(function(){return G})),n.d(t,"c",(function(){return V})),n.d(t,"q",(function(){return J})),n.d(t,"b",(function(){return Y})),n.d(t,"e",(function(){return K})),n.d(t,"g",(function(){return X})),n.d(t,"j",(function(){return Z})),n.d(t,"d",(function(){return ee})),n.d(t,"f",(function(){return te})),n.d(t,"n",(function(){return ne})),n.d(t,"m",(function(){return re})),n.d(t,"l",(function(){return oe})),n.d(t,"i",(function(){return ie})),n.d(t,"h",(function(){return ae})),n.d(t,"p",(function(){return ue})),n.d(t,"o",(function(){return ce})),n.d(t,"z",(function(){return se})),n.d(t,"k",(function(){return le})),n.d(t,"r",(function(){return fe})),n.d(t,"s",(function(){return pe})),n.d(t,"t",(function(){return de}));var U=function(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.apply(void 0,[n[e]].concat(o))}},B=function(e,t,n){return{type:"SET_CONTENT",location:e,content:t,id:n}},q=function(e,t){return{type:"UNSET_CONTENT",location:e,id:t}},H=l.d,W=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return{type:"SET_THEME",theme:{name:e,overrides:t}}},Q=function(e){return{type:"SET_WEBVIEW_CONTEXT",payload:e}},$=function(){return function(){var e=b()(g.a.mark((function e(t){var n,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t({type:"FETCH_APPS"}),e.next=4,w.b.get.apps();case 4:if(n=e.sent,r=n.map(C),n.length){e.next=8;break}throw new Error("No installed apps found by the bar");case 8:return e.next=10,t(E(r));case 10:return e.next=12,t(O(r));case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),t({type:"FETCH_APPS_FAILURE"}),console.warn(e.t0.message?e.t0.message:e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t){return e.apply(this,arguments)}}()},G=function(e,t,n){return{type:"SET_INFOS",appName:e,appNamePrefix:t,appSlug:n}},V=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(){var t=b()(g.a.mark((function t(n){var r;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"FETCH_SETTINGS"}),r=setTimeout((function(){e&&n({type:"FETCH_SETTINGS_BUSY"})}),450),t.next=4,n(A());case 4:return t.next=6,n(D());case 6:clearTimeout(r),n({type:"FETCH_SETTINGS_SUCCESS"});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},J=function(){return function(){var e=b()(g.a.mark((function e(t){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:"LOG_OUT"}),e.prev=1,e.next=4,w.b.logout();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),console.warn("Error while logging out in the cozy-bar",e.t0);case 9:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()},Y=function(){return function(){var e=b()(g.a.mark((function e(t,n){var r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t({type:"FETCH_CONTEXT"}),!n().context.contextNotExist){e.next=3;break}return e.abrupt("return",t({type:"FETCH_CONTEXT_SUCCESS",context:null}));case 3:return e.prev=3,e.next=6,w.b.get.context();case 6:return r=e.sent,e.abrupt("return",t({type:"FETCH_CONTEXT_SUCCESS",context:r}));case 10:return e.prev=10,e.t0=e.catch(3),e.t0.status&&404===e.t0.status&&t({type:"RECEIVE_NO_CONTEXT"}),console.warn("Cannot get Cozy context"),e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(t,n){return e.apply(this,arguments)}}()},K=U("content",(function(e,t){return c(e[t])&&c(e[t])[1]})),X=U("locale",l.b),Z=U("theme",(function(e){return e})),ee=U("apps",(function(e){return e.apps?e.apps:[]})),te=U("apps",(function(e){return e.homeApp})),ne=U("apps",(function(e){return!!e&&e.isFetching})),re=U("apps",k),oe=U("apps",(function(e){return e.hasFetched})),ie=U("settings",(function(e){return e.storageData})),ae=U("settings",(function(e){return e.settingsAppURL})),ue=U("settings",(function(e){return e.isBusy})),ce=U("settings",(function(e){return e.isFetching})),se=(U("context",(function(e){return e.helpLink})),U("context",M),U("context",(function(e){var t=M(e);return!!t&&!!t.length}))),le=U("unserializable",(function(e){return e.webviewContext})),fe=function(e){return{type:"RECEIVE_APP",app:e}},pe=function(e){return{type:"DELETE_APP",app:e}},de={apps:P,content:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s(),t=arguments.length>1?arguments[1]:void 0;if(!t.location||void 0===typeof t.id)return e;switch(t.type){case"SET_CONTENT":var n=e[t.location];return n.set(t.id,t.content),u()({},e,i()({},t.location,n));case"UNSET_CONTENT":var r=e[t.location];return r.get(t.id)?(r.delete(t.id),u()({},e,i()({},t.location,r))):e;default:return e}},context:L,locale:l.c,settings:I,theme:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h(),t=arguments.length>1?arguments[1]:void 0;return"SET_THEME"===t.type?f.includes(t.theme.name)?t.theme:u()({},t.theme,{name:"default"}):e},unserializable:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_WEBVIEW_CONTEXT":return u()({},e,{webviewContext:t.payload});default:return e}}};Object(r.c)(de)},function(e,t,n){var r=n(2);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}},function(e,t,n){var r;
2
+ /*!
3
+ Copyright (c) 2017 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var u in r)n.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){e.exports={"CozyTheme--normal":"cozy-ui-bar-CozyTheme--normal--GgDII","c-modal":"cozy-ui-bar-c-modal--2ICub","c-modal-content":"cozy-ui-bar-c-modal-content--KVDws","c-modal-header":"cozy-ui-bar-c-modal-header--XED91","c-modal-header--branded":"cozy-ui-bar-c-modal-header--branded--uEj-8","c-modal-footer":"cozy-ui-bar-c-modal-footer--14fzp","c-modal-container":"cozy-ui-bar-c-modal-container--30qmf","c-modal-wrapper":"cozy-ui-bar-c-modal-wrapper--17kzj","c-modal--xsmall":"cozy-ui-bar-c-modal--xsmall--35998","c-modal--small":"cozy-ui-bar-c-modal--small--3G05m","c-modal--medium":"cozy-ui-bar-c-modal--medium--39Q8p","c-modal--large":"cozy-ui-bar-c-modal--large--NVdKg","c-modal--xlarge":"cozy-ui-bar-c-modal--xlarge--2JDmw","c-modal--xxlarge":"cozy-ui-bar-c-modal--xxlarge--2GW6J","c-modal-illu-header":"cozy-ui-bar-c-modal-illu-header--2k0gQ","c-modal-illu-header--ghost":"cozy-ui-bar-c-modal-illu-header--ghost--3zgoT","is-active":"cozy-ui-bar-is-active--M5uQG","c-modal--small-spacing":"cozy-ui-bar-c-modal--small-spacing--2NmIi","c-modal--large-spacing":"cozy-ui-bar-c-modal--large-spacing--oIddB","c-modal-app":"cozy-ui-bar-c-modal-app--1Vluy","c-app-editor":"cozy-ui-bar-c-app-editor--2Ha3Y","c-modal-app-icon":"cozy-ui-bar-c-modal-app-icon--2Pyc-","c-modal-content-fixed":"cozy-ui-bar-c-modal-content-fixed--2C_-7","c-modal-footer--button":"cozy-ui-bar-c-modal-footer--button--3yPje","c-modal-section":"cozy-ui-bar-c-modal-section--2tQ5k","c-modal-close":"cozy-ui-bar-c-modal-close--HM_QO","c-modal--closable":"cozy-ui-bar-c-modal--closable--2sytJ","c-modal-close--notitle":"cozy-ui-bar-c-modal-close--notitle--2a-O4","c-modal--overflowHidden":"cozy-ui-bar-c-modal--overflowHidden--JNfIY","c-modal-back-button":"cozy-ui-bar-c-modal-back-button--aTdxE","c-modal-wrapper--fullscreen":"cozy-ui-bar-c-modal-wrapper--fullscreen--12m40","c-modal--fullscreen":"cozy-ui-bar-c-modal--fullscreen--1k9gf",spin:"cozy-ui-bar-spin--1NeSh",shake:"cozy-ui-bar-shake--8T61M"}},function(e,t,n){var r=n(110);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){var r=n(196);function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var u=i?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(n,a,u):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.QueryDefinition=t.MutationTypes=t.Mutations=t.getDoctypeFromOperation=t.uploadFile=t.removeReferencedBy=t.addReferencedBy=t.removeReferencesTo=t.addReferencesTo=t.deleteDocument=t.updateDocuments=t.updateDocument=t.createDocument=t.isAGetByIdQuery=t.Q=void 0;var o=r(n(2)),i=r(n(3)),a=r(n(7)),u=r(n(22)),c=r(n(490));n(19);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,e),this.doctype=t.doctype,this.id=t.id,this.ids=t.ids,this.selector=t.selector,this.fields=t.fields,this.indexedFields=t.indexedFields,this.partialFilter=t.partialFilter,this.sort=t.sort,this.includes=t.includes,this.referenced=t.referenced,this.limit=t.limit,this.skip=t.skip,this.cursor=t.cursor,this.bookmark=t.bookmark}return(0,a.default)(e,[{key:"checkSortOrder",value:function(e){var t=e.sort,n=e.selector,r=e.indexedFields,o=this.sort||t,i=this.selector||n||{},a=this.indexedFields||r;if(o){var u=a||Object.keys(i);if(u&&!(u.length<1))if(o.length>u.length)console.warn("You should not sort on non-indexed fields.\n\n Sort: ".concat(JSON.stringify(o),"\n\n Indexed fields: ").concat(u));else for(var c=0;c<o.length;c++)if(Object.keys(o[c])[0]!==u[c])return void console.warn("The sort order should be the same than the indexed fields.\n\n Sort: ".concat(JSON.stringify(o),"\n\n Indexed fields: ").concat(u,"\n"))}}},{key:"checkSelector",value:function(e){(0,c.default)(e,["$exists",!1])&&console.warn('The "$exists: false" predicate should be defined as a partial index for better performance.\n\n Selector: '.concat(e)),(0,c.default)(e,"$ne")&&console.info("The use of the $ne operator is more efficient with a partial index.\n\n Selector: ".concat(e))}},{key:"getById",value:function(t){if(!t)throw new Error("getById called with undefined id");return new e(l(l({},this.toDefinition()),{},{id:t}))}},{key:"getByIds",value:function(t){return new e(l(l({},this.toDefinition()),{},{ids:t}))}},{key:"where",value:function(t){return this.checkSortOrder({selector:t}),this.checkSelector(t),new e(l(l({},this.toDefinition()),{},{selector:t}))}},{key:"select",value:function(t){return new e(l(l({},this.toDefinition()),{},{fields:t}))}},{key:"indexFields",value:function(t){return this.checkSortOrder({indexedFields:t}),new e(l(l({},this.toDefinition()),{},{indexedFields:t}))}},{key:"partialIndex",value:function(t){return new e(l(l({},this.toDefinition()),{},{partialFilter:t}))}},{key:"sortBy",value:function(t){if(!(0,u.default)(t))throw new Error('Invalid sort, should be an array ([{ label: "desc"}, { name: "asc"}]), you passed '.concat(JSON.stringify(t),"."));return this.checkSortOrder({sort:t}),new e(l(l({},this.toDefinition()),{},{sort:t}))}},{key:"include",value:function(t){if(!Array.isArray(t))throw new Error("include() takes an array of relationship names");return new e(l(l({},this.toDefinition()),{},{includes:t}))}},{key:"limitBy",value:function(t){return new e(l(l({},this.toDefinition()),{},{limit:t}))}},{key:"UNSAFE_noLimit",value:function(){return new e(l(l({},this.toDefinition()),{},{limit:null}))}},{key:"offset",value:function(t){return new e(l(l({},this.toDefinition()),{},{bookmark:void 0,cursor:void 0,skip:t}))}},{key:"offsetCursor",value:function(t){return new e(l(l({},this.toDefinition()),{},{bookmark:void 0,skip:void 0,cursor:t}))}},{key:"offsetBookmark",value:function(t){return new e(l(l({},this.toDefinition()),{},{skip:void 0,cursor:void 0,bookmark:t}))}},{key:"referencedBy",value:function(t){return new e(l(l({},this.toDefinition()),{},{referenced:t}))}},{key:"toDefinition",value:function(){return{doctype:this.doctype,id:this.id,ids:this.ids,selector:this.selector,fields:this.fields,indexedFields:this.indexedFields,partialFilter:this.partialFilter,sort:this.sort,includes:this.includes,referenced:this.referenced,limit:this.limit,skip:this.skip,cursor:this.cursor,bookmark:this.bookmark}}}]),e}();t.QueryDefinition=f;t.Q=function(e){return new f({doctype:e})};t.isAGetByIdQuery=function(e){if(!e)return!1;var t=Object.values(e);return 0!==t.length&&(2===t.filter((function(e){return void 0!==e})).length&&void 0!==e.id)};var p=function(e){return{mutationType:_.CREATE_DOCUMENT,document:e}};t.createDocument=p;var d=function(e){return{mutationType:_.UPDATE_DOCUMENT,document:e}};t.updateDocument=d;var h=function(e){return{mutationType:_.UPDATE_DOCUMENTS,documents:e}};t.updateDocuments=h;var y=function(e){return{mutationType:_.DELETE_DOCUMENT,document:e}};t.deleteDocument=y;var v=function(e,t){return{mutationType:_.ADD_REFERENCES_TO,referencedDocuments:t,document:e}};t.addReferencesTo=v;var g=function(e,t){return{mutationType:_.REMOVE_REFERENCES_TO,referencedDocuments:t,document:e}};t.removeReferencesTo=g;var m=function(e,t){return{mutationType:_.ADD_REFERENCED_BY,referencedDocuments:t,document:e}};t.addReferencedBy=m;var b=function(e,t){return{mutationType:_.REMOVE_REFERENCED_BY,referencedDocuments:t,document:e}};t.removeReferencedBy=b;var w=function(e,t){return{mutationType:_.UPLOAD_FILE,file:e,dirPath:t}};t.uploadFile=w;t.getDoctypeFromOperation=function(e){if(!e.mutationType)return e.doctype;var t=e.mutationType;switch(t){case"CREATE_DOCUMENT":case"UPDATE_DOCUMENT":return e.document._type;case"UPDATE_DOCUMENTS":return e.documents[0]._type;case"DELETE_DOCUMENT":return e.document._type;case"ADD_REFERENCES_TO":case"UPLOAD_FILE":throw new Error("Not implemented");default:throw new Error("Unknown mutationType ".concat(t))}};var x={createDocument:p,updateDocument:d,updateDocuments:h,deleteDocument:y,addReferencesTo:v,removeReferencesTo:g,addReferencedBy:m,removeReferencedBy:b,uploadFile:w};t.Mutations=x;var _={CREATE_DOCUMENT:"CREATE_DOCUMENT",UPDATE_DOCUMENT:"UPDATE_DOCUMENT",UPDATE_DOCUMENTS:"UPDATE_DOCUMENTS",DELETE_DOCUMENT:"DELETE_DOCUMENT",ADD_REFERENCES_TO:"ADD_REFERENCES_TO",REMOVE_REFERENCES_TO:"REMOVE_REFERENCES_TO",ADD_REFERENCED_BY:"ADD_REFERENCED_BY",REMOVE_REFERENCED_BY:"REMOVE_REFERENCED_BY",UPLOAD_FILE:"UPLOAD_FILE"};t.MutationTypes=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;n(18);t.default={}},function(e,t,n){"use strict";n.r(t);var r=n(26),o=n.n(r),i=n(3),a=n.n(i),u=n(7),c=n.n(u),s=n(11),l=n.n(s),f=n(8),p=n.n(f),d=n(10),h=n.n(d),y=n(6),v=n.n(y),g=n(2),m=n.n(g),b=n(0),w=n.n(b),x=n(1),_=n.n(x),k=n(94),O=n(323),S=n.n(O),E=function(e){return'The "'.concat(e,"\" locale isn't supported by date-fns. or has not been included in the build. Check if you have configured a ContextReplacementPlugin that is too restrictive.")};function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}n.d(t,"DEFAULT_LANG",(function(){return P})),n.d(t,"I18nContext",(function(){return C})),n.d(t,"I18n",(function(){return D})),n.d(t,"translate",(function(){return R})),n.d(t,"useI18n",(function(){return I})),n.d(t,"initTranslation",(function(){return k.b})),n.d(t,"extend",(function(){return k.a}));var P="en",C=w.a.createContext(),T=function(e){p()(r,e);var t=j(r);function r(e){var n;return a()(this,r),n=t.call(this,e),m()(l()(n),"UNSAFE_componentWillReceiveProps",(function(e){e.lang!==n.props.lang&&n.init(e)})),n.init(n.props),n}return c()(r,[{key:"init",value:function(e){var t=e.polyglot,r=e.lang,o=e.dictRequire,i=e.context,a=e.defaultLang;this.translator=t||Object(k.b)(r,o,i,a),this.format=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P,r={};try{r[t]=n(229)("./".concat(t,"/index.js"))}catch(e){console.warn(E(t))}if(e&&e!==t)try{r[e]=n(229)("./".concat(e,"/index.js"))}catch(t){console.warn(E(e))}return function(t,n){return S()(t,n,{locale:r[e]})}}(r,a),this.t=this.translator.t.bind(this.translator),this.contextValue=this.getContextValue()}},{key:"getContextValue",value:function(){return{t:this.t,f:this.format,lang:this.props.lang}}},{key:"getChildContext",value:function(){return this.contextValue}},{key:"render",value:function(){return w.a.createElement(C.Provider,{value:this.contextValue},this.props.children)}}]),r}(b.Component);T.propTypes={lang:_.a.string.isRequired,polyglot:_.a.object,dictRequire:_.a.func,context:_.a.string,defaultLang:_.a.string},T.defaultProps={defaultLang:P},T.childContextTypes={t:_.a.func,f:_.a.func,lang:_.a.string};var A=function(e){p()(n,e);var t=j(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"componentWillReceiveProps",value:function(e){this.UNSAFE_componentWillReceiveProps(e)}}]),n}(T),D=Object({USE_REACT:!0}).USE_PREACT?A:T,R=function(){return function(e){var t=function(t){var n=Object(b.useContext)(C);return w.a.createElement(e,o()({},t,{t:n&&n.t,f:n&&n.f,lang:n&&n.lang}))};return t.displayName="withI18n(".concat(e.displayName||e.name,")"),t}},I=function(){return Object(b.useContext)(C)};t.default=D},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return c}));var r,o=n(126),i=function(){if(!r)throw new Error("client not initialized in cozy-bar");return r},a={init:function(e){return(r=o.b).init(e)},get:{app:function(){var e;return(e=i().get).app.apply(e,arguments)},apps:function(){var e;return(e=i().get).apps.apply(e,arguments)},context:function(){var e;return(e=i().get).context.apply(e,arguments)},storageData:function(){var e;return(e=i().get).storageData.apply(e,arguments)},iconProps:function(){var e;return(e=i().get).iconProps.apply(e,arguments)},cozyURL:function(){var e;return(e=i().get).cozyURL.apply(e,arguments)},settingsAppURL:function(){var e;return(e=i().get).settingsAppURL.apply(e,arguments)}},updateAccessToken:function(){var e;return(e=i()).updateAccessToken.apply(e,arguments)},logout:function(){var e;return(e=i()).logout.apply(e,arguments)},cozyFetchJSON:function(){var e;return(e=i()).cozyFetchJSON.apply(e,arguments)},getStack:i,getIntents:function(){return i().get.intents()}};t.b=a;var u=a.cozyFetchJSON,c=a.getIntents},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"checkApp",{enumerable:!0,get:function(){return i.checkApp}}),Object.defineProperty(t,"getDeviceName",{enumerable:!0,get:function(){return o.getDeviceName}}),Object.defineProperty(t,"getPlatform",{enumerable:!0,get:function(){return r.getPlatform}}),Object.defineProperty(t,"hasDevicePlugin",{enumerable:!0,get:function(){return a.hasDevicePlugin}}),Object.defineProperty(t,"hasInAppBrowserPlugin",{enumerable:!0,get:function(){return a.hasInAppBrowserPlugin}}),Object.defineProperty(t,"hasNetworkInformationPlugin",{enumerable:!0,get:function(){return a.hasNetworkInformationPlugin}}),Object.defineProperty(t,"hasSafariPlugin",{enumerable:!0,get:function(){return a.hasSafariPlugin}}),Object.defineProperty(t,"isAndroid",{enumerable:!0,get:function(){return r.isAndroid}}),Object.defineProperty(t,"isAndroidApp",{enumerable:!0,get:function(){return r.isAndroidApp}}),Object.defineProperty(t,"isCordova",{enumerable:!0,get:function(){return u.isCordova}}),Object.defineProperty(t,"isFlagshipApp",{enumerable:!0,get:function(){return r.isFlagshipApp}}),Object.defineProperty(t,"isIOS",{enumerable:!0,get:function(){return r.isIOS}}),Object.defineProperty(t,"isIOSApp",{enumerable:!0,get:function(){return r.isIOSApp}}),Object.defineProperty(t,"isMobile",{enumerable:!0,get:function(){return r.isMobile}}),Object.defineProperty(t,"isMobileApp",{enumerable:!0,get:function(){return r.isMobileApp}}),Object.defineProperty(t,"isWebApp",{enumerable:!0,get:function(){return r.isWebApp}}),Object.defineProperty(t,"nativeLinkOpen",{enumerable:!0,get:function(){return c.nativeLinkOpen}}),Object.defineProperty(t,"openDeeplinkOrRedirect",{enumerable:!0,get:function(){return s.openDeeplinkOrRedirect}}),Object.defineProperty(t,"startApp",{enumerable:!0,get:function(){return i.startApp}});var r=n(131),o=n(335),i=n(343),a=n(134),u=n(97),c=n(344),s=n(345)},function(e,t,n){var r=n(197),o=n(352),i=n(136),a=n(199);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()}},function(e,t,n){var r=n(452);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";var r=SyntaxError,o=Function,i=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var c=function(){throw new i},s=u?function(){try{return c}catch(e){try{return u(arguments,"callee").get}catch(e){return c}}}():c,l=n(155)(),f=Object.getPrototypeOf||function(e){return e.__proto__},p={},d="undefined"==typeof Uint8Array?void 0:f(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":l?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?f(""[Symbol.iterator]()):void 0,"%Symbol%":l?Symbol:void 0,"%SyntaxError%":r,"%ThrowTypeError%":s,"%TypedArray%":d,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=n(83),g=n(154),m=v.call(Function.call,Array.prototype.concat),b=v.call(Function.apply,Array.prototype.splice),w=v.call(Function.call,String.prototype.replace),x=v.call(Function.call,String.prototype.slice),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,O=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return w(e,_,(function(e,t,n,r){o[o.length]=n?w(r,k,"$1"):t||e})),o},S=function(e,t){var n,o=e;if(g(y,o)&&(o="%"+(n=y[o])[0]+"%"),g(h,o)){var u=h[o];if(u===p&&(u=function e(t){var n;if("%AsyncFunction%"===t)n=a("async function () {}");else if("%GeneratorFunction%"===t)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=a("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=f(o.prototype))}return h[t]=n,n}(o)),void 0===u&&!t)throw new i("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:u}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new i('"allowMissing" argument must be a boolean');var n=O(e),o=n.length>0?n[0]:"",a=S("%"+o+"%",t),c=a.name,s=a.value,l=!1,f=a.alias;f&&(o=f[0],b(n,m([0,1],f)));for(var p=1,d=!0;p<n.length;p+=1){var y=n[p],v=x(y,0,1),w=x(y,-1);if(('"'===v||"'"===v||"`"===v||'"'===w||"'"===w||"`"===w)&&v!==w)throw new r("property names with quotes must have matching quotes");if("constructor"!==y&&d||(l=!0),g(h,c="%"+(o+="."+y)+"%"))s=h[c];else if(null!=s){if(!(y in s)){if(!t)throw new i("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&p+1>=n.length){var _=u(s,y);s=(d=!!_)&&"get"in _&&!("originalValue"in _.get)?_.get:s[y]}else d=g(s,y),s=s[y];d&&!l&&(h[c]=s)}}return s}},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0});var i={CozyLink:!0,StackLink:!0,compose:!0,QueryDefinition:!0,Q:!0,Mutations:!0,MutationTypes:!0,getDoctypeFromOperation:!0,Association:!0,HasMany:!0,HasOne:!0,HasOneInPlace:!0,HasManyInPlace:!0,HasManyTriggers:!0,isReferencedBy:!0,isReferencedById:!0,getReferencedBy:!0,getReferencedById:!0,dehydrate:!0,generateWebLink:!0,rootCozyUrl:!0,InvalidCozyUrlError:!0,InvalidProtocolError:!0,cancelable:!0,isQueryLoading:!0,hasQueryBeenLoaded:!0,getQueryFromState:!0,Registry:!0,RealTimeQueries:!0,manifest:!0,CozyProvider:!0,withMutation:!0,withMutations:!0,Query:!0,queryConnect:!0,queryConnectFlat:!0,withClient:!0,models:!0,fetchPolicies:!0,BulkEditError:!0};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"CozyLink",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"StackLink",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"compose",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"QueryDefinition",{enumerable:!0,get:function(){return l.QueryDefinition}}),Object.defineProperty(t,"Q",{enumerable:!0,get:function(){return l.Q}}),Object.defineProperty(t,"Mutations",{enumerable:!0,get:function(){return l.Mutations}}),Object.defineProperty(t,"MutationTypes",{enumerable:!0,get:function(){return l.MutationTypes}}),Object.defineProperty(t,"getDoctypeFromOperation",{enumerable:!0,get:function(){return l.getDoctypeFromOperation}}),Object.defineProperty(t,"Association",{enumerable:!0,get:function(){return f.Association}}),Object.defineProperty(t,"HasMany",{enumerable:!0,get:function(){return f.HasMany}}),Object.defineProperty(t,"HasOne",{enumerable:!0,get:function(){return f.HasOne}}),Object.defineProperty(t,"HasOneInPlace",{enumerable:!0,get:function(){return f.HasOneInPlace}}),Object.defineProperty(t,"HasManyInPlace",{enumerable:!0,get:function(){return f.HasManyInPlace}}),Object.defineProperty(t,"HasManyTriggers",{enumerable:!0,get:function(){return f.HasManyTriggers}}),Object.defineProperty(t,"isReferencedBy",{enumerable:!0,get:function(){return p.isReferencedBy}}),Object.defineProperty(t,"isReferencedById",{enumerable:!0,get:function(){return p.isReferencedById}}),Object.defineProperty(t,"getReferencedBy",{enumerable:!0,get:function(){return p.getReferencedBy}}),Object.defineProperty(t,"getReferencedById",{enumerable:!0,get:function(){return p.getReferencedById}}),Object.defineProperty(t,"dehydrate",{enumerable:!0,get:function(){return d.dehydrate}}),Object.defineProperty(t,"generateWebLink",{enumerable:!0,get:function(){return d.generateWebLink}}),Object.defineProperty(t,"rootCozyUrl",{enumerable:!0,get:function(){return d.rootCozyUrl}}),Object.defineProperty(t,"InvalidCozyUrlError",{enumerable:!0,get:function(){return d.InvalidCozyUrlError}}),Object.defineProperty(t,"InvalidProtocolError",{enumerable:!0,get:function(){return d.InvalidProtocolError}}),Object.defineProperty(t,"cancelable",{enumerable:!0,get:function(){return h.cancelable}}),Object.defineProperty(t,"isQueryLoading",{enumerable:!0,get:function(){return h.isQueryLoading}}),Object.defineProperty(t,"hasQueryBeenLoaded",{enumerable:!0,get:function(){return h.hasQueryBeenLoaded}}),Object.defineProperty(t,"getQueryFromState",{enumerable:!0,get:function(){return y.getQueryFromState}}),Object.defineProperty(t,"Registry",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"RealTimeQueries",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"CozyProvider",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"withMutation",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"withMutations",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"Query",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"queryConnect",{enumerable:!0,get:function(){return k.queryConnect}}),Object.defineProperty(t,"queryConnectFlat",{enumerable:!0,get:function(){return k.queryConnectFlat}}),Object.defineProperty(t,"withClient",{enumerable:!0,get:function(){return k.withClient}}),Object.defineProperty(t,"fetchPolicies",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"BulkEditError",{enumerable:!0,get:function(){return P.BulkEditError}}),t.models=t.manifest=void 0;var a=o(n(40)),u=o(n(173)),c=o(n(263)),s=o(n(566)),l=n(18),f=n(120),p=n(178),d=n(179),h=n(572),y=n(60),v=o(n(165)),g=o(n(573)),m=r(n(574));t.manifest=m;var b=o(n(575)),w=o(n(576)),x=o(n(577)),_=o(n(288)),k=n(578),O=r(n(580));t.models=O;var S=o(n(283)),E=n(645);Object.keys(E).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===E[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return E[e]}}))}));var j=n(646);Object.keys(j).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===j[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return j[e]}}))}));var P=n(264)},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeDoc=M,t.normalizeDoctype=t.default=void 0;var i=o(n(31)),a=o(n(25)),u=o(n(5)),c=o(n(45)),s=o(n(9)),l=o(n(3)),f=o(n(7)),p=o(n(2)),d=o(n(251)),h=n(42),y=o(n(119)),v=o(n(73)),g=o(n(253)),m=o(n(495)),b=o(n(499)),w=n(256),x=r(n(71)),_=r(n(170));n(58);function k(){var e=(0,c.default)(["/data/","/_design/","/copy?rev=",""]);return k=function(){return e},e}function O(){var e=(0,c.default)(["/data/","/_design/","?rev=",""]);return O=function(){return e},e}function S(){var e=(0,c.default)(["/data/","/_design_docs?include_docs=true"]);return S=function(){return e},e}function E(){var e=(0,c.default)(["/data/","/_index"]);return E=function(){return e},e}function j(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(){var e=(0,c.default)(["/data/","/","?rev=",""]);return C=function(){return e},e}function T(){var e=(0,c.default)(["/data/","/",""]);return T=function(){return e},e}function A(){var e=(0,c.default)(["/data/","/",""]);return A=function(){return e},e}function D(){var e=(0,c.default)(["/data/","/_all_docs?include_docs=true"]);return D=function(){return e},e}function R(){var e=(0,c.default)(["/data/","/_find"]);return R=function(){return e},e}function I(){var e=(0,c.default)(["/data/","/",""]);return I=function(){return e},e}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){(0,p.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e._id||e.id;return z({id:n,_id:n,_type:t},e)}var F=function(e){return Object.assign({},(0,v.default)(e,"_type"),{_deleted:!0})},L=function(){function e(t,n){(0,l.default)(this,e),this.doctype=t,this.stackClient=n,this.indexes={},this.endpoint="/data/".concat(this.doctype,"/")}var t,n,r,o,c,P,N,L,U,B,q,H,W,Q,$,G,V,J,Y,K,X;return(0,f.default)(e,[{key:"all",value:(X=(0,s.default)(u.default.mark((function e(){var t,n,r,o,i,a,c,s,l,f,p,d,y,v,g,b=this,w=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=w.length>0&&void 0!==w[0]?w[0]:{},n=t.limit,r=void 0===n?100:n,o=t.skip,i=void 0===o?0:o,a=t.bookmark,c=t.keys,l=(s=!!c||null===r)?"_all_docs":"_normal_docs",f=(0,h.uri)(I(),this.doctype,l),p={include_docs:!0,limit:r,skip:i,keys:c,bookmark:a},d=_.buildURL(f,p),e.prev=7,e.next=10,this.stackClient.fetchJSON("GET",d);case 10:y=e.sent,e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(7),e.abrupt("return",(0,x.dontThrowNotFoundError)(e.t0));case 16:return v=s?y.rows.filter((function(e){return e&&null!==e.doc&&!e.error&&!(0,m.default)(e.id,"_design")})).map((function(e){return M(e.doc,b.doctype)})):y.rows.map((function(e){return M(e,b.doctype)})),g=a?y.rows.length>=r:i+y.rows.length<y.total_rows,e.abrupt("return",{data:v,meta:{count:s?v.length:y.total_rows},skip:i,bookmark:y.bookmark,next:g});case 19:case"end":return e.stop()}}),e,this,[[7,13]])}))),function(){return X.apply(this,arguments)})},{key:"fetchDocumentsWithMango",value:(K=(0,s.default)(u.default.mark((function e(t,n){var r,o=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]?o[2]:{},e.abrupt("return",this.stackClient.fetchJSON("POST",t,this.toMangoOptions(n,r)));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"migrateUnamedIndex",value:(Y=(0,s.default)(u.default.mark((function e(t,n){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.copyIndex(t,n);case 3:return e.next=5,this.destroyIndex(t);case 5:e.next=16;break;case 7:if(e.prev=7,e.t0=e.catch(0),(0,x.isDocumentUpdateConflict)(e.t0)){e.next=11;break}throw e.t0;case 11:return(0,h.sleep)(1e3),e.next=14,this.copyIndex(t,n);case 14:return e.next=16,this.destroyIndex(t);case 16:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return Y.apply(this,arguments)})},{key:"handleMissingIndex",value:(J=(0,s.default)(u.default.mark((function e(t,n){var r,o,i,a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.indexedFields,o=n.partialFilter,r||(r=(0,w.getIndexFields)({sort:n.sort,selector:t})),e.next=4,this.findExistingIndex(t,n);case 4:if(i=e.sent,a=(0,w.getIndexNameFromFields)(r),i){e.next=11;break}return e.next=9,this.createIndex(r,{partialFilter:o,indexName:a});case 9:e.next=17;break;case 11:if(i._id==="_design/".concat(a)){e.next=16;break}return e.next=14,this.migrateUnamedIndex(i,a);case 14:e.next=17;break;case 16:throw new Error("Index unusable for query, index used: ".concat(a));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return J.apply(this,arguments)})},{key:"findWithMango",value:(V=(0,s.default)(u.default.mark((function e(t,n){var r,o,i=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},e.prev=1,e.next=4,this.fetchDocumentsWithMango(t,n,r);case 4:o=e.sent,e.next=18;break;case 7:if(e.prev=7,e.t0=e.catch(1),(0,x.isIndexNotFoundError)(e.t0)||(0,x.isNoUsableIndexError)(e.t0)){e.next=13;break}throw e.t0;case 13:return e.next=15,this.handleMissingIndex(n,r);case 15:return e.next=17,this.fetchDocumentsWithMango(t,n,r);case 17:o=e.sent;case 18:return e.abrupt("return",o);case 19:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e,t){return V.apply(this,arguments)})},{key:"find",value:(G=(0,s.default)(u.default.mark((function e(t){var n,r,o,i,a,c=this,s=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=n.skip,o=void 0===r?0:r,e.prev=2,a=(0,h.uri)(R(),this.doctype),e.next=6,this.findWithMango(a,t,n);case 6:i=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",(0,x.dontThrowNotFoundError)(e.t0));case 12:return e.abrupt("return",{data:i.docs.map((function(e){return M(e,c.doctype)})),next:i.next,skip:o,bookmark:i.bookmark,execution_stats:i.execution_stats});case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return G.apply(this,arguments)})},{key:"get",value:($=(0,s.default)(u.default.mark((function e(t){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",x.default.get(this.stackClient,"".concat(this.endpoint).concat(encodeURIComponent(t)),{normalize:this.constructor.normalizeDoctype(this.doctype)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return $.apply(this,arguments)})},{key:"getAll",value:(Q=(0,s.default)(u.default.mark((function e(t){var n,r,o=this;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.stackClient.fetchJSON("POST",(0,h.uri)(D(),this.doctype),{keys:t});case 3:n=e.sent,e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",(0,x.dontThrowNotFoundError)(e.t0));case 9:return r=n.rows.filter((function(e){return e.doc})),e.abrupt("return",{data:r.map((function(e){return M(e.doc,o.doctype)})),meta:{count:r.length}});case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return Q.apply(this,arguments)})},{key:"create",value:(W=(0,s.default)(u.default.mark((function e(t){var n,r,o,i,c,s;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t._id,t._type,r=(0,a.default)(t,["_id","_type"]),i=(o=!!n)?"PUT":"POST",c=(0,h.uri)(A(),this.doctype,o?n:""),e.next=6,this.stackClient.fetchJSON(i,c,r);case 6:return s=e.sent,e.abrupt("return",{data:M(s.data,this.doctype)});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return W.apply(this,arguments)})},{key:"update",value:(H=(0,s.default)(u.default.mark((function e(t){var n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("PUT",(0,h.uri)(T(),this.doctype,t._id),t);case 2:return n=e.sent,e.abrupt("return",{data:M(n.data,this.doctype)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"destroy",value:(q=(0,s.default)(u.default.mark((function e(t){var n,r,o,i;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t._id,r=t._rev,o=(0,a.default)(t,["_id","_rev"]),e.next=3,this.stackClient.fetchJSON("DELETE",(0,h.uri)(C(),this.doctype,n,r));case 3:return i=e.sent,e.abrupt("return",{data:M(z(z({},o),{},{_id:n,_rev:i.rev,_deleted:!0}),this.doctype)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return q.apply(this,arguments)})},{key:"updateAll",value:(B=(0,s.default)(u.default.mark((function e(t){var n,r,o,i,a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.stackClient,(r=t?t.map((function(e){return(0,v.default)(e,"_type")})):t)&&r.length){e.next=4;break}return e.abrupt("return",Promise.resolve([]));case 4:return e.prev=4,e.next=7,n.fetchJSON("POST","/data/".concat(this.doctype,"/_bulk_docs"),{docs:r});case 7:return o=e.sent,e.abrupt("return",o);case 11:if(e.prev=11,e.t0=e.catch(4),!e.t0.reason||!e.t0.reason.reason||"Database does not exist."!==e.t0.reason.reason){e.next=24;break}return e.next=16,this.create(r[0]);case 16:return i=e.sent,e.next=19,this.updateAll(r.slice(1));case 19:return(a=e.sent).unshift({ok:!0,id:i._id,rev:i._rev}),e.abrupt("return",a);case 24:throw e.t0;case 25:case"end":return e.stop()}}),e,this,[[4,11]])}))),function(e){return B.apply(this,arguments)})},{key:"destroyAll",value:function(e){return this.updateAll(e.map(F))}},{key:"toMangoOptions",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sort,r=t.indexedFields,o=t.fields,a=t.skip,u=void 0===a?0:a,c=t.limit,s=t.bookmark;n=(0,w.transformSort)(n),r=r||(0,w.getIndexFields)({sort:n,selector:e});var l=t.indexId||"_design/".concat((0,w.getIndexNameFromFields)(r));if(n){var f=(0,y.default)(n.map((function(e){return(0,g.default)(Object.values(e))})));if(f.length>1)throw new Error("Mango sort can only use a single order (asc or desc).");var h,v=f.length>0?(0,g.default)(f):"asc",m=j(r);try{var b=function(){var e=h.value;n.find((function(t){return(0,g.default)(Object.keys(t))===e}))||n.push((0,p.default)({},e,v))};for(m.s();!(h=m.n()).done;)b()}catch(e){m.e(e)}finally{m.f()}}var x={selector:e,use_index:l,fields:o?[].concat((0,i.default)(o),["_id","_type","class"]):void 0,limit:c,skip:u,bookmark:t.bookmark||s,sort:n,execution_stats:!!(0,d.default)("debug")||void 0};return x}},{key:"checkUniquenessOf",value:(U=(0,s.default)(u.default.mark((function e(t,n){var r,o;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUniqueIndexId(t);case 2:return r=e.sent,e.next=5,this.find((0,p.default)({},t,n),{indexId:r,fields:["_id"]});case 5:return o=e.sent,e.abrupt("return",0===o.data.length);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getUniqueIndexId",value:function(e){return this.getIndexId([e],{indexName:"".concat(this.doctype,"/").concat(e)})}},{key:"getIndexId",value:(L=(0,s.default)(u.default.mark((function e(t,n){var r,o,i,a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.partialFilter,o=n.indexName,i=void 0===o?this.getIndexNameFromFields(t):o,this.indexes[i]){e.next=20;break}return e.prev=2,e.next=5,this.createIndex(t,{partialFilter:r});case 5:a=e.sent,e.next=19;break;case 8:if(e.prev=8,e.t0=e.catch(2),(0,x.isIndexConflictError)(e.t0)){e.next=14;break}throw e.t0;case 14:return e.next=16,(0,h.sleep)(1e3);case 16:return e.next=18,this.createIndex(t,{partialFilter:r});case 18:a=e.sent;case 19:this.indexes[i]=a;case 20:return e.abrupt("return",this.indexes[i].id);case 21:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e,t){return L.apply(this,arguments)})},{key:"createIndex",value:(N=(0,s.default)(u.default.mark((function e(t){var n,r,o,i,a,c,s,l,f=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>1&&void 0!==f[1]?f[1]:{},r=n.partialFilter,o=n.indexName,i={index:{fields:t}},o&&(i.ddoc=o),r&&(i.index.partial_filter_selector=r),e.prev=4,e.next=7,this.stackClient.fetchJSON("POST",(0,h.uri)(E(),this.doctype),i);case 7:a=e.sent,e.next=17;break;case 10:if(e.prev=10,e.t0=e.catch(4),(0,x.isIndexConflictError)(e.t0)){e.next=16;break}throw e.t0;case 16:return e.abrupt("return");case 17:if(c={id:a.id,fields:t},"exists"!==a.result){e.next=20;break}return e.abrupt("return",c);case 20:return s={},t.forEach((function(e){return s[e]={$gt:null}})),l={indexId:c.id,limit:1},e.next=25,(0,h.attempt)(this.find(s,l));case 25:if(!e.sent){e.next=27;break}return e.abrupt("return",c);case 27:return e.next=29,(0,h.sleep)(1e3);case 29:return e.next=31,(0,h.attempt)(this.find(s,l));case 31:if(!e.sent){e.next=33;break}return e.abrupt("return",c);case 33:return e.next=35,(0,h.sleep)(500);case 35:return e.abrupt("return",c);case 36:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(e){return N.apply(this,arguments)})},{key:"fetchAllMangoIndexes",value:(P=(0,s.default)(u.default.mark((function e(){var t,n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,h.uri)(S(),this.doctype),e.next=3,this.stackClient.fetchJSON("GET",t);case 3:return n=e.sent,e.abrupt("return",n.rows.filter((function(e){return"query"===e.doc.language})).map((function(e){return(0,w.normalizeDesignDoc)(e)})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"destroyIndex",value:(c=(0,s.default)(u.default.mark((function e(t){var n,r,o;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t._id.split("/")[1],r=t._rev,o=(0,h.uri)(O(),this.doctype,n,r),e.abrupt("return",this.stackClient.fetchJSON("DELETE",o));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"copyIndex",value:(o=(0,s.default)(u.default.mark((function e(t,n){var r,o,i,a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t._id.split("/")[1],o=t._rev,i=(0,h.uri)(k(),this.doctype,r,o),a={headers:{Destination:"_design/".concat(n)}},e.abrupt("return",this.stackClient.fetchJSON("POST",i,null,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"findExistingIndex",value:(r=(0,s.default)(u.default.mark((function e(t,n){var r,o,i,a,c,s,l,f,p;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.sort,o=n.indexedFields,i=n.partialFilter,e.next=3,this.fetchAllMangoIndexes();case 3:if(!((a=e.sent).length<1)){e.next=6;break}return e.abrupt("return",null);case 6:r=(0,w.transformSort)(r),c=o||(0,w.getIndexFields)({sort:r,selector:t}),s=a.find((function(e){return(0,w.isMatchingIndex)(e,c,i)})),l=j(a),e.prev=10,l.s();case 12:if((f=l.n()).done){e.next=19;break}if(p=f.value,!(0,w.isInconsistentIndex)(p)){e.next=17;break}return e.next=17,this.destroyIndex(p);case 17:e.next=12;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(10),l.e(e.t0);case 24:return e.prev=24,l.f(),e.finish(24);case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}}),e,this,[[10,21,24,27]])}))),function(e,t){return r.apply(this,arguments)})},{key:"fetchChangesRaw",value:(n=(0,s.default)(u.default.mark((function e(t){var n,r,o,i,a,c;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.doc_ids&&t.doc_ids.length>0,r="?".concat([b.default.stringify(z(z({},(0,v.default)(t,["doc_ids","includeDocs"])),{},{include_docs:t.includeDocs})),n&&void 0===t.filter?"filter=_doc_ids":void 0].filter(Boolean).join("&")),o=n?"POST":"GET",i="/data/".concat(this.doctype,"/_changes").concat(r),a=n?{doc_ids:t.doc_ids}:void 0,e.next=7,this.stackClient.fetchJSON(o,i,a);case 7:return c=e.sent,e.abrupt("return",c);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"fetchChanges",value:(t=(0,s.default)(u.default.mark((function e(){var t,n,r,o,i,a,c=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},n=c.length>1&&void 0!==c[1]?c[1]:{},r={includeDocs:!0},"object"!=typeof t?(r.since=t,console.warn('fetchChanges use couchOptions as Object not a string, since is deprecated, please use fetchChanges({since: "'.concat(t,'"}).'))):Object.keys(t).length>0&&Object.assign(r,t),e.next=6,this.fetchChangesRaw(r);case 6:return o=e.sent,i=o.last_seq,a=o.results.map((function(e){return e.doc})).filter(Boolean),n.includeDesign||(a=a.filter((function(e){return 0!==e._id.indexOf("_design")}))),n.includeDeleted||(a=a.filter((function(e){return!e._deleted}))),e.abrupt("return",{newLastSeq:i,documents:a});case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"normalizeDoctype",value:function(e){return this.normalizeDoctypeRawApi(e)}},{key:"normalizeDoctypeJsonApi",value:function(e){return function(t,n){return M(t,e)}}},{key:"normalizeDoctypeRawApi",value:function(e){return function(t,n){return M(n,e)}}}]),e}(),U=L;t.default=U;var B=L.normalizeDoctype;t.normalizeDoctype=B},function(e,t,n){var r=n(453),o=n(235),i=n(136),a=n(454);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t,n){"use strict";var r=n(320),o="object"==typeof self&&self&&self.Object===Object&&self,i=(r.a||o||Function("return this")()).Symbol,a=Object.prototype,u=a.hasOwnProperty,c=a.toString,s=i?i.toStringTag:void 0;var l=function(e){var t=u.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=c.call(e);return r&&(t?e[s]=n:delete e[s]),o},f=Object.prototype.toString;var p=function(e){return f.call(e)},d=i?i.toStringTag:void 0;var h=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":d&&d in Object(e)?l(e):p(e)};var y=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var v=function(e){return null!=e&&"object"==typeof e},g=Function.prototype,m=Object.prototype,b=g.toString,w=m.hasOwnProperty,x=b.call(Object);var _=function(e){if(!v(e)||"[object Object]"!=h(e))return!1;var t=y(e);if(null===t)return!0;var n=w.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&b.call(n)==x},k=n(189),O="@@redux/INIT";function S(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(S)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],u=a,c=!1;function s(){u===a&&(u=a.slice())}function l(){return i}function f(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return s(),u.push(e),function(){if(t){t=!1,s();var n=u.indexOf(e);u.splice(n,1)}}}function p(e){if(!_(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(c)throw new Error("Reducers may not dispatch actions.");try{c=!0,i=o(i,e)}finally{c=!1}for(var t=a=u,n=0;n<t.length;n++){(0,t[n])()}return e}return p({type:O}),(r={dispatch:p,subscribe:f,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,p({type:O})}})[k.a]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[k.a]=function(){return this},e},r}function E(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function j(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i=Object.keys(n);var a=void 0;try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:O}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+O+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){a=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,o={},u=0;u<i.length;u++){var c=i[u],s=n[c],l=e[c],f=s(l,t);if(void 0===f){var p=E(c,t);throw new Error(p)}o[c]=f,r=r||f!==l}return r?o:e}}function P(e,t){return function(){return t(e.apply(void 0,arguments))}}function C(e,t){if("function"==typeof e)return P(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;o<n.length;o++){var i=n[o],a=e[i];"function"==typeof a&&(r[i]=P(a,t))}return r}function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function D(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i,a=e(n,r,o),u=a.dispatch,c={getState:a.getState,dispatch:function(e){return u(e)}};return i=t.map((function(e){return e(c)})),u=T.apply(void 0,i)(a.dispatch),A({},a,{dispatch:u})}}}n.d(t,"e",(function(){return S})),n.d(t,"c",(function(){return j})),n.d(t,"b",(function(){return C})),n.d(t,"a",(function(){return D})),n.d(t,"d",(function(){return T}))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(6),o=n(152),i=n(412),a=n(413);function u(t){var n="function"==typeof Map?new Map:void 0;return e.exports=u=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},u(t)}e.exports=u},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.r(t);var o=n(0),i=n(1),a=n.n(i),u=a.a.shape({trySubscribe:a.a.func.isRequired,tryUnsubscribe:a.a.func.isRequired,notifyNestedSubs:a.a.func.isRequired,isSubscribed:a.a.func.isRequired}),c=a.a.shape({subscribe:a.a.func.isRequired,dispatch:a.a.func.isRequired,getState:a.a.func.isRequired});function s(e){var t;void 0===e&&(e="store");var n=e+"Subscription",i=function(t){r(a,t);var i=a.prototype;function a(n,r){var o;return(o=t.call(this,n,r)||this)[e]=n.store,o}return i.getChildContext=function(){var t;return(t={})[e]=this[e],t[n]=null,t},i.render=function(){return o.Children.only(this.props.children)},a}(o.Component);return i.propTypes={store:c.isRequired,children:a.a.element.isRequired},i.childContextTypes=((t={})[e]=c.isRequired,t[n]=u,t),i}var l=s();function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var p=n(28),d=n(36),h=n(96),y=n.n(h),v=n(127),g=n.n(v),m=n(95),b={notify:function(){}};var w=function(){function e(e,t,n){this.store=e,this.parentSub=t,this.onStateChange=n,this.unsubscribe=null,this.listeners=b}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=null,e=null},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&null!==e&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=b)},e}(),x=0,_={};function k(){}function O(e,t){var n,i;void 0===t&&(t={});var a=t,s=a.getDisplayName,l=void 0===s?function(e){return"ConnectAdvanced("+e+")"}:s,h=a.methodName,v=void 0===h?"connectAdvanced":h,b=a.renderCountProp,O=void 0===b?void 0:b,S=a.shouldHandleStateChanges,E=void 0===S||S,j=a.storeKey,P=void 0===j?"store":j,C=a.withRef,T=void 0!==C&&C,A=Object(d.a)(a,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),D=P+"Subscription",R=x++,I=((n={})[P]=c,n[D]=u,n),N=((i={})[D]=u,i);return function(t){g()(Object(m.isValidElementType)(t),"You must pass a component to the function returned by "+v+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",i=l(n),a=Object(p.a)({},A,{getDisplayName:l,methodName:v,renderCountProp:O,shouldHandleStateChanges:E,storeKey:P,withRef:T,displayName:i,wrappedComponentName:n,WrappedComponent:t}),u=function(n){function u(e,t){var r;return(r=n.call(this,e,t)||this).version=R,r.state={},r.renderCount=0,r.store=e[P]||t[P],r.propsMode=Boolean(e[P]),r.setWrappedInstance=r.setWrappedInstance.bind(f(f(r))),g()(r.store,'Could not find "'+P+'" in either the context or props of "'+i+'". Either wrap the root component in a <Provider>, or explicitly pass "'+P+'" as a prop to "'+i+'".'),r.initSelector(),r.initSubscription(),r}r(u,n);var c=u.prototype;return c.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[D]=t||this.context[D],e},c.componentDidMount=function(){E&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},c.componentWillReceiveProps=function(e){this.selector.run(e)},c.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},c.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=k,this.store=null,this.selector.run=k,this.selector.shouldComponentUpdate=!1},c.getWrappedInstance=function(){return g()(T,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+v+"() call."),this.wrappedInstance},c.setWrappedInstance=function(e){this.wrappedInstance=e},c.initSelector=function(){var t=e(this.store.dispatch,a);this.selector=function(e,t){var n={run:function(r){try{var o=e(t.getState(),r);(o!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=o,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}(t,this.store),this.selector.run(this.props)},c.initSubscription=function(){if(E){var e=(this.propsMode?this.props:this.context)[D];this.subscription=new w(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},c.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(_)):this.notifyNestedSubs()},c.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},c.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},c.addExtraProps=function(e){if(!(T||O||this.propsMode&&this.subscription))return e;var t=Object(p.a)({},e);return T&&(t.ref=this.setWrappedInstance),O&&(t[O]=this.renderCount++),this.propsMode&&this.subscription&&(t[D]=this.subscription),t},c.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(o.createElement)(t,this.addExtraProps(e.props))},u}(o.Component);return u.WrappedComponent=t,u.displayName=i,u.childContextTypes=N,u.contextTypes=I,u.propTypes=I,y()(u,t)}}var S=Object.prototype.hasOwnProperty;function E(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function j(e,t){if(E(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!S.call(t,n[o])||!E(e[n[o]],t[n[o]]))return!1;return!0}var P=n(32);function C(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function T(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function A(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=T(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=T(o),o=r(t,n)),o},r}}var D=[function(e){return"function"==typeof e?A(e):void 0},function(e){return e?void 0:C((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?C((function(t){return Object(P.b)(e,t)})):void 0}];var R=[function(e){return"function"==typeof e?A(e):void 0},function(e){return e?void 0:C((function(){return{}}))}];function I(e,t,n){return Object(p.a)({},n,e,t)}var N=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,u){var c=e(t,n,u);return a?o&&i(c,r)||(r=c):(a=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return I}}];function z(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function M(e,t,n,r,o){var i,a,u,c,s,l=o.areStatesEqual,f=o.areOwnPropsEqual,p=o.areStatePropsEqual,d=!1;function h(o,d){var h,y,v=!f(d,a),g=!l(o,i);return i=o,a=d,v&&g?(u=e(i,a),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):v?(e.dependsOnOwnProps&&(u=e(i,a)),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):g?(h=e(i,a),y=!p(h,u),u=h,y&&(s=n(u,c,a)),s):s}return function(o,l){return d?h(o,l):(u=e(i=o,a=l),c=t(r,a),s=n(u,c,a),d=!0,s)}}function F(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=Object(d.a)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=n(e,i),u=r(e,i),c=o(e,i);return(i.pure?M:z)(a,u,c,e,i)}function L(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function U(e,t){return e===t}var B,q,H,W,Q,$,G,V,J,Y,K,X,Z=(H=(q=void 0===B?{}:B).connectHOC,W=void 0===H?O:H,Q=q.mapStateToPropsFactories,$=void 0===Q?R:Q,G=q.mapDispatchToPropsFactories,V=void 0===G?D:G,J=q.mergePropsFactories,Y=void 0===J?N:J,K=q.selectorFactory,X=void 0===K?F:K,function(e,t,n,r){void 0===r&&(r={});var o=r,i=o.pure,a=void 0===i||i,u=o.areStatesEqual,c=void 0===u?U:u,s=o.areOwnPropsEqual,l=void 0===s?j:s,f=o.areStatePropsEqual,h=void 0===f?j:f,y=o.areMergedPropsEqual,v=void 0===y?j:y,g=Object(d.a)(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),m=L(e,$,"mapStateToProps"),b=L(t,V,"mapDispatchToProps"),w=L(n,Y,"mergeProps");return W(X,Object(p.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:m,initMapDispatchToProps:b,initMergeProps:w,pure:a,areStatesEqual:c,areOwnPropsEqual:l,areStatePropsEqual:h,areMergedPropsEqual:v},g))});n.d(t,"Provider",(function(){return l})),n.d(t,"createProvider",(function(){return s})),n.d(t,"connectAdvanced",(function(){return O})),n.d(t,"connect",(function(){return Z}))},function(e,t,n){var r=n(192),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";(function(e){var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(234)),a=o(n(24)),u=o(n(31)),c=o(n(25)),s=o(n(5)),l=o(n(9)),f=o(n(3)),p=o(n(7)),d=o(n(2)),h=o(n(72)),y=o(n(456)),v=o(n(158)),g=o(n(458)),m=o(n(463)),b=o(n(467)),w=o(n(16)),x=o(n(52)),_=r(n(244)),k=n(59),O=o(n(263)),S=n(120),E=n(178),j=n(179),P=n(18),C=n(549),T=o(n(550)),A=r(n(60)),D=o(n(283)),R=o(n(552)),I=n(173),N=o(n(284)),z=n(558),M=o(n(174)),F=(n(19),n(175)),L=o(n(559)),U=o(n(563)),B=n(564);function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){(0,d.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function W(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $=function(e){return Array.isArray(e)?e:[e]},G=function(e){return{get:function(t,n){return console.warn(e),t[n]}}},V=function(e){return e.prototype.addReferences&&e.prototype.removeReferences},J=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,f.default)(this,t),(0,d.default)(this,"fetchQueryAndGetFromState",function(){var t=(0,l.default)(s.default.mark((function t(n){return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.query(n.definition,n.options);case 3:return t.abrupt("return",e.getQueryFromState(n.options.as));case 6:throw t.prev=6,t.t0=t.catch(0),t.t0;case 9:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(e){return t.apply(this,arguments)}}());var r=n.link,o=n.links,i=n.schema,a=void 0===i?{}:i,u=n.appMetadata,p=void 0===u?{}:u,h=n.capabilities,y=(0,c.default)(n,["link","links","schema","appMetadata","capabilities"]);r&&console.warn("`link` is deprecated, use `links`"),this.appMetadata=p,this.options=y,this.queryIdGenerator=new F.QueryIDGenerator,this.isLogged=!1,this.instanceOptions={},this.handleRevocationChange=this.handleRevocationChange.bind(this),this.handleTokenRefresh=this.handleTokenRefresh.bind(this),this.createClient();var v=this.getStackClient();v.on("error",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.emit.apply(e,["error"].concat(n))})),this.links=$(r||o||new O.default),this.registerClientOnLinks(),this.chain=(0,I.chain)(this.links),this.schema=new R.default(a,v),this.capabilities=h||null,this.plugins={};try{this.loadInstanceOptionsFromDOM()}catch(e){}y.uri&&y.token&&this.login(),this.storeAccesors=null,!1!==y.store&&this.ensureStore(),this._promiseCache=new U.default}var n,r,o,x,D,q,Q,J,Y,K,X,Z,ee,te,ne,re;return(0,p.default)(t,[{key:"emit",value:function(){}},{key:"on",value:function(){}},{key:"removeListener",value:function(){}},{key:"registerPlugin",value:function(e,t){if(!e.pluginName)throw new Error("Cannot register a plugin whose class does not have `pluginName` attribute.");if(this.plugins[e.pluginName])throw new Error("Cannot register plugin ".concat(e.pluginName,". A plugin with the same name has already been registered."));var n=new e(this,t);return this.plugins[e.pluginName]=n,n}},{key:"addSchema",value:function(e){this.schema.add(e)}},{key:"registerClientOnLinks",value:function(){var e,t=W(this.links);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.registerClient)try{n.registerClient(this)}catch(e){console.warn(e)}}}catch(e){t.e(e)}finally{t.f()}}},{key:"login",value:function(e){return this.isLogged&&!this.isRevoked?(console.warn("CozyClient is already logged."),this.loginPromise):this.loginPromise=this._login(e)}},{key:"_login",value:(re=(0,l.default)(s.default.mark((function e(t){var n,r,o;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("beforeLogin"),this.registerClientOnLinks(),t&&(t.uri&&this.stackClient.setUri(t.uri),t.token&&this.stackClient.setToken(t.token)),n=W(this.links),e.prev=4,n.s();case 6:if((r=n.n()).done){e.next=13;break}if(!(o=r.value).onLogin){e.next=11;break}return e.next=11,o.onLogin();case 11:e.next=6;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:this.isLogged=!0,this.isRevoked=!1,this.emit("login");case 24:case"end":return e.stop()}}),e,this,[[4,15,18,21]])}))),function(e){return re.apply(this,arguments)})},{key:"logout",value:(ne=(0,l.default)(s.default.mark((function e(){var t,n,r;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isLogged){e.next=3;break}return M.default.warn("CozyClient isn't logged."),e.abrupt("return");case 3:if(this.emit("beforeLogout"),this.isLogged=!1,!(this.stackClient instanceof _.OAuthClient)){e.next=17;break}if(e.prev=6,!this.stackClient.unregister||this.stackClient.isRegistered&&!this.stackClient.isRegistered()){e.next=10;break}return e.next=10,this.stackClient.unregister();case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),M.default.warn("Impossible to unregister client on stack: ".concat(e.t0));case 15:e.next=25;break;case 17:return e.prev=17,e.next=20,this.stackClient.fetch("DELETE","/auth/login");case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(17),M.default.warn("Impossible to log out: ".concat(e.t1));case 25:t=W(this.links),e.prev=26,t.s();case 28:if((n=t.n()).done){e.next=41;break}if(!(r=n.value).reset){e.next=39;break}return e.prev=31,e.next=34,r.reset();case 34:e.next=39;break;case 36:e.prev=36,e.t2=e.catch(31),console.warn(e.t2);case 39:e.next=28;break;case 41:e.next=46;break;case 43:e.prev=43,e.t3=e.catch(26),t.e(e.t3);case 46:return e.prev=46,t.f(),e.finish(46);case 49:this.store&&this.dispatch((0,A.resetState)()),this.emit("logout");case 51:case"end":return e.stop()}}),e,this,[[6,12],[17,22],[26,43,46,49],[31,36]])}))),function(){return ne.apply(this,arguments)})},{key:"collection",value:function(e){return this.getStackClient().collection(e)}},{key:"fetch",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.getStackClient().fetch(e,t,n,r)}},{key:"all",value:function(e){return M.default.warn("\nclient.all is deprecated, prefer to use the Q helper to build a new QueryDefinition.\n\nimport { Q } from 'cozy-client'\nclient.query(Q('io.cozy.bills'))"),(0,P.Q)(e)}},{key:"find",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return console.warn("client.find(doctype, selector) is deprecated, please use Q(doctype).where(selector) to build the same query."),new P.QueryDefinition({doctype:e,selector:t})}},{key:"get",value:function(e,t){return console.warn("client.get(".concat(e,", id) is deprecated, please use Q(").concat(e,").getById(id) to build the same query.")),new P.QueryDefinition({doctype:e,id:t})}},{key:"create",value:(te=(0,l.default)(s.default.mark((function e(t,n,r){var o,i,a,u=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>3&&void 0!==u[3]?u[3]:{},n._type,i=(0,c.default)(n,["_type"]),a=H({_type:t},i),e.next=5,this.schema.validate(a);case 5:if(!0===e.sent){e.next=8;break}throw new Error("Validation failed");case 8:return e.abrupt("return",this.mutate(this.getDocumentSavePlan(a,r),o));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return te.apply(this,arguments)})},{key:"validate",value:function(e){return this.schema.validate(e)}},{key:"save",value:(ee=(0,l.default)(s.default.mark((function e(t){var n,r,o,i,a=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:{},r=t._type,o=(0,c.default)(t,["_type"]),r){e.next=4;break}throw new Error("The document must have a `_type` property");case 4:return i=H({_type:r},o),e.next=7,this.schema.validate(i);case 7:if(!0===e.sent){e.next=10;break}throw new Error("Validation failed");case 10:return e.abrupt("return",this.mutate(this.getDocumentSavePlan(i),n));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return ee.apply(this,arguments)})},{key:"saveAll",value:(Z=(0,l.default)(s.default.mark((function e(t){var n,r,o,i,a,u=this,c=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=c.length>1&&void 0!==c[1]?c[1]:{},1===Array.from(new Set(t.map((function(e){return e._type})))).length){e.next=4;break}throw new Error("saveAll can only save documents with the same doctype");case 4:return e.next=6,Promise.all(t.map((function(e){return u.schema.validate(e)})));case 6:if(r=e.sent,!((o=r.filter((function(e){return!0!==e}))).length>0)){e.next=11;break}throw console.warn("There has been some validation errors while bulk saving",o),new Error("Validation failed for at least one doc");case 11:return i=t.map((function(e){return u.prepareDocumentForSave(e)})),a=P.Mutations.updateDocuments(i),e.abrupt("return",this.mutate(a,n));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return Z.apply(this,arguments)})},{key:"ensureCozyMetadata",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{event:"creation"},r=1;if(void 0===this.appMetadata)return e;if(e._type){var o=this.schema.getDoctypeSchema(e._type);t=(0,w.default)(o,"doctypeVersion")}var i=this.appMetadata,a=i.slug,c=i.sourceAccount,s=i.version,l=(new Date).toISOString(),f=(0,w.default)(e,"cozyMetadata",{});return"creation"===n.event?f=H({metadataVersion:r,doctypeVersion:t,createdByApp:a,sourceAccount:c,createdAt:l,createdByAppVersion:s,updatedAt:l,updatedByApps:a?[{date:l,slug:a,version:s}]:[]},f):"update"===n.event&&(f=H(H({},f),{},{updatedAt:l,updatedByApps:[{date:l,slug:a,version:s}].concat((0,u.default)((0,w.default)(e,"cozyMetadata.updatedByApps",[]).filter((function(e){return e.slug!==a}))))})),H(H({},e),{},{cozyMetadata:f})}},{key:"prepareDocumentForSave",value:function(e){var t=!e._rev;return this.ensureCozyMetadata((0,j.dehydrate)(e),{event:t?"creation":"update"})}},{key:"getDocumentSavePlan",value:function(e,t){var n,r=this,o=!e._rev,i=this.prepareDocumentForSave(e),u=o?P.Mutations.createDocument(i):P.Mutations.updateDocument(i);if(!(t&&Object.values(t).filter((function(e){return Array.isArray(e)?e.length>0:e})).length>0))return u;for(var c=0,s=Object.keys(t);c<s.length;c++){var l=s[c],f=e._type,p=this.schema.getRelationship(f,l),d=p.type;if(!V(d))throw n=p.name,new Error('The "'.concat(n,'" relationship does not support references. If you need to add references to a document, its relationship class must have the methods {add,remove}References'))}if(t&&!o)throw new Error("Unable to save external relationships on a not-new document");return[u,function(e){var n=r.hydrateDocument(e.data);return Object.entries(t).map((function(e){var t=(0,a.default)(e,2),r=t[0],o=t[1];return n[r].addReferences(o)}))}]}},{key:"triggerHook",value:function(e,n){if(t.hooks){var r,o=W((t.hooks[n._type]||{})[e]||[]);try{for(o.s();!(r=o.n()).done;){(0,r.value)(this,n)}}catch(e){o.e(e)}finally{o.f()}}}},{key:"destroy",value:(X=(0,l.default)(s.default.mark((function e(t){var n,r,o=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},e.next=3,this.triggerHook("before:destroy",t);case 3:return e.next=5,this.mutate(P.Mutations.deleteDocument(t),n);case 5:return r=e.sent,e.next=8,this.triggerHook("after:destroy",t);case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"upload",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.mutate(P.Mutations.uploadFile(e,t),n)}},{key:"ensureQueryExists",value:function(e,t,n){this.ensureStore(),"loaded"===(0,A.getQueryFromState)(this.store.getState(),e).fetchStatus&&(t.skip||t.bookmark)||this.dispatch((0,A.initQuery)(e,t,n))}},{key:"query",value:(K=(0,l.default)(s.default.mark((function e(t){var n,r,o,i,a,u,l=this,f=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>1&&void 0!==f[1]?f[1]:{},r=n.update,o=(0,c.default)(n,["update"]),this.ensureStore(),i=o.as||this.queryIdGenerator.generateId(t),a=this.getQueryFromState(i),!o.fetchPolicy){e.next=11;break}if(o.as){e.next=8;break}throw new Error("Cannot use `fetchPolicy` without naming the query, please use `as` to name the query");case 8:if(o.fetchPolicy(a)){e.next=11;break}return e.abrupt("return");case 11:if(!(a&&Object.keys(a).length>0)){e.next=14;break}if("loading"!==a.fetchStatus){e.next=14;break}return e.abrupt("return",this._promiseCache.get((function(){return(0,L.default)(t)})));case 14:return this.ensureQueryExists(i,t,o),e.prev=15,this.dispatch((0,A.loadQuery)(i)),e.next=19,this._promiseCache.exec((function(){return l.requestQuery(t)}),(function(){return(0,L.default)(t)}));case 19:return u=e.sent,this.dispatch((0,A.receiveQueryResult)(i,u,{update:r})),e.abrupt("return",u);case 24:if(e.prev=24,e.t0=e.catch(15),this.dispatch((0,A.receiveQueryError)(i,e.t0)),!o.onError){e.next=31;break}o.onError(e.t0),e.next=36;break;case 31:if(!this.options.onError){e.next=35;break}this.options.onError(e.t0),e.next=36;break;case 35:throw e.t0;case 36:case"end":return e.stop()}}),e,this,[[15,24]])}))),function(e){return K.apply(this,arguments)})},{key:"queryAll",value:(Y=(0,l.default)(s.default.mark((function e(t){var n,r,o,i,a,c,l=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:{},r=n.as||this.queryIdGenerator.generateId(t),o=H(H({},n),{},{as:r}),e.next=5,this.query(t,o);case 5:i=e.sent,a=i.data;case 7:if(!i||!i.next){e.next=21;break}if(!i.bookmark){e.next=14;break}return e.next=11,this.query(t.offsetBookmark(i.bookmark),o);case 11:i=e.sent,e.next=18;break;case 14:return c=(0,A.getRawQueryFromState)(this.store.getState(),r),e.next=17,this.query(t.offset(c.data.length),o);case 17:i=e.sent;case 18:a.push.apply(a,(0,u.default)(i.data)),e.next=7;break;case 21:return e.abrupt("return",a);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return Y.apply(this,arguments)})},{key:"watchQuery",value:function(){return console.warn("client.watchQuery is deprecated, please use client.makeObservableQuery."),this.makeObservableQuery.apply(this,arguments)}},{key:"makeObservableQuery",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ensureStore();var n=t.as||this.queryIdGenerator.generateId(e);return this.ensureQueryExists(n,e),new N.default(n,e,this,t)}},{key:"mutate",value:(J=(0,l.default)(s.default.mark((function e(t){var n,r,o,i,a,u,l=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:{},r=n.update,o=n.updateQueries,i=(0,c.default)(n,["update","updateQueries"]),this.ensureStore(),a=i.as||this.queryIdGenerator.generateId(t),this.dispatch((0,A.initMutation)(a,t)),e.prev=5,e.next=8,this.requestMutation(t);case 8:return u=e.sent,this.dispatch((0,A.receiveMutationResult)(a,u,{update:r,updateQueries:o},t)),e.abrupt("return",u);case 13:throw e.prev=13,e.t0=e.catch(5),this.dispatch((0,A.receiveMutationError)(a,e.t0,t)),e.t0;case 17:case"end":return e.stop()}}),e,this,[[5,13]])}))),function(e){return J.apply(this,arguments)})},{key:"requestQuery",value:(Q=(0,l.default)(s.default.mark((function e(t){var n,r;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.chain.request(t);case 2:if(n=e.sent,t.includes){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.fetchRelationships(n,this.getIncludesRelationships(t));case 7:return r=e.sent,e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return Q.apply(this,arguments)})},{key:"fetchRelationships",value:(q=(0,l.default)(s.default.mark((function e(t,n){var r,o,i,u,c,l,f,p,d,h,y,w,x,_,k,O,S,j,C,A=this;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=!Array.isArray(t.data))||0!==t.data.length){e.next=3;break}return e.abrupt("return",t);case 3:return o=r?[t.data]:t.data,i=new Map,u=[],c=[],o.forEach((function(e){return(0,b.default)(n,(function(t,n){try{var r=t.type.query(e,A,t),o=e._id;i.set(r,[o,n]),r instanceof P.QueryDefinition?c.push(r):u.push(r)}catch(e){}}))})),l=(0,T.default)(c),e.next=11,Promise.all(l.map((function(e){return A.chain.request(e)})));case 11:f=e.sent,p=(0,g.default)((0,v.default)(u),"_id"),d=(0,v.default)(f.map((function(e){return e.included||e.data}))).concat(p).filter(Boolean),h={},y=W((0,m.default)(l,f));try{for(y.s();!(w=y.n()).done;)x=(0,a.default)(w.value,2),_=x[0],k=x[1],(O=i.get(_))&&(S=(0,a.default)(O,2),j=S[0],C=S[1],h[j]=h[j]||{},h[j][C]=(0,E.responseToRelationship)(k))}catch(e){y.e(e)}finally{y.f()}return e.abrupt("return",H(H({},(0,E.attachRelationships)(t,h)),{},{included:d}));case 18:case"end":return e.stop()}}),e)}))),function(e,t){return q.apply(this,arguments)})},{key:"requestMutation",value:(D=(0,l.default)(s.default.mark((function e(t){var n,r,o,a,u=this;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Array.isArray(t)){e.next=8;break}return n=(0,i.default)(t),r=n[0],o=n.slice(1),e.next=4,this.requestMutation(r);case 4:return a=e.sent,e.next=7,Promise.all(o.map((function(e){var t="function"==typeof e?e(a):e;return u.requestMutation(t)})));case 7:return e.abrupt("return",a);case 8:return e.abrupt("return",this.chain.request(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return D.apply(this,arguments)})},{key:"getIncludesRelationships",value:function(e){var t=this,n=e.includes,r=e.doctype;return n?(0,y.default)(n.map((function(e){return[e,t.schema.getRelationship(r,e)]}))):{}}},{key:"hydrateDocuments",value:function(e,t){var n=this;if(!1===this.options.autoHydrate)return t;var r=this.schema.getDoctypeSchema(e);return r.relationships?t.map((function(e){return n.hydrateDocument(e,r)})):t}},{key:"hydrateDocument",value:function(e,t){if(!e)return e;var n=t||this.schema.getDoctypeSchema(e._type);return H(H({},e),this.hydrateRelationships(e,n.relationships))}},{key:"hydrateRelationships",value:function(e,t){var n=this.getRelationshipStoreAccessors();return(0,h.default)(t,(function(t,r){return(0,S.create)(e,t,n)}))}},{key:"makeNewDocument",value:function(e){var t={_type:e};return this.hydrateDocument(t)}},{key:"generateRandomId",value:function(){return this.queryIdGenerator.generateRandomId()}},{key:"getAssociation",value:function(e,t){return(0,S.create)(e,this.schema.getRelationship(e._type,t),this.getRelationshipStoreAccessors())}},{key:"getRelationshipStoreAccessors",value:function(){var e=this;return this.storeAccesors||(this.storeAccessors={get:this.getDocumentFromState.bind(this),save:function(t,n){return e.save.call(e,t,n)},dispatch:this.dispatch.bind(this),query:function(t,n){return e.query.call(e,t,n)},mutate:function(t,n){return e.mutate.call(e,t,n)}}),this.storeAccessors}},{key:"getCollectionFromState",value:function(e){try{return(0,A.getCollectionFromState)(this.store.getState(),e)}catch(t){return M.default.warn("Could not getCollectionFromState",e,t.message),null}}},{key:"getDocumentFromState",value:function(e,t){try{return(0,A.getDocumentFromState)(this.store.getState(),e,t)}catch(n){return M.default.warn("Could not getDocumentFromState",e,t,n.message),null}}},{key:"getQueryFromState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.hydrated||!1,r=t.singleDocData||!1;try{var o=(0,A.getQueryFromState)(this.store.getState(),e),i=o.definition&&o.definition.doctype,a=o.definition&&o.definition.id;if(!n&&!r)return o;var u=n&&i?this.hydrateDocuments(i,o.data):o.data;return H(H({},o),{},{data:a&&r?u[0]:u})}catch(t){return console.warn("Could not get query from state. queryId: ".concat(e,", error: ").concat(t.message)),null}}},{key:"register",value:function(e){return this.getStackClient().setUri(e),this.startOAuthFlow(C.authFunction)}},{key:"isReactNative",value:function(){return"undefined"!=typeof navigator&&"ReactNative"==navigator.product}},{key:"startOAuthFlow",value:(x=(0,l.default)(s.default.mark((function e(t){var n;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getStackClient(),e.next=3,n.register();case 3:if(!n.oauthOptions.shouldRequireFlagshipPermissions){e.next=6;break}return e.next=6,(0,B.certifyFlagship)(n.oauthOptions.certificationConfig,this);case 6:return e.abrupt("return",this.authorize(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"authorize",value:(o=(0,l.default)(s.default.mark((function e(t){var n,r,o,i,a,u;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.getStackClient(),r=n.generateStateCode(),o=n.getAuthCodeURL(r),e.next=6,t(o);case 6:return i=e.sent,a=n.getAccessCodeFromURL(i,r),e.next=10,n.fetchAccessToken(a);case 10:return u=e.sent,n.setToken(u),e.abrupt("return",{token:u,infos:n.oauthOptions,client:n.oauthOptions});case 15:throw e.prev=15,e.t0=e.catch(0),e.t0.message===k.REGISTRATION_ABORT&&this.getStackClient().unregister(),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return o.apply(this,arguments)})},{key:"renewAuthorization",value:function(){return this.authorize(C.authFunction)}},{key:"setStore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.force,r=void 0!==n&&n;if(void 0===e)throw new Error("Store is undefined");if(this.store&&!r)throw new Error("Client already has a store, it is forbidden to change store.\nsetStore must be called before any query is executed. Try to\ncall setStore earlier in your code, preferably just after the\ninstantiation of the client.");this.store=e}},{key:"ensureStore",value:function(){this.store||this.setStore((0,A.createStore)())}},{key:"checkForRevocation",value:(r=(0,l.default)(s.default.mark((function e(){return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stackClient.checkForRevocation());case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"handleRevocationChange",value:function(e){e?(this.isRevoked=!0,this.emit("revoked")):(this.isRevoked=!1,this.emit("unrevoked"))}},{key:"handleTokenRefresh",value:function(e){this.emit("tokenRefreshed"),this.options.onTokenRefresh&&(G("Using onTokenRefresh is deprecated, please use events like this: cozyClient.on('tokenRefreshed', token => console.log('Token has been refreshed', token)). https://git.io/fj3M3"),this.options.onTokenRefresh(e))}},{key:"createClient",value:function(){this.options.client&&console.warn("CozyClient: Using options.client is deprecated, please use options.stackClient.");var e=void 0===this.options.warningForCustomHandlers||this.options.warningForCustomHandlers,t=this.options.client||this.options.stackClient,n={onRevocationChange:this.handleRevocationChange,onTokenRefresh:this.handleTokenRefresh};if(t){this.stackClient=t,t.options||(t.options={});for(var r=0,o=Object.keys(n);r<o.length;r++){var i=o[r];t.options[i]?e&&console.warn("You passed a stackClient with its own ".concat(i,". It is not supported, unexpected things might happen.")):t.options[i]=n[i]}}else{var a=H(H({},this.options),n);this.stackClient=this.options.oauth?new _.OAuthClient(a):new _.default(a)}this.client=new Proxy(this.stackClient,G("Using cozyClient.client is deprecated, please use cozyClient.stackClient."))}},{key:"getClient",value:function(){return console.warn("CozyClient: getClient() is deprecated, please use getStackClient()."),this.getStackClient()}},{key:"getStackClient",value:function(){return this.stackClient||this.createClient(),this.stackClient}},{key:"reducer",value:function(){return A.default}},{key:"dispatch",value:function(e){return this.store.dispatch(e)}},{key:"getInstanceOptions",value:function(){return this.instanceOptions}},{key:"loadInstanceOptionsFromDOM",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[role=application]",t=document.querySelector(e);if(!(t instanceof HTMLElement))throw new Error("The selector that is passed does not return an HTMLElement");var n=t.dataset,r=n.cozy,o=void 0===r?"{}":r,i=(0,c.default)(n,["cozy"]);this.instanceOptions=H(H({},JSON.parse(o)),i),this.capabilities=this.instanceOptions.capabilities||null}},{key:"setData",value:function(e){var t=this;this.ensureStore(),Object.entries(e).forEach((function(e){var n=(0,a.default)(e,2),r=(n[0],n[1]);t.dispatch((0,A.receiveQueryResult)(null,{data:r}))}))}},{key:"setOnError",value:function(e){if(this.options&&this.options.onError)throw new Error("On Error is already defined");this.options.onError=e}},{key:"toJSON",value:function(){return new z.CozyClient({uri:this.options.uri})}}],[{key:"fromOldClient",value:function(e,n){return new t(H({uri:e._url,token:e._token.token},n))}},{key:"fromOldOAuthClient",value:(n=(0,l.default)(s.default.mark((function e(n,r){var o,i;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n._oauth){e.next=8;break}return e.next=3,n.authorize();case 3:return o=e.sent,i={oauth:o.client,token:o.token,scope:o.token.scope},e.abrupt("return",new t(H(H({uri:n._url},i),r)));case 8:throw new Error("Cannot instantiate a new client: old client is not an OAuth client. CozyClient.fromOldClient might be more suitable.");case 9:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"fromEnv",value:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n||(void 0!==e?Object({USE_REACT:!0}):{}),i=o.COZY_URL,a=o.COZY_CREDENTIALS,u=o.NODE_ENV;if(!i||!a)throw new Error("Env used to instantiate CozyClient must have COZY_URL and COZY_CREDENTIALS");return"development"===u?r.oauth=JSON.parse(a):r.token=a.trim(),r.uri=i.trim(),new t(H({},r))}},{key:"fromDOM",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"[role=application]",r=document.querySelector(n);if(!(r instanceof HTMLElement))throw new Error("Cannot find an HTMLElement corresponding to ".concat(n));if(!r||!r.dataset)throw new Error("Found no data in ".concat(n," to instantiate cozyClient"));var o=r.dataset.cozy?JSON.parse(r.dataset.cozy):H({},r.dataset),i=o.domain,a=o.token;if(i&&a||(i=i||o.cozyDomain,a=a||o.cozyToken),!i||!a)throw new Error("Found no data in ".concat(r.dataset," to instantiate cozyClient"));return new t(H({uri:"".concat(window.location.protocol,"//").concat(i),token:a,capabilities:o.capabilities},e))}},{key:"registerHook",value:function(e,n,r){var o=t.hooks[e]=t.hooks[e]||{};o[n]=o[n]||[],o[n].push(r)}}]),t}();J.hooks=J.hooks||{},J.fetchPolicies=D.default,J.version="27.14.4",x.default.mixin(J);var Y=J;t.default=Y}).call(this,n(233))},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes=t.slugify=t.sleep=t.attempt=t.uri=void 0;t.uri=function(e){for(var t=[e[0]],n=0;n<(arguments.length<=1?0:arguments.length-1);n++)t.push(encodeURIComponent(n+1<1||arguments.length<=n+1?void 0:arguments[n+1])+e[n+1]);return t.join("")};t.attempt=function(e){return e.then((function(){return!0})).catch((function(){return!1}))};t.sleep=function(e,t){return new Promise((function(n){setTimeout(n,e,t)}))};t.slugify=function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")};t.formatBytes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(0===e)return"0 Bytes";var n=1024,r=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+" "+o[i]}},function(e,t,n){(function(t){var n;n=function(){"use strict";var e=function(e){var t=e.id,n=e.viewBox,r=e.content;this.id=t,this.viewBox=n,this.content=r};function n(e,t){return e(t={exports:{}},t.exports),t.exports}e.prototype.stringify=function(){return this.content},e.prototype.toString=function(){return this.stringify()},e.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach((function(t){return delete e[t]}))},"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var r=n((function(e,t){e.exports=function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(t,n){var o;return n&&!0===n.clone&&e(t)?r((o=t,Array.isArray(o)?[]:{}),t,n):t}function n(n,o,i){var a=n.slice();return o.forEach((function(o,u){void 0===a[u]?a[u]=t(o,i):e(o)?a[u]=r(n[u],o,i):-1===n.indexOf(o)&&a.push(t(o,i))})),a}function r(o,i,a){var u=Array.isArray(i),c=(a||{arrayMerge:n}).arrayMerge||n;return u?Array.isArray(o)?c(o,i,a):t(i,a):function(n,o,i){var a={};return e(n)&&Object.keys(n).forEach((function(e){a[e]=t(n[e],i)})),Object.keys(o).forEach((function(u){e(o[u])&&n[u]?a[u]=r(n[u],o[u],i):a[u]=t(o[u],i)})),a}(o,i,a)}return r.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return r(e,n,t)}))},r}()})),o=n((function(e,t){t.default={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}},e.exports=t.default})),i=o.svg,a=o.xlink,u={};u[i.name]=i.uri,u[a.name]=a.uri;var c=function(e,t){return void 0===e&&(e=""),"<svg "+function(e){return Object.keys(e).map((function(t){return t+'="'+e[t].toString().replace(/"/g,"&quot;")+'"'})).join(" ")}(r(u,t||{}))+">"+e+"</svg>"};return function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,n=this.render();return this.node=n,t.appendChild(n),n},t.prototype.render=function(){var e=this.stringify();return function(e){var t=!!document.importNode,n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(n,!0):n}(c(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,n),t}(e)},e.exports=n()}).call(this,n(33))},function(e,t,n){(function(t){var n;n=function(){"use strict";function e(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var n=e((function(e,t){e.exports=function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(t,n){var o;return n&&!0===n.clone&&e(t)?r((o=t,Array.isArray(o)?[]:{}),t,n):t}function n(n,o,i){var a=n.slice();return o.forEach((function(o,u){void 0===a[u]?a[u]=t(o,i):e(o)?a[u]=r(n[u],o,i):-1===n.indexOf(o)&&a.push(t(o,i))})),a}function r(o,i,a){var u=Array.isArray(i),c=(a||{arrayMerge:n}).arrayMerge||n;return u?Array.isArray(o)?c(o,i,a):t(i,a):function(n,o,i){var a={};return e(n)&&Object.keys(n).forEach((function(e){a[e]=t(n[e],i)})),Object.keys(o).forEach((function(u){e(o[u])&&n[u]?a[u]=r(n[u],o[u],i):a[u]=t(o[u],i)})),a}(o,i,a)}return r.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return r(e,n,t)}))},r}()})),r=e((function(e,t){t.default={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}},e.exports=t.default})),o=r.svg,i=r.xlink,a={};a[o.name]=o.uri,a[i.name]=i.uri;var u,c=function(e,t){return void 0===e&&(e=""),"<svg "+function(e){return Object.keys(e).map((function(t){return t+'="'+e[t].toString().replace(/"/g,"&quot;")+'"'})).join(" ")}(n(a,t||{}))+">"+e+"</svg>"},s=r.svg,l=r.xlink,f={attrs:(u={style:["position: absolute","width: 0","height: 0"].join("; ")},u[s.name]=s.uri,u[l.name]=l.uri,u)},p=function(e){this.config=n(f,e||{}),this.symbols=[]};p.prototype.add=function(e){var t=this.symbols,n=this.find(e.id);return n?(t[t.indexOf(n)]=e,!1):(t.push(e),!0)},p.prototype.remove=function(e){var t=this.symbols,n=this.find(e);return!!n&&(t.splice(t.indexOf(n),1),n.destroy(),!0)},p.prototype.find=function(e){return this.symbols.filter((function(t){return t.id===e}))[0]||null},p.prototype.has=function(e){return null!==this.find(e)},p.prototype.stringify=function(){var e=this.config.attrs,t=this.symbols.map((function(e){return e.stringify()})).join("");return c(t,e)},p.prototype.toString=function(){return this.stringify()},p.prototype.destroy=function(){this.symbols.forEach((function(e){return e.destroy()}))};var d=function(e){var t=e.id,n=e.viewBox,r=e.content;this.id=t,this.viewBox=n,this.content=r};d.prototype.stringify=function(){return this.content},d.prototype.toString=function(){return this.stringify()},d.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach((function(t){return delete e[t]}))};var h=function(e){var t=!!document.importNode,n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(n,!0):n},y=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,n=this.render();return this.node=n,t.appendChild(n),n},t.prototype.render=function(){var e=this.stringify();return h(c(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,n),t}(d),v={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},g=function(e){return Array.prototype.slice.call(e,0)},m=function(){return/firefox/i.test(navigator.userAgent)},b=function(){return/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent)},w=function(){return/edge/i.test(navigator.userAgent)},x=function(e){return(e||window.location.href).split("#")[0]},_=function(e){angular.module("ng").run(["$rootScope",function(t){t.$on("$locationChangeSuccess",(function(t,n,r){var o,i,a;o=e,i={oldUrl:r,newUrl:n},(a=document.createEvent("CustomEvent")).initCustomEvent(o,!1,!1,i),window.dispatchEvent(a)}))}])},k=function(e,t){return void 0===t&&(t="linearGradient, radialGradient, pattern"),g(e.querySelectorAll("symbol")).forEach((function(e){g(e.querySelectorAll(t)).forEach((function(t){e.parentNode.insertBefore(t,e)}))})),e},O=r.xlink.uri,S=/[{}|\\\^\[\]`"<>]/g;function E(e){return e.replace(S,(function(e){return"%"+e[0].charCodeAt(0).toString(16).toUpperCase()}))}var j,P=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],C=P.map((function(e){return"["+e+"]"})).join(","),T=function(e,t,n,r){var o=E(n),i=E(r);(function(e,t){return g(e).reduce((function(e,n){if(!n.attributes)return e;var r=g(n.attributes),o=t?r.filter(t):r;return e.concat(o)}),[])})(e.querySelectorAll(C),(function(e){var t=e.localName,n=e.value;return-1!==P.indexOf(t)&&-1!==n.indexOf("url("+o)})).forEach((function(e){return e.value=e.value.replace(new RegExp(o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),i)})),function(e,t,n){g(e).forEach((function(e){var r=e.getAttribute("xlink:href");if(r&&0===r.indexOf(t)){var o=r.replace(t,n);e.setAttributeNS(O,"xlink:href",o)}}))}(t,o,i)},A="mount",D="symbol_mount",R=function(e){function t(t){var r=this;void 0===t&&(t={}),e.call(this,n(v,t));var o,i=(o=o||Object.create(null),{on:function(e,t){(o[e]||(o[e]=[])).push(t)},off:function(e,t){o[e]&&o[e].splice(o[e].indexOf(t)>>>0,1)},emit:function(e,t){(o[e]||[]).map((function(e){e(t)})),(o["*"]||[]).map((function(n){n(e,t)}))}});this._emitter=i,this.node=null;var a=this.config;if(a.autoConfigure&&this._autoConfigure(t),a.syncUrlsWithBaseTag){var u=document.getElementsByTagName("base")[0].getAttribute("href");i.on(A,(function(){return r.updateUrls("#",u)}))}var c=this._handleLocationChange.bind(this);this._handleLocationChange=c,a.listenLocationChangeEvent&&window.addEventListener(a.locationChangeEvent,c),a.locationChangeAngularEmitter&&_(a.locationChangeEvent),i.on(A,(function(e){a.moveGradientsOutsideSymbol&&k(e)})),i.on(D,(function(e){var t;a.moveGradientsOutsideSymbol&&k(e.parentNode),(b()||w())&&(t=[],g(e.querySelectorAll("style")).forEach((function(e){e.textContent+="",t.push(e)})))}))}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={isMounted:{}};return r.isMounted.get=function(){return!!this.node},t.prototype._autoConfigure=function(e){var t=this.config;void 0===e.syncUrlsWithBaseTag&&(t.syncUrlsWithBaseTag=void 0!==document.getElementsByTagName("base")[0]),void 0===e.locationChangeAngularEmitter&&(t.locationChangeAngularEmitter="angular"in window),void 0===e.moveGradientsOutsideSymbol&&(t.moveGradientsOutsideSymbol=m())},t.prototype._handleLocationChange=function(e){var t=e.detail,n=t.oldUrl,r=t.newUrl;this.updateUrls(n,r)},t.prototype.add=function(t){var n=e.prototype.add.call(this,t);return this.isMounted&&n&&(t.mount(this.node),this._emitter.emit(D,t.node)),n},t.prototype.attach=function(e){var t=this,n=this;if(n.isMounted)return n.node;var r="string"==typeof e?document.querySelector(e):e;return n.node=r,this.symbols.forEach((function(e){e.mount(n.node),t._emitter.emit(D,e.node)})),g(r.querySelectorAll("symbol")).forEach((function(e){var t=y.createFromExistingNode(e);t.node=e,n.add(t)})),this._emitter.emit(A,r),r},t.prototype.destroy=function(){var e=this.config,t=this.symbols,n=this._emitter;t.forEach((function(e){return e.destroy()})),n.off("*"),window.removeEventListener(e.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},t.prototype.mount=function(e,t){if(void 0===e&&(e=this.config.mountTo),void 0===t&&(t=!1),this.isMounted)return this.node;var n="string"==typeof e?document.querySelector(e):e,r=this.render();return this.node=r,t&&n.childNodes[0]?n.insertBefore(r,n.childNodes[0]):n.appendChild(r),this._emitter.emit(A,r),r},t.prototype.render=function(){return h(this.stringify())},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},t.prototype.updateUrls=function(e,t){if(!this.isMounted)return!1;var n=document.querySelectorAll(this.config.usagesToUpdate);return T(this.node,n,x(e)+"#",x(t)+"#"),!0},Object.defineProperties(t.prototype,r),t}(p),I=e((function(e){var t,n,r,o,i;e.exports=(n=[],r=document,o=r.documentElement.doScroll,(i=(o?/^loaded|^c/:/^loaded|^i|^c/).test(r.readyState))||r.addEventListener("DOMContentLoaded",t=function(){for(r.removeEventListener("DOMContentLoaded",t),i=1;t=n.shift();)t()}),function(e){i?setTimeout(e,0):n.push(e)})}));window.__SVG_SPRITE__?j=window.__SVG_SPRITE__:(j=new R({attrs:{id:"__SVG_SPRITE_NODE__"}}),window.__SVG_SPRITE__=j);var N=function(){var e=document.getElementById("__SVG_SPRITE_NODE__");e?j.attach(e):j.mount(document.body,!0)};return document.body?N():I(N),j},e.exports=n()}).call(this,n(33))},function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},function(e,t,n){var r=n(139),o=n(144);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){function r(){}n(52).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",(function(o){var i=o===e||void 0===o;return i&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),i})),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},function(e,t,n){"use strict";var r=n(434),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=Object.defineProperty,c=u&&function(){var e={};try{for(var t in u(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),s=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===i.call(o)&&r())&&(c?u(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},l=function(e,t){var n=arguments.length>2?arguments[2]:{},i=r(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var u=0;u<i.length;u+=1)s(e,i[u],t[i[u]],n[i[u]])};l.supportsDescriptors=!!c,e.exports=l},function(e,t,n){function r(){}n(52).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",(function(o){var i=o===e||void 0===o;return i&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),i})),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},function(e,t,n){e.exports={"c-btn":"cozy-ui-bar-c-btn--3Vk8q","c-btn--regular":"cozy-ui-bar-c-btn--regular--2vXm9","c-btn--ghost":"cozy-ui-bar-c-btn--ghost--2erzD","c-btn--highlight":"cozy-ui-bar-c-btn--highlight--139k0","c-btn--alpha":"cozy-ui-bar-c-btn--alpha--3xuwd","c-btn--action":"cozy-ui-bar-c-btn--action--1mNtp","c-btn--close":"cozy-ui-bar-c-btn--close--m97vB","c-btn--danger":"cozy-ui-bar-c-btn--danger--3pdnK","c-btn--secondary":"cozy-ui-bar-c-btn--secondary--2JUsA","c-btn--danger-outline":"cozy-ui-bar-c-btn--danger-outline--2Bltk","c-btn--text":"cozy-ui-bar-c-btn--text--1M_ap","c-btn--left":"cozy-ui-bar-c-btn--left--3xEmE","c-btn--center":"cozy-ui-bar-c-btn--center--T8nT8","c-btn--right":"cozy-ui-bar-c-btn--right--3pX-0","c-btn--tiny":"cozy-ui-bar-c-btn--tiny--15Am0","c-btn--small":"cozy-ui-bar-c-btn--small--gNd1_","c-btn--large":"cozy-ui-bar-c-btn--large--VoQ1T","c-btn--full":"cozy-ui-bar-c-btn--full--257V_","c-btn--narrow":"cozy-ui-bar-c-btn--narrow--37r_T","c-btn--round":"cozy-ui-bar-c-btn--round--TSd9o","c-btn--subtle":"cozy-ui-bar-c-btn--subtle--225Zu",spin:"cozy-ui-bar-spin--39OaW",shake:"cozy-ui-bar-shake--34qwk"}},function(e,t,n){var r=n(64),o=n(337),i=n(338),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t){function n(){this._events={}}n.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n]!==t&&r[n].cb!==t||r.splice(n,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},listeners:function(e){return this._events&&this._events[e]||[]},emit:function(e){this._events||(this._events={});var t,n=Array.prototype.slice.call(arguments,1),r=this._events[e]||[];for(t=r.length-1;t>=0&&r[t];t--)r[t].apply(this,n);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){if(!t)return this;function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return r.cb=t,this.on(e,r),this}},n.mixin=function(e){var t,r=n.prototype;for(t in r)r.hasOwnProperty(t)&&(e.prototype[t]=r[t])},e.exports=n},function(e,t,n){var r=n(354),o=n(396),i=n(82),a=n(22),u=n(400);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):u(e)}},function(e,t,n){var r=n(366),o=n(369);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(441),o=n(227),i=/[T ]/,a=/:/,u=/^(\d{2})$/,c=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],s=/^(\d{4})/,l=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],f=/^-(\d{2})$/,p=/^-?(\d{3})$/,d=/^-?(\d{2})-?(\d{2})$/,h=/^-?W(\d{2})$/,y=/^-?W(\d{2})-?(\d{1})$/,v=/^(\d{2}([.,]\d*)?)$/,g=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,m=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,b=/([Z+-].*)$/,w=/^(Z)$/,x=/^([+-])(\d{2})$/,_=/^([+-])(\d{2}):?(\d{2})$/;function k(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var o=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}e.exports=function(e,t){if(o(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var n=(t||{}).additionalDigits;n=null==n?2:Number(n);var O=function(e){var t,n={},r=e.split(i);a.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1]);if(t){var o=b.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}(e),S=function(e,t){var n,r=c[t],o=l[t];if(n=s.exec(e)||o.exec(e)){var i=n[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(n=u.exec(e)||r.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(O.date,n),E=S.year,j=function(e,t){if(null===t)return null;var n,r,o,i;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=f.exec(e))return r=new Date(0),o=parseInt(n[1],10)-1,r.setUTCFullYear(t,o),r;if(n=p.exec(e)){r=new Date(0);var a=parseInt(n[1],10);return r.setUTCFullYear(t,0,a),r}if(n=d.exec(e)){r=new Date(0),o=parseInt(n[1],10)-1;var u=parseInt(n[2],10);return r.setUTCFullYear(t,o,u),r}if(n=h.exec(e))return i=parseInt(n[1],10)-1,k(t,i);if(n=y.exec(e)){i=parseInt(n[1],10)-1;var c=parseInt(n[2],10)-1;return k(t,i,c)}return null}(S.restDateString,E);if(j){var P,C=j.getTime(),T=0;if(O.time&&(T=function(e){var t,n,r;if(t=v.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*36e5;if(t=g.exec(e))return n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),n%24*36e5+6e4*r;if(t=m.exec(e)){n=parseInt(t[1],10),r=parseInt(t[2],10);var o=parseFloat(t[3].replace(",","."));return n%24*36e5+6e4*r+1e3*o}return null}(O.time)),O.timezone)P=6e4*function(e){var t,n;if(t=w.exec(e))return 0;if(t=x.exec(e))return n=60*parseInt(t[2],10),"+"===t[1]?-n:n;if(t=_.exec(e))return n=60*parseInt(t[2],10)+parseInt(t[3],10),"+"===t[1]?-n:n;return 0}(O.timezone);else{var A=C+T,D=new Date(A);P=r(D);var R=new Date(A);R.setDate(D.getDate()+1);var I=r(R)-r(D);I>0&&(P+=I)}return new Date(C+T+P)}return new Date(e)}},function(e,t){var n=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];e.exports=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);var o=n.concat(t).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+o.join("|")+"|.)","g")}},function(e,t,n){var r=n(82),o=n(239),i=n(241);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.FetchError=t.default=void 0;var o=r(n(3)),i=r(n(11)),a=r(n(8)),u=r(n(10)),c=r(n(6)),s=r(n(35));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var f={EXPIRED_TOKEN:/Expired token/,CLIENT_NOT_FOUND:/Client not found/,INVALID_TOKEN:/Invalid JWT token/};t.default=f;var p=function(e){(0,a.default)(n,e);var t=l(n);function n(e,r){var a;return(0,o.default)(this,n),a=t.call(this),Error.captureStackTrace&&Error.captureStackTrace((0,i.default)(a),a.constructor),a.name="FetchError",a.response=e,a.url=e.url,a.status=e.status,a.reason=r,Object.defineProperty((0,i.default)(a),"message",{value:r.message||("string"==typeof r?r:JSON.stringify(r))}),a}return n}((0,s.default)(Error));t.FetchError=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DOCTYPE_FILES=t.REGISTRATION_ABORT=void 0;t.REGISTRATION_ABORT="REGISTRATION_ABORT";t.DOCTYPE_FILES="io.cozy.files"},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"initQuery",{enumerable:!0,get:function(){return f.initQuery}}),Object.defineProperty(t,"loadQuery",{enumerable:!0,get:function(){return f.loadQuery}}),Object.defineProperty(t,"receiveQueryResult",{enumerable:!0,get:function(){return f.receiveQueryResult}}),Object.defineProperty(t,"receiveQueryError",{enumerable:!0,get:function(){return f.receiveQueryError}}),Object.defineProperty(t,"initMutation",{enumerable:!0,get:function(){return p.initMutation}}),Object.defineProperty(t,"receiveMutationResult",{enumerable:!0,get:function(){return p.receiveMutationResult}}),Object.defineProperty(t,"receiveMutationError",{enumerable:!0,get:function(){return p.receiveMutationError}}),t.resetState=t.getRawQueryFromState=t.getQueryFromState=t.getQueryFromStore=t.getDocumentFromState=t.getCollectionFromState=t.getStateRoot=t.createStore=t.default=t.StoreProxy=void 0;var i=o(n(2)),a=o(n(3)),u=o(n(7)),c=n(188),s=o(n(187)),l=r(n(267)),f=r(n(175)),p=n(177);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.resetState=function(){return{type:"COZY_CLIENT.RESET_STATE"}};var y=function(){function e(t){(0,a.default)(this,e),this.state=t}return(0,u.default)(e,[{key:"readDocument",value:function(e,t){return this.state.documents[e][t]}},{key:"writeDocument",value:function(e){this.setState((function(t){return h(h({},t),{},{documents:h(h({},t.documents),{},(0,i.default)({},e._type,h(h({},t.documents[e._type]),{},(0,i.default)({},e._id,e))))})}))}},{key:"setState",value:function(e){this.state=e(this.state)}},{key:"getState",value:function(){return this.state}}]),e}();t.StoreProxy=y;var v={documents:{},queries:{}},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;if("COZY_CLIENT.RESET_STATE"==t.type)return v;if(!(0,f.isQueryAction)(t)&&!(0,p.isMutationAction)(t))return e;if(t.update){var n=new y(e);return t.update(n,t.response),{documents:n.getState().documents,queries:(0,f.default)(n.getState().queries,t,n.getState().documents)}}var r=(0,l.default)(e.documents,t),o=r!==e.documents;return{documents:r,queries:(0,f.default)(e.queries,t,r,o)}},m=g;t.default=m;t.createStore=function(){return(0,c.createStore)((0,c.combineReducers)({cozy:g}),(0,c.applyMiddleware)(s.default))};var b=function(e){return e.cozy||{}};t.getStateRoot=b;t.getCollectionFromState=function(e,t){return(0,l.getCollectionFromSlice)(b(e).documents,t)};t.getDocumentFromState=function(e,t,n){return(0,l.getDocumentFromSlice)(b(e).documents,t,n)};t.getQueryFromStore=function(e,t){return w(e.getState(),t)};var w=function(e,t){return(0,f.getQueryFromSlice)(b(e).queries,t,b(e).documents)};t.getQueryFromState=w;t.getRawQueryFromState=function(e,t){return(0,f.getQueryFromSlice)(b(e).queries,t)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=(n(19),n(18),function(){function e(t,n,r,i){(0,o.default)(this,e);var a=i.dispatch,u=i.get,c=i.query,s=i.mutate,l=i.save;this.target=t,this.name=n,this.doctype=r,this.get=u,this.query=c,this.mutate=s,this.save=l,this.dispatch=a}return(0,i.default)(e,[{key:"raw",get:function(){throw new Error("A relationship must define its raw getter")}},{key:"data",get:function(){throw new Error("A relationship must define its data getter")}}],[{key:"query",value:function(e,t,n){throw new Error("A custom relationship must define its query() function")}}]),e}());t.default=a},function(e,t,n){"use strict";var r=n(27),o=n(93),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},function(e,t,n){var r=n(132);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(38).Symbol;e.exports=r},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){var r=n(393),o=n(138),i=n(394),a=n(210),u=n(211),c=n(51),s=n(200),l=s(r),f=s(o),p=s(i),d=s(a),h=s(u),y=c;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=y(new o)||i&&"[object Promise]"!=y(i.resolve())||a&&"[object Set]"!=y(new a)||u&&"[object WeakMap]"!=y(new u))&&(y=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case l:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=y},function(e,t,n){var r=n(22),o=n(147),i=n(397),a=n(63);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(77);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(218);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(149),o=n(69);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var u=-1,c=t.length;++u<c;){var s=t[u],l=i?i(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),a?o(n,s,l):r(n,s,l)}return n}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Collection=t.isDocumentUpdateConflict=t.isNoUsableIndexError=t.isIndexConflictError=t.isIndexNotFoundError=t.dontThrowNotFoundError=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(3)),u=r(n(7)),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e.message.match(/not_found/)){var n=Array.isArray(t);return n?{data:t,meta:{count:0},skip:0,next:!1}:{data:t}}throw e};t.dontThrowNotFoundError=c;t.isIndexNotFoundError=function(e){return e.message.match(/no_index/)};t.isIndexConflictError=function(e){return e.message.match(/error_saving_ddoc/)};t.isNoUsableIndexError=function(e){return e.message.match(/no_usable_index/)};t.isDocumentUpdateConflict=function(e){return e.message.match(/Document update conflict/)};var s=function(){function e(){(0,a.default)(this,e)}var t;return(0,u.default)(e,null,[{key:"get",value:(t=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u,s,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.normalize,a=void 0===i?function(e,t){return e}:i,u=r.method,s=void 0===u?"GET":u,e.prev=1,e.next=4,t.fetchJSON(s,n);case 4:return l=e.sent,e.abrupt("return",{data:a(l.data,l)});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",c(e.t0,null));case 11:case"end":return e.stop()}}),e,null,[[1,8]])}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.Collection=s;var l=s;t.default=l},function(e,t,n){var r=n(69),o=n(157),i=n(53);e.exports=function(e,t){var n={};return t=i(t,3),o(e,(function(e,o,i){r(n,o,t(e,o,i))})),n}},function(e,t,n){var r=n(41),o=n(246),i=n(492),a=n(67),u=n(70),c=n(494),s=n(167),l=n(150),f=s((function(e,t){var n={};if(null==e)return n;var s=!1;t=r(t,(function(t){return t=a(t,e),s||(s=t.length>1),t})),u(e,l(e),n),s&&(n=o(n,7,c));for(var f=t.length;f--;)i(n,t[f]);return n}));e.exports=f},function(e,t){e.exports={black:"var(--black)",white:"var(--white)",paleGrey:"var(--paleGrey)",silver:"var(--silver)",coolGrey:"var(--coolGrey)",slateGrey:"var(--slateGrey)",charcoalGrey:"var(--charcoalGrey)",overlay:"var(--overlay)",zircon:"var(--zircon)",frenchPass:"var(--frenchPass)",dodgerBlue:"var(--dodgerBlue)",scienceBlue:"var(--scienceBlue)",puertoRico:"var(--puertoRico)",grannyApple:"var(--grannyApple)",emerald:"var(--emerald)",malachite:"var(--malachite)",seafoamGreen:"var(--seafoamGreen)",brightSun:"var(--brightSun)",texasRose:"var(--texasRose)",chablis:"var(--chablis)",yourPink:"var(--yourPink)",fuchsia:"var(--fuchsia)",pomegranate:"var(--pomegranate)",monza:"var(--monza)",portage:"var(--portage)",azure:"var(--azure)",melon:"var(--melon)",blazeOrange:"var(--blazeOrange)",mango:"var(--mango)",pumpkinOrange:"var(--pumpkinOrange)",lavender:"var(--lavender)",darkPeriwinkle:"var(--darkPeriwinkle)",purpley:"var(--purpley)",lightishPurple:"var(--lightishPurple)",barney:"var(--barney)",weirdGreen:"var(--weirdGreen)",primaryColor:"var(--primaryColor)",primaryColorLight:"var(--primaryColorLight)",primaryContrastTextColor:"var(--primaryContrastTextColor)"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return u}));var r="SET_LOCALE",o=function(e){return{type:r,lang:e}},i=function(){return document.documentElement.getAttribute("lang")||"en"},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i(),t=arguments.length>1?arguments[1]:void 0;return t.type===r?t.lang:e},u=function(e){return e}},function(e,t,n){e.exports={"c-loading-placeholder":"cozy-ui-bar-c-loading-placeholder--215aK",placeHolderShimmer:"cozy-ui-bar-placeHolderShimmer--3-jlD","c-app-icon":"cozy-ui-bar-c-app-icon--3Xbeb","c-app-icon-default":"cozy-ui-bar-c-app-icon-default--2Jv93"}},function(e,t,n){var r=n(51),o=n(39);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(207),o=n(146),i=n(46);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){var r=n(389),o=n(39),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(38),o=n(390),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===i?r.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;e.exports=c}).call(this,n(106)(e))},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=n(431);e.exports=Function.prototype.bind||r},function(e,t,n){var r=n(85),o=n(86);e.exports={distanceInWords:r(),format:o()}},function(e,t){e.exports=function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var o;return r=r||{},o="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+o:o+" ago":o}}}},function(e,t,n){var r=n(56);e.exports=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],a=["AM","PM"],u=["am","pm"],c=["a.m.","p.m."],s={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return o[e.getDay()]},dddd:function(e){return i[e.getDay()]},A:function(e){return e.getHours()/12>=1?a[1]:a[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){return e.getHours()/12>=1?c[1]:c[0]}};return["M","D","DDD","d","Q","W"].forEach((function(e){s[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}})),{formatters:s,formattingTokensRegExp:r(s)}}},function(e,t){e.exports=function(){var e={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}};return{localize:function(t,n,r){var o;return r=r||{},o="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"en "+o:"hace "+o:o}}}},function(e,t,n){var r=n(56);e.exports=function(){var e=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],t=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],n=["do","lu","ma","mi","ju","vi","sa"],o=["dom","lun","mar","mié","jue","vie","sáb"],i=["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],a=["AM","PM"],u=["am","pm"],c=["a.m.","p.m."],s={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return o[e.getDay()]},dddd:function(e){return i[e.getDay()]},A:function(e){return e.getHours()/12>=1?a[1]:a[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){return e.getHours()/12>=1?c[1]:c[0]}};return["M","D","DDD","d","Q","W"].forEach((function(e){s[e+"o"]=function(t,n){return n[e](t)+"º"}})),{formatters:s,formattingTokensRegExp:r(s)}}},function(e,t){e.exports=function(){var e={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}};return{localize:function(t,n,r){var o;return r=r||{},o="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"dans "+o:"il y a "+o:o}}}},function(e,t,n){var r=n(56);e.exports=function(){var e=["janv.","févr.","mars","avr.","mai","juin","juill.","août","sept.","oct.","nov.","déc."],t=["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],n=["di","lu","ma","me","je","ve","sa"],o=["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],i=["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],a=["AM","PM"],u=["am","pm"],c=["du matin","de l’après-midi","du soir"],s={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return o[e.getDay()]},dddd:function(e){return i[e.getDay()]},A:function(e){return e.getHours()/12>=1?a[1]:a[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){var t=e.getHours();return t<=12?c[0]:t<=16?c[1]:c[2]},Wo:function(e,t){return function(e){if(1===e)return"1re";return e+"e"}(t.W(e))}};return["M","D","DDD","d","Q"].forEach((function(e){s[e+"o"]=function(t,n){return function(e){if(1===e)return"1er";return e+"e"}(n[e](t))}})),["MMM","MMMM"].forEach((function(e){s["Do "+e]=function(t,n){var r=1===t.getDate()?"Do":"D";return(s[r]||n[r])(t,n)+" "+s[e](t)}})),{formatters:s,formattingTokensRegExp:r(s)}}},function(e,t,n){var r=n(509);function o(t,n,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=o=Reflect.get:e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}},o(t,n,i||t)}e.exports=o},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.updateRelationship=t.updateHasManyItem=t.removeHasManyItem=t.setHasManyItem=t.getHasManyItems=t.getHasManyItem=void 0;var o=r(n(3)),i=r(n(7)),a=r(n(11)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=r(n(2)),f=r(n(31)),p=r(n(16)),d=r(n(121)),h=n(18),y=n(60),v=(n(19),r(n(61)));function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,l.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var w=function(e){(0,u.default)(n,e);var t=b(n);function n(){var e;(0,o.default)(this,n);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return e=t.call.apply(t,[this].concat(i)),(0,l.default)((0,a.default)(e),"updateRelationshipData",(function(t){return function(n,r){var o=(0,y.getDocumentFromState)(r(),e.target._type,e.target._id);n((0,y.receiveQueryResult)(null,{data:m(m({},o),{},{relationships:m(m({},o.relationships),{},(0,l.default)({},e.name,t(o.relationships[e.name])))})}))}})),e}return(0,i.default)(n,[{key:"fetchMore",value:function(){throw"Not implemented"}},{key:"exists",value:function(e){return this.existsById(e._id)}},{key:"containsById",value:function(e){return void 0!==this.getRelationship().data.find((function(t){var n=t._id;return e===n}))}},{key:"existsById",value:function(e){return Boolean(this.containsById(e)&&this.get(this.doctype,e))}},{key:"add",value:function(e){var t=(Array.isArray(e)?e:[e]).map((function(e){return e._id}));return this.addById(t)}},{key:"remove",value:function(e){var t=(Array.isArray(e)?e:[e]).map((function(e){return e._id}));return this.removeById(t)}},{key:"addTargetRelationships",value:function(e){var t,n=this;this.target.relationships||(this.target.relationships={}),this.target.relationships[this.name]||(this.target.relationships[this.name]={data:[]});var r=(Array.isArray(e)?e:[e]).filter((function(e){return!n.existsById(e)})).map((function(e){return{_id:e,_type:n.doctype}}));(t=this.target.relationships[this.name].data).push.apply(t,(0,f.default)(r)),this.updateMetaCount()}},{key:"addById",value:function(e){return this.addTargetRelationships(e),this.save(this.target)}},{key:"removeTargetRelationships",value:function(e){var t=Array.isArray(e)?e:[e];this.target.relationships[this.name].data=this.target.relationships[this.name].data.filter((function(e){var n=e._id;return!t.includes(n)})),this.updateMetaCount()}},{key:"removeById",value:function(e){return this.removeTargetRelationships(e),this.save(this.target)}},{key:"updateMetaCount",value:function(){void 0!==(0,p.default)(this.target.relationships[this.name],"meta.count")&&(this.target.relationships[this.name].meta=m(m({},this.target.relationships[this.name].meta),{},{count:this.target.relationships[this.name].data.length}))}},{key:"getRelationship",value:function(){var e=this.target[this.name],t=(0,p.default)(this.target,"relationships.".concat(this.name));return t||(e&&e.length&&console.warn("You're trying to access data on a relationship that appear to not be loaded yet. You may want to use 'include()' on your query"),{data:[],next:!0,meta:{count:0}})}},{key:"updateTargetRelationship",value:function(e,t){var n=e.readDocument(this.target._type,this.target._id);e.writeDocument(this.updateRelationship(n,t))}},{key:"updateRelationship",value:function(e,t){return n.updateRelationship(e,this.name,t)}},{key:"dehydrate",value:function(e){return m(m({},e),{},{relationships:m(m({},e.relationships),{},(0,l.default)({},this.name,{data:this.raw}))})}},{key:"raw",get:function(){return this.getRelationship().data}},{key:"data",get:function(){var e=this;return this.getRelationship().data.map((function(t){var n=t._id,r=t._type;return e.get(r,n)})).filter(Boolean)}},{key:"hasMore",get:function(){return this.getRelationship().next}},{key:"count",get:function(){var e=this.getRelationship();return e.meta?e.meta.count:e.data.length}}],[{key:"query",value:function(e,t,n){var r=(0,p.default)(e,"relationships.".concat(n.name,".data"),[]).map((function(e){return e._id}));return new h.QueryDefinition({doctype:n.doctype,ids:r})}}]),n}(v.default),x=w.getHasManyItem=function(e,t,n){return(0,p.default)(e,"relationships.".concat(t,".data"),[]).find((function(e){return e._id==n}))};t.getHasManyItem=x;var _=w.getHasManyItems=function(e,t){return(0,p.default)(e,"relationships.".concat(t,".data"),[])};t.getHasManyItems=_;var k=w.setHasManyItem=function(e,t,n,r){var o,i,a,u,c=w.getHasManyItems(e,t),s=c.findIndex((function(e){return e._id===n})),l=(0,d.default)({},c[s],r),p=(o=c,a=l,u=-1===(i=s)?o.length:i,[].concat((0,f.default)(o.slice(0,u)),[a],(0,f.default)(o.slice(u+1))));return w.updateRelationship(e,t,(function(e){return(0,d.default)({},e,{data:p})}))};t.setHasManyItem=k;var O=w.removeHasManyItem=function(e,t,n){var r=w.getHasManyItems(e,t).filter((function(e){return e._id!==n}));return w.updateRelationship(e,t,(function(){return{data:r}}))};t.removeHasManyItem=O;var S=w.updateHasManyItem=function(e,t,n,r){var o=r(w.getHasManyItem(e,t,n));return w.setHasManyItem(e,t,n,o)};t.updateHasManyItem=S;var E=w.updateRelationship=function(e,t,n){return m(m({},e),{},{relationships:m(m({},e.relationships),{},(0,l.default)({},t,m(m({},e.relationships?e.relationships[t]:{}),n(e.relationships?e.relationships[t]:{}))))})};t.updateRelationship=E;var j=w;t.default=j},function(e,t,n){"use strict";var r=n(83),o=n(27),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||r.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),s=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(s)try{s({},"a",{value:1})}catch(e){s=null}e.exports=function(e){var t=u(r,a,arguments);if(c&&s){var n=c(t,"length");n.configurable&&s(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var f=function(){return u(r,i,arguments)};s?s(e.exports,"apply",{value:f}):e.exports.apply=f},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c}));var r,o=n(322),i=n.n(o),a=n(20),u=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.DEFAULT_LANG;if(r=new i.a({phrases:t(o),locale:o}),e&&e!==o)try{var u=t(e);r.extend(u),r.locale(e)}catch(t){console.warn('The dict phrases for "'.concat(e,"\" can't be loaded"))}if(n)try{var c=t(e,n);r.extend(c)}catch(t){console.warn("The context ".concat(n," cannot be loaded for lang ").concat(e))}return r},c=function(e){return r&&r.extend(e)}},function(e,t,n){"use strict";e.exports=n(429)},function(e,t,n){"use strict";var r=n(95),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function c(e){return r.isMemo(e)?a:u[e.$$typeof]||o}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=a;var s=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=d(n);o&&o!==h&&e(t,o,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var u=c(t),y=c(n),v=0;v<a.length;++v){var g=a[v];if(!(i[g]||r&&r[g]||y&&y[g]||u&&u[g])){var m=p(n,g);try{s(t,g,m)}catch(e){}}}}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCordova=void 0;t.isCordova=function(){return"undefined"!=typeof window&&void 0!==window.cordova}},function(e,t,n){var r=n(99),o=n(361),i=n(362),a=n(363),u=n(364),c=n(365);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=u,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(356),o=n(357),i=n(358),a=n(359),u=n(360);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,e.exports=c},function(e,t,n){var r=n(78);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(54)(Object,"create");e.exports=r},function(e,t,n){var r=n(378);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(140),o=n(383),i=n(384);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(391),o=n(65),i=n(145),a=i&&i.isTypedArray,u=a?o(a):r;e.exports=u},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(67),o=n(68);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){var r=n(207),o=n(402),i=n(46);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t,n){e.exports=window.ReactDOM||n(423)},function(e,t,n){"use strict";var r=TypeError,o=Object.getOwnPropertyDescriptor;if(o)try{o({},"")}catch(e){o=null}var i=function(){throw new r},a=o?function(){try{return i}catch(e){try{return o(arguments,"callee").get}catch(e){return i}}}():i,u=n(155)(),c=Object.getPrototypeOf||function(e){return e.__proto__},s=void 0,l="undefined"==typeof Uint8Array?void 0:c(Uint8Array),f={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":u?c([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":s&&u&&Symbol.asyncIterator?s[Symbol.asyncIterator]():void 0,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?c(c([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%JSONParse%":"object"==typeof JSON?JSON.parse:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u?c((new Map)[Symbol.iterator]()):void 0,"%MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"%PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"%Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"%Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"%Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u?c((new Set)[Symbol.iterator]()):void 0,"%SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":u?c(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":u?Symbol:void 0,"%SymbolPrototype%":u?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":a,"%TypedArray%":l,"%TypedArrayPrototype%":l?l.prototype:void 0,"%TypeError%":r,"%TypeErrorPrototype%":r.prototype,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype},p=n(83).call(Function.call,String.prototype.replace),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,h=/\\(\\)?/g,y=function(e){var t=[];return p(e,d,(function(e,n,r,o){t[t.length]=r?p(o,h,"$1"):n||e})),t},v=function(e,t){if(!(e in f))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===f[e]&&!t)throw new r("intrinsic "+e+" exists, but is not available. Please file an issue!");return f[e]};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');for(var n=y(e),i=v("%"+(n.length>0?n[0]:"")+"%",t),a=1;a<n.length;a+=1)if(null!=i)if(o&&a+1>=n.length){var u=o(i,n[a]);if(!t&&!(n[a]in i))throw new r("base intrinsic for "+e+" exists, but the property is not available.");i=u?u.get||u.value:i[n[a]]}else i=i[n[a]];return i}},function(e,t,n){var r=n(87),o=n(88);e.exports={distanceInWords:r(),format:o()}},function(e,t,n){var r=n(89),o=n(90);e.exports={distanceInWords:r(),format:o()}},function(e,t,n){var r=n(105),o=n(457);e.exports=function e(t,n,i,a,u){var c=-1,s=t.length;for(i||(i=o),u||(u=[]);++c<s;){var l=t[c];n>0&&i(l)?n>1?e(l,n-1,i,a,u):r(u,l):a||(u[u.length]=l)}return u}},function(e,t,n){var r=n(46),o=n(39);e.exports=function(e){return o(e)&&r(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(159);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HasManyFiles",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"HasMany",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"HasOne",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"HasOneInPlace",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"HasManyInPlace",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"HasManyTriggers",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"Association",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"resolveClass",{enumerable:!0,get:function(){return f.resolveClass}}),Object.defineProperty(t,"create",{enumerable:!0,get:function(){return f.create}}),Object.defineProperty(t,"isReferencedBy",{enumerable:!0,get:function(){return f.isReferencedBy}}),Object.defineProperty(t,"isReferencedById",{enumerable:!0,get:function(){return f.isReferencedById}}),Object.defineProperty(t,"getReferencedBy",{enumerable:!0,get:function(){return f.getReferencedBy}}),Object.defineProperty(t,"getReferencedById",{enumerable:!0,get:function(){return f.getReferencedById}});var o=r(n(266)),i=r(n(92)),a=r(n(280)),u=r(n(281)),c=r(n(282)),s=r(n(548)),l=r(n(61)),f=n(178)},function(e,t,n){var r=n(543),o=n(546)((function(e,t,n){r(e,t,n)}));e.exports=o},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(0),i=r(n(183)),a=(r(n(40)),function(){return(0,o.useContext)(i.default).client});t.default=a},function(e,t,n){var r=n(140);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){var r=n(404),o=r.enable,i=r.disable,a="undefined"!=typeof navigator&&/chrome/i.test(navigator.userAgent),u=n(406);if(r.defaultBackend=a?u.minilog:u,"undefined"!=typeof window){try{r.enable(JSON.parse(window.localStorage.minilogSettings))}catch(e){}if(window.location&&window.location.search){var c=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);c&&r.enable(decodeURIComponent(c[1]))}}r.enable=function(){o.call(r,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(e){}return this},r.disable=function(){i.call(r);try{delete window.localStorage.minilogSettings}catch(e){}return this},(e.exports=r).backends={array:n(409),browser:r.defaultBackend,localStorage:n(410),jQuery:n(411)}},function(e,t,n){"use strict";var r=n(124),o=n.n(r),i=o()("cozy-bar");o.a.suggest.deny("cozy-bar","info"),t.a=i},function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(9),a=n.n(i),u=n(316),c=n.n(u),s=n(317),l={},f={gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"};function p(){return(p=a()(o.a.mark((function e(t){var n,r,i,a,u,c,s,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]?p[1]:{},!((r=!(p.length>2&&void 0!==p[2])||p[2])&&l.icons&&l.icons[i])){e.next=4;break}return e.abrupt("return",l.icons[i]);case 4:if(i=n.links&&n.links.icon){e.next=7;break}return e.abrupt("return","");case 7:return e.prev=7,e.next=10,t(i);case 10:if((u=e.sent).ok){e.next=13;break}throw new Error("Error while fetching icon ".concat(u.statusText,": ").concat(i));case 13:return e.next=15,u.blob();case 15:a=e.sent,e.next=21;break;case 18:throw e.prev=18,e.t0=e.catch(7),e.t0;case 21:if(a.type){e.next=30;break}if(n.icon){e.next=24;break}throw new Error("".concat(n.name,": Cannot detect mime type for icon ").concat(i));case 24:if(c=n.icon.split(".").pop()){e.next=27;break}throw new Error("".concat(n.name,": Unable to detect icon mime type from extension (").concat(n.icon,")"));case 27:if(f[c]){e.next=29;break}throw new Error("".concat(n.name,": 'Unexpected icon extension (").concat(n.icon,")"));case 29:a=new Blob([a],{type:f[c]});case 30:if(!a.type.match(/^image\/.*$/)){e.next=34;break}return s=URL.createObjectURL(a),r&&(l.icons=l.icons||{},l.icons[i]=s),e.abrupt("return",s);case 34:throw new Error("".concat(n.name,": icon ").concat(i," is not an image."));case 35:case"end":return e.stop()}}),e,null,[[7,18]])})))).apply(this,arguments)}var d=n(318),h=n.n(d);var y=function(e){var t=e.getApp,n=e.onCreate,r=e.onDelete,i=e.cozyClient,u=function(){var e=a()(o.a.mark((function e(r){var i;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(r.slug);case 3:i=e.sent,e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(0),new Error("Cannot fetch app ".concat(r.slug,": ").concat(e.t0.message));case 9:"function"==typeof n&&n(i);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}();try{var c=new h.a({client:i});c.subscribe("created","io.cozy.apps",u),c.subscribe("deleted","io.cozy.apps",(function(e){"function"==typeof r&&r(e)}))}catch(e){console.warn("Cannot initialize realtime in Cozy-bar: ".concat(e.message))}},v=n(3),g=n.n(v),m=n(8),b=n.n(m),w=n(10),x=n.n(w),_=n(6),k=n.n(_),O=n(35),S=n.n(O);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=k()(e);if(t){var o=k()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return x()(this,n)}}var j=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="Forbidden",r.status=403,r.message=e||"The application does not have permission to access this resource.",r.stack=(new Error).stack,r}return n}(S()(Error)),P=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="ServerError",r.status=500,r.message=e||"A server error occurred",r.stack=(new Error).stack,r}return n}(S()(Error)),C=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="NotFound",r.status=404,r.message=e||"The ressource was not found",r.stack=(new Error).stack,r}return n}(S()(Error)),T=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="MethodNotAllowed",r.status=405,r.message=e||"Method not allowed",r.stack=(new Error).stack,r}return n}(S()(Error)),A=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="UnavailableStack",r.message=e||"The stack is temporarily unavailable",r.stack=(new Error).stack,r}return n}(S()(Error)),D=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="UnauthorizedStack",r.status=401,r.message=e||"The app is not allowed to access to the requested resource",r.stack=(new Error).stack,r}return n}(S()(Error)),R=function(e){b()(n,e);var t=E(n);function n(e){var r;return g()(this,n),(r=t.call(this)).name="UnavailableSettings",r.message=e||"The 'Settings' application isn't available or installed in the stack",r.stack=(new Error).stack,r}return n}(S()(Error)),I=n(23);n.d(t,"a",(function(){return $}));var N,z,M,F,L={401:D,403:j,404:C,405:T,500:P},U=function(){return N.getStackClient()},B=function(){return new URL(U().uri)},q=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.headers=r.headers||{};return o.Accept="application/json","GET"!==e&&"HEAD"!==e&&void 0!==n&&(o["Content-Type"]||(o["Content-Type"]="application/json",n=JSON.stringify(n))),U().fetch(e,t,n,r).then((function(e){if("function"==typeof L[e.status])throw new L[e.status];if(!e.headers.get("content-type").includes("json"))throw new Error("Server response not in JSON");return e.json()}))},H=function(e){if(!e)throw new Error("Missing slug");return q("GET","/apps/".concat(e)).then((function(e){if(e.error)throw new Error(e.error);return e.data}))},W=Math.pow(10,12),Q=function(e){return U().fetch("GET",e)},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=N?N.constructor:{},r=null!==t?t:n;if(!r.version)return!1;var o=c()(r.version,e);return o>=0};t.b={get:{app:H,apps:function(){return q("GET","/apps/").then((function(e){if(e.error)throw new Error(e.error);return e.data}))},context:(z=function(){return q("GET","/settings/context")},M={},F=void 0,a()(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==F){e.next=10;break}return e.prev=1,e.next=4,z();case 4:F=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),t=e.t0,F=["NotFoundException","NotFound","FetchError"].includes(t.name)&&t.status&&404===t.status?M:void 0;case 10:return e.abrupt("return",F);case 11:case"end":return e.stop()}var t}),e,null,[[1,7]])})))),storageData:function(){return q("GET","/settings/disk-usage").then((function(e){var t=parseInt(e.data.attributes.used,10);return{usage:t,quota:parseInt(e.data.attributes.quota,10)||Math.max(W,10*t),isLimited:e.data.attributes.is_limited}})).catch((function(){throw new A}))},iconProps:function(){var e={fetchIcon:function(e){return function(e){return p.apply(this,arguments)}(Q,e,!0)}},t={domain:B().host,secure:"https:"===B().protocol};return Object(I.isMobileApp)()?e:t},cozyURL:function(){return B().origin},intents:function(){return new s.Intents({client:N})},settingsAppURL:function(){return H("settings").then((function(e){if(!e)throw new R;return e.links.related}))}},updateAccessToken:function(){throw new Error("updateAccessToken should not be used with a cozy-client instance initialization")},cozyFetchJSON:function(e,t,n,r){return q(t,n,r).then((function(e){var t=Object.assign({},e.data);return t.id&&(t._id=t.id),t}))},logout:function(){return U().fetch("DELETE","/auth/login").then((function(e){if(401===e.status)throw new D;return 204===e.status&&window.location.reload(),!0})).catch((function(){throw new A}))},init:function(e){var t=e.cozyClient,n=e.onCreate,r=e.onDelete;(N=t).isLogged&&y({getApp:H,onCreate:n,onDelete:r,cozyClient:N})}}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,u){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,a,u],l=0;(c=new Error(t.replace(/%s/g,(function(){return s[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){var r;
7
+ /*! Hammer.JS - v2.0.7 - 2016-04-22
8
+ * http://hammerjs.github.io/
9
+ *
10
+ * Copyright (c) 2016 Jorik Tangelder;
11
+ * Licensed under the MIT license */!function(o,i,a,u){"use strict";var c,s=["","webkit","Moz","MS","ms","o"],l=i.createElement("div"),f=Math.round,p=Math.abs,d=Date.now;function h(e,t,n){return setTimeout(x(e,n),t)}function y(e,t,n){return!!Array.isArray(e)&&(v(e,n[t],n),!0)}function v(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(void 0!==e.length)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function g(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=o.console&&(o.console.warn||o.console.log);return i&&i.call(o.console,r,n),e.apply(this,arguments)}}c="function"!=typeof Object.assign?function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=g((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&void 0===e[r[o]])&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),b=g((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function w(e,t,n){var r,o=t.prototype;(r=e.prototype=Object.create(o)).constructor=e,r._super=o,n&&c(r,n)}function x(e,t){return function(){return e.apply(t,arguments)}}function _(e,t){return"function"==typeof e?e.apply(t&&t[0]||void 0,t):e}function k(e,t){return void 0===e?t:e}function O(e,t,n){v(P(t),(function(t){e.addEventListener(t,n,!1)}))}function S(e,t,n){v(P(t),(function(t){e.removeEventListener(t,n,!1)}))}function E(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function j(e,t){return e.indexOf(t)>-1}function P(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function T(e){return Array.prototype.slice.call(e,0)}function A(e,t,n){for(var r=[],o=[],i=0;i<e.length;){var a=t?e[i][t]:e[i];C(o,a)<0&&r.push(e[i]),o[i]=a,i++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function D(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),i=0;i<s.length;){if((r=(n=s[i])?n+o:t)in e)return r;i++}}var R=1;function I(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||o}var N="ontouchstart"in o,z=void 0!==D(o,"PointerEvent"),M=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F=["x","y"],L=["clientX","clientY"];function U(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){_(e.options.enable,[e])&&n.handler(t)},this.init()}function B(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,i=1&t&&r-o==0,a=12&t&&r-o==0;n.isFirst=!!i,n.isFinal=!!a,i&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=q(t));o>1&&!n.firstMultiple?n.firstMultiple=q(t):1===o&&(n.firstMultiple=!1);var i=n.firstInput,a=n.firstMultiple,u=a?a.center:i.center,c=t.center=H(r);t.timeStamp=d(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=G(u,c),t.distance=$(u,c),function(e,t){var n=t.center,r=e.offsetDelta||{},o=e.prevDelta||{},i=e.prevInput||{};1!==t.eventType&&4!==i.eventType||(o=e.prevDelta={x:i.deltaX||0,y:i.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=o.x+(n.x-r.x),t.deltaY=o.y+(n.y-r.y)}(n,t),t.offsetDirection=Q(t.deltaX,t.deltaY);var s=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=s.x,t.overallVelocityY=s.y,t.overallVelocity=p(s.x)>p(s.y)?s.x:s.y,t.scale=a?(l=a.pointers,f=r,$(f[0],f[1],L)/$(l[0],l[1],L)):1,t.rotation=a?function(e,t){return G(t[1],t[0],L)+G(e[1],e[0],L)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,i,a=e.lastInterval||t,u=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(u>25||void 0===a.velocity)){var c=t.deltaX-a.deltaX,s=t.deltaY-a.deltaY,l=W(u,c,s);r=l.x,o=l.y,n=p(l.x)>p(l.y)?l.x:l.y,i=Q(c,s),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,i=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=i}(n,t);var l,f;var h=e.element;E(t.srcEvent.target,h)&&(h=t.srcEvent.target);t.target=h}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function q(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:f(e.pointers[n].clientX),clientY:f(e.pointers[n].clientY)},n++;return{timeStamp:d(),pointers:t,center:H(t),deltaX:e.deltaX,deltaY:e.deltaY}}function H(e){var t=e.length;if(1===t)return{x:f(e[0].clientX),y:f(e[0].clientY)};for(var n=0,r=0,o=0;o<t;)n+=e[o].clientX,r+=e[o].clientY,o++;return{x:f(n/t),y:f(r/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function Q(e,t){return e===t?1:p(e)>=p(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],o=t[n[1]]-e[n[1]];return Math.sqrt(r*r+o*o)}function G(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],o=t[n[1]]-e[n[1]];return 180*Math.atan2(o,r)/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)}};var V={mousedown:1,mousemove:2,mouseup:4};function J(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,U.apply(this,arguments)}w(J,U,{handler:function(e){var t=V[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var Y={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},K={2:"touch",3:"pen",4:"mouse",5:"kinect"},X="pointerdown",Z="pointermove pointerup pointercancel";function ee(){this.evEl=X,this.evWin=Z,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(X="MSPointerDown",Z="MSPointerMove MSPointerUp MSPointerCancel"),w(ee,U,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),o=Y[r],i=K[e.pointerType]||e.pointerType,a="touch"==i,u=C(t,e.pointerId,"pointerId");1&o&&(0===e.button||a)?u<0&&(t.push(e),u=t.length-1):12&o&&(n=!0),u<0||(t[u]=e,this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(u,1))}});var te={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ne(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,U.apply(this,arguments)}function re(e,t){var n=T(e.touches),r=T(e.changedTouches);return 12&t&&(n=A(n.concat(r),"identifier",!0)),[n,r]}w(ne,U,{handler:function(e){var t=te[e.type];if(1===t&&(this.started=!0),this.started){var n=re.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},U.apply(this,arguments)}function ae(e,t){var n=T(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var o,i,a=T(e.changedTouches),u=[],c=this.target;if(i=n.filter((function(e){return E(e.target,c)})),1===t)for(o=0;o<i.length;)r[i[o].identifier]=!0,o++;for(o=0;o<a.length;)r[a[o].identifier]&&u.push(a[o]),12&t&&delete r[a[o].identifier],o++;return u.length?[A(i.concat(u),"identifier",!0),u]:void 0}w(ie,U,{handler:function(e){var t=oe[e.type],n=ae.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}});function ue(){U.apply(this,arguments);var e=x(this.handler,this);this.touch=new ie(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function ce(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,se.call(this,t)):12&e&&se.call(this,t)}function se(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function le(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var o=this.lastTouches[r],i=Math.abs(t-o.x),a=Math.abs(n-o.y);if(i<=25&&a<=25)return!0}return!1}w(ue,U,{handler:function(e,t,n){var r="touch"==n.pointerType,o="mouse"==n.pointerType;if(!(o&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)ce.call(this,t,n);else if(o&&le.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var fe=D(l.style,"touchAction"),pe=void 0!==fe,de=function(){if(!pe)return!1;var e={},t=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!t||o.CSS.supports("touch-action",n)})),e}();function he(e,t){this.manager=e,this.set(t)}he.prototype={set:function(e){"compute"==e&&(e=this.compute()),pe&&this.manager.element.style&&de[e]&&(this.manager.element.style[fe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return v(this.manager.recognizers,(function(t){_(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(j(e,"none"))return"none";var t=j(e,"pan-x"),n=j(e,"pan-y");if(t&&n)return"none";if(t||n)return t?"pan-x":"pan-y";if(j(e,"manipulation"))return"manipulation";return"auto"}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,o=j(r,"none")&&!de.none,i=j(r,"pan-y")&&!de["pan-y"],a=j(r,"pan-x")&&!de["pan-x"];if(o){var u=1===e.pointers.length,c=e.distance<2,s=e.deltaTime<250;if(u&&c&&s)return}if(!a||!i)return o||i&&6&n||a&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function ye(e){this.options=c({},this.defaults,e||{}),this.id=R++,this.manager=null,this.options.enable=k(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function ve(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ge(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function me(e,t){var n=t.manager;return n?n.get(e):e}function be(){ye.apply(this,arguments)}function we(){be.apply(this,arguments),this.pX=null,this.pY=null}function xe(){be.apply(this,arguments)}function _e(){ye.apply(this,arguments),this._timer=null,this._input=null}function ke(){be.apply(this,arguments)}function Oe(){be.apply(this,arguments)}function Se(){ye.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ee(e,t){return(t=t||{}).recognizers=k(t.recognizers,Ee.defaults.preset),new je(e,t)}ye.prototype={defaults:{},set:function(e){return c(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(y(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=me(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return y(e,"dropRecognizeWith",this)||(e=me(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(y(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=me(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(y(e,"dropRequireFailure",this))return this;e=me(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+ve(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+ve(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=c({},e);if(!_(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},w(be,ye,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,o=this.attrTest(e);return r&&(8&n||!o)?16|t:r||o?4&n?8|t:2&t?4|t:2:32}}),w(we,be,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push("pan-y"),24&e&&t.push("pan-x"),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,o=e.direction,i=e.deltaX,a=e.deltaY;return o&t.direction||(6&t.direction?(o=0===i?1:i<0?2:4,n=i!=this.pX,r=Math.abs(e.deltaX)):(o=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=o,n&&r>t.threshold&&o&t.direction},attrTest:function(e){return be.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ge(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),w(xe,be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),w(_e,ye,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!o)this.reset();else if(1&e.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),w(ke,be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),w(Oe,be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return we.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&p(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ge(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),w(Se,ye,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&o&&n){if(4!=e.eventType)return this.failTimeout();var i=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&i?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=h((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ee.VERSION="2.0.7",Ee.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[ke,{enable:!1}],[xe,{enable:!1},["rotate"]],[Oe,{direction:6}],[we,{direction:6},["swipe"]],[Se],[Se,{event:"doubletap",taps:2},["tap"]],[_e]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function je(e,t){var n;this.options=c({},Ee.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(z?ee:M?ie:N?ue:J))(n,B),this.touchAction=new he(this,this.options.touchAction),Pe(this,!0),v(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Pe(e,t){var n,r=e.element;r.style&&(v(e.options.cssProps,(function(o,i){n=D(r.style,i),t?(e.oldCssProps[n]=r.style[n],r.style[n]=o):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}je.prototype={set:function(e){return c(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,o=t.curRecognizer;(!o||o&&8&o.state)&&(o=t.curRecognizer=null);for(var i=0;i<r.length;)n=r[i],2===t.stopped||o&&n!=o&&!n.canRecognizeWith(o)?n.reset():n.recognize(e),!o&&14&n.state&&(o=t.curRecognizer=n),i++}},get:function(e){if(e instanceof ye)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(y(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(y(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(void 0!==e&&void 0!==t){var n=this.handlers;return v(P(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(void 0!==e){var n=this.handlers;return v(P(e),(function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=i.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&Pe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},c(Ee,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:je,Input:U,TouchAction:he,TouchInput:ie,MouseInput:J,PointerEventInput:ee,TouchMouseInput:ue,SingleTouchInput:ne,Recognizer:ye,AttrRecognizer:be,Tap:Se,Pan:we,Swipe:Oe,Pinch:xe,Rotate:ke,Press:_e,on:O,off:S,each:v,merge:b,extend:m,assign:c,inherit:w,bindFn:x,prefixed:D}),(void 0!==o?o:"undefined"!=typeof self?self:{}).Hammer=Ee,void 0===(r=function(){return Ee}.call(t,n,t,e))||(e.exports=r)}(window,document)},function(e,t,n){var r,o,i;o=[t],void 0===(i="function"==typeof(r=function(e){"use strict";function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0});var n=!1;if("undefined"!=typeof window){var r={get passive(){n=!0}};window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}function o(e){return c.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))}function i(e){var t=e||window.event;return!!o(t.target)||1<t.touches.length||(t.preventDefault&&t.preventDefault(),!1)}function a(){setTimeout((function(){void 0!==p&&(document.body.style.paddingRight=p,p=void 0),void 0!==f&&(document.body.style.overflow=f,f=void 0)}))}var u="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&1<window.navigator.maxTouchPoints),c=[],s=!1,l=-1,f=void 0,p=void 0;e.disableBodyScroll=function(e,r){if(u){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!c.some((function(t){return t.targetElement===e}))){var a={targetElement:e,options:r||{}};c=[].concat(t(c),[a]),e.ontouchstart=function(e){1===e.targetTouches.length&&(l=e.targetTouches[0].clientY)},e.ontouchmove=function(t){var n,r,a,u;1===t.targetTouches.length&&(r=e,u=(n=t).targetTouches[0].clientY-l,o(n.target)||(r&&0===r.scrollTop&&0<u||(a=r)&&a.scrollHeight-a.scrollTop<=a.clientHeight&&u<0?i(n):n.stopPropagation()))},s||(document.addEventListener("touchmove",i,n?{passive:!1}:void 0),s=!0)}}else{h=r,setTimeout((function(){if(void 0===p){var e=!!h&&!0===h.reserveScrollBarGap,t=window.innerWidth-document.documentElement.clientWidth;e&&0<t&&(p=document.body.style.paddingRight,document.body.style.paddingRight=t+"px")}void 0===f&&(f=document.body.style.overflow,document.body.style.overflow="hidden")}));var d={targetElement:e,options:r||{}};c=[].concat(t(c),[d])}var h},e.clearAllBodyScrollLocks=function(){u?(c.forEach((function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null})),s&&(document.removeEventListener("touchmove",i,n?{passive:!1}:void 0),s=!1),c=[],l=-1):(a(),c=[])},e.enableBodyScroll=function(e){if(u){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,c=c.filter((function(t){return t.targetElement!==e})),s&&0===c.length&&(document.removeEventListener("touchmove",i,n?{passive:!1}:void 0),s=!1)}else(c=c.filter((function(t){return t.targetElement!==e}))).length||a()}})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){e.exports={"CozyTheme--normal":"cozy-ui-bar-CozyTheme--normal--1OuNS","c-spinner":"cozy-ui-bar-c-spinner--3vDLT","c-spinner--middle":"cozy-ui-bar-c-spinner--middle--1Nmj_","c-spinner--nomargin":"cozy-ui-bar-c-spinner--nomargin--2GQe1",spin:"cozy-ui-bar-spin--3DZqI",shake:"cozy-ui-bar-shake--1gzL2"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWebApp=t.isMobileApp=t.isMobile=t.isIOSApp=t.isIOS=t.isFlagshipApp=t.isAndroidApp=t.isAndroid=t.getPlatform=void 0;var r=n(97),o=function(){return(0,r.isCordova)()?window.cordova.platformId:"web"};t.getPlatform=o;var i=function(e){return o()===e};t.isIOSApp=function(){return i("ios")};t.isAndroidApp=function(){return i("android")};t.isWebApp=function(){return i("web")};t.isMobileApp=function(){return(0,r.isCordova)()};var a=function(){return window.navigator.userAgent&&window.navigator.userAgent.indexOf("Android")>=0};t.isAndroid=a;var u=function(){return window.navigator.userAgent&&/iPad|iPhone|iPod/.test(window.navigator.userAgent)};t.isIOS=u;t.isMobile=function(){return a()||u()};t.isFlagshipApp=function(){var e;return null===(e=window.cozy)||void 0===e?void 0:e.isFlagshipApp}},function(e,t,n){var r=n(64),o=n(41),i=n(22),a=n(77),u=r?r.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasSafariPlugin=t.hasNetworkInformationPlugin=t.hasInAppBrowserPlugin=t.hasDevicePlugin=void 0;var r=n(97);t.hasDevicePlugin=function(){return(0,r.isCordova)()&&void 0!==window.device};t.hasInAppBrowserPlugin=function(){return(0,r.isCordova)()&&void 0!==window.cordova.InAppBrowser};t.hasSafariPlugin=function(){return new Promise((function(e){(0,r.isCordova)()&&void 0!==window.SafariViewController?window.SafariViewController.isAvailable((function(t){return e(t)})):e(!1)}))};t.hasNetworkInformationPlugin=function(){return(0,r.isCordova)()&&void 0!==window.navigator.connection}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeQueryString=t.buildRedirectionURL=t.pickService=t.errorSerializer=void 0;var r,o=(r=function(e,t){var n=Object.assign(t,e);return["name","message"].reduce((function(n,r){return e[r]&&(t[r]=e[r]),n}),n)},{serialize:function(e){return r(e,{})},deserialize:function(e){return r(e,new Error(e.message))}});t.errorSerializer=o;t.pickService=function(e,t){var n=e.attributes.services||[],r=t?n.find(t):n[0];if(!r)throw new Error("Unable to find a service");return r};t.buildRedirectionURL=function(e,t){var n=Object.keys(t).filter((function(e){return n=t[e],!["object","function"].includes(typeof n);var n})).map((function(e){return"".concat(e,"=").concat(t[e])}));return n.length?"".concat(e,"?").concat(n.join("&")):e};t.removeQueryString=function(e){return e.replace(/\?[^/#]*/,"")}},function(e,t,n){var r=n(198);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t,n){var r=n(41),o=n(53),i=n(216),a=n(150);e.exports=function(e,t){if(null==e)return{};var n=r(a(e),(function(e){return[e]}));return t=o(t),i(e,n,(function(e,n){return t(e,n[0])}))}},function(e,t,n){var r=n(54)(n(38),"Map");e.exports=r},function(e,t,n){var r=n(51),o=n(34);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(370),o=n(377),i=n(379),a=n(380),u=n(381);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,e.exports=c},function(e,t,n){var r=n(382),o=n(39);e.exports=function e(t,n,i,a,u){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,u))}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(205),o=n(206),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=u},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(192),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(this,n(106)(e))},function(e,t,n){var r=n(109),o=n(392),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(22),o=n(77),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(69),o=n(78),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(204),o=n(219),i=n(111);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(209)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r,o,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={}}catch(e){a=null}else a=null;var u=/^\s*class\b/,c=function(e){try{var t=i.call(e);return u.test(t)}catch(e){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=a?function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{a(e,null,r)}catch(e){if(e!==o)return!1}return!c(e)}:function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(l)return function(e){try{return!c(e)&&(i.call(e),!0)}catch(e){return!1}}(e);if(c(e))return!1;var t=s.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,n){"use strict";var r=n(83);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,n){"use strict";(function(t){var r=t.Symbol,o=n(433);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(33))},function(e,t,n){var r=n(446);e.exports=function(e){return r(e,{weekStartsOn:1})}},function(e,t,n){var r=n(236),o=n(79);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(116);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(103),o=n(160),i=n(161),a=n(104),u=n(462),c=n(142);e.exports=function(e,t,n){var s=-1,l=o,f=e.length,p=!0,d=[],h=d;if(n)p=!1,l=i;else if(f>=200){var y=t?null:u(e);if(y)return c(y);p=!1,l=a,h=new r}else h=t?[]:d;e:for(;++s<f;){var v=e[s],g=t?t(v):v;if(v=n||0!==v?v:0,p&&g==g){for(var m=h.length;m--;)if(h[m]===g)continue e;t&&h.push(g),d.push(v)}else l(h,g,n)||(h!==d&&h.push(g),d.push(v))}return d}},function(e,t,n){var r=n(237);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},function(e,t,n){var r=n(157),o=n(468)(r);e.exports=o},function(e,t,n){var r=n(202);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){var r=n(34),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.registryEndpoint=t.transformRegistryFormatToStackFormat=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(3)),u=r(n(7)),c=r(n(2)),s=r(n(16));n(484);var l=r(n(485)),f=n(486);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.transformRegistryFormatToStackFormat=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:(0,s.default)(e,"latest_version.manifest.source"),attributes:(0,s.default)(e,"latest_version.manifest")},e)};t.registryEndpoint="/registry/";var d=function(e){var t=e.type,n=t===f.APP_TYPE.KONNECTOR||"node"===t?"konnectors":"apps";return"/".concat(n)},h=function(){function e(t){if((0,a.default)(this,e),!t.client)throw new Error("Need to pass a client to instantiate a Registry API.");this.client=t.client}var t,n,r;return(0,u.default)(e,[{key:"installApp",value:(r=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,u,c,s,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.slug,i=t.terms,a={},(u=t.installed)&&(a.PermissionsAcked=u),n&&(a.Source=n),o=void 0,o=new URLSearchParams(a).toString(),c=o?"?".concat(o):"",!i){e.next=9;break}return e.next=9,l.default.save(this.client,i);case 9:return s=t.installed?"PUT":"POST",f=d(t),e.abrupt("return",this.client.stackClient.fetchJSON(s,"".concat(f,"/").concat(r).concat(c)));case 12:case"end":return e.stop()}var o}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"uninstallApp",value:(n=(0,i.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.slug,r=d(t),e.abrupt("return",this.client.stackClient.fetchJSON("DELETE","".concat(r,"/").concat(n)));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"fetchApps",value:(t=(0,i.default)(o.default.mark((function e(t){var n,r,i,a,u,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.channel,r=t.type,i=t.limit,a=new URLSearchParams({limit:void 0===i?"200":i,versionsChannel:n,latestChannelVersion:n}).toString(),r&&(a+="&filter[type]=".concat(r)),e.next=6,this.client.stackClient.fetchJSON("GET","/registry?".concat(a));case 6:return u=e.sent,c=u.data,e.abrupt("return",c);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"fetchAppsInMaintenance",value:function(){return this.client.stackClient.fetchJSON("GET","/registry/maintenance")}},{key:"fetchApp",value:function(e){return this.client.stackClient.fetchJSON("GET","/registry/".concat(e))}},{key:"fetchAppVersion",value:function(e){if(!e.slug)throw new Error("Need to pass a slug to use fetchAppVersion");var t=e.slug,n=e.channel,r=e.version,o=n||r&&"latest"!==r?n:"stable",i="/registry/".concat(t,"/");return i+=o?"".concat(o,"/").concat(r||"latest"):"".concat(r),this.client.stackClient.fetchJSON("GET",i)}}]),e}();t.default=h},function(e,t,n){var r=n(51),o=n(151),i=n(39),a=Function.prototype,u=Object.prototype,c=a.toString,s=u.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==l}},function(e,t,n){var r=n(158),o=n(239),i=n(241);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],u=Object.keys(a),c=0;c<u.length;++c){var s=u[c],l=a[s];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:a,prop:s}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",a=0;a<r.length;++a){var u=r.charCodeAt(a);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122?o+=r.charAt(a):u<128?o+=i[u]:u<2048?o+=i[192|u>>6]+i[128|63&u]:u<55296||u>=57344?o+=i[224|u>>12]+i[128|u>>6&63]+i[128|63&u]:(a+=1,u=65536+((1023&u)<<10|1023&r.charCodeAt(a)),o+=i[240|u>>18]+i[128|u>>12&63]+i[128|u>>6&63]+i[128|63&u])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(i&&(i.plainObjects||i.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var u=t;return o(t)&&!o(n)&&(u=a(t,i)),o(t)&&o(n)?(n.forEach((function(n,o){if(r.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,i):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t}),u)}}},function(e,t,n){var r=n(141);e.exports=function(e,t){return r(e,t)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.buildURL=t.encode=void 0;var o=r(n(24)),i=r(n(137)),a=function(e){return Object.entries(e).map((function(e){var t=(0,o.default)(e,2),n=t[0],r=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?"["+t.map((function(t){return e(t,!0)})).join(",")+"]":n?encodeURIComponent('"'.concat(t,'"')):encodeURIComponent(t)}(t[1]);return"".concat(n,"=").concat(r)})).join("&")};t.encode=a;t.buildURL=function(e,t){var n=a((0,i.default)(t));return n?"".concat(e,"?").concat(n):e}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isDirectory=t.isFile=void 0;var i=o(n(25)),a=o(n(45)),u=o(n(5)),c=o(n(9)),s=o(n(3)),l=o(n(7)),f=o(n(11)),p=o(n(8)),d=o(n(10)),h=o(n(6)),y=o(n(2)),v=o(n(503)),g=o(n(258)),m=o(n(16)),b=o(n(73)),w=o(n(172)),x=(n(256),r(n(30))),_=n(42),k=(n(58),n(71)),O=n(259),S=r(n(170));function E(){var e=(0,a.default)(["/files/_changes"]);return E=function(){return e},e}function j(){var e=(0,a.default)(["/data/","/","/relationships/not_synchronizing"]);return j=function(){return e},e}function P(){var e=(0,a.default)(["/data/","/","/relationships/not_synchronizing"]);return P=function(){return e},e}function C(){var e=(0,a.default)(["/data/","/","/relationships/not_synchronizing"]);return C=function(){return e},e}function T(){var e=(0,a.default)(["/files/","/versions"]);return T=function(){return e},e}function A(){var e=(0,a.default)(["/files/upload/metadata"]);return A=function(){return e},e}function D(){var e=(0,a.default)(["/files/",""]);return D=function(){return e},e}function R(){var e=(0,a.default)(["/files/","?Name=","&Type=directory"]);return R=function(){return e},e}function I(){var e=(0,a.default)(["/files/metadata?Path=",""]);return I=function(){return e},e}function N(){var e=(0,a.default)(["/files/",""]);return N=function(){return e},e}function z(){var e=(0,a.default)(["/files/downloads?Path=",""]);return z=function(){return e},e}function M(){var e=(0,a.default)(["/files/downloads?VersionId=","&Filename=",""]);return M=function(){return e},e}function F(){var e=(0,a.default)(["/files/downloads?Id=","&Filename=",""]);return F=function(){return e},e}function L(){var e=(0,a.default)(["/files/","?Name=","&Type=file&Executable=",""]);return L=function(){return e},e}function U(){var e=(0,a.default)(["/files/","?Name=","&Type=file&Executable=","&MetadataID=","&Size=",""]);return U=function(){return e},e}function B(){var e=(0,a.default)(["/files/",""]);return B=function(){return e},e}function q(){var e=(0,a.default)(["/files/trash/",""]);return q=function(){return e},e}function H(){var e=(0,a.default)(["/files/",""]);return H=function(){return e},e}function W(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $(){var e=(0,a.default)(["/data/","/","/relationships/references"]);return $=function(){return e},e}function G(){var e=(0,a.default)(["/data/","/","/relationships/references"]);return G=function(){return e},e}function V(){var e=(0,a.default)(["/files/","/relationships/referenced_by"]);return V=function(){return e},e}function J(){var e=(0,a.default)(["/files/","/relationships/referenced_by"]);return J=function(){return e},e}function Y(){var e=(0,a.default)(["/data/","/","/relationships/references"]);return Y=function(){return e},e}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,h.default)(e);if(t){var o=(0,h.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,d.default)(this,n)}}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){(0,y.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ee=function(e){return Z(Z({},(0,x.normalizeDoc)(e,"io.cozy.files")),e.attributes)},te=function(e){return e?e.map((function(e){return{_type:e.type,_id:e.id}})):[]},ne=function(e){return e&&e.trim()},re=function(e){var t=ne(e);if("string"!=typeof t||""===t)throw new Error("Missing name argument");if("."===e||".."===e)throw new Error("Invalid filename: ".concat(e));var n=(0,O.getIllegalCharacters)(t);if(n.length)throw new Error("Invalid filename containing illegal character(s): ".concat(n));return t};t.isFile=function(e){var t=e._type,n=e.type;return"io.cozy.files"===t||"directory"===n||"file"===n};t.isDirectory=function(e){return"directory"===e.type};var oe=function(e,t){return new Promise((function(n){e.forEach((function(e){return e.then((function(e){t(e)&&n(!0)}))})),Promise.all(e).then((function(){return n(!1)}))}))},ie=function(e){(0,p.default)(Pe,e);var t,n,r,o,a,d,h,x,O,Q,X,ie,ae,ue,ce,se,le,fe,pe,de,he,ye,ve,ge,me,be,we,xe,_e,ke,Oe,Se,Ee,je=K(Pe);function Pe(e,t){var n;return(0,s.default)(this,Pe),n=je.call(this,e,t),(0,y.default)((0,f.default)(n),"extractResponseLinkRelated",(function(e){var t=e.links&&e.links.related;if(!t)throw new Error("No related link in server response");return n.stackClient.fullpath(t)})),(0,y.default)((0,f.default)(n),"forceFileDownload",(function(e,t){var n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",t),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)})),n.specialDirectories={},n}return(0,l.default)(Pe,[{key:"get",value:function(e){return this.statById(e)}},{key:"fetchFindFiles",value:(Ee=(0,c.default)(u.default.mark((function e(t,n){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stackClient.fetchJSON("POST","/files/_find",this.toMangoOptions(t,n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ee.apply(this,arguments)})},{key:"find",value:(Se=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a,c,s,l,f=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>1&&void 0!==f[1]?f[1]:{},r=n.skip,o=void 0===r?0:r,e.prev=2,a="/files/_find",e.next=6,this.findWithMango(a,t,n);case 6:i=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",(0,k.dontThrowNotFoundError)(e.t0));case 12:return c=(0,m.default)(i,"links.next",""),s=new URL("".concat(this.stackClient.uri).concat(c)),l=s.searchParams.get("page[cursor]"),e.abrupt("return",{data:i.data.map((function(e){return ee(e)})),meta:i.meta,next:i.meta.count>o+i.data.length,skip:o,bookmark:l||void 0,execution_stats:i.meta.execution_stats});case 16:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return Se.apply(this,arguments)})},{key:"findReferencedBy",value:(Oe=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a,c,s,l,f,p=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:{},r=n.skip,o=void 0===r?0:r,i=n.limit,a=n.cursor,c={include:"files","page[limit]":i,"page[cursor]":a,sort:"datetime"},s=(0,_.uri)(Y(),t._type,t._id),l=S.buildURL(s,c),e.next=6,this.stackClient.fetchJSON("GET",l);case 6:return f=e.sent,e.abrupt("return",{data:te(f.data),included:f.included?f.included.map((function(e){return ee(e)})):[],next:(0,g.default)(f,"links.next"),meta:f.meta,skip:o});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return Oe.apply(this,arguments)})},{key:"addReferencedBy",value:(ke=(0,c.default)(u.default.mark((function e(t,n){var r,o;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.map((function(e){return{id:e._id,type:e._type}})),e.next=3,this.stackClient.fetchJSON("POST",(0,_.uri)(J(),t._id),{data:r});case 3:return o=e.sent,e.abrupt("return",{data:te(o.data),meta:o.meta});case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return ke.apply(this,arguments)})},{key:"removeReferencedBy",value:(_e=(0,c.default)(u.default.mark((function e(t,n){var r,o;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.map((function(e){return{id:e._id,type:e._type}})),e.next=3,this.stackClient.fetchJSON("DELETE",(0,_.uri)(V(),t._id),{data:r});case 3:return o=e.sent,e.abrupt("return",{data:te(o.data),meta:o.meta});case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return _e.apply(this,arguments)})},{key:"addReferencesTo",value:(xe=(0,c.default)(u.default.mark((function e(t,n){var r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.map((function(e){return{id:e._id,type:"io.cozy.files"}})),e.abrupt("return",this.stackClient.fetchJSON("POST",(0,_.uri)(G(),t._type,t._id),{data:r}));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return xe.apply(this,arguments)})},{key:"removeReferencesTo",value:(we=(0,c.default)(u.default.mark((function e(t,n){var r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.map((function(e){return{id:e._id,type:"io.cozy.files"}})),e.abrupt("return",this.stackClient.fetchJSON("DELETE",(0,_.uri)($(),t._type,t._id),{data:r}));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return we.apply(this,arguments)})},{key:"destroy",value:(be=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a,c,s,l,f,p=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]?p[1]:{},r=n.ifMatch,o=void 0===r?"":r,i=t._id,!((a=t.relationships)&&a.referenced_by&&Array.isArray(a.referenced_by.data))){e.next=20;break}c=W(a.referenced_by.data),e.prev=4,c.s();case 6:if((s=c.n()).done){e.next=12;break}return l=s.value,e.next=10,this.removeReferencesTo({_id:l.id,_type:l.type},[{_id:i}]);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),c.e(e.t0);case 17:return e.prev=17,c.f(),e.finish(17);case 20:return e.next=22,this.stackClient.fetchJSON("DELETE",(0,_.uri)(H(),i),void 0,{headers:{"If-Match":o}});case 22:return f=e.sent,e.abrupt("return",{data:ee(f.data)});case 24:case"end":return e.stop()}}),e,this,[[4,14,17,20]])}))),function(e){return be.apply(this,arguments)})},{key:"emptyTrash",value:function(){return this.stackClient.fetchJSON("DELETE","/files/trash")}},{key:"restore",value:function(e){return this.stackClient.fetchJSON("POST",(0,_.uri)(q(),e))}},{key:"deleteFilePermanently",value:(me=(0,c.default)(u.default.mark((function e(t){var n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("PATCH",(0,_.uri)(B(),t),{data:{type:"io.cozy.files",id:t,attributes:{permanent_delete:!0}}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return me.apply(this,arguments)})},{key:"upload",value:(ge=(0,c.default)(u.default.mark((function e(t,n){var r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureDirectoryExists(n);case 2:return r=e.sent,e.abrupt("return",this.createFile(t,{dirId:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return ge.apply(this,arguments)})},{key:"create",value:(ve=(0,c.default)(u.default.mark((function e(t){var n,r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("directory"!==t.type){e.next=4;break}return e.abrupt("return",this.createDirectory(t));case 4:return n=t.data,r=(0,i.default)(t,["data"]),e.abrupt("return",this.createFile(n,r));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return ve.apply(this,arguments)})},{key:"update",value:(ye=(0,c.default)(u.default.mark((function e(t){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateAttributes(t.id,t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return ye.apply(this,arguments)})},{key:"createFile",value:(he=(0,c.default)(u.default.mark((function e(t){var n,r,o,a,c,s,l,f,p,d,h,y,v,g=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=g.length>1&&void 0!==g[1]?g[1]:{},r=n.name,o=n.dirId,a=void 0===o?"":o,c=n.executable,s=n.metadata,l=(0,i.default)(n,["name","dirId","executable","metadata"]),p=c,(f=r)||"string"!=typeof t.name||(f=t.name),f=re(f),void 0===p&&(p=!1),d="",!s){e.next=13;break}return e.next=11,this.createFileMetadata(s);case 11:h=e.sent,d=h.data.id;case 13:return y="",l.contentLength&&(y=String(l.contentLength)),v=(0,_.uri)(U(),a,f,p,d,y),e.abrupt("return",this.doUpload(t,v,l));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return he.apply(this,arguments)})},{key:"updateFile",value:(de=(0,c.default)(u.default.mark((function e(t){var n,r,o,a,c,s,l,f,p,d,h,y,v,g,m=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]?m[1]:{},r=n.executable,o=void 0!==r&&r,a=n.fileId,c=n.name,s=void 0===c?"":c,l=n.metadata,f=(0,i.default)(n,["executable","fileId","name","metadata"]),a&&"string"==typeof a){e.next=4;break}throw new Error("missing fileId argument");case 4:if((p=s||t.name)&&"string"==typeof p){e.next=7;break}throw new Error("missing name in data argument");case 7:if(d=re(p),y=(0,_.uri)(L(),a,d,o),!l){e.next=15;break}return e.next=12,this.createFileMetadata(l);case 12:v=e.sent,h=v.data.id,y+="&MetadataID=".concat(h);case 15:return g="",f.contentLength&&(g=String(f.contentLength),y+="&Size=".concat(g)),e.abrupt("return",this.doUpload(t,y,f,"PUT"));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return de.apply(this,arguments)})},{key:"getDownloadLinkById",value:function(e,t){return this.stackClient.fetchJSON("POST",(0,_.uri)(F(),e,t)).then(this.extractResponseLinkRelated)}},{key:"getDownloadLinkByRevision",value:function(e,t){return this.stackClient.fetchJSON("POST",(0,_.uri)(M(),e,t)).then(this.extractResponseLinkRelated)}},{key:"getDownloadLinkByPath",value:function(e){return this.stackClient.fetchJSON("POST",(0,_.uri)(z(),e)).then(this.extractResponseLinkRelated)}},{key:"download",value:(pe=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:null,r=a.length>2&&void 0!==a[2]?a[2]:void 0,i=r||t.name,n){e.next=9;break}return e.next=6,this.getDownloadLinkById(t._id,i);case 6:o=e.sent,e.next=12;break;case 9:return e.next=11,this.getDownloadLinkByRevision(n,i);case 11:o=e.sent;case 12:this.forceFileDownload("".concat(o,"?Dl=1"),i);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return pe.apply(this,arguments)})},{key:"fetchFileContent",value:(fe=(0,c.default)(u.default.mark((function e(t){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("FileCollection.fetchFileContent() is deprecated. Use FileCollection.fetchFileContentById() instead"),e.abrupt("return",this.fetchFileContentById(t));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return fe.apply(this,arguments)})},{key:"fetchFileContentById",value:(le=(0,c.default)(u.default.mark((function e(t){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stackClient.fetch("GET","/files/download/".concat(t)));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return le.apply(this,arguments)})},{key:"getBeautifulSize",value:function(e,t){return(0,_.formatBytes)(parseInt(e.size),t)}},{key:"downloadArchive",value:(se=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:"files",r=(0,_.slugify)(n),e.next=4,this.getArchiveLinkByIds(t,r);case 4:o=e.sent,i=this.stackClient.fullpath(o),this.forceFileDownload(i,r+".zip");case 7:case"end":return e.stop()}}),e,this)}))),function(e){return se.apply(this,arguments)})},{key:"getArchiveLinkByIds",value:(ce=(0,c.default)(u.default.mark((function e(t){var n,r,o=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:"files",e.next=3,this.stackClient.fetchJSON("POST","/files/archive",{data:{type:"io.cozy.archives",attributes:{name:n,ids:t}}});case 3:return r=e.sent,e.abrupt("return",r.links.related);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return ce.apply(this,arguments)})},{key:"isChildOf",value:(ue=(0,c.default)(u.default.mark((function e(t,n){var r,o,i,a,c,s,l,f,p,d=this;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r="object"==typeof t?t:{_id:t})._id,i=r.dirID,a=r.path,c=("object"==typeof n?n:{_id:n})._id,o!==c&&i!==c){e.next=4;break}return e.abrupt("return",!0);case 4:if(a){e.next=10;break}return e.next=7,this.statById(o);case 7:s=e.sent,a=s.data.path,i=s.data.dirID;case 10:for(l=a,f=[a];""!=l;)h=void 0,h=(u=l).lastIndexOf("/"),""!=(p=u.substring(0,h))&&f.push(p),l=p;return f.reverse(),e.abrupt("return",oe(f.map((function(e){return d.statByPath(e)})),(function(e){return e.data._id==c})));case 15:case"end":return e.stop()}var u,h}),e,this)}))),function(e,t){return ue.apply(this,arguments)})},{key:"statById",value:(ae=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a,c=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},r=(0,w.default)(n,["page[limit]","page[skip]","page[cursor]"]),o=(0,_.uri)(N(),t),i=S.buildURL(o,r),e.next=6,this.stackClient.fetchJSON("GET",i);case 6:return a=e.sent,e.abrupt("return",{data:ee(a.data),included:a.included&&a.included.map((function(e){return ee(e)})),links:a.links});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return ae.apply(this,arguments)})},{key:"statByPath",value:(ie=(0,c.default)(u.default.mark((function e(t){var n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",(0,_.uri)(I(),t));case 2:return n=e.sent,e.abrupt("return",{data:ee(n.data),included:n.included&&n.included.map((function(e){return ee(e)}))});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return ie.apply(this,arguments)})},{key:"createDirectory",value:(X=(0,c.default)(u.default.mark((function e(){var t,n,r,o,i,a,c,s=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},n=t.name,r=t.dirId,o=t.lastModifiedDate,i=re(n),a=o&&("string"==typeof o?new Date(o):o),e.next=6,this.stackClient.fetchJSON("POST",(0,_.uri)(R(),r,i),void 0,{headers:{Date:a?a.toGMTString():""}});case 6:return c=e.sent,e.abrupt("return",{data:ee(c.data)});case 8:case"end":return e.stop()}}),e,this)}))),function(){return X.apply(this,arguments)})},{key:"ensureDirectoryExists",value:(Q=(0,c.default)(u.default.mark((function e(t){var n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.specialDirectories[t]){e.next=5;break}return e.next=3,this.createDirectoryByPath(t);case 3:n=e.sent,this.specialDirectories[t]=n.data._id;case 5:return e.abrupt("return",this.specialDirectories[t]);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return Q.apply(this,arguments)})},{key:"getDirectoryOrCreate",value:(O=(0,c.default)(u.default.mark((function e(t,n){var r,o,i,a,c;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||n.attributes){e.next=2;break}throw new Error("Malformed parent directory");case 2:return r=ne(t),o="".concat("io.cozy.files.root-dir"===n._id?"":n.attributes.path,"/").concat(r),e.prev=4,e.next=7,this.statByPath(o||"/");case 7:return i=e.sent,e.abrupt("return",i);case 11:if(e.prev=11,e.t0=e.catch(4),a=JSON.parse(e.t0.message),!(c=a.errors)||!c.length||"404"!==c[0].status){e.next=17;break}return e.abrupt("return",this.createDirectory({name:r,dirId:n&&n._id}));case 17:throw c;case 18:case"end":return e.stop()}}),e,this,[[4,11]])}))),function(e,t){return O.apply(this,arguments)})},{key:"createDirectoryByPath",value:(x=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a,c;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").filter((function(e){return""!==e})),e.next=3,this.statById("io.cozy.files.root-dir");case 3:if(r=e.sent,n.length){e.next=6;break}return e.abrupt("return",r);case 6:o=r,i=W(n),e.prev=8,i.s();case 10:if((a=i.n()).done){e.next=17;break}return c=a.value,e.next=14,this.getDirectoryOrCreate(c,o.data);case 14:o=e.sent;case 15:e.next=10;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(8),i.e(e.t0);case 22:return e.prev=22,i.f(),e.finish(22);case 25:return e.abrupt("return",o);case 26:case"end":return e.stop()}}),e,this,[[8,19,22,25]])}))),function(e){return x.apply(this,arguments)})},{key:"updateAttributes",value:(h=(0,c.default)(u.default.mark((function e(t,n){var r,o;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Z({},n),n.name&&(r.name=re(n.name)),e.next=4,this.stackClient.fetchJSON("PATCH",(0,_.uri)(D(),t),{data:{type:"io.cozy.files",id:t,attributes:r}});case 4:return o=e.sent,e.abrupt("return",{data:ee(o.data)});case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"updateFileMetadata",value:(d=(0,c.default)(u.default.mark((function e(t,n){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("CozyClient FileCollection updateFileMetadata method is deprecated. Use updateAttributes instead"),e.abrupt("return",this.updateAttributes(t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"createFileMetadata",value:(a=(0,c.default)(u.default.mark((function e(t){var n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("POST",(0,_.uri)(A()),{data:{type:"io.cozy.files.metadata",attributes:t}});case 2:return n=e.sent,e.abrupt("return",{data:n.data});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"updateMetadataAttribute",value:(o=(0,c.default)(u.default.mark((function e(t,n){var r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("POST",(0,_.uri)(T(),t),{data:{type:"io.cozy.files.metadata",attributes:n}});case 2:return r=e.sent,e.abrupt("return",{data:r.data});case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getFileTypeFromName",value:function(e){return v.default.getType(e)||"application/octet-stream"}},{key:"doUpload",value:(r=(0,c.default)(u.default.mark((function e(t,n,r){var o,i,a,c,s,l,f,p,d,h,y,v,g,m,b,w,x,_,k=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=k.length>3&&void 0!==k[3]?k[3]:"POST",i=t){e.next=4;break}throw new Error("missing data argument");case 4:if(i.buffer&&i.buffer instanceof ArrayBuffer&&(i=i.buffer),a="undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer,c="undefined"!=typeof File&&i instanceof File,s="undefined"!=typeof Blob&&i instanceof Blob,l=!0===i.readable&&"function"==typeof i.pipe,f="string"==typeof i,a||c||s||l||f){e.next=12;break}throw new Error("invalid data type");case 12:return d=(p=r||{}).contentType,h=p.contentLength,y=p.checksum,v=p.lastModifiedDate,g=p.ifMatch,d||("string"==typeof i?d="text/plain":i.type?d=i.type:(m=n.split("?"),b=m.length>1?m[1]:"",w=new URLSearchParams(b).get("Name"),d=this.getFileTypeFromName(w.toLowerCase()))),(v=v||i.lastModified)&&(v=new Date(v)),x={"Content-Type":d},h&&(x["Content-Length"]=String(h)),y&&(x["Content-MD5"]=y),v&&(x.Date=v.toGMTString()),g&&(x["If-Match"]=g),e.next=23,this.stackClient.fetchJSON(o,n,i,{headers:x,onUploadProgress:r.onUploadProgress});case 23:return _=e.sent,e.abrupt("return",{data:ee(_.data)});case 25:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"findNotSynchronizedDirectories",value:(n=(0,c.default)(u.default.mark((function e(t){var n,r,o,i,a,c,s,l,f,p,d=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>1&&void 0!==d[1]?d[1]:{},r=n.skip,o=void 0===r?0:r,i=n.limit,a=n.cursor,c=n.includeFiles,s={include:void 0!==c&&c?"files":void 0,"page[limit]":i,"page[cursor]":a,sort:"id"},l=(0,_.uri)(C(),t._type,t._id),f=S.buildURL(l,s),e.next=6,this.stackClient.fetchJSON("GET",f);case 6:return p=e.sent,e.abrupt("return",{data:p.data.map((function(e){return ee(e)})),included:p.included?p.included.map((function(e){return ee(e)})):[],next:(0,g.default)(p,"links.next"),meta:p.meta,skip:o});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addNotSynchronizedDirectories",value:function(e,t){var n=t.map((function(e){return{id:e._id,type:e._type}}));return this.stackClient.fetchJSON("POST",(0,_.uri)(P(),e._type,e._id),{data:n})}},{key:"removeNotSynchronizedDirectories",value:function(e,t){var n=t.map((function(e){return{id:e._id,type:e._type}}));return this.stackClient.fetchJSON("DELETE",(0,_.uri)(j(),e._type,e._id),{data:n})}},{key:"fetchChanges",value:(t=(0,c.default)(u.default.mark((function e(){var t,n,r,o,i,a,c,s,l,f,p=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},n=p.length>1&&void 0!==p[1]?p[1]:{},r={},"object"!=typeof t?(r.since=t,console.warn('fetchChanges use couchOptions as Object not a string, since is deprecated, please use fetchChanges({since: "'.concat(t,'"}).'))):Object.keys(t).length>0&&Object.assign(r,t),Object.keys(n).length>0&&(Object.assign(r,n),(n.skipTrashed||n.includeFilePath)&&(r.includeDocs=!0)),o=Z(Z({},(0,b.default)(r,["fields","includeDocs","includeFilePath","skipDeleted","skipTrashed"])),{},{fields:r.fields?r.fields.join(","):null,include_docs:r.includeDocs,include_file_path:r.includeFilePath,skip_deleted:r.skipDeleted,skip_trashed:r.skipTrashed}),i=(0,_.uri)(E()),a=S.buildURL(i,o),e.next=10,this.stackClient.fetchJSON("GET",a);case 10:return c=e.sent,s=c.last_seq,l=c.pending,f=c.results,e.abrupt("return",{newLastSeq:s,pending:l,results:f});case 15:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),Pe}(x.default);t.default=ie},function(e,t,n){var r=n(507),o=n(167)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.chain=t.default=void 0;var o=r(n(31)),i=r(n(3)),a=r(n(7)),u=function(){function e(t){(0,i.default)(this,e),"function"==typeof t&&(this.request=t)}return(0,a.default)(e,[{key:"request",value:function(e,t,n){throw new Error("request is not implemented")}}]),e}();t.default=u;var c=function(e){return"function"==typeof e?new u(e):e},s=function(e,t){if(t)return t;if(e.execute)return e.execute();throw new Error("No link could handle operation ".concat(JSON.stringify(e)))};t.chain=function(e){return[].concat((0,o.default)(e),[s]).map(c).reduce(l)};var l=function(e,t){return new u((function(n,r,o){return e.request(n,r,(function(e,n){return t.request(e,n,o)}))}))}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(525)),i=(0,o.default)("cozy-client");o.default.suggest.deny("cozy-client","info");var a=i;t.default=a},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.QueryIDGenerator=t.getQueryFromSlice=t.receiveQueryError=t.receiveQueryResult=t.loadQuery=t.initQuery=t.default=t.makeSorterFromDefinition=t.mergeSelectorAndPartialIndex=t.convert$gtNullSelectors=t.isReceivingData=t.isQueryAction=void 0;var o=r(n(3)),i=r(n(7)),a=r(n(24)),u=r(n(2)),c=r(n(31)),s=r(n(72)),l=r(n(271)),f=r(n(534)),p=r(n(272)),d=r(n(536)),h=r(n(166)),y=r(n(119)),v=r(n(537)),g=r(n(22)),m=r(n(176)),b=r(n(16)),w=r(n(542)),x=r(n(251)),_=n(267),k=n(177),O=n(276),S=n(18);n(19);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){(0,u.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P="INIT_QUERY",C="LOAD_QUERY",T="RECEIVE_QUERY_RESULT",A="RECEIVE_QUERY_ERROR",D=(0,x.default)("debug"),R=function(e){return-1!==[P,C,T,A].indexOf(e.type)};t.isQueryAction=R;t.isReceivingData=function(e){return e.type===T};var I={id:null,definition:null,fetchStatus:"pending",lastFetch:null,lastUpdate:null,lastErrorUpdate:null,lastError:null,hasMore:!1,count:0,data:[],bookmark:null},N=function(e,t,n){var r=(0,y.default)([].concat((0,c.default)(e.data),(0,c.default)(t.data.map(O.properId))));if(e.definition.sort){var o=B(e.definition),i=n[e.definition.doctype],a=i?r.map((function(e){return i[e]})).filter(Boolean):[];r=o(a).map(O.properId)}return r},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;switch(t.type){case P:return e.lastUpdate&&e.id===t.queryId&&e.definition===t.queryDefinition?e:j(j({},e),{},{id:t.queryId,definition:t.queryDefinition,options:t.options,fetchStatus:e.lastUpdate?e.fetchStatus:"pending"});case C:return"loading"===e.fetchStatus?e:j(j({},e),{},{fetchStatus:"loading"});case T:var r=t.response;if(!r.data)return e;var o=j({fetchStatus:"loaded",lastFetch:Date.now(),lastUpdate:Date.now()},D&&{execution_stats:r.execution_stats});return Array.isArray(r.data)?j(j(j({},e),o),{},{bookmark:r.bookmark||null,hasMore:void 0!==r.next?r.next:e.hasMore,count:r.meta&&r.meta.count?r.meta.count:r.data.length,data:N(e,r,n)}):j(j(j({},e),o),{},{hasMore:!1,count:1,data:[(0,O.properId)(r.data)]});case A:return j(j({},e),{},{id:t.queryId,fetchStatus:"failed",lastError:t.error,lastErrorUpdate:Date.now()});default:return e}},M=function e(t){for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=(0,a.default)(o[r],2),u=i[0],c=i[1],s=(0,h.default)(c)?e(c):c;n["$gt"===u&&null===s?"$gtnull":u]=s}return n};t.convert$gtNullSelectors=M;var F=function(e){return j(j({},e.selector),(0,b.default)(e,"partialFilter"))};t.mergeSelectorAndPartialIndex=F;var L=function(e){var t=e.definition.doctype,n=function(e){if(e.selector){var t=F(e);return w.default.use({$gtnull:function(e,t){return!!t}}),(0,w.default)(M(t))}if(e.id){var n={_id:e.id};return(0,w.default)(n)}if(e.ids){var r={_id:{$in:e.ids}};return(0,w.default)(r)}return null}(e.definition);return function(e){return e._type===t&&(!e._deleted&&(!n||!!n(e)))}},U=function(e){return function(t){var n=(0,b.default)(t,e);return(0,m.default)(n)?n.toLowerCase():n}},B=function(e){var t=e.sort;if(t){if((0,g.default)(e.sort)){var n=t.map((function(e){return Object.entries(e)[0]})),r=n.map((function(e){return e[0]})).map(U),o=n.map((function(e){return e[1]}));return function(e){return(0,v.default)(e,r,o)}}return console.warn("Correct update of queries with a sort that is not an array is not supported. Use an array as argument of QueryDefinition::sort"),function(e){return e}}return function(e){return e}};t.makeSorterFromDefinition=B;var q=function(e,t){return function(n){var r=(0,b.default)(e,"response.data")||(0,b.default)(e,"definition.document");return r?(Array.isArray(r)||(r=[r]),r.length?n.definition.doctype!==r[0]._type?n:function(e,t,n){var r=L(e),o=(0,s.default)((0,l.default)(t,r),(function(e){return e.map(O.properId)})),i=o.true,a=void 0===i?[]:i,u=o.false,c=void 0===u?[]:u,h=e.data,y=e.options&&e.options.autoUpdate,v=!y||!1!==y.remove,g=!y||!1!==y.add,m=!y||!1!==y.update,b=v?(0,p.default)(h,c):[],w=g?(0,f.default)(a,h):[],x=m?(0,p.default)(h,a):[],_=b.length||w.length||x.length,k=(0,f.default)((0,d.default)(h,w),b);if(e.definition.sort&&n){var S=B(e.definition),E=n[e.definition.doctype],P=k.map((function(e){return E[e]}));k=S(P).map(O.properId)}return j(j({},e),{},{data:k,count:k.length,lastUpdate:_?Date.now():e.lastUpdate})}(n,r,t):n):n}},H=function(e,t){return function(n){var r=e.updateQueries,o=e.response,i=r[n.id];if(!i)return n;var a=n.definition.doctype,u=n.data,c=i(Q(t,a,u),o).map(O.properId);return j(j({},n),{},{data:c,count:c.length,lastUpdate:Date.now()})}},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t.type==P){var o=z(e[t.queryId],t,n);return o===e[t.queryId]?e:j(j({},e),{},(0,u.default)({},t.queryId,o))}if(R(t)){var i=q(t,n);return(0,s.default)(e,(function(e){return e.id==t.queryId?z(e,t,n):r?i(e):e}))}if((0,k.isReceivingMutationResult)(t)){var a=t.updateQueries?H(t,n):q(t,n);return(0,s.default)(e,a)}return e};t.default=W;t.initQuery=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.doctype)throw new Error("Cannot init query with no doctype");return{type:P,queryId:e,queryDefinition:t,options:n}};t.loadQuery=function(e){return{type:C,queryId:e}};t.receiveQueryResult=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return j({type:T,queryId:e,response:t},n)};t.receiveQueryError=function(e,t){return{type:A,queryId:e,error:t}};var Q=function(e,t,n){return n.map((function(n){return(0,_.getDocumentFromSlice)(e,t,n)}))};t.getQueryFromSlice=function(e,t,n){if(!e||!e[t])return j(j({},I),{},{id:t,data:null});var r=e[t];return n?j(j({},r),{},{data:Q(n,r.definition.doctype,r.data)}):r};var $=function(){function e(){(0,o.default)(this,e),this.idCounter=1}return(0,i.default)(e,[{key:"generateRandomId",value:function(){var e=this.idCounter;return this.idCounter++,e.toString()}},{key:"generateId",value:function(e){if((0,S.isAGetByIdQuery)(e)){var t=e.id,n=e.doctype;return"".concat(n,"/").concat(t)}return this.generateRandomId()}}]),e}();t.QueryIDGenerator=$,$.UNNAMED="unnamed"},function(e,t,n){var r=n(51),o=n(22),i=n(39);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.receiveMutationError=t.receiveMutationResult=t.initMutation=t.isReceivingMutationResult=t.isMutationAction=void 0;var o=r(n(2));function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u="INIT_MUTATION",c="RECEIVE_MUTATION_RESULT",s="RECEIVE_MUTATION_ERROR";t.isMutationAction=function(e){return-1!==[u,c,s].indexOf(e.type)};t.isReceivingMutationResult=function(e){return e.type===c};t.initMutation=function(e,t){return{type:u,mutationId:e,definition:t}};t.receiveMutationResult=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(a({type:c,mutationId:e,response:t},n),{},{definition:r})};t.receiveMutationError=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:s,mutationId:e,error:t,definition:n}}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getReferencedById=t.getReferencedBy=t.isReferencedById=t.isReferencedBy=t.create=t.resolveClass=t.attachRelationships=t.responseToRelationship=t.pickTypeAndId=void 0;var o=r(n(2)),i=r(n(172)),a=r(n(137)),u=r(n(61)),c=r(n(280)),s=r(n(281)),l=r(n(92)),f=r(n(282)),p=r(n(266));n(19);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=function(e){return(0,i.default)(e,"_type","_id")};t.pickTypeAndId=y;t.responseToRelationship=function(e){return(0,a.default)({data:(t=y,n=e.data,Array.isArray(n)?n.map(t):t(n)),meta:e.meta,next:e.next,skip:e.skip,bookmark:e.bookmark});var t,n};var v=function(e,t){return h(h({},e),{},{relationships:h(h({},e.relationships),t)})};t.attachRelationships=function(e,t){if(Array.isArray(e.data))return h(h({},e),{},{data:e.data.map((function(e){return v(e,t[e._id])}))});var n=e.data;return h(h({},e),{},{data:v(n,t[n._id])})};var g={"io.cozy.files:has-many":p.default,"has-many":l.default,"belongs-to-in-place":s.default,"has-one":c.default,"has-one-in-place":s.default,"has-many-in-place":f.default};t.resolveClass=function(e,t){if(void 0===t)throw new Error("Undefined type for "+e);if("string"!=typeof t)return t;var n="".concat(e,":").concat(t),r=g[n]||g[t];if(r)return r;throw new Error("Unknown association '".concat(t,"'"))};t.create=function(e,t,n){var r=t.name,o=t.type,i=t.doctype;if(e[r]instanceof u.default)throw new Error("Association ".concat(r," already exists"));return new o(e,r,i,n)};t.isReferencedBy=function(e,t){var n,r;return((null==e||null===(n=e.relationships)||void 0===n||null===(r=n.referenced_by)||void 0===r?void 0:r.data)||(null==e?void 0:e.referenced_by)||[]).some((function(e){return e.type===t}))};t.isReferencedById=function(e,t,n){var r,o;return((null==e||null===(r=e.relationships)||void 0===r||null===(o=r.referenced_by)||void 0===o?void 0:o.data)||(null==e?void 0:e.referenced_by)||[]).some((function(e){return e.type===t&&e.id===n}))};t.getReferencedBy=function(e,t){var n,r;return((null==e||null===(n=e.relationships)||void 0===n||null===(r=n.referenced_by)||void 0===r?void 0:r.data)||(null==e?void 0:e.referenced_by)||[]).filter((function(e){return e.type===t}))};t.getReferencedById=function(e,t,n){var r,o;return((null==e||null===(r=e.relationships)||void 0===r||null===(o=r.referenced_by)||void 0===o?void 0:o.data)||(null==e?void 0:e.referenced_by)||[]).filter((function(e){return e.type===t&&e.id===n}))}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.rootCozyUrl=t.InvalidCozyUrlError=t.InvalidProtocolError=t.generateWebLink=t.dehydrate=void 0;var o=r(n(31)),i=r(n(234)),a=r(n(5)),u=r(n(9)),c=r(n(3)),s=r(n(8)),l=r(n(10)),f=r(n(6)),p=r(n(35)),d=r(n(24)),h=n(120);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}function v(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.dehydrate=function(e){return Object.entries(e).reduce((function(e,t){var n=(0,d.default)(t,2),r=n[0],o=n[1],i=e;if(o instanceof h.Association){if(!o.dehydrate)throw new Error("Association on key ".concat(r," should have a dehydrate method"));i=o.dehydrate(i)}else i[r]=o;return i}),{})};t.generateWebLink=function(e){var t,n=e.cozyUrl,r=e.searchParams,o=e.pathname,i=e.hash,a=e.slug,u=e.subDomainType,c=r||[],s=new URL(n);s.host="nested"===u?"".concat(a,".").concat(s.host):s.host.split(".").map((function(e,t){return 0===t?e+"-"+a:e})).join("."),s.pathname=o,s.hash=(t=i)?t.startsWith("/")?t:"/"+t:"/";var l,f=v(c);try{for(f.s();!(l=f.n()).done;){var p=(0,d.default)(l.value,2),h=p[0],y=p[1];s.searchParams.set(h,y)}}catch(e){f.e(e)}finally{f.f()}return s.toString()};var m=function(e){(0,s.default)(n,e);var t=y(n);function n(e){var r;return(0,c.default)(this,n),(r=t.call(this,"Invalid URL protocol ".concat(e.protocol))).url=e,r}return n}((0,p.default)(Error));t.InvalidProtocolError=m;var b=function(e){(0,s.default)(n,e);var t=y(n);function n(e){var r;return(0,c.default)(this,n),(r=t.call(this,"URL ".concat(e.toString()," does not seem to be a valid Cozy URL"))).url=e,r}return n}((0,p.default)(Error));t.InvalidCozyUrlError=b;var w=function(e){var t=e.protocol,n=e.hostname,r=e.port;return(""!==t?"".concat(t,"//"):"https://")+n+(""!==r?":".concat(r):"")},x=function(e){return w(e)+"/.well-known/change-password"},_=function(){var e=(0,u.default)(a.default.mark((function e(t){var n,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(x(t));case 2:if(n=e.sent,404!==(r=n.status)){e.next=6;break}throw new b(t);case 6:return e.abrupt("return",200===r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=(0,u.default)(a.default.mark((function e(t){var n,r,u,c,s,l;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(["http:","https:"].includes(t.protocol)){e.next=2;break}throw new m(t);case 2:return e.next=4,_(t);case 4:if(!e.sent){e.next=6;break}return e.abrupt("return",t);case 6:if(!/^[^.-][^.]+-[^.-]+\./.test(t.hostname)){e.next=13;break}return n=t.hostname.split("."),r=(0,i.default)(n),u=r[0],c=r.slice(1),s=[u.replace(/-.+/,"")].concat((0,o.default)(c)).join("."),e.next=11,_({protocol:t.protocol,hostname:s,port:t.port});case 11:if(!e.sent){e.next=13;break}return e.abrupt("return",new URL(w({protocol:t.protocol,hostname:s,port:t.port})));case 13:return l=t.hostname.split(".").splice(1).join("."),e.next=16,_({protocol:t.protocol,hostname:l,port:t.port});case 16:if(!e.sent){e.next=18;break}return e.abrupt("return",new URL(w({protocol:t.protocol,hostname:l,port:t.port})));case 18:throw new b(t);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.rootCozyUrl=k},function(e,t,n){var r=n(164),o=n(181);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(164),o=n(181);function i(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.clientContext=void 0;var o=n(0),i=(r(n(40)),(0,o.createContext)({client:null,store:null}));t.clientContext=i;var a=i;t.default=a},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getQualification=t.setQualification=t.Qualification=void 0;var i=o(n(2)),a=o(n(3)),u=o(n(7)),c=n(585),s=r(n(586));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.default)(this,e);var r=s.qualifications.find((function(e){return e.label===t}));if(!r)throw new Error("No qualification found for the label ".concat(t));this.label=r.label,this.purpose=n.purpose||r.purpose,this.sourceCategory=n.sourceCategory||r.sourceCategory,this.sourceSubCategory=n.sourceSubCategory||r.sourceSubCategory,this.subjects=n.subjects||r.subjects}return(0,u.default)(e,[{key:"checkAttributes",value:function(e){if(this.purpose!==e.purpose){if(this.purpose)throw new Error("The purpose for the label ".concat(this.label," should be ").concat(this.purpose,". ")+"Please use this or open an issue on https://github.com/cozy/cozy-client/issues");s.purposeKnownValues.includes(e.purpose)||console.info("This purpose is not listed among the known values: ".concat(e.purpose,". ")+"Please open an issue on https://github.com/cozy/cozy-client/issues")}if(this.sourceCategory!==e.sourceCategory){if(this.sourceCategory)throw new Error("The sourceCategory for the label ".concat(this.label," should be ").concat(this.sourceCategory,". ")+"Please use this or open an issue on https://github.com/cozy/cozy-client/issues");s.sourceCategoryKnownValues.includes(e.sourceCategory)||console.info("This sourceCategory is not listed among the known values: ".concat(e.sourceCategory,". ")+"Please open an issue on https://github.com/cozy/cozy-client/issues")}if(this.sourceSubCategory!==e.sourceSubCategory){if(this.sourceSubCategory)throw new Error("The sourceSubCategory for the label ".concat(this.label," should be ").concat(this.sourceSubCategory,". ")+"Please use this or open an issue on https://github.com/cozy/cozy-client/issues");s.sourceSubCategoryKnownValues.includes(e.sourceSubCategory)||console.info("This sourceSubCategory is not listed among the known values: ".concat(e.sourceSubCategory,". ")+"Please open an issue on https://github.com/cozy/cozy-client/issues")}if((0,c.difference)(this.subjects,e.subjects).length>0)throw new Error("The subjects for the label ".concat(this.label," should include ").concat(this.subjects,". ")+"Please use this or open an issue on https://github.com/cozy/cozy-client/issues");var t=(0,c.difference)(e.subjects,this.subjects);if(t.length>0){var n=(0,c.difference)(t,s.subjectsKnownValues);n.length>0&&console.info("These subjects are not listed among the known values: ".concat(n,". ")+"Please open an issue on https://github.com/cozy/cozy-client/issues")}}},{key:"setPurpose",value:function(t){return new e(this.label,f(f({},this.toQualification()),{},{purpose:t}))}},{key:"setSourceCategory",value:function(t){return new e(this.label,f(f({},this.toQualification()),{},{sourceCategory:t}))}},{key:"setSourceSubCategory",value:function(t){return new e(this.label,f(f({},this.toQualification()),{},{sourceSubCategory:t}))}},{key:"setSubjects",value:function(t){return new e(this.label,f(f({},this.toQualification()),{},{subjects:t}))}},{key:"toQualification",value:function(){return{label:this.label,purpose:this.purpose,sourceCategory:this.sourceCategory,sourceSubCategory:this.sourceSubCategory,subjects:this.subjects}}}]),e}();t.Qualification=p,p.getByLabel=function(e){return new p(e)};t.setQualification=function(e,t){if(!t.label)throw new Error("You must set a label to qualify");return new p(t.label).checkAttributes(t),(0,c.set)(e,"metadata.qualification",t)};t.getQualification=function(e){var t=(0,c.get)(e,"metadata.qualification");return new p(t.label,t.qualification).toQualification()}},function(e,t,n){"use strict";var r=n(603);e.exports=function(e){return"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!0;var a={},u=void 0,c=void 0;for(u=0,c=n.length;u<c;u++)a[n[u]]=!0;for(u=0,c=o.length;u<c;u++){var s=o[u],l=e[s],f=t[s];if(l!==f){if(!a[s]||null===l||null===f||"object"!==(void 0===l?"undefined":r(l))||"object"!==(void 0===f?"undefined":r(f)))return!0;var p=Object.keys(l),d=Object.keys(f);if(p.length!==d.length)return!0;for(var h=0,y=p.length;h<y;h++){var v=p[h];if(l[v]!==f[v])return!0}}}return!1}},function(e,t,n){"use strict";function r(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}n.r(t);var o=r();o.withExtraArgument=r,t.default=o},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}n.r(t),n.d(t,"__DO_NOT_USE__ActionTypes",(function(){return s})),n.d(t,"applyMiddleware",(function(){return v})),n.d(t,"bindActionCreators",(function(){return h})),n.d(t,"combineReducers",(function(){return p})),n.d(t,"compose",(function(){return y})),n.d(t,"createStore",(function(){return f}));var u="function"==typeof Symbol&&Symbol.observable||"@@observable",c=function(){return Math.random().toString(36).substring(7).split("").join(".")},s={INIT:"@@redux/INIT"+c(),REPLACE:"@@redux/REPLACE"+c(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+c()}};function l(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function f(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(a(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(a(1));return n(f)(e,t)}if("function"!=typeof e)throw new Error(a(2));var o=e,i=t,c=[],p=c,d=!1;function h(){p===c&&(p=c.slice())}function y(){if(d)throw new Error(a(3));return i}function v(e){if("function"!=typeof e)throw new Error(a(4));if(d)throw new Error(a(5));var t=!0;return h(),p.push(e),function(){if(t){if(d)throw new Error(a(6));t=!1,h();var n=p.indexOf(e);p.splice(n,1),c=null}}}function g(e){if(!l(e))throw new Error(a(7));if(void 0===e.type)throw new Error(a(8));if(d)throw new Error(a(9));try{d=!0,i=o(i,e)}finally{d=!1}for(var t=c=p,n=0;n<t.length;n++){(0,t[n])()}return e}function m(e){if("function"!=typeof e)throw new Error(a(10));o=e,g({type:s.REPLACE})}function b(){var e,t=v;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(a(11));function n(){e.next&&e.next(y())}return n(),{unsubscribe:t(n)}}})[u]=function(){return this},e}return g({type:s.INIT}),(r={dispatch:g,subscribe:v,getState:y,replaceReducer:m})[u]=b,r}function p(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i,u=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:s.INIT}))throw new Error(a(12));if(void 0===n(void 0,{type:s.PROBE_UNKNOWN_ACTION()}))throw new Error(a(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},c=0;c<u.length;c++){var s=u[c],l=n[s],f=e[s],p=l(f,t);if(void 0===p){t&&t.type;throw new Error(a(14))}o[s]=p,r=r||p!==f}return(r=r||u.length!==Object.keys(e).length)?o:e}}function d(e,t){return function(){return t(e.apply(this,arguments))}}function h(e,t){if("function"==typeof e)return d(e,t);if("object"!=typeof e||null===e)throw new Error(a(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=d(o,t))}return n}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(a(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},u=t.map((function(e){return e(o)}));return r=y.apply(void 0,u)(n.dispatch),i(i({},n),{},{dispatch:r})}}}},function(e,t,n){"use strict";(function(e,r){var o,i=n(319);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n(33),n(415)(e))},function(e,t){e.exports={desktop:{icon:"icon-laptop.svg",link:{type:"external"}},mobile:{icon:"icon-phone.svg",link:{type:"external"}},support:{icon:"icon-question-mark.svg",link:{type:"external"}}}},function(e,t,n){e.exports={"icon--spin":"cozy-ui-bar-icon--spin--3IvCw",spin:"cozy-ui-bar-spin--3r0RK",icon:"cozy-ui-bar-icon--3NURx","icon--preserveColor":"cozy-ui-bar-icon--preserveColor--bqA0L",shake:"cozy-ui-bar-shake--1Tqb8"}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(33))},function(e,t,n){var r=n(194);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t,n){var r=n(341),o=n(133),i=n(342);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(103),o=n(385),i=n(104);e.exports=function(e,t,n,a,u,c){var s=1&n,l=e.length,f=t.length;if(l!=f&&!(s&&f>l))return!1;var p=c.get(e);if(p&&c.get(t))return p==t;var d=-1,h=!0,y=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++d<l;){var v=e[d],g=t[d];if(a)var m=s?a(g,v,d,t,e,c):a(v,g,d,e,t,c);if(void 0!==m){if(m)continue;h=!1;break}if(y){if(!o(t,(function(e,t){if(!i(y,t)&&(v===e||u(v,e,n,a,c)))return y.push(t)}))){h=!1;break}}else if(v!==g&&!u(v,g,n,a,c)){h=!1;break}}return c.delete(e),c.delete(t),h}},function(e,t,n){var r=n(38).Uint8Array;e.exports=r},function(e,t,n){var r=n(204),o=n(143),i=n(79);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(105),o=n(22);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(208),o=n(80),i=n(22),a=n(81),u=n(107),c=n(108),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),f=!n&&!l&&a(e),p=!n&&!l&&!f&&c(e),d=n||l||f||p,h=d?r(e.length,String):[],y=h.length;for(var v in e)!t&&!s.call(e,v)||d&&("length"==v||f&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||u(v,y))||h.push(v);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(54)(n(38),"Set");e.exports=r},function(e,t,n){var r=n(54)(n(38),"WeakMap");e.exports=r},function(e,t,n){var r=n(34);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(399),o=n(215);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(67),o=n(80),i=n(22),a=n(107),u=n(144),c=n(68);e.exports=function(e,t,n){for(var s=-1,l=(t=r(t,e)).length,f=!1;++s<l;){var p=c(t[s]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++s!=l?f:!!(l=null==e?0:e.length)&&u(l)&&a(p,l)&&(i(e)||o(e))}},function(e,t,n){var r=n(110),o=n(217),i=n(67);e.exports=function(e,t,n){for(var a=-1,u=t.length,c={};++a<u;){var s=t[a],l=r(e,s);n(l,s)&&o(c,i(s,e),l)}return c}},function(e,t,n){var r=n(149),o=n(67),i=n(107),a=n(34),u=n(68);e.exports=function(e,t,n,c){if(!a(e))return e;for(var s=-1,l=(t=o(t,e)).length,f=l-1,p=e;null!=p&&++s<l;){var d=u(t[s]),h=n;if(s!=f){var y=p[d];void 0===(h=c?c(y,d,p):void 0)&&(h=a(y)?y:i(t[s+1])?[]:{})}r(p,d,h),p=p[d]}return e}},function(e,t,n){var r=n(54),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){var r=n(105),o=n(151),i=n(143),a=n(206),u=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=u},function(e,t){var n={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,t){return t?"color: #fff; background: "+n[e]+";":"color: "+n[e]+";"}},function(e,t,n){"use strict";
12
+ /*
13
+ object-assign
14
+ (c) Sindre Sorhus
15
+ @license MIT
16
+ */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,c=a(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))o.call(n,l)&&(c[l]=n[l]);if(r){u=r(n);for(var f=0;f<u.length;f++)i.call(n,u[f])&&(c[u[f]]=n[u[f]])}}return c}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";var r=n(83),o=n(113),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||r.call(a,i);e.exports=function(){return u(r,a,arguments)},e.exports.apply=function(){return u(r,i,arguments)}},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t,n){"use strict";var r=n(436),o=n(437),i=n(438)("String.prototype.replace"),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var e=o(r(this));return i(i(e,a,""),u,"")}},function(e,t,n){"use strict";var r=n(225);e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(e,t){e.exports=function(e){return e instanceof Date}},function(e,t,n){var r=n(55),o=n(156);e.exports=function(e){var t=r(e),n=t.getFullYear(),i=new Date(0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=o(i),u=new Date(0);u.setFullYear(n,0,4),u.setHours(0,0,0,0);var c=o(u);return t.getTime()>=a.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}},function(e,t,n){var r={"./_lib/build_formatting_tokens_reg_exp":56,"./_lib/build_formatting_tokens_reg_exp/":56,"./_lib/build_formatting_tokens_reg_exp/index":56,"./_lib/build_formatting_tokens_reg_exp/index.js":56,"./en":84,"./en/":84,"./en/build_distance_in_words_locale":85,"./en/build_distance_in_words_locale/":85,"./en/build_distance_in_words_locale/index":85,"./en/build_distance_in_words_locale/index.js":85,"./en/build_format_locale":86,"./en/build_format_locale/":86,"./en/build_format_locale/index":86,"./en/build_format_locale/index.js":86,"./en/index":84,"./en/index.d.ts":449,"./en/index.js":84,"./en/package":230,"./en/package.json":230,"./es":114,"./es/":114,"./es/build_distance_in_words_locale":87,"./es/build_distance_in_words_locale/":87,"./es/build_distance_in_words_locale/index":87,"./es/build_distance_in_words_locale/index.js":87,"./es/build_format_locale":88,"./es/build_format_locale/":88,"./es/build_format_locale/index":88,"./es/build_format_locale/index.js":88,"./es/index":114,"./es/index.d.ts":450,"./es/index.js":114,"./es/package":231,"./es/package.json":231,"./fr":115,"./fr/":115,"./fr/build_distance_in_words_locale":89,"./fr/build_distance_in_words_locale/":89,"./fr/build_distance_in_words_locale/index":89,"./fr/build_distance_in_words_locale/index.js":89,"./fr/build_format_locale":90,"./fr/build_format_locale/":90,"./fr/build_format_locale/index":90,"./fr/build_format_locale/index.js":90,"./fr/index":115,"./fr/index.d.ts":451,"./fr/index.js":115,"./fr/package":232,"./fr/package.json":232};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=229},function(e){e.exports=JSON.parse('{"typings":"../../typings.d.ts"}')},function(e){e.exports=JSON.parse('{"typings":"../../typings.d.ts"}')},function(e){e.exports=JSON.parse('{"typings":"../../typings.d.ts"}')},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,s=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?s=c.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=u(p);l=!0;for(var t=s.length;t;){for(c=s,s=[];++f<t;)c&&c[f].run();f=-1,t=s.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new h(e,t)),1!==s.length||l||u(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){var r=n(197),o=n(235),i=n(136),a=n(199);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,n){var r=n(455)();e.exports=r},function(e,t,n){var r=n(459),o=n(460),i=n(461);e.exports=function(e,t,n){return t==t?i(e,t,n):r(e,o,n)}},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(240),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,u=o(i.length-t,0),c=Array(u);++a<u;)c[a]=i[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=i[a];return s[t]=n(c),r(e,this,s)}}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(464),o=n(466)(r);e.exports=o},function(e,t,n){var r=n(205),o=n(41),i=n(148),a=n(208),u=n(117),c=Math.max;e.exports=function(e){if(!e||!e.length)return[];var t=0;return e=r(e,(function(e){if(u(e))return t=c(e.length,t),!0})),a(t,(function(t){return o(e,i(t))}))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"OAuthClient",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"FetchError",{enumerable:!0,get:function(){return u.FetchError}}),Object.defineProperty(t,"normalizeDoc",{enumerable:!0,get:function(){return c.normalizeDoc}});var i=o(n(245)),a=o(n(521)),u=r(n(58)),c=n(30)},function(e,t,n){"use strict";(function(e){var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(5)),a=o(n(9)),u=o(n(2)),c=o(n(3)),s=o(n(7)),l=o(n(470)),f=r(n(250)),p=o(n(502)),d=(o(n(257)),o(n(30))),h=o(n(171)),y=r(n(260)),v=r(n(508)),g=o(n(510)),m=o(n(511)),b=r(n(261)),w=r(n(512)),x=r(n(513)),_=r(n(515)),k=r(n(516)),O=r(n(517)),S=o(n(518)),E=o(n(262)),j=r(n(58)),P=n(520),C=o(n(52));function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){(0,u.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var D=function(e){return e.message&&j.default.CLIENT_NOT_FOUND.test(e.message)},R=function(){function t(e){(0,c.default)(this,t);var n=A({},e),r=n.token,o=n.uri,i=void 0===o?"":o;this.options=n,this.setUri(i),this.setToken(r),this.konnectors=new v.default(this),this.jobs=new y.default(this)}var n,r,o,u;return(0,s.default)(t,[{key:"collection",value:function(e){if(!e)throw new Error("CozyStackClient.collection() called without a doctype");switch(e){case f.APPS_DOCTYPE:return new f.default(this);case v.KONNECTORS_DOCTYPE:return new v.default(this);case"io.cozy.files":return new h.default(e,this);case"io.cozy.sharings":return new g.default(e,this);case"io.cozy.permissions":return new m.default(e,this);case O.CONTACTS_DOCTYPE:return new O.default(e,this);case b.TRIGGERS_DOCTYPE:return new b.default(this);case y.JOBS_DOCTYPE:return new y.default(this);case w.SETTINGS_DOCTYPE:return new w.default(this);case x.NOTES_DOCTYPE:return new x.default(this);case _.OAUTH_CLIENTS_DOCTYPE:return new _.default(this);case k.SHORTCUTS_DOCTYPE:return new k.default(this);default:return new d.default(e,this)}}},{key:"fetch",value:function(e){function t(t,n,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=(0,a.default)(i.default.mark((function e(t,n,r){var o,a,u,c,s,l,f=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=f.length>3&&void 0!==f[3]?f[3]:{},(a=A({},o)).method=t,u=a.headers=A({},o.headers),"GET"!==t&&"HEAD"!==t&&void 0!==r&&u["Content-Type"]&&(a.body=r),u.Authorization||(u.Authorization=this.getAuthorizationHeader()),a.credentials="include",c=this.fullpath(n),s=(0,P.shouldXMLHTTPRequestBeUsed)(t,n,a)?P.fetchWithXMLHttpRequest:fetch,e.prev=9,e.next=12,s(c,a);case 12:return(l=e.sent).ok||this.emit("error",new j.FetchError(l,"".concat(l.status," ").concat(l.statusText))),e.abrupt("return",l);case 17:throw e.prev=17,e.t0=e.catch(9),D(e.t0)&&this.onRevocationChange(!0),e.t0;case 21:case"end":return e.stop()}}),e,this,[[9,17]])})));return function(t,n,r){return e.apply(this,arguments)}}())},{key:"onTokenRefresh",value:function(e){this.options&&this.options.onTokenRefresh&&this.options.onTokenRefresh(e)}},{key:"onRevocationChange",value:function(e){this.options&&this.options.onRevocationChange&&this.options.onRevocationChange(e)}},{key:"checkForRevocation",value:(u=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.fetchInformation();case 3:return e.abrupt("return",!1);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",D(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return u.apply(this,arguments)})},{key:"refreshToken",value:(o=(0,a.default)(i.default.mark((function t(){var n,r,o,a,u,c,s,l,f;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.token){t.next=2;break}throw new Error("Cannot refresh an empty token");case 2:if(n={method:"GET",credentials:"include"},e.document){t.next=5;break}throw new Error("Not in a web context, cannot refresh token");case 5:return t.next=7,fetch("/",n);case 7:if((r=t.sent).ok){t.next=10;break}throw new Error("couldn't fetch a new token - response "+r.statusCode);case 10:return t.next=12,r.text();case 12:if(o=t.sent,a=new DOMParser,u=a.parseFromString(o,"text/html")){t.next=17;break}throw Error("couldn't fetch a new token - doc is not html");case 17:if(c=u.querySelector('div[role="application"]')){t.next=20;break}throw Error("couldn't fetch a new token - no div[role=application]");case 20:if(s=c.dataset.cozy?JSON.parse(c.dataset.cozy):A({},c.dataset),(l=s.token)&&(l=l||s.cozyToken),l){t.next=25;break}throw Error("couldn't fetch a new token -- missing data-cozy or data-cozy-token attribute");case 25:return f=new p.default(l),this.onTokenRefresh(f),t.abrupt("return",f);case 28:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"fetchJSON",value:(r=(0,a.default)(i.default.mark((function e(t,n,r){var o,a,u=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>3&&void 0!==u[3]?u[3]:{},e.prev=1,e.next=4,this.fetchJSONWithCurrentToken(t,n,r,o);case 4:return e.abrupt("return",e.sent);case 7:if(e.prev=7,e.t0=e.catch(1),!j.default.EXPIRED_TOKEN.test(e.t0.message)&&!j.default.INVALID_TOKEN.test(e.t0.message)){e.next=25;break}return e.prev=10,e.next=13,this.refreshToken();case 13:a=e.sent,e.next=19;break;case 16:throw e.prev=16,e.t1=e.catch(10),e.t0;case 19:return this.setToken(a),e.next=22,this.fetchJSONWithCurrentToken(t,n,r,o);case 22:return e.abrupt("return",e.sent);case 25:throw e.t0;case 26:case"end":return e.stop()}}),e,this,[[1,7],[10,16]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"fetchJSONWithCurrentToken",value:(n=(0,a.default)(i.default.mark((function e(t,n,r){var o,a,u,c,s,f,p,d,h=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=h.length>3&&void 0!==h[3]?h[3]:{},a=(0,l.default)(o),(u=a.headers=a.headers||{}).Accept="application/json",c=r,"GET"!==t&&"HEAD"!==t&&void 0!==c&&(u["Content-Type"]||(u["Content-Type"]="application/json",c=JSON.stringify(c))),e.next=8,this.fetch(t,n,c,a);case 8:return s=e.sent,f=s.headers.get("content-type"),p=f&&f.indexOf("json")>=0,e.next=13,p?s.json():s.text();case 13:if(d=e.sent,!s.ok){e.next=16;break}return e.abrupt("return",d);case 16:throw new j.FetchError(s,d);case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"fullpath",value:function(e){return e.startsWith("http")?e:this.uri+e}},{key:"getAuthorizationHeader",value:function(){return this.token?this.token.toAuthHeader():null}},{key:"setCredentials",value:function(e){return(0,E.default)("CozyStackClient::setCredentials is deprecated, use CozyStackClient::setToken"),this.setToken(e)}},{key:"getCredentials",value:function(){return(0,E.default)("CozyStackClient::getCredentials is deprecated, use CozyStackClient::getAuthorizationHeader"),this.getAuthorizationHeader()}},{key:"setToken",value:function(e){if(e){if(e.toAuthHeader)this.token=e;else{if("string"!=typeof e)throw console.warn("Cozy-Client: Unknown token format",e),new Error("Cozy-Client: Unknown token format");this.token=new p.default(e)}this.onRevocationChange(!1)}else this.token=null}},{key:"getAccessToken",value:function(){return this.token&&this.token.getAccessToken()}},{key:"setUri",value:function(e){this.uri=function(e){var t=e;if(null===t)return null;for(;"/"===t[t.length-1];)t=t.slice(0,-1);return t}(e)}},{key:"getIconURL",value:function(e){return(0,S.default)(this,e)}}]),t}();C.default.mixin(R);var I=R;t.default=I}).call(this,n(33))},function(e,t,n){var r=n(98),o=n(243),i=n(149),a=n(471),u=n(472),c=n(247),s=n(118),l=n(473),f=n(474),p=n(203),d=n(150),h=n(66),y=n(475),v=n(476),g=n(249),m=n(22),b=n(81),w=n(480),x=n(34),_=n(482),k=n(79),O={};O["[object Arguments]"]=O["[object Array]"]=O["[object ArrayBuffer]"]=O["[object DataView]"]=O["[object Boolean]"]=O["[object Date]"]=O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Map]"]=O["[object Number]"]=O["[object Object]"]=O["[object RegExp]"]=O["[object Set]"]=O["[object String]"]=O["[object Symbol]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O["[object Error]"]=O["[object Function]"]=O["[object WeakMap]"]=!1,e.exports=function e(t,n,S,E,j,P){var C,T=1&n,A=2&n,D=4&n;if(S&&(C=j?S(t,E,j,P):S(t)),void 0!==C)return C;if(!x(t))return t;var R=m(t);if(R){if(C=y(t),!T)return s(t,C)}else{var I=h(t),N="[object Function]"==I||"[object GeneratorFunction]"==I;if(b(t))return c(t,T);if("[object Object]"==I||"[object Arguments]"==I||N&&!j){if(C=A||N?{}:g(t),!T)return A?f(t,u(C,t)):l(t,a(C,t))}else{if(!O[I])return j?t:{};C=v(t,I,T)}}P||(P=new r);var z=P.get(t);if(z)return z;P.set(t,C),_(t)?t.forEach((function(r){C.add(e(r,n,S,r,t,P))})):w(t)&&t.forEach((function(r,o){C.set(o,e(r,n,S,o,t,P))}));var M=D?A?d:p:A?keysIn:k,F=R?void 0:M(t);return o(F||t,(function(r,o){F&&(r=t[o=r]),i(C,o,e(r,n,S,o,t,P))})),C}},function(e,t,n){(function(e){var r=n(38),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=u?u(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(106)(e))},function(e,t,n){var r=n(163);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(164),o=n(151),i=n(109);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.normalizeApp=t.APPS_DOCTYPE=void 0;var i=o(n(5)),a=o(n(9)),u=o(n(3)),c=o(n(7)),s=o(n(8)),l=o(n(10)),f=o(n(6)),p=o(n(2)),d=o(n(16)),h=n(165),y=o(n(71)),v=r(n(30));n(58);function g(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){(0,p.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.APPS_DOCTYPE="io.cozy.apps";var _=function(e,t){return x(x(x(x({},e.attributes),e),(0,v.normalizeDoc)(e,t)),{},{id:e.id})};t.normalizeApp=_;var k=function(e){(0,s.default)(p,e);var t,n,r,o,l,f=b(p);function p(e){var t;return(0,u.default)(this,p),(t=f.call(this,"io.cozy.apps",e)).endpoint="/apps/",t}return(0,c.default)(p,[{key:"get",value:(l=(0,a.default)(i.default.mark((function e(t,n){var r,o,a,u,c,s,l,f,p,m=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.indexOf("/")>-1?r=t.split("/")[1]:(console.warn("Deprecated: in next versions of cozy-client, it will not be possible to query apps/konnectors only with id, please use the form ".concat(this.doctype,"/").concat(t,"\n\n- Q('io.cozy.apps').getById('banks')\n+ Q('io.cozy.apps').getById('io.cozy.apps/banks')")),r=t),!n||!n.sources||Array.isArray(n.sources)&&0!==n.sources.length){e.next=3;break}throw new Error('Invalid "sources" attribute passed in query, please use an array with at least one element.');case 3:o=(0,d.default)(n,"sources",["stack"]),a={stack:function(){return y.default.get(m.stackClient,"".concat(m.endpoint).concat(encodeURIComponent(r)),{normalize:m.constructor.normalizeDoctype(m.doctype)})},registry:function(){return m.stackClient.fetchJSON("GET",h.registryEndpoint+r)}},u=g(o),e.prev=6,u.s();case 8:if((c=u.n()).done){e.next=27;break}return s=c.value,e.prev=10,e.next=13,a[s]();case 13:if(l=e.sent,"registry"===s){e.next=16;break}return e.abrupt("return",l);case 16:return f=(0,h.transformRegistryFormatToStackFormat)(l),p=(0,v.normalizeDoc)(f,this.doctype),e.abrupt("return",{data:p});case 21:if(e.prev=21,e.t0=e.catch(10),s!==o[o.length-1]){e.next=25;break}throw e.t0;case 25:e.next=8;break;case 27:e.next=32;break;case 29:e.prev=29,e.t1=e.catch(6),u.e(e.t1);case 32:return e.prev=32,u.f(),e.finish(32);case 35:case"end":return e.stop()}}),e,this,[[6,29,32,35],[10,21]])}))),function(e,t){return l.apply(this,arguments)})},{key:"all",value:(o=(0,a.default)(i.default.mark((function e(){var t,n=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",this.endpoint);case 2:return t=e.sent,e.abrupt("return",{data:t.data.map((function(e){return _(e,n.doctype)})),meta:{count:t.meta.count},skip:0,next:!1});case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"create",value:(r=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("create() method is not available for applications");case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"update",value:(n=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("update() method is not available for applications");case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"destroy",value:(t=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("destroy() method is not available for applications");case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),p}(v.default);k.normalizeDoctype=v.default.normalizeDoctypeJsonApi;var O=k;t.default=O},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(487));"undefined"!=typeof __ENABLED_FLAGS__&&o.default.enable(__ENABLED_FLAGS__);var i=o.default;t.default=i},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t){e.exports=function(e){return e&&e.length?e[0]:void 0}},function(e,t,n){var r=n(34),o=n(77),i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):a.test(e)?NaN:+e}},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g,i=n(168),a={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=i.assign({default:a.RFC3986,formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}}},a)},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.isMatchingIndex=t.isInconsistentIndex=t.getIndexFields=t.transformSort=t.getIndexNameFromFields=t.normalizeDesignDoc=void 0;var o=r(n(31)),i=r(n(2)),a=n(42),u=r(n(253)),c=r(n(16)),s=r(n(169));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.normalizeDesignDoc=function(e){var t=e._id||e.id;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:t,_id:t},e.doc)};t.getIndexNameFromFields=function(e){return"by_".concat(e.join("_and_"))};t.transformSort=function(e){return!e||Array.isArray(e)?e:(console.warn('Passing an object to the "sort" is deprecated, please use an array instead.'),(0,a.transform)(e,(function(e,t,n){return e.push((0,i.default)({},n,t))}),[]))};t.getIndexFields=function(e){var t=e.selector,n=e.sort,r=void 0===n?[]:n;return Array.from(new Set([].concat((0,o.default)(r.map((function(e){return(0,u.default)(Object.keys(e))}))),(0,o.default)(t?Object.keys(t):[]))))};t.isInconsistentIndex=function(e){var t=e._id;if(!t.startsWith("_design/by_"))return!1;var n=t.split("_design/by_")[1].split("_and_"),r=Object.keys((0,c.default)(e,"views"))[0],o=Object.keys((0,c.default)(e,"views.".concat(r,".map.fields")));return!(0,s.default)(n,o)};t.isMatchingIndex=function(e,t,n){var r=Object.keys((0,c.default)(e,"views"))[0],o=Object.keys((0,c.default)(e,"views.".concat(r,".map.fields")));if((0,s.default)(o,t)){if(!n)return!0;var i=(0,c.default)(e,"views.".concat(r,".map.partial_filter_selector"));if((0,s.default)(n,i))return!0}return!1}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=function(){function e(t){(0,o.default)(this,e);var n=t;"string"==typeof n&&(n=JSON.parse(n)),this.tokenType=n.token_type||n.tokenType,this.accessToken=n.access_token||n.accessToken,this.refreshToken=n.refresh_token||n.refreshToken,this.scope=n.scope}return(0,i.default)(e,[{key:"toAuthHeader",value:function(){return"Bearer "+this.accessToken}},{key:"toBasicAuth",value:function(){return"user:".concat(this.accessToken,"@")}},{key:"toJSON",value:function(){return{tokenType:this.tokenType,accessToken:this.accessToken,refreshToken:this.refreshToken,scope:this.scope}}},{key:"toString",value:function(){return JSON.stringify(this.toJSON())}},{key:"getAccessToken",value:function(){return this.accessToken}}]),e}();t.default=a},function(e,t,n){var r=n(506),o=n(215);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIllegalCharacters=void 0;t.getIllegalCharacters=function(e){var t=e.match(/\/|\x00|\n|\r/g);return t?t.join(" "):""}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.hasJobFinished=t.normalizeJob=t.JOBS_DOCTYPE=void 0;var o=r(n(5)),i=r(n(45)),a=r(n(9)),u=r(n(3)),c=r(n(7)),s=r(n(2)),l=r(n(71)),f=n(30),p=n(42);function d(){var e=(0,i.default)(["/jobs/",""]);return d=function(){return e},e}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.JOBS_DOCTYPE="io.cozy.jobs";var v=function(e){return new Promise((function(t){return setTimeout(t,e)}))},g=function(e){return y(y(y({},e),(0,f.normalizeDoc)(e,"io.cozy.jobs")),e.attributes)};t.normalizeJob=g;var m=function(e){return"done"===e.state||"errored"===e.state};t.hasJobFinished=m;var b=function(){function e(t){(0,u.default)(this,e),this.stackClient=t}var t,n,r;return(0,c.default)(e,[{key:"queued",value:function(e){return this.stackClient.fetchJSON("GET","/jobs/queue/".concat(e))}},{key:"create",value:function(e,t,n){return this.stackClient.fetchJSON("POST","/jobs/queue/".concat(e),{data:{type:"io.cozy.jobs",attributes:{arguments:t||{},options:n||{}}}})}},{key:"get",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",l.default.get(this.stackClient,(0,p.uri)(d(),t),{normalize:g}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"update",value:(n=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("client"===t.worker){e.next=2;break}throw new Error("JobCollection.update only works for client workers. ".concat(t.worker," given"));case 2:return e.next=4,this.stackClient.fetchJSON("PATCH","/jobs/".concat(t._id),{data:{type:"io.cozy.jobs",id:t._id,attributes:{state:t.attributes.state,error:t.attributes.error}}});case 4:return n=e.sent,e.abrupt("return",g(n.data));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"waitFor",value:(t=(0,a.default)(o.default.mark((function e(t){var n,r,i,a,u,c,s,l,f,p,d,h,y=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=y.length>1&&void 0!==y[1]?y[1]:{},r=n.onUpdate,i=void 0===r?null:r,a=n.until,u=void 0===a?m:a,c=n.delay,s=void 0===c?5e3:c,l=n.timeout,f=void 0===l?3e5:l,p=Date.now(),e.next=4,this.get(t);case 4:d=e.sent.data.attributes;case 5:if(d&&u(d)){e.next=17;break}return e.next=8,v(s);case 8:return e.next=10,this.get(t);case 10:if(d=e.sent.data.attributes,i&&i(d),h=Date.now(),!(p-h>f)){e.next=15;break}throw new Error("Timeout for JobCollection::waitFor");case 15:e.next=5;break;case 17:return e.abrupt("return",d);case 18:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();t.default=b},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isForAccount=t.isForKonnector=t.normalizeTrigger=t.TRIGGERS_DOCTYPE=t.JOBS_DOCTYPE=void 0;var i=o(n(25)),a=o(n(45)),u=o(n(5)),c=o(n(9)),s=o(n(3)),l=o(n(7)),f=o(n(91)),p=o(n(8)),d=o(n(10)),h=o(n(6)),y=o(n(2)),v=r(n(71)),g=r(n(30)),m=n(260),b=n(42);n(58);function w(){var e=(0,a.default)(["/jobs/triggers/","/launch"]);return w=function(){return e},e}function x(){var e=(0,a.default)(["/jobs/triggers/",""]);return x=function(){return e},e}function _(){var e=(0,a.default)(["/jobs/triggers/",""]);return _=function(){return e},e}function k(){var e=(0,a.default)(["/jobs/triggers"]);return k=function(){return e},e}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,h.default)(e);if(t){var o=(0,h.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,d.default)(this,n)}}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){(0,y.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.JOBS_DOCTYPE="io.cozy.jobs";t.TRIGGERS_DOCTYPE="io.cozy.triggers";var j=function(e){return E(E(E({},e),(0,g.normalizeDoc)(e,"io.cozy.triggers")),e.attributes)};t.normalizeTrigger=j;t.isForKonnector=function(e,t){return"konnector"===e.worker&&e.message.konnector==t};t.isForAccount=function(e,t){return e.message.account==t};var P=function(e,t){var n=new URLSearchParams;return e&&(Array.isArray(e.$in)?n.set("Worker",e.$in.join(",")):n.set("Worker",e)),t&&(Array.isArray(t.$in)?n.set("Type",t.$in.join(",")):n.set("Type",t)),n.toString()},C=function(e){(0,p.default)(S,e);var t,n,r,o,a,d,y,g=O(S);function S(e){return(0,s.default)(this,S),g.call(this,"io.cozy.triggers",e)}return(0,l.default)(S,[{key:"all",value:(y=(0,c.default)(u.default.mark((function e(){var t,n=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.length>0&&void 0!==n[0]&&n[0],e.prev=1,e.next=4,this.stackClient.fetchJSON("GET","/jobs/triggers");case 4:return t=e.sent,e.abrupt("return",{data:t.data.map((function(e){return j(e)})),meta:{count:t.data.length},next:!1,skip:0});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",(0,v.dontThrowNotFoundError)(e.t0));case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return y.apply(this,arguments)})},{key:"create",value:(d=(0,c.default)(u.default.mark((function e(t){var n,r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,b.uri)(k()),e.next=3,this.stackClient.fetchJSON("POST",n,{data:{attributes:t}});case 3:return r=e.sent,e.abrupt("return",{data:j(r.data)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"destroy",value:(a=(0,c.default)(u.default.mark((function e(t){var n;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t._id){e.next=3;break}throw new Error("TriggerCollection.destroy needs a document with an _id");case 3:return e.next=5,this.stackClient.fetchJSON("DELETE",(0,b.uri)(_(),n));case 5:return e.abrupt("return",{data:j(E(E({},t),{},{_deleted:!0}))});case 6:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"find",value:(o=(0,c.default)(u.default.mark((function e(){var t,n,r,o,a,c,s,l=arguments;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>0&&void 0!==l[0]?l[0]:{},n=l.length>1&&void 0!==l[1]?l[1]:{},r=t.worker,o=t.type,a=(0,i.default)(t,["worker","type"]),0!==Object.keys(a).length){e.next=18;break}return c="/jobs/triggers?".concat(P(r,o)),e.prev=6,e.next=9,this.stackClient.fetchJSON("GET",c);case 9:return s=e.sent,e.abrupt("return",{data:s.data.map((function(e){return j(e)})),meta:{count:s.data.length},next:!1,skip:0});case 13:return e.prev=13,e.t0=e.catch(6),e.abrupt("return",(0,v.dontThrowNotFoundError)(e.t0));case 16:e.next=19;break;case 18:return e.abrupt("return",(0,f.default)((0,h.default)(S.prototype),"find",this).call(this,t,n));case 19:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return o.apply(this,arguments)})},{key:"get",value:(r=(0,c.default)(u.default.mark((function e(t){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",v.default.get(this.stackClient,(0,b.uri)(x(),t),{normalize:j}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"launch",value:(n=(0,c.default)(u.default.mark((function e(t){var n,r;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,b.uri)(w(),t._id),e.next=3,this.stackClient.fetchJSON("POST",n);case 3:return r=e.sent,e.abrupt("return",{data:(0,m.normalizeJob)(r.data)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"update",value:(t=(0,c.default)(u.default.mark((function e(){return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("update() method is not available for triggers");case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),S}(g.default);C.normalizeDoctype=g.default.normalizeDoctypeJsonApi;var T=C;t.default=T},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){var e;(e=console).warn.apply(e,arguments)};t.default=r},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.transformBulkDocsResponse=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(25)),u=r(n(3)),c=r(n(7)),s=r(n(8)),l=r(n(10)),f=r(n(6)),p=r(n(2)),d=n(18),h=r(n(173)),y=(n(19),n(59)),v=n(264),g=r(n(265));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){(0,p.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(e,t){var n=(0,g.default)(e,t,(function(e,t){return e.ok?w(w({},t),{},{_id:e.id,_rev:e.rev}):t}));if(e.find((function(e){return!e.ok})))throw new v.BulkEditError(e,n);return{data:n}};t.transformBulkDocsResponse=x;var _=function(e){(0,s.default)(r,e);var t,n=m(r);function r(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.client,i=t.stackClient;return(0,u.default)(this,r),e=n.call(this),o&&console.warn("Using options.client is deprecated, prefer options.stackClient"),e.stackClient=i||o,e}return(0,c.default)(r,[{key:"registerClient",value:function(e){this.stackClient=e.stackClient||e.client}},{key:"reset",value:function(){this.stackClient=null}},{key:"request",value:function(e,t,n){return e.mutationType?this.executeMutation(e,t,n):this.executeQuery(e)}},{key:"executeQuery",value:function(e){var t=e.doctype,n=e.selector,r=e.id,o=e.ids,i=e.referenced,u=(0,a.default)(e,["doctype","selector","id","ids","referenced"]);if(!t)throw console.warn("Bad query",e),new Error("No doctype found in a query definition");var c=this.stackClient.collection(t);return r?c.get(r,e):o?c.getAll(o):i?c.findReferencedBy(i,u):n||u.sort?c.find(n,u):c.all(u)}},{key:"executeMutation",value:(t=(0,i.default)(o.default.mark((function e(t,n,r){var i,u,c,s,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.mutationType,u=t.document,c=t.documents,s=(0,a.default)(t,["mutationType","document","documents"]),e.t0=i,e.next=e.t0===d.MutationTypes.CREATE_DOCUMENT?4:e.t0===d.MutationTypes.UPDATE_DOCUMENTS?5:e.t0===d.MutationTypes.UPDATE_DOCUMENT?9:e.t0===d.MutationTypes.DELETE_DOCUMENT?10:e.t0===d.MutationTypes.ADD_REFERENCES_TO?11:e.t0===d.MutationTypes.REMOVE_REFERENCES_TO?12:e.t0===d.MutationTypes.ADD_REFERENCED_BY?13:e.t0===d.MutationTypes.REMOVE_REFERENCED_BY?18:e.t0===d.MutationTypes.UPLOAD_FILE?23:24;break;case 4:return e.abrupt("return",this.stackClient.collection(u._type).create(u));case 5:return e.next=7,this.stackClient.collection(c[0]._type).updateAll(c);case 7:return l=e.sent,e.abrupt("return",x(l,c));case 9:return e.abrupt("return",this.stackClient.collection(u._type).update(u));case 10:return e.abrupt("return",this.stackClient.collection(u._type).destroy(u));case 11:return e.abrupt("return",this.stackClient.collection(s.referencedDocuments[0]._type).addReferencesTo(u,s.referencedDocuments));case 12:return e.abrupt("return",this.stackClient.collection(s.referencedDocuments[0]._type).removeReferencesTo(u,s.referencedDocuments));case 13:if(u._type!==y.DOCTYPE_FILES){e.next=17;break}return e.abrupt("return",this.stackClient.collection(y.DOCTYPE_FILES).addReferencedBy(u,s.referencedDocuments));case 17:throw new Error("The document type should be io.cozy.files");case 18:if(u._type!==y.DOCTYPE_FILES){e.next=22;break}return e.abrupt("return",this.stackClient.collection(y.DOCTYPE_FILES).removeReferencedBy(u,s.referencedDocuments));case 22:throw new Error("The document type should be io.cozy.files");case 23:return e.abrupt("return",this.stackClient.collection(y.DOCTYPE_FILES).upload(s.file,s.dirPath));case 24:return e.abrupt("return",r(t,n));case 25:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),r}(h.default);t.default=_},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.BulkEditError=void 0;var o=r(n(2)),i=r(n(3)),a=r(n(7)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=r(n(35)),f=r(n(265));n(19);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var y=function(e){(0,u.default)(n,e);var t=h(n);function n(e,r){var o;return(0,i.default)(this,n),(o=t.call(this,"Error while bulk saving")).name="BulkEditError",o.results=(0,f.default)(e,r,(function(e,t){return d(d({},e),{},{doc:t})})),o}return(0,a.default)(n,[{key:"getUpdatedDocuments",value:function(){return this.results.filter((function(e){return e.ok})).map((function(e){return e.doc}))}},{key:"getErrors",value:function(){return this.results.filter((function(e){return!e.ok}))}}]),n}((0,l.default)(Error));t.BulkEditError=y},function(e,t,n){var r=n(57),o=n(522),i=r((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,o(e,n)}));e.exports=i},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(31)),a=r(n(2)),u=r(n(9)),c=r(n(3)),s=r(n(7)),l=r(n(91)),f=r(n(8)),p=r(n(10)),d=r(n(6)),h=r(n(24)),y=r(n(16)),v=r(n(73)),g=r(n(119)),m=n(18),b=n(60),w=(n(19),n(59)),x=(r(n(61)),r(n(92)));function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var o=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,p.default)(this,n)}}var S=function(e,t){var n=(0,h.default)(e,3),r=n[0],o=n[1],i=n[2];return[i?[r,o,i]:[r,o],t]},E=function(e){(0,f.default)(p,e);var t,n,r,a=O(p);function p(){return(0,c.default)(this,p),a.apply(this,arguments)}return(0,s.default)(p,[{key:"fetchMore",value:(r=(0,u.default)(o.default.mark((function e(){var t,n,r,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new m.QueryDefinition({doctype:w.DOCTYPE_FILES}),n=this.getRelationship().data,r=n[n.length-1],e.next=5,this.dispatch(function(){var e=(0,u.default)(o.default.mark((function e(u,c){var s,l,f,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(0,b.getDocumentFromState)(c(),r._type,r._id),l=s.attributes.metadata.datetime,f=S([a.target._type,a.target._id,l],n[n.length-1]._id),e.next=5,a.query(t.referencedBy(a.target).offsetCursor(f));case 5:return(p=e.sent).data.shift(),e.next=9,a.dispatch(a.updateRelationshipData((function(e){return k(k({},e),{},{data:[].concat((0,i.default)(e.data),(0,i.default)(p.data)),next:p.next})})));case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"addById",value:(n=(0,u.default)(o.default.mark((function e(t){var n,r,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Array.isArray(t)?t:[t],r=n.map((function(e){return{_id:e,_type:i.doctype}})),e.next=4,this.mutate(this.addReferences(r));case 4:this.addTargetRelationships(n);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"removeById",value:(t=(0,u.default)(o.default.mark((function e(t){var n,r,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Array.isArray(t)?t:[t],r=n.map((function(e){return{_id:e,_type:i.doctype}})),e.next=4,this.mutate(this.removeReferences(r));case 4:this.removeTargetRelationships(n);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"addReferences",value:function(e){if(this.target._type===w.DOCTYPE_FILES)return m.Mutations.addReferencedBy(this.target,e);if(e[0]._type===w.DOCTYPE_FILES)return m.Mutations.addReferencesTo(this.target,e);throw new Error("Either the document or the references should be io.cozy.files")}},{key:"removeReferences",value:function(e){if(this.target._type===w.DOCTYPE_FILES)return m.Mutations.removeReferencedBy(this.target,e);if(e[0]._type===w.DOCTYPE_FILES)return m.Mutations.removeReferencesTo(this.target,e);throw new Error("Either the document or the references should be io.cozy.files")}},{key:"dehydrate",value:function(e){return(0,v.default)(e,[this.name,"relationships.".concat(this.name)])}},{key:"data",get:function(){var e=this;return this.target._type===w.DOCTYPE_FILES?(0,y.default)(this.target,"referenced_by",[]).map((function(t){var n=t.id,r=t.type;return e.get(r,n)})).filter(Boolean):(0,l.default)((0,d.default)(p.prototype),"data",this)}}],[{key:"query",value:function(e,t,n){if(e._type===w.DOCTYPE_FILES){var r=(0,y.default)(e,"relationships.referenced_by.data",[]),o=(0,g.default)(r.filter((function(e){return e.type===n.doctype})).map((function(e){return e.id})));return o.length>0?(0,m.Q)(n.doctype).getByIds(o):null}var i=S([e._type,e._id],"");return(0,m.Q)(n.doctype).referencedBy(e).offsetCursor(i)}}]),p}(x.default);t.default=E},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.extractAndMergeDocument=t.getCollectionFromSlice=t.getDocumentFromSlice=t.default=t.mergeDocumentsWithRelationships=void 0;var o=r(n(2)),i=r(n(268)),a=r(n(16)),u=r(n(169)),c=r(n(73)),s=r(n(174)),l=n(175),f=n(18),p=n(177),d=(n(19),n(276));function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e,t){var n=t._type;if(!n)throw new Error("Document without _type");if(!(0,d.properId)(t))throw new Error("Document without id");var r=(0,a.default)(e,[n,(0,d.properId)(t)]);return(0,u.default)(r,t)?e:y(y({},e),{},(0,o.default)({},n,y(y({},e[n]),{},(0,o.default)({},(0,d.properId)(t),g(r,t)))))},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=y(y({},e),t);return(e.relationships||t.relationships)&&(n.relationships=y(y({},e.relationships),t.relationships)),n};t.mergeDocumentsWithRelationships=g;var m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(!(0,l.isReceivingData)(t)&&!(0,p.isReceivingMutationResult)(t))return e;if(t&&t.definition&&t.definition.mutationType===f.MutationTypes.DELETE_DOCUMENT){var n=t.definition.document._id,r=t.definition.document._type;return y(y({},e),{},(0,o.default)({},r,(0,c.default)(e[r],n)))}var i=t.response,a=i.data,u=i.included;if(!a||Array.isArray(a)&&0===a.length)return e;var s=u?u.reduce(v,e):e;return Array.isArray(a)?b(a,s):v(s,a)};t.default=m;t.getDocumentFromSlice=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error("getDocumentFromSlice: Cannot retrieve document with undefined doctype");if(!n)throw new Error("getDocumentFromSlice: Cannot retrieve document with undefined id");return e[t]&&e[t][n]?e[t][n]:null};t.getCollectionFromSlice=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(!t)throw new Error("getDocumentFromSlice: Cannot retrieve document with undefined doctype");return e[t]?Object.values(e[t]):null};var b=function(e,t){var n=e[0]._type;if(!n)throw s.default.info("Document without _type",e[0]),new Error("Document without _type");var r=(0,i.default)(e,d.properId),o=Object.assign({},t);return Object.values(r).map((function(e){o[n]||(o[n]={});var t=(0,d.properId)(e);o[n][t]?o[n][t]=y(y({},o[n][t]),e):o[n][t]=e})),o};t.extractAndMergeDocument=b},function(e,t,n){var r=n(69),o=n(269)((function(e,t,n){r(e,n,t)}));e.exports=o},function(e,t,n){var r=n(523),o=n(524),i=n(53),a=n(22);e.exports=function(e,t){return function(n,u){var c=a(n)?r:o,s=t?t():{};return c(n,e,i(u,2),s)}}},function(e,t){var n={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,t){return t?"color: #fff; background: "+n[e]+";":"color: "+n[e]+";"}},function(e,t,n){var r=n(69),o=n(269),i=Object.prototype.hasOwnProperty,a=o((function(e,t,n){i.call(e,n)?e[n].push(t):r(e,n,[t])}));e.exports=a},function(e,t,n){var r=n(41),o=n(273),i=n(57),a=n(274),u=i((function(e){var t=r(e,a);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=u},function(e,t,n){var r=n(103),o=n(160),i=n(161),a=n(41),u=n(65),c=n(104),s=Math.min;e.exports=function(e,t,n){for(var l=n?i:o,f=e[0].length,p=e.length,d=p,h=Array(p),y=1/0,v=[];d--;){var g=e[d];d&&t&&(g=a(g,u(t))),y=s(g.length,y),h[d]=!n&&(t||f>=120&&g.length>=120)?new r(d&&g):void 0}g=e[0];var m=-1,b=h[0];e:for(;++m<f&&v.length<y;){var w=g[m],x=t?t(w):w;if(w=n||0!==w?w:0,!(b?c(b,x):l(v,x,n))){for(d=p;--d;){var _=h[d];if(!(_?c(_,x):l(e[d],x,n)))continue e}b&&b.push(x),v.push(w)}}return v}},function(e,t,n){var r=n(117);e.exports=function(e){return r(e)?e:[]}},function(e,t,n){var r=n(41),o=n(53),i=n(538),a=n(539),u=n(65),c=n(540),s=n(82);e.exports=function(e,t,n){var l=-1;t=r(t.length?t:[s],u(o));var f=i(e,(function(e,n,o){return{criteria:r(t,(function(t){return t(e)})),index:++l,value:e}}));return a(f,(function(e,t){return c(e,t,n)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.properId=void 0;t.properId=function(e){return e.id||e._id}},function(e,t,n){var r=n(69),o=n(78);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){var r=n(78),o=n(46),i=n(107),a=n(34);e.exports=function(e,t,n){if(!a(n))return!1;var u=typeof t;return!!("number"==u?o(n)&&i(t,n.length):"string"==u&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(2)),i=r(n(3)),a=r(n(7)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=r(n(16)),f=r(n(547)),p=n(18);n(19);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var v=function(e){(0,u.default)(n,e);var t=y(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,a.default)(n,[{key:"add",value:function(e){return this.setRelationship(e),this.save(this.target)}},{key:"remove",value:function(){return this.setRelationship(void 0),this.save(this.target)}},{key:"setRelationship",value:function(e){if(e&&e._type!==this.doctype)throw new Error("Tried to associate a ".concat(e._type," document to a HasOne relationship on ").concat(this.doctype," document"));var t="relationships[".concat(this.name,"].data");e?(0,f.default)(this.target,t,{_id:e._id,_type:e._type}):(0,f.default)(this.target,t,void 0)}},{key:"set",value:function(e){console.warn("set is deprecated for has-one relationships. Use `add` instead."),this.setRelationship(e)}},{key:"unset",value:function(){console.warn("unset is deprecated for has-one relationships. Use `remove` instead."),this.setRelationship(void 0)}},{key:"dehydrate",value:function(e){return this.raw?h(h({},e),{},{relationships:h(h({},e.relationships),{},(0,o.default)({},this.name,{data:this.raw}))}):e}},{key:"raw",get:function(){return(0,l.default)(this.target,"relationships[".concat(this.name,"].data"),null)}},{key:"data",get:function(){return this.raw?this.get(this.doctype,this.raw._id):null}}],[{key:"query",value:function(e,t,n){var r=(0,l.default)(e,"relationships.".concat(n.name,".data"),{});return r&&r._id?(0,p.Q)(n.doctype).getById(r._id):null}}]),n}(r(n(61)).default);t.default=v},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.BelongsToInPlace=t.default=void 0;var o=r(n(2)),i=r(n(3)),a=r(n(7)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=r(n(61)),f=n(18);n(19);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var y=function(e){(0,u.default)(n,e);var t=h(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,a.default)(n,[{key:"dehydrate",value:function(e){return d(d({},e),{},(0,o.default)({},this.name,this.raw||void 0))}},{key:"raw",get:function(){return this.target[this.name]}},{key:"data",get:function(){return this.get(this.doctype,this.raw)}}],[{key:"query",value:function(e,t,n){var r=e[n.name];return t.getDocumentFromState(n.doctype,r)||(0,f.Q)(n.doctype).getById(r)}}]),n}(l.default);t.default=y;var v=y;t.BelongsToInPlace=v},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(2)),i=r(n(3)),a=r(n(7)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=n(18);n(19);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var h=function(e){(0,u.default)(n,e);var t=d(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,a.default)(n,[{key:"addById",value:function(e){this.getRelationship().push(e)}},{key:"removeById",value:function(e){var t=this.getRelationship(),n=t.indexOf(e);-1!==n&&t.splice(n,1)}},{key:"existsById",value:function(e){return-1!==this.getRelationship().indexOf(e)}},{key:"getRelationship",value:function(){return this.target[this.name]=this.target[this.name]||[],this.target[this.name]}},{key:"dehydrate",value:function(e){return p(p({},e),{},(0,o.default)({},this.name,this.raw||[]))}},{key:"raw",get:function(){return this.target[this.name]}},{key:"data",get:function(){var e=this,t=this.doctype;return(this.raw||[]).map((function(n){return e.get(t,n)}))}}],[{key:"query",value:function(e,t,n){var r=e[n.name];return r&&r>0?(0,l.Q)(n.doctype).getByIds(r):null}}]),n}(r(n(61)).default);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={olderThan:function(e){return function(t){return!t||!t.lastUpdate||Date.now()-t.lastUpdate>e}},noFetch:function(){return!1}};t.default=r},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=r(n(2)),u=r(n(16)),c=n(60),s=Object.prototype.hasOwnProperty,l=function(){function e(t,n,r,i){var u=this;if((0,o.default)(this,e),(0,a.default)(this,"handleStoreChange",(function(){var e=u.currentRawResult();(function(e,t){if(f(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!s.call(t,n[o])||!f(e[n[o]],t[n[o]]))return!1;return!0})(e,u.lastResult)||(u.lastResult=e,u.notifyObservers())})),!t||!n||!r)throw new Error("ObservableQuery takes 3 arguments: queryId, definition and client");this.queryId=t,this.definition=n,this.client=r,this.observers={},this.idCounter=1,this.lastResult=this.currentRawResult(),this.options=i}return(0,i.default)(e,[{key:"currentResult",value:function(){return this.client.getQueryFromState(this.queryId,{hydrated:(0,u.default)(this.options,"hydrated",!0),singleDocData:!0})}},{key:"fetch",value:function(){return this.client.query(this.definition,{as:this.queryId})}},{key:"fetchMore",value:function(){var e=this.currentRawResult();return e.bookmark?this.client.query(this.definition.offsetBookmark(e.bookmark),{as:this.queryId}):this.client.query(this.definition.offset(e.data.length),{as:this.queryId})}},{key:"currentRawResult",value:function(){return(0,c.getRawQueryFromState)(this.getStore().getState(),this.queryId)}},{key:"notifyObservers",value:function(){var e=this;Object.keys(this.observers).forEach((function(t){return e.observers[t]()}))}},{key:"subscribeToStore",value:function(){if(this._unsubscribeStore)throw new Error("ObservableQuery instance is already subscribed to store.");this._unsubscribeStore=this.getStore().subscribe(this.handleStoreChange)}},{key:"unsubscribeFromStore",value:function(){if(!this._unsubscribeStore)throw new Error("ObservableQuery instance is not subscribed to store");this._unsubscribeStore()}},{key:"subscribe",value:function(e){var t=this,n=this.idCounter;return this.idCounter++,this.observers[n]=e,1===Object.keys(this.observers).length&&this.subscribeToStore(),function(){return t.unsubscribe(n)}}},{key:"unsubscribe",value:function(e){if(!this.observers[e])throw new Error("Cannot unsubscribe unknown callbackId ".concat(e));delete this.observers[e],0===Object.keys(this.observers).length&&(this.unsubscribeFromStore(),this._unsubscribeStore=null)}},{key:"getStore",value:function(){return this.client.store}}]),e}();function f(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}t.default=l},function(e,t,n){var r=n(180),o=n(167),i=n(286),a=n(287),u=n(22),c=n(569);e.exports=function(e){return o((function(t){var n=t.length,o=n,s=r.prototype.thru;for(e&&t.reverse();o--;){var l=t[o];if("function"!=typeof l)throw new TypeError("Expected a function");if(s&&!f&&"wrapper"==a(l))var f=new r([],!0)}for(o=f?o:n;++o<n;){l=t[o];var p=a(l),d="wrapper"==p?i(l):void 0;f=d&&c(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?f[a(d[0])].apply(f,d[3]):1==l.length&&c(l)?f[p]():f.thru(l)}return function(){var e=arguments,r=e[0];if(f&&1==e.length&&u(r))return f.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}},function(e,t,n){var r=n(567),o=n(238),i=r?function(e){return r.get(e)}:o;e.exports=i},function(e,t,n){var r=n(568),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",n=r[t],i=o.call(r,t)?n.length:0;i--;){var a=n[i],u=a.func;if(null==u||u==e)return a.name}return t}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.computeChildrenArgs=t.getQueryAttributes=t.default=t.fetchQuery=void 0;var o=r(n(3)),i=r(n(7)),a=r(n(11)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=r(n(2)),f=r(n(25)),p=n(0),d=(r(n(40)),r(n(1)));r(n(284));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,l.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g={},m=function(e,t){return t.fetch?t.fetch():e.query(t.definition,{as:t.queryId})};t.fetchQuery=m;var b=function(e,t){var n=e.create.bind(e),r=e.save.bind(e),o=e.destroy.bind(e),i=e.getAssociation.bind(e),a="function"==typeof t.query?t.query(e,t):t.query,u=e.makeObservableQuery(a,t),c=u.fetchMore.bind(u),s=t.mutations,l=(0,f.default)(t,["mutations"]),p="function"==typeof s?s(e,u,l):s,d=u.fetch?u.fetch.bind(u):null;return{client:e,observableQuery:u,queryDefinition:a,createDocument:n,saveDocument:r,deleteDocument:o,getAssociation:i,fetchMore:c,fetch:d,mutations:p}};t.getQueryAttributes=b;var w=function(e){var t=e.observableQuery,n=e.fetchMore,r=e.fetch,o=e.createDocument,i=e.saveDocument,a=e.deleteDocument,u=e.getAssociation,c=e.mutations;return[v({fetchMore:n,fetch:r},t.currentResult()),v({createDocument:o,saveDocument:i,deleteDocument:a,getAssociation:u},c)]};t.computeChildrenArgs=w;var x=function(e){(0,u.default)(n,e);var t=h(n);function n(e,r){var i;(0,o.default)(this,n),i=t.call(this,e,r),(0,l.default)((0,a.default)(i),"onQueryChange",(function(){i.recomputeChildrenArgs(),i.setState(g)}));var u=r.client;if(!r.client)throw new Error("Query should be used with client in context (use CozyProvider to set context)");return i.client=u,i.observableQuery=null,i.queryUnsubscribe=null,Object.assign((0,a.default)(i),b(u,e)),i.recomputeChildrenArgs(),i}return(0,i.default)(n,[{key:"componentDidMount",value:function(){this.queryUnsubscribe=this.observableQuery.subscribe(this.onQueryChange),!1!==this.props.enabled&&this.executeQueryRespectingFetchPolicy()}},{key:"executeQueryRespectingFetchPolicy",value:function(){if(this.props.fetchPolicy){var e=this.client.getQueryFromState(this.props.as);this.props.fetchPolicy&&"function"==typeof this.props.fetchPolicy&&this.props.fetchPolicy(e)&&m(this.client,this.observableQuery)}else m(this.client,this.observableQuery)}},{key:"componentDidUpdate",value:function(e){!1===e.enabled&&!1!==this.props.enabled&&this.executeQueryRespectingFetchPolicy()}},{key:"componentWillUnmount",value:function(){this.queryUnsubscribe&&this.queryUnsubscribe()}},{key:"recomputeChildrenArgs",value:function(){this.childrenArgs=w(this)}},{key:"render",value:function(){return(0,this.props.children)(this.childrenArgs[0],this.childrenArgs[1])}}]),n}(p.Component);t.default=x,x.contextTypes={client:d.default.object,store:d.default.object};var _=d.default.object;x.propTypes={query:d.default.oneOfType([d.default.func,_]).isRequired,enabled:d.default.bool,as:d.default.string,children:d.default.func.isRequired,fetchPolicy:d.default.func},x.defaultProps={enabled:!0}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.useQueries=void 0;var o=r(n(24)),i=r(n(2)),a=n(0),u=n(671),c=r(n(16)),s=r(n(122)),l=r(n(174)),f=(n(19),n(183));n(18);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=(0,u.createSelectorHook)(f.clientContext),y=function(e,t){if(!h)throw new Error("You must use react-redux > 7.1.0 to use useQuery (uses useSelector) under the hood");if(!e)throw l.default.warn("Bad query",e),new Error("Bad query");var n,r="function"==typeof(n=e)?n():n,o=t.as,i=t.enabled,u=void 0===i||i;if(!o)throw new Error("You must specify options.as when using useQuery");var f=(0,s.default)(),p=h((function(){return void 0===t.singleDocData&&e.id&&l.default.warn("useQuery options.singleDocData will pass to true in a next version of cozy-client, please add it now to prevent any problem in the future."),f.getQueryFromState(o,{hydrated:(0,c.default)(t,"hydrated",!0),singleDocData:(0,c.default)(t,"singleDocData",!1)})}));(0,a.useEffect)((function(){!1!==u&&f.query(r,t)}),[o,u]);var y=(0,a.useCallback)((function(){var e,t=f.getQueryFromState(o);return f.query((e=t).bookmark?e.definition.offsetBookmark(e.bookmark):e.definition.offset(e.data.length),{as:o})}),[o,f]),v=(0,a.useCallback)((function(){return f.query(r,t)}),[f,r,t]);return d(d({},p),{},{fetchMore:y,fetch:v})};t.useQueries=function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=(0,o.default)(r[n],2),a=i[0],u=i[1];t[a]=y(u.query,u)}return t};var v=y;t.default=v},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.setContractSyncStatusInAccount=t.getContractSyncStatusFromAccount=t.muteError=t.getMutedErrors=void 0;var o=r(n(2)),i=r(n(16)),a=r(n(121)),u=n(92);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){return(0,i.default)(e,"mutedErrors",[])};t.getMutedErrors=l;t.muteError=function(e,t){var n=l(e);return n.push({type:t,mutedAt:(new Date).toISOString()}),s(s({},e),{},{mutedErrors:n})};t.getContractSyncStatusFromAccount=function(e,t){var n=(0,u.getHasManyItem)(e,"contracts",t);if(!n)throw new Error("Cannot find contrat ".concat(t," in account"));return(0,i.default)(n,"metadata.imported",!0)};t.setContractSyncStatusInAccount=function(e,t,n){return(0,u.updateHasManyItem)(e,"contracts",t,(function(e){if(void 0===e)throw new Error("Cannot find contrat ".concat(t," in account"));return(0,a.default)({},e,{metadata:{imported:n}})}))}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getAppDisplayName=t.getUrl=t.isInstalled=t.getStoreInstallationURL=t.getStoreURL=void 0;var o=r(n(16)),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.slug)throw new Error("Expected app / konnector with the defined slug");var n=a(e,{slug:"store"});if(!n)return null;var r=n.links&&n.links.related;return r?"".concat(r,"#/discover/").concat(t.slug):null};t.getStoreURL=i;t.getStoreInstallationURL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i(e,t);return n?"".concat(n,"/install"):null};var a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.find((function(e){return e.attributes&&e.attributes.slug===t.slug}))};t.isInstalled=a;t.getUrl=function(e){return e.links&&e.links.related};t.getAppDisplayName=function(e,t){var n=(0,o.default)(e,"name_prefix"),r=(0,o.default)(e,"name"),i=(0,o.default)(e,["locales",t,"name"],r),a=(0,o.default)(e,["locales",t,"name_prefix"],n);return a&&"cozy"!==a.toLowerCase()?"".concat(a," ").concat(i):i}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=function(e){var t=e._id||e.id,n=e._type||d.DOCTYPE_FILES;return g({_id:t,id:t,_type:n},e)},t.ensureFilePath=function(e,t){if(e.path)return e;if(!t||!t.path)throw new Error("Could not define a file path for ".concat(e._id||e.id));return g({path:t.path+"/"+e.name},e)},t.getParentFolderId=function(e){var t=(0,u.default)(e,"attributes.dir_id");return""===t?null:t},t.fetchBlobFileById=t.isFromKonnector=t.hasCertifications=t.hasQualifications=t.isPlainText=t.doMobileUpload=t.readMobileFile=t.uploadFileWithConflictStrategy=t.generateFileNameForRevision=t.generateNewFileNameOnConflict=t.overrideFileForPath=t.move=t.getFullpath=t.hasMetadataAttribute=t.isReferencedByAlbum=t.fetchFilesByQualificationRules=t.saveFileQualification=t.isSharingShorcutNew=t.isSharingShortcutNew=t.isSharingShorcut=t.isSharingShortcut=t.getSharingShortcutTargetDoctype=t.getSharingShortcutTargetMime=t.getSharingShortcutStatus=t.isShortcut=t.shouldBeOpenedByOnlyOffice=t.isOnlyOfficeFile=t.isNote=t.isDirectory=t.isFile=t.splitFilename=t.ALBUMS_DOCTYPE=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(2)),u=r(n(16)),c=r(n(176)),s=r(n(258)),l=r(n(583)),f=n(184),p=n(18),d=(n(19),n(59));r(n(40));function h(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.ALBUMS_DOCTYPE="io.cozy.photos.albums";var m=/(.+)(\..*)$/,b=function(e){if(!(0,c.default)(e.name))throw new Error("file should have a name property");if("file"===e.type){var t=e.name.match(m);if(t)return{filename:t[1],extension:t[2]}}return{filename:e.name,extension:""}};t.splitFilename=b;var w=function(e){return e&&"file"===e.type};t.isFile=w;t.isDirectory=function(e){return e&&"directory"===e.type};var x=function(e){return!!(e&&e.name&&e.name.endsWith(".cozy-note")&&"file"===e.type&&e.metadata&&void 0!==e.metadata.content&&void 0!==e.metadata.schema&&void 0!==e.metadata.title&&void 0!==e.metadata.version)};t.isNote=x;var _=function(e){return w(e)&&!x(e)&&("text"===e.class||"spreadsheet"===e.class||"slide"===e.class)};t.isOnlyOfficeFile=_;t.shouldBeOpenedByOnlyOffice=function(e){return _(e)&&!e.name.endsWith(".txt")&&!e.name.endsWith(".md")};t.isShortcut=function(e){return e&&"shortcut"===e.class};var k=function(e){return(0,u.default)(e,"metadata.sharing.status")};t.getSharingShortcutStatus=k;t.getSharingShortcutTargetMime=function(e){return(0,u.default)(e,"metadata.target.mime")};t.getSharingShortcutTargetDoctype=function(e){return(0,u.default)(e,"metadata.target._type")};var O=function(e){return Boolean(k(e))};t.isSharingShortcut=O;t.isSharingShorcut=function(e){return console.warn("Deprecation: `isSharingShorcut` is deprecated, please use `isSharingShortcut` instead"),O(e)};var S=function(e){return"new"===k(e)};t.isSharingShortcutNew=S;t.isSharingShorcutNew=function(e){return console.warn("Deprecation: `isSharingShorcutNew` is deprecated, please use `isSharingShortcutNew` instead"),S(e)};var E=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(0,f.setQualification)(n,r),e.abrupt("return",t.collection(d.DOCTYPE_FILES).updateMetadataAttribute(n._id,i.metadata));case 2:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.saveFileQualification=E;var j=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.rules,i=n.count,a=(0,p.Q)(d.DOCTYPE_FILES).where(g({},r)).partialIndex({trashed:!1}).indexFields(["cozyMetadata.updatedAt","metadata.qualification"]).sortBy([{"cozyMetadata.updatedAt":"desc"}]).limitBy(i||1),e.next=4,t.query(a);case 4:return u=e.sent,e.abrupt("return",u);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchFilesByQualificationRules=j;t.isReferencedByAlbum=function(e){if(e.relationships&&e.relationships.referenced_by&&e.relationships.referenced_by.data&&e.relationships.referenced_by.data.length>0){var t,n=h(e.relationships.referenced_by.data);try{for(n.s();!(t=n.n()).done;){if("io.cozy.photos.albums"===t.value.type)return!0}}catch(e){n.e(e)}finally{n.f()}}return!1};t.hasMetadataAttribute=function(e){var t=e.file,n=e.attribute;return(0,s.default)(t,"metadata.".concat(n))};var P=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("You must provide a dirId");case 2:return e.next=4,t.query((0,p.Q)(d.DOCTYPE_FILES).getById(n));case 4:return i=e.sent,a=i.data,u=(0,l.default)(a.path,"/"),e.abrupt("return","".concat(u,"/").concat(r));case 8:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.getFullpath=P;var C=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u,c,s,l,f,h,y,v,g=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=g.length>3&&void 0!==g[3]&&g[3],a=r.folderId,u=r.path,e.prev=2,e.next=5,t.collection(d.DOCTYPE_FILES).updateFileMetadata(n,{dir_id:a});case 5:return c=e.sent,e.abrupt("return",{moved:c.data,deleted:null});case 9:if(e.prev=9,e.t0=e.catch(2),409!==e.t0.status||!i){e.next=35;break}if(!u){e.next=16;break}s=u,e.next=24;break;case 16:return e.next=18,t.query((0,p.Q)(d.DOCTYPE_FILES).getById(n));case 18:return l=e.sent,f=l.data,h=f.name,e.next=23,P(t,a,h);case 23:s=e.sent;case 24:return e.next=26,t.collection(d.DOCTYPE_FILES).statByPath(s);case 26:return y=e.sent,e.next=29,t.collection(d.DOCTYPE_FILES).destroy(y.data);case 29:return e.next=31,t.collection(d.DOCTYPE_FILES).updateFileMetadata(n,{dir_id:a});case 31:return v=e.sent,e.abrupt("return",{moved:v.data,deleted:y.data.id});case 35:throw e.t0;case 36:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n,r){return e.apply(this,arguments)}}();t.move=C;var T=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r,i){var a,u,c,s,l,f,p,h,y;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a=n).endsWith("/")||(a+="/"),u=t.collection(d.DOCTYPE_FILES),e.prev=3,e.next=6,u.statByPath(a+r.name);case 6:return c=e.sent,s=c.data,l=s.id,f=s.dir_id,e.next=10,u.updateFile(r,{dirId:f,fileId:l,metadata:i});case 10:return p=e.sent,e.abrupt("return",p);case 14:if(e.prev=14,e.t0=e.catch(3),!/Not Found/.test(e.t0)){e.next=24;break}return e.next=19,u.ensureDirectoryExists(a);case 19:return h=e.sent,e.next=22,u.createFile(r,{dirId:h,metadata:i});case 22:return y=e.sent,e.abrupt("return",y);case 24:throw e.t0;case 25:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(t,n,r,o){return e.apply(this,arguments)}}();t.overrideFileForPath=T;var A=function(e){var t=new RegExp("(_)([0-9]+)$"),n=e.match(t);if(n){var r=parseInt(n[2]);return r++,e.replace(new RegExp("(_)([0-9]+)$"),"_".concat(r))}return"".concat(e,"_1")};t.generateNewFileNameOnConflict=A;t.generateFileNameForRevision=function(e,t,n){var r=b(e),o=r.filename,i=r.extension;return"".concat(o,"_").concat(n(t.updated_at,"DD MMMM - HH[h]mm")).concat(i)};var D=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u,c,s,l,f,p,h,y,v;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.name,a=r.dirId,u=r.conflictStrategy,e.prev=1,e.next=4,P(t,a,i);case 4:return c=e.sent,e.next=7,t.collection(d.DOCTYPE_FILES).statByPath(c);case 7:if(s=e.sent,l=s.data.id,"erase"!==u){e.next=16;break}return e.next=12,t.collection(d.DOCTYPE_FILES).updateFile(n,g(g({},r),{},{fileId:l}));case 12:return f=e.sent,e.abrupt("return",f);case 16:return p=b({name:i,type:"file"}),h=p.filename,y=p.extension,v=A(h)+y,e.abrupt("return",D(t,n,g(g({},r),{},{name:v})));case 19:e.next=26;break;case 21:if(e.prev=21,e.t0=e.catch(1),!/Not Found/.test(e.t0.message)){e.next=25;break}return e.abrupt("return",t.collection(d.DOCTYPE_FILES).createFile(n,r));case 25:throw e.t0;case 26:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t,n,r){return e.apply(this,arguments)}}();t.uploadFileWithConflictStrategy=D;var R=function(){var e=(0,i.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Promise((function(e,n){var r=function(){var t=(0,i.default)(o.default.mark((function t(r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.file(function(){var t=(0,i.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(r=new FileReader).onloadend=(0,i.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e(r.result);case 1:case"end":return t.stop()}}),t)}))),r.readAsArrayBuffer(n);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),(function(e){console.error("error getting fileentry file!"+e),n(e)}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();window.resolveLocalFileSystemURL(t,r,(function(e){n(e)}))})),e.abrupt("return",n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.readMobileFile=R;var I=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R(n);case 2:return i=e.sent,e.abrupt("return",D(t,i,r));case 4:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.doMobileUpload=I;t.isPlainText=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?/^text\//.test(e):/\.(txt|md)$/.test(t)};t.hasQualifications=function(e){return(0,s.default)(e,"metadata.qualification")};t.hasCertifications=function(e){return(0,u.default)(e,"metadata.carbonCopy",!1)||(0,u.default)(e,"metadata.electronicSafe",!1)};t.isFromKonnector=function(e){return(0,s.default)(e,"cozyMetadata.sourceAccount")};var N=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.collection(d.DOCTYPE_FILES),e.next=3,r.fetchFileContentById(n);case 3:return i=e.sent,e.next=6,i.blob();case 6:return a=e.sent,e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchBlobFileById=N},function(e,t,n){"use strict";e.exports=n(598)},function(e,t,n){"use strict";var r=n(27),o=n(62),i=r("%TypeError%"),a=n(599),u=n(295),c=n(604),s=n(605),l=n(607),f=n(627),p=n(628),d=n(629),h=o("String.prototype.split"),y=Object("a"),v="a"!==y[0]||!(0 in y);e.exports=function(e){var t,n=f(this),r=v&&d(this)?h(this,""):n,o=l(r);if(!s(e))throw new i("Array.prototype.forEach callback must be a function");arguments.length>1&&(t=arguments[1]);for(var y=0;y<o;){var g=p(y),m=c(r,g);if(m){var b=u(r,g);a(e,t,[b,y,r])}y+=1}}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(601),i=n(296),a=n(185);e.exports=function(e,t){if("Object"!==a(e))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+o(t));return e[t]}},function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e||"symbol"==typeof e}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=n(632),o=n(294);e.exports=function(){var e=Array.prototype.forEach;return r(e)?e:o}},function(e,t,n){"use strict";var r=n(300),o=n(62),i=o("Object.prototype.propertyIsEnumerable"),a=o("Array.prototype.push");e.exports=function(e){var t=r(e),n=[];for(var o in t)i(t,o)&&a(n,[o,t[o]]);return n}},function(e,t,n){"use strict";e.exports=n(635)},function(e,t,n){"use strict";var r=n(299);e.exports=function(){return"function"==typeof Object.entries?Object.entries:r}},function(e,t,n){"use strict";var r=n(300),o=n(638),i=n(62)("String.prototype.replace"),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var e=o(r(this));return i(i(e,a,""),u,"")}},function(e,t,n){"use strict";var r=n(302);e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themesList=void 0;var r=n(184),o=(n(19),function(e){return e.map((function(e){try{return r.Qualification.getByLabel(e)}catch(e){return console.log("error",e),null}})).filter((function(e){return e}))}),i=[{id:"theme1",label:"identity",icon:"people",items:o(["identity_photo","national_id_card","passport","residence_permit","family_record_book","birth_certificate","driver_license","citizen_registration_certificate","other_identity_document"]),defaultItems:["birth_certificate"]},{id:"theme2",label:"family",icon:"team",items:o(["family_record_book","birth_certificate","wedding","pacs","divorce","large_family_card","caf","payment_proof_family_allowance","other_family_document"]),defaultItems:["family_record_book"]},{id:"theme3",label:"work_study",icon:"company",items:o(["diploma","work_contract","pay_sheet","unemployment_benefit","pension","work_disability_recognition","gradebook","student_card","school_attendance_certificate","resume","motivation_letter","other_work_document"])},{id:"theme4",label:"health",icon:"heart",items:o(["health_certificate","health_book","national_health_insurance_card","national_health_insurance_right_certificate","health_insurance_card","prescription","health_invoice","work_disability_recognition","pregnancy_medical_certificate","other_health_document"])},{id:"theme5",label:"home",icon:"home",items:o(["phone_invoice","isp_invoice","telecom_invoice","energy_invoice","water_invoice","house_sale_agreeement","building_permit","technical_diagnostic_record","unfit_for_habitation_declaration","lease","rent_receipt","accommodation_proof","house_insurance","work_quote","work_invoice","other_house_document"])},{id:"theme6",label:"transport",icon:"car",items:o(["driver_license","vehicle_registration","car_insurance","mechanic_invoice","transport_invoice","other_transport_document"]),defaultItems:["driver_license"]},{id:"theme7",label:"activity",icon:"compass",items:o(["personal_sporting_licence","other_activity_document"])},{id:"theme8",label:"finance",icon:"bank",items:o(["tax_return","tax_notice","tax_timetable","receipt","other_tax_document","bank_details","bank_statement","loan_agreement","payment_proof_family_allowance","other_bank_document","other_revenue"])},{id:"theme9",label:"invoice",icon:"bill",items:o(["phone_invoice","isp_invoice","telecom_invoice","energy_invoice","water_invoice","appliance_invoice","web_service_invoice","restaurant_invoice","work_invoice","transport_invoice","health_invoice","other_invoice"])}];t.themesList=i},function(e){e.exports=JSON.parse('{"drawer":"Menü anzeigen","profile":"Profile","connectedDevices":"Verbundene Geräte","storage":"Speicher","storage_phrase":"%{diskUsage} GB von %{diskQuota} GB benutzt","view_offers":"View offers","view_my_offer":"My offer","help":"Hilfe","logout":"Ausloggen","soon":"Später","error_UnavailableStack":"Der Stapel ist nicht erreichbar (Verbindung Zeitüberschreitung).","error_UnauthorizedStack":"Einige Berechtigungen fehlen, die Anwendung kann nicht auf die angeforderte Ressource auf dem Stapel zugreifen.","no_apps":"Keine Anwendungen für Cozy gefunden.","menu":{"apps":"Anwendungen","settings":"Einstellungen","home_mobile":"Back to home...","home":"Back to home","home_title":"Home"},"Categories":{"cozy":"Cozy Anwendungen","partners":"Partner Anwendungen","ptnb":"expPTNB","others":"Andere Anwendungen"},"claudy":{"title":"Wie willst du dein Cozy steuern?"},"searchbar":{"placeholder":"Alle Dateien durchsuchen","empty":"Es wurde kein Ergebnis für die Suche \\"%{query}\\" gefunden"},"permsModal":{"title":"Greife von deiner Anwendung aus auf dein komplettes Cozy zu","description":"Erlaube %{app} den Zugriff auf deine Cozy Anwendungen auf diesem Gerät","button":"Erlaube Zugriff"},"comingSoon":{"store":{"title":"Die Store Anwendung wird in deinem Cozy bald verfügbar sein.","description":"Dank Cozy Store wird es bald möglich sein gewünschte Anwendungen in dein Cozy zu installieren."}},"banner":{"tos-updated":{"description":"To comply with the GDPR, Cozy Cloud has updated its Terms of Services that have taken effect on May 25, 2018","CTA":"Jetzt lesen"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Show menu drawer","profile":"Profile","connectedDevices":"Connected devices","storage":"Storage","storage_phrase":"%{diskUsage} GB of %{diskQuota} GB used","view_offers":"View offers","view_my_offer":"My offer","help":"Help","logout":"Sign out","soon":"soon","error_UnavailableStack":"The stack is unreachable (connection timed-out).","error_UnauthorizedStack":"Some permissions are missing, the application can\'t access the requested resource on the stack.","no_apps":"No applications found on the Cozy.","menu":{"apps":"Apps","settings":"Settings","home_mobile":"Back to home...","home":"Back to home","home_title":"Home"},"Categories":{"cozy":"Cozy apps","partners":"Partners apps","ptnb":"expPTNB","others":"Other apps"},"claudy":{"title":"How to drive your Cozy?"},"searchbar":{"placeholder":"Search anything","empty":"No result has been found for the query “%{query}”"},"permsModal":{"title":"Access your whole Cozy from your application","description":"Authorize %{app} to display your Cozy applications on this device","button":"Authorize access"},"comingSoon":{"store":{"title":"The Store application will be available soon in your Cozy.","description":"Thanks to Cozy Store you will be able to install the applications that you want in your Cozy."}},"banner":{"tos-updated":{"description":"To comply with the GDPR, Cozy Cloud has updated its Terms of Services that have taken effect on May 25, 2018","CTA":"Read now"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Mostrar el menu lateral","profile":"Perfil","connectedDevices":"Aparatos conectados","storage":"Espacio en el disco","storage_phrase":"%{diskUsage} Go de %{diskQuota} Go","view_offers":"Ver ofertas","view_my_offer":"Mi oferta","help":"Ayuda","logout":"Desconectar","soon":"pronto","error_UnavailableStack":"Conexión a la stack imposible ( se agotó el tiempo para la conexión ).","error_UnauthorizedStack":"Faltan algunos permisos, la aplicación no puede acceder a los recursos solicitados.","no_apps":"No se han encontrado aplicaciones en su Cozy.","menu":{"apps":"Aplicaciones","settings":"Parámetros","home_mobile":"Regresar a Inicio...","home":"Regresar a Inicio","home_title":"Inicio"},"Categories":{"cozy":"Aplicaciones Cozy","partners":"Aplicaciones de asociados","ptnb":"expPTNB","others":"Otras aplicaciones"},"claudy":{"title":"¿Cómo utilizar su Cozy?"},"searchbar":{"placeholder":"Buscar","empty":"No se ha encontrado ningún resultado para su consulta “%{query}”"},"permsModal":{"title":"Acceder a su Cozy desde su aplicación","description":"Autorizar a %{app} para mostrar sus aplicaciones Cozy en este aparato","button":"Autorizar el acceso"},"comingSoon":{"store":{"title":"En breve, la aplicación Store estará disponible en su Cozy","description":"Gracias a Cozy Store usted podrá instalar en su Cozy las aplicaciones que desee."}},"banner":{"tos-updated":{"description":"Para cumplir con el RGPD, Cozy Cloud ha actualizado sus Condiciones de utilización que entraron en vigor desde el 25 de mayo de 2018.","CTA":"Leerlo ahora"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Afficher le menu latéral","profile":"Profil","connectedDevices":"Appareils connectés","storage":"Espace disque","storage_phrase":"%{diskUsage} Go sur %{diskQuota} Go","view_offers":"Voir les offres","view_my_offer":"Mon offre","help":"Aide","logout":"Déconnexion","soon":"à venir","error_UnavailableStack":"Connexion à la stack impossible (connection timed-out)","error_UnauthorizedStack":"Des permissions sont manquante, l\'application ne peut accéder aux ressources demandées.","no_apps":"Pas d\'applications Cozy trouvées.","menu":{"apps":"Applications","settings":"Paramètres","home_mobile":"Retour à l\'accueil...","home":"Retour à l\'accueil","home_title":"Accueil "},"Categories":{"cozy":"Apps Cozy","partners":"Expérimentation MesInfos","ptnb":"Expérimentation Carnet du logement","others":"Autres apps"},"claudy":{"title":"Comment utiliser votre Cozy ?"},"searchbar":{"placeholder":"Rechercher","empty":"Aucun résultat trouvé pour la requête \\"%{query}\\""},"permsModal":{"title":"Accéder à ton Cozy à partir de ton application","description":"Autoriser %{app} à afficher les applications de ton Cozy sur cet appareil","button":"Autoriser l\'accès"},"comingSoon":{"store":{"title":"L\'application Store sera bientôt disponible dans votre Cozy","description":"Grâce à cozy Store vous pourrez installer les applications que vous souhaitez sur votre Cozy."}},"banner":{"tos-updated":{"description":"Dans le cadre du RGPD, Cozy Cloud met à jour ses Conditions Générales d\'Utilisation qui ont pris effet le 25 Mai 2018","CTA":"Lire maintenant"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Mostra menu laterale","profile":"Profilo","connectedDevices":"Dispositivi connessi","storage":"Archiviazione","storage_phrase":"%{diskUsage} GB di %{diskQuota} GB usati","view_offers":"Vedi offerte","view_my_offer":"La mia offerta","help":"Aiuto","logout":"Esci","soon":"a breve","error_UnavailableStack":"La stack è irraggiungibile (connessione scaduta)","error_UnauthorizedStack":"Alcune autorizzazioni mancano, l\'applicazione non può accedere alle risorse richieste.","no_apps":"Nessuna applicazione trovata nel Cozy","menu":{"apps":"App","settings":"Impostazioni","home_mobile":"Torna alla home...","home":"Torna alla home","home_title":"Home"},"Categories":{"cozy":"App Cozy","partners":"App partner","ptnb":"expPTNB","others":"Altre app"},"claudy":{"title":"Come usare il tuo Cozy?"},"searchbar":{"placeholder":"Cerca","empty":"Nessun risultato trovato per la richiesta “%{query}”"},"permsModal":{"title":"Accedi al tuo Cozy dalla tua applicazione","description":"Autorizza %{app} a mostrare le applicazioni del tuo Cozy su questo dispositivo","button":"Autorizza l\'accesso"},"comingSoon":{"store":{"title":"Lo store di applicazioni sarà disponibile a breve nel tuo Cozy.","description":"Grazie al Cozy Store potrai installare le applicazioni che vuoi nel tuo Cozy."}},"banner":{"tos-updated":{"description":"Al fine di rispettare il GDPR, Cozy Cloud ha aggiornato le sue Condizioni generali d\'utilizzo che hanno preso effetto il 25 Maggio 2018","CTA":"Leggi adesso"}}}')},function(e){e.exports=JSON.parse('{"drawer":"メニュードロワーを表示","profile":"プロフィール","connectedDevices":"接続されたデバイス","storage":"ストレージ","storage_phrase":"%{diskUsage} GB / %{diskQuota} GB 使用","view_offers":"オファーを表示","view_my_offer":"マイオファー","help":"ヘルプ","logout":"サインアウト","soon":"間もなく","error_UnavailableStack":"スタックに到達できません (接続タイムアウト)。","error_UnauthorizedStack":"一部のアクセス許可が不足しているため、アプリケーションはスタック上の要求されたリソースにアクセスできません。","no_apps":"Cozy にアプリケーションはありません。","menu":{"apps":"アプリ","settings":"設定","home_mobile":"ホームに戻る...","home":"ホームに戻る","home_title":"ホーム"},"Categories":{"cozy":"Cozy アプリ","partners":"パートナーアプリ","ptnb":"expPTNB","others":"他のアプリ"},"claudy":{"title":"Cozy をドライブする方法は?"},"searchbar":{"placeholder":"検索します","empty":"問い合わせ “%{query}” の結果が見つかりません"},"permsModal":{"title":"お使いのアプリケーションから Cozy 全体にアクセス","description":"%{app} を承認して、このデバイスにお使いの Cozy アプリケーションを表示します","button":"アクセスを承認"},"comingSoon":{"store":{"title":"ストアアプリケーションはお使いの Cozy でまもなくご利用いただけます。","description":"Cozy ストアのおかげで Cozy で欲しいアプリケーションをインストールすることができます。"}},"banner":{"tos-updated":{"description":"GDPRを遵守するため、Cozyクラウドは利用規約を更新して2018年5月25日に施行されました","CTA":"今すぐお読みください"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Navigatiemenu tonen","profile":"Profiel","connectedDevices":"Verbonden apparaten","storage":"Opslag","storage_phrase":"%{diskUsage} GB van %{diskQuota} GB gebruikt","view_offers":"Aanbiedingen bekijken","view_my_offer":"Mijn aanbieding","help":"Hulp","logout":"Uitloggen","soon":"binnenkort","error_UnavailableStack":"De stack is onbereikbaar (verbindingstime-out).","error_UnauthorizedStack":"Sommige machtigingen ontbreken. De app kan hierdoor de opgevraagde bron niet benaderen.","no_apps":"Geen apps aangetroffen op de Cozy.","menu":{"apps":"Apps","settings":"Instellingen","home_mobile":"Terug naar startpagina...","home":"Terug naar startpagina","home_title":"Startpagina"},"Categories":{"cozy":"Cozy-apps","partners":"Partner-apps","ptnb":"expPTNB","others":"Overige apps"},"claudy":{"title":"How beheers je je Cozy?"},"searchbar":{"placeholder":"Zoeken naar iets","empty":"Geen resultaten gevonden voor de zoekopdracht \\"%{query}\\""},"permsModal":{"title":"Toegang tot je gehele Cozy vanuit je app","description":"%{app} machtigen om je Cozy-apps te tonen op dit apparaat","button":"Machtigen"},"comingSoon":{"store":{"title":"De Winkel-app is binnenkort beschikbaar op je Cozy.","description":"Dankzij de Cozy Winkel kun je je favoriete apps installeren op je Cozy."}},"banner":{"tos-updated":{"description":"In overeenstemming met de GPDR heeft Cozy Cloud de Algemene voorwaarden bijgewerkt. Deze zijn ingegaan op 25 mei 2018.","CTA":"Nu lezen"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Wysuń menu","profile":"Profil","connectedDevices":"Połączone urządzenia","storage":"Magazyn","storage_phrase":"%{diskUsage} GB z %{diskQuota} GB użyte","view_offers":"View offers","view_my_offer":"My offer","help":"Pomoc","logout":"Wyloguj","soon":"niebawem","error_UnavailableStack":"Stos jest niedostępny (przekroczono limit czasu połączenia).","error_UnauthorizedStack":"Brakuje uprawnień, aplikacja nie może korzystać z wymaganych zasobów stosu.","no_apps":"Nie znaleziono żadnych aplikacji na Cozy.","menu":{"apps":"Aplikacje","settings":"Ustawienia","home_mobile":"Back to home...","home":"Back to home","home_title":"Home"},"Categories":{"cozy":"Aplikacje Cozy","partners":"Aplikacje Partnerskie","ptnb":"expPTNB","others":"Aplikacje inne"},"claudy":{"title":"Jak korzystać z Twojego Cozy?"},"searchbar":{"placeholder":"Szukaj czegokolwiek","empty":"Brak wyników dla wyszukania \\"%{query}\\""},"permsModal":{"title":"Uzyskaj dostęp do swojego Cozy z dowolnej aplikacji.","description":"Autoryzuj %{app} aby korzystać z aplikacji Cozy na tym urządzeniu","button":"Autoryzuj dostęp"},"comingSoon":{"store":{"title":"Market Aplikacji będzie wkrótce dostępny w Twoim Cozy.","description":"Dzięki Marketowi Cozy będziesz mógł instalować aplikacje, które będą Ci potrzebne."}},"banner":{"tos-updated":{"description":"To comply with the GDPR, Cozy Cloud has updated its Terms of Services that have taken effect on May 25, 2018","CTA":"Read now"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Показать панель меню","profile":"Профиль","connectedDevices":"Присоединённые устройства","storage":"Хранилище","storage_phrase":"%{diskUsage} ГБ из %{diskQuota} ГБ использовано","view_offers":"View offers","view_my_offer":"My offer","help":"Помощь","logout":"Выход","soon":"скоро","error_UnavailableStack":"Это стек не доступен (превышено время ожидания)","error_UnauthorizedStack":"Некоторые разрешения отсутствуют, получить доступ к запрашиваемому ресурсу в стеке не возможно.","no_apps":"В Cozy приложение не найдены.","menu":{"apps":"Приложения","settings":"Настройки","home_mobile":"Back to home...","home":"Back to home","home_title":"Home"},"Categories":{"cozy":"Cozy приложения","partners":"Приложения партнеров","ptnb":"expPTNB","others":"Другие приложения"},"claudy":{"title":"Как найти ваш Cozy?"},"searchbar":{"placeholder":"Найти что-нибудь","empty":"По запросу “%{query}” ничего не найдено."},"permsModal":{"title":"Получите доступ ко всем функциям Cozy из приложения","description":"Авторизация %{app} для отображения приложений Cozy на этом устройстве","button":"Разрешенный доступ"},"comingSoon":{"store":{"title":"Магазин Приложений скоро будет доступен в вашем Cozy.","description":"Благодаря Магазину Cozy вы можете установить те приложения, которые вам нужны в вашем Cozy."}},"banner":{"tos-updated":{"description":"To comply with the GDPR, Cozy Cloud has updated its Terms of Services that have taken effect on May 25, 2018","CTA":"Прочитать"}}}')},function(e){e.exports=JSON.parse('{"drawer":"Show menu drawer","profile":"Profil","connectedDevices":"Pajisje të lidhura","storage":"Depozitim","storage_phrase":"%{diskUsage} GB të përdorur nga %{diskQuota} GB gjithsej","view_offers":"View offers","view_my_offer":"My offer","help":"Ndihmë","logout":"Dilni","soon":"së shpejti","error_UnavailableStack":"The stack is unreachable (connection timed-out).","error_UnauthorizedStack":"Some permissions are missing, the application can\'t access the requested resource on the stack.","no_apps":"S’u gjetën aplikacione te Cozy","menu":{"apps":"Aplikacione","settings":"Rregullime","home_mobile":"Back to home...","home":"Back to home","home_title":"Home"},"Categories":{"cozy":"Aplikacione Cozy","partners":"Aplikacione partnerësh","ptnb":"expPTNB","others":"Aplikacione të tjerë"},"claudy":{"title":"How to drive your Cozy?"},"searchbar":{"placeholder":"Search anything","empty":"No result has been found for the query “%{query}”"},"permsModal":{"title":"Hyni në krejt Cozy-n nga aplikacioni juaj","description":"Autorizojeni %{app} të shfaqë në këtë pajisje aplikacionet tuaja Cozy","button":"Autorizo hyrjen"},"comingSoon":{"store":{"title":"Aplikacioni Store do të jetë gati së shpejti në Cozy.","description":"Falë Cozy Store-it do të jeni në gjendje të instaloni aplikacionet që doni në Cozy-n tuaj."}},"banner":{"tos-updated":{"description":"To comply with the GDPR, Cozy Cloud has updated its Terms of Services that have taken effect on May 25, 2018","CTA":"Read now"}}}')},function(e){e.exports=JSON.parse('{"drawer":"显示菜单抽屉","profile":"资料","connectedDevices":"已连接的设备","storage":"储存","storage_phrase":"%{diskQuota} GB 中的 %{diskUsage} GB已被使用","view_offers":"View offers","view_my_offer":"My offer","help":"帮助","logout":"登出","soon":"很快","error_UnavailableStack":"此堆栈无法连接 (连接超时)","error_UnauthorizedStack":"缺少某些权限,应用程序无法访问堆栈上请求的资源。","no_apps":"在Cozy中没有找到任何应用程序。","menu":{"apps":"应用程序","settings":"设置","home_mobile":"回到首页...","home":"回到首页","home_title":"Home"},"Categories":{"cozy":"Cozy应用程序","partners":"合作伙伴应用程序","ptnb":"expPTNB","others":"其他应用"},"claudy":{"title":"如何驱动您的Cozy?"},"searchbar":{"placeholder":"搜索任何内容","empty":"没有任何关于“%{query}”的内容"},"permsModal":{"title":"从您的应用程序访问整个Cozy","description":"授权%{app}在此设备上显示您的Cozy应用程序","button":"授权访问"},"comingSoon":{"store":{"title":"商店应用程序将很快在您的Cozy中可用。","description":"感谢Cozy商店,您将能够在您的Cozy中安装您想要的应用程序。"}},"banner":{"tos-updated":{"description":"为了遵守GDPR,Cozy Cloud更新了其于2018年5月25日生效的服务条款","CTA":"立即阅读"}}}')},function(e,t){e.exports=function(e,t){for(var n=e.split("."),r=t.split("."),o=0;o<3;o++){var i=Number(n[o]),a=Number(r[o]);if(i>a)return 1;if(a>i)return-1;if(!isNaN(i)&&isNaN(a))return 1;if(isNaN(i)&&!isNaN(a))return-1}return 0}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Intents",{enumerable:!0,get:function(){return o.default}});var o=r(n(346))},function(e,t,n){"use strict";(function(e){var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.getWebSocketToken=t.getWebSocketUrl=t.generateKey=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(24)),u=r(n(3)),c=r(n(7)),s=r(n(2)),l=r(n(52)),f=r(n(353)),p=r(n(124)),d=void 0!==typeof window&&window.minilog||p.default,h=d("cozy-realtime");d.suggest.deny("cozy-realtime","info");var y=function(e,t,n){return"".concat(e).concat("//").concat(t).concat("//").concat(n)};t.generateKey=y;var v=function(e,t){if("function"!=typeof e&&"function"!=typeof t)throw new Error("You should call this function with an handler");var n,r;return t?(n=e,r=t):(n=void 0,r=e),{id:n,handler:r}},g=function(e,t,n,r){var o;if(["created","updated","deleted"].includes(e)||(o="'".concat(e,"' is not a valid event, valid events are 'created', 'updated' or 'deleted'.")),"string"!=typeof t&&(o="'".concat(t,"' is not a valide type, it should be a string.")),n&&"created"===e&&(o="The 'id' should not be specified for 'created' event."),"function"!=typeof r&&(o="The handler '".concat(r,"' should be a function.")),o)throw h.error(o),new Error(o)},m=function(e){var t=e.stackClient.uri,n=function(e){return!!e.match("^(https:/{2})")}(t)?"wss:":"ws:",r=new URL(t).host;return"".concat(n,"//").concat(r,"/realtime/")};t.getWebSocketUrl=m;var b=function(e){return e.stackClient.token.accessToken||e.stackClient.token.token};t.getWebSocketToken=b;var w=function(){function t(n){var r=n.cozyClient,o=n.client;if((0,u.default)(this,t),(0,s.default)(this,"_cozyClient",null),(0,s.default)(this,"_socket",null),(0,s.default)(this,"_retryDelay",1e3),(0,s.default)(this,"_retryLimit",60),r&&console.warn("Realtime: options.cozyClient is deprecated, please use options.client"),this._cozyClient=o||r,!this._cozyClient)throw new Error("Realtime must be initialized with a client. Ex: new Realtime({ client })");this._updateAuthentication=this._updateAuthentication.bind(this),this.unsubscribeAll=this.unsubscribeAll.bind(this),this._receiveMessage=this._receiveMessage.bind(this),this._receiveError=this._receiveError.bind(this),this._resubscribe=this._resubscribe.bind(this),this._beforeUnload=this._beforeUnload.bind(this),this._resetSocket=this._resetSocket.bind(this),this._createSocket(),this._cozyClient.on("login",this._updateAuthentication),this._cozyClient.on("tokenRefreshed",this._updateAuthentication),this._cozyClient.on("logout",this.unsubscribeAll),e&&(e.addEventListener("beforeunload",this._beforeUnload),e.addEventListener("online",this._resubscribe),e.removeEventListener("offline",this._resetSocket))}return(0,c.default)(t,[{key:"_beforeUnload",value:function(){e.removeEventListener("beforeunload",this._windowUnload),this.unsubscribeAll()}},{key:"_createSocket",value:function(){var e=this;if(!this._socket){this._socket=new f.default((function(){return m(e._cozyClient)}),(function(){return b(e._cozyClient)})),this._socket.on("message",this._receiveMessage),this._socket.on("error",this._receiveError)}}},{key:"_receiveError",value:function(t){h.info("Receive error: ".concat(t)),this._resetSocket(),0===this._retryLimit?this.emit("error",t):(this.retry&&clearTimeout(this.retry),e.navigator.onLine&&(this.retry=setTimeout(this._resubscribe,this._retryDelay)))}},{key:"_resubscribe",value:function(){var e=this;this._retryLimit--;var t=Object.keys(this._events).map((function(t){if(t.includes("//")&&0!==e._events[t].length){var n=t.split("//"),r=(0,a.default)(n,3),o=r[1],i=r[2];return"undefined"===i&&(i=void 0),{type:o,id:i}}})).filter(Boolean),n=!0,r=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var c=i.value,s=c.type,l=c.id;this._socket.subscribe(s,l)}}catch(e){r=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw o}}}},{key:"_receiveMessage",value:function(e,t){var n=e.type,r=e.id,o=e.eventName,i=[y(o,n)];r&&i.push(y(o,n,r));for(var a=0;a<i.length;a++){var u=i[a];h.debug("Emitting",u,t),this.emit(u,t)}}},{key:"_updateAuthentication",value:function(){h.info("Update token on socket"),this._socket.authenticate()}},{key:"_resetSocket",value:function(){this._socket&&(this._socket.close(),this._socket=null),this._createSocket()}},{key:"subscribe",value:function(e,t,n,r){var a=this,u=v(n,r),c=u.handler,s=u.id;return g(e,t,s,c),this._socket.isConnecting()?new Promise((function(u){a._socket.once("open",(0,i.default)(o.default.mark((function i(){return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,a.subscribe(e,t,n,r);case 2:u();case 3:case"end":return o.stop()}}),i)}))))})):new Promise((function(n){var r=y(e,t,s);a.on(r,c),a._socket.once("subscribe_".concat(t,"_").concat(s),n),a._socket.subscribe(t,s)}))}},{key:"unsubscribe",value:function(e,t,n,r){var o=v(n,r),i=o.handler,a=o.id;g(e,t,a,i);var u=y(e,t,a);this.removeListener(u,i),this._haveEventHandler()||this._resetSocket()}},{key:"unsubscribeAll",value:function(){var e=this;this._getEventKeys().map((function(t){return e._events[t].length>0&&t})).filter(Boolean).forEach((function(t){return e._events[t]=[]})),this._resetSocket()}},{key:"_getEventKeys",value:function(){return this._events?Object.keys(this._events).map((function(e){return e.includes("//")&&e})).filter(Boolean):[]}},{key:"_haveEventHandler",value:function(){var e=this;return this._getEventKeys().map((function(t){return e._events[t].length})).filter(Boolean).length>0}}]),t}();l.default.mixin(w);var x=w;t.default=x}).call(this,n(33))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(33))},function(e,t,n){(function(t){var n=/^\[object .+?Constructor\]$/,r="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();function a(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function u(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var o=e.length,i=n+(r?1:-1);for(;r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,l,n);var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function c(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)if(n(t,e[r]))return!0;return!1}function s(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function l(e){return e!=e}function f(e,t){return e.has(t)}function p(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var d,h=Array.prototype,y=Function.prototype,v=Object.prototype,g=i["__core-js_shared__"],m=(d=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",b=y.toString,w=v.hasOwnProperty,x=v.toString,_=RegExp("^"+b.call(w).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=i.Symbol,O=v.propertyIsEnumerable,S=h.splice,E=k?k.isConcatSpreadable:void 0,j=Math.max,P=L(i,"Map"),C=L(i,"Set"),T=L(Object,"create");function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function I(e){var t=-1,n=e?e.length:0;for(this.__data__=new R;++t<n;)this.add(e[t])}function N(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function z(e){return!(!V(e)||(t=e,m&&m in t))&&(G(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?_:n).test(function(e){if(null!=e){try{return b.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}A.prototype.clear=function(){this.__data__=T?T(null):{}},A.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},A.prototype.get=function(e){var t=this.__data__;if(T){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return w.call(t,e)?t[e]:void 0},A.prototype.has=function(e){var t=this.__data__;return T?void 0!==t[e]:w.call(t,e)},A.prototype.set=function(e,t){return this.__data__[e]=T&&void 0===t?"__lodash_hash_undefined__":t,this},D.prototype.clear=function(){this.__data__=[]},D.prototype.delete=function(e){var t=this.__data__,n=N(t,e);return!(n<0)&&(n==t.length-1?t.pop():S.call(t,n,1),!0)},D.prototype.get=function(e){var t=this.__data__,n=N(t,e);return n<0?void 0:t[n][1]},D.prototype.has=function(e){return N(this.__data__,e)>-1},D.prototype.set=function(e,t){var n=this.__data__,r=N(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new A,map:new(P||D),string:new A}},R.prototype.delete=function(e){return F(this,e).delete(e)},R.prototype.get=function(e){return F(this,e).get(e)},R.prototype.has=function(e){return F(this,e).has(e)},R.prototype.set=function(e,t){return F(this,e).set(e,t),this},I.prototype.add=I.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},I.prototype.has=function(e){return this.__data__.has(e)};var M=C&&1/p(new C([,-0]))[1]==1/0?function(e){return new C(e)}:function(){};function F(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function L(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return z(n)?n:void 0}function U(e){return W(e)||function(e){return $(e)&&w.call(e,"callee")&&(!O.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)||!!(E&&e&&e[E])}var B,q,H=(B=function(e){var t,n,r=(n=(t=e)?t.length:0)?t[n-1]:void 0;return $(r)&&(r=void 0),function(e,t,n){var r=-1,o=u,i=e.length,a=!0,s=[],l=s;if(n)a=!1,o=c;else if(i>=200){var d=t?null:M(e);if(d)return p(d);a=!1,o=f,l=new I}else l=t?[]:s;e:for(;++r<i;){var h=e[r],y=t?t(h):h;if(h=n||0!==h?h:0,a&&y==y){for(var v=l.length;v--;)if(l[v]===y)continue e;t&&l.push(y),s.push(h)}else o(l,y,n)||(l!==s&&l.push(y),s.push(h))}return s}(function e(t,n,r,o,i){var a=-1,u=t.length;for(r||(r=U),i||(i=[]);++a<u;){var c=t[a];n>0&&r(c)?n>1?e(c,n-1,r,o,i):s(i,c):o||(i[i.length]=c)}return i}(e,1,$,!0),void 0,r)},q=j(void 0===q?B.length-1:q,0),function(){for(var e=arguments,t=-1,n=j(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var o=Array(q+1);++t<q;)o[t]=e[t];return o[q]=r,a(B,this,o)});var W=Array.isArray;function Q(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!G(e)}function $(e){return function(e){return!!e&&"object"==typeof e}(e)&&Q(e)}function G(e){var t=V(e)?x.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function V(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=H}).call(this,n(33))},function(e,t,n){"use strict";var r=n(430),o=n(222),i=n(154),a=n(432),u=function(e){o(!1,e)},c=String.prototype.replace,s=String.prototype.split,l=function(e){var t=e%100,n=t%10;return 11!==t&&1===n?0:2<=n&&n<=4&&!(t>=12&&t<=14)?1:2},f={pluralTypes:{arabic:function(e){if(e<3)return e;var t=e%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:l,chinese:function(){return 0},croatian:l,french:function(e){return e>1?1:0},german:function(e){return 1!==e?1:0},russian:l,lithuanian:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?1:2},czech:function(e){return 1===e?0:e>=2&&e<=4?1:2},polish:function(e){if(1===e)return 0;var t=e%10;return 2<=t&&t<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!=1||e%100==11?1:0},slovenian:function(e){var t=e%100;return 1===t?0:2===t?1:3===t||4===t?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}};function p(e,t){var n,o,i=(n=e.pluralTypeToLanguages,o={},r(n,(function(e,t){r(e,(function(e){o[e]=t}))})),o);return i[t]||i[s.call(t,/-/,1)[0]]||i.en}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var h=/%\{(.*?)\}/g;function y(e,t,n,r,o){if("string"!=typeof e)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==t)return e;var u=e,l=r||h,d=o||f,y="number"==typeof t?{smart_count:t}:t;if(null!=y.smart_count&&u){var v=s.call(u,"||||");u=a(v[function(e,t,n){return e.pluralTypes[p(e,t)](n)}(d,n||"en",y.smart_count)]||v[0])}return u=c.call(u,l,(function(e,t){return i(y,t)&&null!=y[t]?y[t]:e}))}function v(e){var t=e||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var n=t.allowMissing?y:null;this.onMissingKey="function"==typeof t.onMissingKey?t.onMissingKey:n,this.warn=t.warn||u,this.tokenRegex=function(e){var t=e&&e.prefix||"%{",n=e&&e.suffix||"}";if("||||"===t||"||||"===n)throw new RangeError('"||||" token is reserved for pluralization');return new RegExp(d(t)+"(.*?)"+d(n),"g")}(t.interpolation),this.pluralRules=t.pluralRules||f}v.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},v.prototype.extend=function(e,t){r(e,(function(e,n){var r=t?t+"."+n:n;"object"==typeof e?this.extend(e,r):this.phrases[r]=e}),this)},v.prototype.unset=function(e,t){"string"==typeof e?delete this.phrases[e]:r(e,(function(e,n){var r=t?t+"."+n:n;"object"==typeof e?this.unset(e,r):delete this.phrases[r]}),this)},v.prototype.clear=function(){this.phrases={}},v.prototype.replace=function(e){this.clear(),this.extend(e)},v.prototype.t=function(e,t){var n,r,o=null==t?{}:t;if("string"==typeof this.phrases[e])n=this.phrases[e];else if("string"==typeof o._)n=o._;else if(this.onMissingKey){r=(0,this.onMissingKey)(e,o,this.currentLocale,this.tokenRegex,this.pluralRules)}else this.warn('Missing translation for key: "'+e+'"'),r=e;return"string"==typeof n&&(r=y(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},v.prototype.has=function(e){return i(this.phrases,e)},v.transformPhrase=function(e,t,n){return y(e,t,n)},e.exports=v},function(e,t,n){var r=n(440),o=n(445),i=n(228),a=n(55),u=n(448),c=n(84);var s={M:function(e){return e.getMonth()+1},MM:function(e){return p(e.getMonth()+1,2)},Q:function(e){return Math.ceil((e.getMonth()+1)/3)},D:function(e){return e.getDate()},DD:function(e){return p(e.getDate(),2)},DDD:function(e){return r(e)},DDDD:function(e){return p(r(e),3)},d:function(e){return e.getDay()},E:function(e){return e.getDay()||7},W:function(e){return o(e)},WW:function(e){return p(o(e),2)},YY:function(e){return p(e.getFullYear(),4).substr(2)},YYYY:function(e){return p(e.getFullYear(),4)},GG:function(e){return String(i(e)).substr(2)},GGGG:function(e){return i(e)},H:function(e){return e.getHours()},HH:function(e){return p(e.getHours(),2)},h:function(e){var t=e.getHours();return 0===t?12:t>12?t%12:t},hh:function(e){return p(s.h(e),2)},m:function(e){return e.getMinutes()},mm:function(e){return p(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return p(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return p(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return p(e.getMilliseconds(),3)},Z:function(e){return f(e.getTimezoneOffset(),":")},ZZ:function(e){return f(e.getTimezoneOffset())},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()}};function l(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|]$/g,""):e.replace(/\\/g,"")}function f(e,t){t=t||"";var n=e>0?"-":"+",r=Math.abs(e),o=r%60;return n+p(Math.floor(r/60),2)+t+p(o,2)}function p(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return n}e.exports=function(e,t,n){var r=t?String(t):"YYYY-MM-DDTHH:mm:ss.SSSZ",o=(n||{}).locale,i=c.format.formatters,f=c.format.formattingTokensRegExp;o&&o.format&&o.format.formatters&&(i=o.format.formatters,o.format.formattingTokensRegExp&&(f=o.format.formattingTokensRegExp));var p=a(e);return u(p)?function(e,t,n){var r,o,i=e.match(n),a=i.length;for(r=0;r<a;r++)o=t[i[r]]||s[i[r]],i[r]=o||l(i[r]);return function(e){for(var t="",n=0;n<a;n++)i[n]instanceof Function?t+=i[n](e,s):t+=i[n];return t}}(r,i,f)(p):"Invalid Date"}},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGZpbGw9IiM1RDYxNjUiIGQ9Ik0xNjQgMjYxYTQgNCAwIDEgMSA4IDAgNCA0IDAgMSAxIDAgOGgtOGE0IDQgMCAxIDEgMC04em0xLjE0NiAzLjg1NGMuMTU1LjE1NC40MjMuMzY4Ljc5My41OC42MTguMzUzIDEuMzEuNTY2IDIuMDYxLjU2Ni43NSAwIDEuNDQzLS4yMTMgMi4wNi0uNTY2LjM3MS0uMjEyLjY0LS40MjYuNzk0LS41OGEuNS41IDAgMSAwLS43MDgtLjcwOCAyLjkzNCAyLjkzNCAwIDAgMS0uNTgyLjQyQTMuMTM2IDMuMTM2IDAgMCAxIDE2OCAyNjVhMy4xMzYgMy4xMzYgMCAwIDEtMS41NjQtLjQzNCAyLjkzNCAyLjkzNCAwIDAgMS0uNTgyLS40Mi41LjUgMCAxIDAtLjcwOC43MDh6IiBpZD0iYSIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNjAgLTI1NSkiPjx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2EiLz48L2c+PC9zdmc+Cg=="},function(e,t,n){var r=n(651),o=n(34);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},function(e,t,n){"use strict";e.exports=n(653).default},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,u="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,s=u||c||Function("return this")(),l=Object.prototype.toString,f=Math.max,p=Math.min,d=function(){return s.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var u=o.test(e);return u||i.test(e)?a(e.slice(2),u?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,u,c,s=0,l=!1,v=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,i=o;return r=o=void 0,s=t,a=e.apply(i,n)}function b(e){return s=e,u=setTimeout(x,t),l?m(e):a}function w(e){var n=e-c;return void 0===c||n>=t||n<0||v&&e-s>=i}function x(){var e=d();if(w(e))return _(e);u=setTimeout(x,function(e){var n=t-(e-c);return v?p(n,i-(e-s)):n}(e))}function _(e){return u=void 0,g&&r?m(e):(r=o=void 0,a)}function k(){var e=d(),n=w(e);if(r=arguments,o=this,c=e,n){if(void 0===u)return b(c);if(v)return u=setTimeout(x,t),m(c)}return void 0===u&&(u=setTimeout(x,t)),a}return t=y(t)||0,h(n)&&(l=!!n.leading,i=(v="maxWait"in n)?f(y(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},k.flush=function(){return void 0===u?a:_(d())},k}}).call(this,n(33))},function(e,t,n){var r=n(63),o=0;e.exports=function(e){var t=++o;return r(e)+t}},function(e,t,n){e.exports={"c-overlay":"cozy-ui-bar-c-overlay--3097A"}},function(e,t,n){(function(e){!function(t){"use strict";function n(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function r(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function o(e,t,n){o.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function i(e,t){i.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function a(e,t){a.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function u(e,t,n){u.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:n,enumerable:!0})}function c(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r),e}function s(e){var t=void 0===e?"undefined":k(e);return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function l(e,t,n,r,f,p,d){d=d||[];var h=(f=f||[]).slice(0);if(void 0!==p){if(r){if("function"==typeof r&&r(h,p))return;if("object"===(void 0===r?"undefined":k(r))){if(r.prefilter&&r.prefilter(h,p))return;if(r.normalize){var y=r.normalize(h,p,e,t);y&&(e=y[0],t=y[1])}}}h.push(p)}"regexp"===s(e)&&"regexp"===s(t)&&(e=e.toString(),t=t.toString());var v=void 0===e?"undefined":k(e),g=void 0===t?"undefined":k(t),m="undefined"!==v||d&&d[d.length-1].lhs&&d[d.length-1].lhs.hasOwnProperty(p),b="undefined"!==g||d&&d[d.length-1].rhs&&d[d.length-1].rhs.hasOwnProperty(p);if(!m&&b)n(new i(h,t));else if(!b&&m)n(new a(h,e));else if(s(e)!==s(t))n(new o(h,e,t));else if("date"===s(e)&&e-t!=0)n(new o(h,e,t));else if("object"===v&&null!==e&&null!==t)if(d.filter((function(t){return t.lhs===e})).length)e!==t&&n(new o(h,e,t));else{if(d.push({lhs:e,rhs:t}),Array.isArray(e)){var w;for(e.length,w=0;w<e.length;w++)w>=t.length?n(new u(h,w,new a(void 0,e[w]))):l(e[w],t[w],n,r,h,w,d);for(;w<t.length;)n(new u(h,w,new i(void 0,t[w++])))}else{var x=Object.keys(e),_=Object.keys(t);x.forEach((function(o,i){var a=_.indexOf(o);a>=0?(l(e[o],t[o],n,r,h,o,d),_=c(_,a)):l(e[o],void 0,n,r,h,o,d)})),_.forEach((function(e){l(void 0,t[e],n,r,h,e,d)}))}d.length=d.length-1}else e!==t&&("number"===v&&isNaN(e)&&isNaN(t)||n(new o(h,e,t)))}function f(e,t,n,r){return r=r||[],l(e,t,(function(e){e&&r.push(e)}),n),r.length?r:void 0}function p(e,t,n){if(e&&t&&n&&n.kind){for(var r=e,o=-1,i=n.path?n.path.length-1:0;++o<i;)void 0===r[n.path[o]]&&(r[n.path[o]]="number"==typeof n.path[o]?[]:{}),r=r[n.path[o]];switch(n.kind){case"A":!function e(t,n,r){if(r.path&&r.path.length){var o,i=t[n],a=r.path.length-1;for(o=0;o<a;o++)i=i[r.path[o]];switch(r.kind){case"A":e(i[r.path[o]],r.index,r.item);break;case"D":delete i[r.path[o]];break;case"E":case"N":i[r.path[o]]=r.rhs}}else switch(r.kind){case"A":e(t[n],r.index,r.item);break;case"D":t=c(t,n);break;case"E":case"N":t[n]=r.rhs}return t}(n.path?r[n.path[o]]:r,n.index,n.item);break;case"D":delete r[n.path[o]];break;case"E":case"N":r[n.path[o]]=n.rhs}}}function d(e){return"color: "+E[e].color+"; font-weight: bold"}function h(e,t,n,r){var o=f(e,t);try{r?n.groupCollapsed("diff"):n.group("diff")}catch(e){n.log("diff")}o?o.forEach((function(e){var t=e.kind,r=function(e){var t=e.kind,n=e.path,r=e.lhs,o=e.rhs,i=e.index,a=e.item;switch(t){case"E":return[n.join("."),r,"→",o];case"N":return[n.join("."),o];case"D":return[n.join(".")];case"A":return[n.join(".")+"["+i+"]",a];default:return[]}}(e);n.log.apply(n,["%c "+E[t].text,d(t)].concat(O(r)))})):n.log("—— no diff ——");try{n.groupEnd()}catch(e){n.log("—— diff end —— ")}}function y(e,t,n,r){switch(void 0===e?"undefined":k(e)){case"object":return"function"==typeof e[r]?e[r].apply(e,O(n)):e[r];case"function":return e(t);default:return e}}function v(e,t){var n=t.logger,r=t.actionTransformer,o=t.titleFormatter,i=void 0===o?function(e){var t=e.timestamp,n=e.duration;return function(e,r,o){var i=["action"];return i.push("%c"+String(e.type)),t&&i.push("%c@ "+r),n&&i.push("%c(in "+o.toFixed(2)+" ms)"),i.join(" ")}}(t):o,a=t.collapsed,u=t.colors,c=t.level,s=t.diff,l=void 0===t.titleFormatter;e.forEach((function(o,f){var p=o.started,d=o.startedTime,v=o.action,g=o.prevState,m=o.error,b=o.took,w=o.nextState,_=e[f+1];_&&(w=_.prevState,b=_.started-p);var k=r(v),O="function"==typeof a?a((function(){return w}),v,o):a,S=x(d),E=u.title?"color: "+u.title(k)+";":"",j=["color: gray; font-weight: lighter;"];j.push(E),t.timestamp&&j.push("color: gray; font-weight: lighter;"),t.duration&&j.push("color: gray; font-weight: lighter;");var P=i(k,S,b);try{O?u.title&&l?n.groupCollapsed.apply(n,["%c "+P].concat(j)):n.groupCollapsed(P):u.title&&l?n.group.apply(n,["%c "+P].concat(j)):n.group(P)}catch(e){n.log(P)}var C=y(c,k,[g],"prevState"),T=y(c,k,[k],"action"),A=y(c,k,[m,g],"error"),D=y(c,k,[w],"nextState");if(C)if(u.prevState){var R="color: "+u.prevState(g)+"; font-weight: bold";n[C]("%c prev state",R,g)}else n[C]("prev state",g);if(T)if(u.action){var I="color: "+u.action(k)+"; font-weight: bold";n[T]("%c action ",I,k)}else n[T]("action ",k);if(m&&A)if(u.error){var N="color: "+u.error(m,g)+"; font-weight: bold;";n[A]("%c error ",N,m)}else n[A]("error ",m);if(D)if(u.nextState){var z="color: "+u.nextState(w)+"; font-weight: bold";n[D]("%c next state",z,w)}else n[D]("next state",w);s&&h(g,w,n,O);try{n.groupEnd()}catch(e){n.log("—— log end ——")}}))}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},j,e),n=t.logger,r=t.stateTransformer,o=t.errorTransformer,i=t.predicate,a=t.logErrors,u=t.diffPredicate;if(void 0===n)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(e){return function(t){return e(t)}}};var c=[];return function(e){var n=e.getState;return function(e){return function(s){if("function"==typeof i&&!i(n,s))return e(s);var l={};c.push(l),l.started=_.now(),l.startedTime=new Date,l.prevState=r(n()),l.action=s;var f=void 0;if(a)try{f=e(s)}catch(e){l.error=o(e)}else f=e(s);l.took=_.now()-l.started,l.nextState=r(n());var p=t.diff&&"function"==typeof u?u(n,s):t.diff;if(v(c,Object.assign({},t,{diff:p})),c.length=0,l.error)throw l.error;return f}}}}var m,b,w=function(e,t){return function(e,t){return new Array(t+1).join(e)}("0",t-e.toString().length)+e},x=function(e){return w(e.getHours(),2)+":"+w(e.getMinutes(),2)+":"+w(e.getSeconds(),2)+"."+w(e.getMilliseconds(),3)},_="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},S=[];m="object"===(void 0===e?"undefined":k(e))&&e?e:"undefined"!=typeof window?window:{},(b=m.DeepDiff)&&S.push((function(){void 0!==b&&m.DeepDiff===f&&(m.DeepDiff=b,b=void 0)})),n(o,r),n(i,r),n(a,r),n(u,r),Object.defineProperties(f,{diff:{value:f,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:function(e,t,n){e&&t&&l(e,t,(function(r){n&&!n(e,t,r)||p(e,t,r)}))},enumerable:!0},applyChange:{value:p,enumerable:!0},revertChange:{value:function(e,t,n){if(e&&t&&n&&n.kind){var r,o,i=e;for(o=n.path.length-1,r=0;r<o;r++)void 0===i[n.path[r]]&&(i[n.path[r]]={}),i=i[n.path[r]];switch(n.kind){case"A":!function e(t,n,r){if(r.path&&r.path.length){var o,i=t[n],a=r.path.length-1;for(o=0;o<a;o++)i=i[r.path[o]];switch(r.kind){case"A":e(i[r.path[o]],r.index,r.item);break;case"D":case"E":i[r.path[o]]=r.lhs;break;case"N":delete i[r.path[o]]}}else switch(r.kind){case"A":e(t[n],r.index,r.item);break;case"D":case"E":t[n]=r.lhs;break;case"N":t=c(t,n)}return t}(i[n.path[r]],n.index,n.item);break;case"D":case"E":i[n.path[r]]=n.lhs;break;case"N":delete i[n.path[r]]}}},enumerable:!0},isConflict:{value:function(){return void 0!==b},enumerable:!0},noConflict:{value:function(){return S&&(S.forEach((function(e){e()})),S=null),f},enumerable:!0}});var E={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},j={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,n=e.getState;return"function"==typeof t||"function"==typeof n?g()({dispatch:t,getState:n}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};t.defaults=j,t.createLogger=g,t.logger=P,t.default=P,Object.defineProperty(t,"__esModule",{value:!0})}(t)}).call(this,n(33))},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(668),i=(r=o)&&r.__esModule?r:{default:r};t.default=(0,i.default)("local")},function(e,t){e.exports=["apps","context"]},,function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new k(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return S()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===l)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function f(){}function p(){}function d(){}var h={};h[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(O([])));v&&v!==t&&n.call(v,o)&&(h=v);var g=d.prototype=f.prototype=Object.create(h);function m(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,u){var c=s(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=g.constructor=d,d.constructor=p,p.displayName=u(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},m(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(g),u(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getDeviceName=void 0;var o=r(n(336)),i=n(97),a=n(134),u=n(131);t.getDeviceName=function(){if(!(0,a.hasDevicePlugin)())return(0,i.isCordova)()&&console.warn("You should install `cordova-plugin-device`."),"Device";var e=window.device,t=e.manufacturer,n=e.model,r=(0,u.isIOSApp)()?function(e){for(var t=0,n=["iPhone","iPad","Watch","AppleTV"];t<n.length;t++){var r=n[t];if(e.match(new RegExp(r)))return r}return"Device"}(n):n;return"".concat((0,o.default)(t)," ").concat(r)}},function(e,t,n){var r=n(63),o=n(339);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(64),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(340)("toUpperCase");e.exports=r},function(e,t,n){var r=n(193),o=n(133),i=n(195),a=n(63);e.exports=function(e){return function(t){t=a(t);var n=o(t)?i(t):void 0,u=n?n[0]:t.charAt(0),c=n?r(n,1).join(""):t.slice(1);return u[e]()+c}}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+r+"|"+o+")"+"?",s="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[i,a,u].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),l="(?:"+[i+r+"?",r,a,u,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+l+s,"g");e.exports=function(e){return e.match(f)||[]}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.startApp=t.default=t.checkApp=void 0;var o=r(n(5)),i=r(n(9)),a=n(131),u=function(){return window.startApp},c=function(e){var t=e.appId,n=e.uri;return(0,a.isAndroidApp)()?{package:t}:n},s={},l=s.startApp=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=window.startApp,e.next=3,s.checkApp(t);case 3:if(!e.sent){e.next=9;break}return r=c(t),e.abrupt("return",new Promise((function(e,t){u()?n.set(r).start(e,t):t(new Error("Cordova plugin 'com.lampa.startapp' is not installed. This plugin is needed to start a native app. Required by cozy-bar"))})));case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.startApp=l;var f=s.checkApp=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=window.startApp,r=c(t),e.abrupt("return",new Promise((function(e,t){u()?n.set(r).check((function(t){e("OK"===t||t)}),(function(n){!1===n||0===n.indexOf("NameNotFoundException")?e(!1):t(n)})):t(new Error("Cordova plugin 'com.lampa.startapp' is not installed."))})));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.checkApp=f;var p=s;t.default=p},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.nativeLinkOpen=void 0;var o=r(n(5)),i=r(n(9)),a=n(134),u=function(){var e=(0,i.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url,e.next=3,(0,a.hasSafariPlugin)();case 3:if(e.t0=e.sent,!e.t0){e.next=6;break}e.t0=window.SafariViewController;case 6:if(!e.t0){e.next=10;break}window.SafariViewController.show({url:n,transition:"curl"},(function(e){"closed"===e.event&&window.SafariViewController.hide()}),(function(){window.SafariViewController.hide()})),e.next=11;break;case 10:(0,a.hasInAppBrowserPlugin)()?("_blank","clearcache=yes,zoom=no",window.cordova.InAppBrowser.open(n,"_blank","clearcache=yes,zoom=no")):window.location=n;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.nativeLinkOpen=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openDeeplinkOrRedirect=void 0;var r=function(e,t){var n=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5);window.addEventListener("blur",i);var r=function(e,t,n){var r=document.createElement("iframe");return r.src=t,r.id="hiddenIframe_".concat(n),r.style.display="none",e.appendChild(r),r}(document.body,"about:blank",n),o=setTimeout((function(){t(),window.removeEventListener("blur",i),r.parentElement.removeChild(r)}),500);function i(){clearTimeout(o),window.removeEventListener("blur",i),r.parentElement.removeChild(r)}r.contentWindow.location.href=e};t.openDeeplinkOrRedirect=function(e,t){if(navigator.msLaunchUri)!function(e,t){navigator.msLaunchUri(e,void 0,t)}(e,t);else{var n=(o=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,i=navigator.userAgent.toLowerCase(),a=i.includes("safari")&&!i.includes("chrome")||Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,u=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,c=u&&(i.includes("os 12_2")||i.includes("os 12_3")),{isOpera:o,isFirefox:"undefined"!=typeof InstallTrigger,isSafari:a,isChrome:!!window.chrome&&!o,isIOS122:c,isIOS:u});n.isChrome||n.isIOS&&!n.isIOS122?function(e,t){for(var n=setTimeout((function(){t(),r.removeEventListener("blur",o)}),500),r=window;r!=r.parent;)r=r.parent;function o(){clearTimeout(n),r.removeEventListener("blur",o)}r.addEventListener("blur",o),window.location=e}(e,t):n.isSafari&&!n.isIOS122||n.isFirefox?r(e,t):t()}var o,i,a,u,c}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(5)),a=o(n(9)),u=o(n(3)),c=o(n(7)),s=r(n(347)),l=r(n(350)),f=o(n(351)),p=n(135),d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.client;(0,u.default)(this,e),this.request=new f.default(n),this.create=this.create.bind(this)}var t,n;return(0,c.default)(e,[{key:"create",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)throw new Error('Misformed intent, "action" property must be provided');if(!t)throw new Error('Misformed intent, "type" property must be provided');var i=this.request.post(e,t,r,o);return i.start=function(e,t){var o,a={filteredServices:r.filteredServices,onReadyCallback:t};delete r.filteredServices;var u=i.then((function(t){return o=s.start(n.create,t,e,r,a)}));return u.stop=function(){o&&o.destroy()},u},i}},{key:"createService",value:function(e,t){return l.start(this.request)(e,t)}},{key:"getRedirectionURL",value:(n=(0,a.default)(i.default.mark((function e(t,n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||n){e.next=2;break}throw new Error("Cannot retrieve redirection, at least type or doc must be provided");case 2:return e.next=4,this.create("REDIRECT",t,n);case 4:return r=e.sent,o=(0,p.pickService)(r),a=(0,p.removeQueryString)(o.href),e.abrupt("return",n?(0,p.buildRedirectionURL)(a,n):a);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"redirect",value:(t=(0,a.default)(i.default.mark((function e(t,n,r){var o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window){e.next=2;break}throw new Error("redirect() method can only be called in a browser");case 2:return e.next=4,this.getRedirectionURL(t,n);case 4:if(o=e.sent,!r||"function"!=typeof r){e.next=7;break}return e.abrupt("return",r(o));case 7:window.location.href=o;case 8:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=d},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.start=function e(t,n,r,o){var p,d,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},y=function(){d&&s.remove(d),p&&p.stopListening()},v=function(){y()},g=new Promise((function(y,g){var m=(0,c.pickService)(n,h.filterServices);d=s.insertIntentIframe(n,r,m.href,h.onReadyCallback);var b=f(m.href);(p=new l.default({intentId:n.id,origin:b,onReady:function(e){e.source.postMessage(o,e.origin)},onDone:function(e){y(e.data.document),v()},onCancel:function(){y(null),v()},onError:function(e){g(e instanceof Event?c.errorSerializer.deserialize(e.data.error):e),v()},onResize:function(e){var t=e.data,n=t.transition,o=t.dimensions;s.applyStyle(r,(0,u.default)({transition:n},o))},onExposeFrameRemoval:function(e){y({document:e.document,removeIntentIframe:function(){return s.remove(d)}})},onCompose:function(){var n=(0,a.default)(i.default.mark((function n(o){var a,c,l,f,p,h,y,v;return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.data,c=a.action,l=a.doctype,f=a.data,p=o.source,h=o.origin,n.next=4,t(c,l,f);case 4:return y=n.sent,s.hide(d),n.prev=6,n.next=9,e(t,y,r,(0,u.default)({},f,{exposeIntentFrameRemoval:!1}));case 9:v=n.sent,p.postMessage(v,h);case 11:return n.prev=11,s.show(d),n.finish(11);case 14:case"end":return n.stop()}}),n,null,[[6,,11,14]])})));return function(e){return n.apply(this,arguments)}}()})).listen()}));return g.destroy=y,g};var i=o(n(5)),a=o(n(9)),u=o(n(13)),c=n(135),s=r(n(348)),l=o(n(349)),f=function(e){return e.split("/",3).join("/")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hide=function(e){e.style.display="none"},t.show=function(e){e.style.display="block"},t.remove=function(e){if(!e.parentNode)return;e.parentNode.removeChild(e)},t.iframeFromIntent=a,t.insertIntentIframe=function(e,t,n,r){i(t);var o=a(e,t,n);"function"==typeof r&&(o.onload=r);return t.appendChild(o),o.focus(),o},t.assertOKForIntentIframe=t.applyStyle=void 0;var r=function(e){return e+"px"},o={width:r,height:r,maxWidth:r,maxHeight:r};t.applyStyle=function(e,t){Object.keys(t).forEach((function(n){var r=t[n];e.style[n]="".concat(o[n]?o[n](r):r)}))};var i=function(e){var t=e.ownerDocument;if(!t)throw console.warn("assertProperForIframe: bad node",e),new Error("Cannot retrieve document object from given node");if(!t.defaultView)throw console.warn("assertProperForIframe: bad document",t),new Error("Cannot retrieve window object from document")};function a(e,t,n){var r=t.ownerDocument;if(!r)throw new Error("Cannot retrieve document object from given node");var o=r.createElement("iframe");return o.setAttribute("id","intent-".concat(e.id)),o.setAttribute("src",n),o.classList.add("coz-intent"),o}t.assertOKForIntentIframe=i},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=/intent-(.*):(.*)/,u=function(){function e(t){(0,o.default)(this,e),this.state={handshaken:!1},this.options=t,this.handleMessageWrapper=this.handleMessageWrapper.bind(this)}return(0,i.default)(e,[{key:"handleMessage",value:function(e){if(e.origin===this.options.origin){var t=e.data.type;if("load"!==t){var n=a.exec(t);if(n){var r=n[1];c(r==this.options.intentId,"Invalid event id","eventId: ".concat(r," != listener eventId ").concat(this.options.intentId));var o=n[2];"ready"!==o?c(this.state.handshaken,"Unexpected handshake message from intent service"):this.state.handshaken=!0;var i=this.options["on"+s(o)];if(i)return i(e);console.warn("intents: Unhandled event ".concat(o))}else console.warn("intents: Message type ".concat(t," not matching intent format"))}else console.warn&&console.warn("Cozy Client ignored MessageEvent having data.type `load`.")}}},{key:"handleMessageWrapper",value:function(e){try{this.handleMessage(e)}catch(e){this.options.onError(e)}}},{key:"listen",value:function(){window.addEventListener("message",this.handleMessageWrapper)}},{key:"stopListening",value:function(){window.removeEventListener("message",this.handleMessageWrapper)}}]),e}();t.default=u;var c=function(e,t,n){if(!e)throw n&&console.warn(n),new Error(t)},s=function(e){return e[0].toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.start=void 0;var r=n(135);function o(e){e&&e.style&&(e.style.height="100%")}t.start=function(e){return function(t,n){return(n=n||"undefined"!=typeof window&&window)&&n.document?(n.addEventListener("load",(function(){var e=n.document;[e.documentElement,e.body].forEach(o)})),(t=t||n.location.search.split("=")[1])?e.get(t).then((function(e){var t=!1,o=function(r){if(t)throw new Error("Intent service has already been terminated");n.parent.postMessage(r,e.attributes.client)},i=function(t,r,i){return new Promise((function(a){n.addEventListener("message",(function t(r){if(r.origin===e.attributes.client)return n.removeEventListener("message",t),a(r.data)})),o({type:"intent-".concat(e._id,":compose"),action:t,doctype:r,data:i})}))},a=function(e){o(e),t=!0},u=function(n,r){if(t)throw new Error("Intent service has been terminated");o({type:"intent-".concat(e._id,":resize"),dimensions:n.element?Object.assign({},n,{maxHeight:n.element.clientHeight,maxWidth:n.element.clientWidth}):n,transition:r})},c=function(){a({type:"intent-".concat(e._id,":cancel")})};return n.addEventListener("unload",(function(){t||c()})),function(e,t){return new Promise((function(n){t.addEventListener("message",(function r(o){o.origin===e.attributes.client&&(t.removeEventListener("message",r),n(o.data))})),t.parent.postMessage({type:"intent-".concat(e._id,":ready")},e.attributes.client)}))}(e,n).then((function(t){return{compose:i,getData:function(){return t},getIntent:function(){return e},terminate:function(n){var r=t&&t.exposeIntentFrameRemoval?"exposeFrameRemoval":"done";return a({type:"intent-".concat(e._id,":").concat(r),document:n})},throw:function(t){return a({type:"intent-".concat(e._id,":error"),error:r.errorSerializer.serialize(t)})},resizeClient:u,cancel:c}}))})):Promise.reject(new Error("Cannot retrieve intent from URL"))):Promise.reject(new Error("Intent service should be used in browser"))}}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=function(){function e(t){(0,o.default)(this,e),this.stackClient=t.stackClient}return(0,i.default)(e,[{key:"get",value:function(e){return this.stackClient.fetchJSON("GET","/intents/".concat(e)).then((function(e){var t=e.data;return t._id||(t._id=t.id),t}))}},{key:"post",value:function(e,t,n,r){return this.stackClient.fetchJSON("POST","/intents",{data:{type:"io.cozy.intents",attributes:{action:e,type:t,data:n,permissions:r}}}).then((function(e){return e.data}))}}]),e}();t.default=a},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(3)),u=r(n(7)),c=r(n(2)),s=r(n(52)),l=r(n(137)),f=function(){function e(t,n){(0,a.default)(this,e),(0,c.default)(this,"_doctype","io.cozy.websocket"),(0,c.default)(this,"_webSocket",null),(0,c.default)(this,"_url",null),(0,c.default)(this,"_token",null),this._getUrl=t,this._getToken=n,this.removeAllListeners=this.removeAllListeners.bind(this),this.on("close",this.removeAllListeners)}var t;return(0,u.default)(e,[{key:"isOpen",value:function(){return!(!this._webSocket||this._webSocket.readyState!==WebSocket.OPEN)}},{key:"isConnecting",value:function(){return!(!this._webSocket||this._webSocket.readyState!==WebSocket.CONNECTING)}},{key:"connect",value:function(){var e=this;return new Promise((function(t,n){e._webSocket=new WebSocket(e._getUrl(),e._doctype),e._webSocket.onmessage=function(t){var n=JSON.parse(t.data),r=n.event.toLowerCase(),o=n.payload,i=o.type,a=o.id,u=o.doc;e.emit("message",{type:i,id:a,eventName:r},u)},e._webSocket.onclose=function(t){return e.emit("close",t)},e._webSocket.onerror=function(t){e._webSocket=null,e.emit("error",t),n(t)},e._webSocket.onopen=function(n){e.authenticate(),e.emit("open",n),t(n)}}))}},{key:"authenticate",value:function(){this.isOpen()&&this._webSocket.send(JSON.stringify({method:"AUTH",payload:this._getToken()}))}},{key:"subscribe",value:(t=(0,i.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isOpen()){e.next=3;break}return e.next=3,this.connect();case 3:r=(0,l.default)({type:t,id:n}),i=JSON.stringify({method:"SUBSCRIBE",payload:r}),this._webSocket.send(i),this.emit("subscribe_".concat(t,"_").concat(n));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"close",value:function(){this.isOpen()?this._webSocket.close():this.removeAllListeners(),this._webSocket=null}}]),e}();s.default.mixin(f);var p=f;t.default=p},function(e,t,n){var r=n(355),o=n(395),i=n(213);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(98),o=n(141);e.exports=function(e,t,n,i){var a=n.length,u=a,c=!i;if(null==e)return!u;for(e=Object(e);a--;){var s=n[a];if(c&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++a<u;){var l=(s=n[a])[0],f=e[l],p=s[1];if(c&&s[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(i)var h=i(f,p,l,e,t,d);if(!(void 0===h?o(p,f,3,i,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(100),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(100);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(100);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(100);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(99);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(99),o=n(138),i=n(140);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(139),o=n(367),i=n(34),a=n(200),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,l=c.toString,f=s.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?p:u).test(a(e))}},function(e,t,n){var r,o=n(368),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(38)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(371),o=n(99),i=n(138);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(372),o=n(373),i=n(374),a=n(375),u=n(376);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,e.exports=c},function(e,t,n){var r=n(101);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(101),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(101),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(101);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(102);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(102);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(102);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(102);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(98),o=n(201),i=n(386),a=n(388),u=n(66),c=n(22),s=n(81),l=n(108),f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,d,h,y){var v=c(e),g=c(t),m=v?"[object Array]":u(e),b=g?"[object Array]":u(t),w=(m="[object Arguments]"==m?f:m)==f,x=(b="[object Arguments]"==b?f:b)==f,_=m==b;if(_&&s(e)){if(!s(t))return!1;v=!0,w=!1}if(_&&!w)return y||(y=new r),v||l(e)?o(e,t,n,d,h,y):i(e,t,m,n,d,h,y);if(!(1&n)){var k=w&&p.call(e,"__wrapped__"),O=x&&p.call(t,"__wrapped__");if(k||O){var S=k?e.value():e,E=O?t.value():t;return y||(y=new r),h(S,E,n,d,y)}}return!!_&&(y||(y=new r),a(e,t,n,d,h,y))}},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(64),o=n(202),i=n(78),a=n(201),u=n(387),c=n(142),s=r?r.prototype:void 0,l=s?s.valueOf:void 0;e.exports=function(e,t,n,r,s,f,p){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var d=u;case"[object Set]":var h=1&r;if(d||(d=c),e.size!=t.size&&!h)return!1;var y=p.get(e);if(y)return y==t;r|=2,p.set(e,t);var v=a(d(e),d(t),r,s,f,p);return p.delete(e),v;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t,n){var r=n(203),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,u){var c=1&n,s=r(e),l=s.length;if(l!=r(t).length&&!c)return!1;for(var f=l;f--;){var p=s[f];if(!(c?p in t:o.call(t,p)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var h=!0;u.set(e,t),u.set(t,e);for(var y=c;++f<l;){var v=e[p=s[f]],g=t[p];if(i)var m=c?i(g,v,p,t,e,u):i(v,g,p,e,t,u);if(!(void 0===m?v===g||a(v,g,n,i,u):m)){h=!1;break}y||(y="constructor"==p)}if(h&&!y){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(h=!1)}return u.delete(e),u.delete(t),h}},function(e,t,n){var r=n(51),o=n(39);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(51),o=n(144),i=n(39),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t,n){var r=n(209)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(54)(n(38),"DataView");e.exports=r},function(e,t,n){var r=n(54)(n(38),"Promise");e.exports=r},function(e,t,n){var r=n(212),o=n(79);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},function(e,t,n){var r=n(141),o=n(16),i=n(214),a=n(147),u=n(212),c=n(213),s=n(68);e.exports=function(e,t){return a(e)&&u(t)?c(s(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,3)}}},function(e,t,n){var r=n(398),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},function(e,t,n){var r=n(123);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(148),o=n(401),i=n(147),a=n(68);e.exports=function(e){return i(e)?r(a(e)):o(e)}},function(e,t,n){var r=n(110);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(34),o=n(109),i=n(403),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var u in e)("constructor"!=u||!t&&a.call(e,u))&&n.push(u);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(47),o=n(405),i=new r,a=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return i.write(e,void 0,a.call(arguments)),n};return n.debug=function(){return i.write(e,"debug",a.call(arguments)),n},n.info=function(){return i.write(e,"info",a.call(arguments)),n},n.warn=function(){return i.write(e,"warn",a.call(arguments)),n},n.error=function(){return i.write(e,"error",a.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=i.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return i.pipe(e)},t.end=t.unpipe=t.disable=function(e){return i.unpipe(e)},t.Transform=r,t.Filter=o,t.suggest=new o,t.enable=function(){return t.defaultFormatter?i.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):i.pipe(t.suggest).pipe(t.defaultBackend)}},function(e,t,n){var r=n(47),o={debug:1,info:2,warn:3,error:4};function i(){this.enabled=!0,this.defaultResult=!0,this.clear()}function a(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(i),i.prototype.allow=function(e,t){return this._white.push({n:e,l:o[t]}),this},i.prototype.deny=function(e,t){return this._black.push({n:e,l:o[t]}),this},i.prototype.clear=function(){return this._white=[],this._black=[],this},i.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n<r;n++){if(this._white[n]&&a(this._white[n],e)&&o[t]>=this._white[n].l)return!0;if(this._black[n]&&a(this._black[n],e)&&o[t]<=this._black[n].l)return!1}return this.defaultResult},i.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=i},function(e,t,n){var r=n(47),o=/\n+$/,i=new r;i.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(o,""));try{for(r=0;r<n.length;r++)n[r]=JSON.stringify(n[r])}catch(e){}console.log(n.join(" "))}}},i.formatters=["color","minilog"],i.color=n(407),i.minilog=n(408),e.exports=i},function(e,t,n){var r=n(47),o=n(220),i={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},a=new r;a.write=function(e,t,n){console.log;console[t]&&console[t].apply&&console[t].apply(console,["%c"+e+" %c"+t,o("gray"),o.apply(o,i[t])].concat(n))},a.pipe=function(){},e.exports=a},function(e,t,n){var r=n(47),o=n(220),i={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},a=new r;a.write=function(e,t,n){var r=console.log;"debug"!=t&&console[t]&&(r=console[t]);var a=0;if("info"!=t){for(;a<n.length&&"string"==typeof n[a];a++);r.apply(console,["%c"+e+" "+n.slice(0,a).join(" "),o.apply(o,i[t])].concat(n.slice(a)))}else r.apply(console,["%c"+e,o.apply(o,i[t])].concat(n))},a.pipe=function(){},e.exports=a},function(e,t,n){var r=n(47),o=[],i=new r;i.write=function(e,t,n){o.push([e,t,n])},i.get=function(){return o},i.empty=function(){o=[]},e.exports=i},function(e,t,n){var r=n(47),o=!1,i=new r;i.write=function(e,t,n){if("undefined"!=typeof window&&"undefined"!=typeof JSON&&JSON.stringify&&JSON.parse)try{o||(o=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),o.push([(new Date).toString(),e,t,n]),window.localStorage.minilog=JSON.stringify(o)}catch(e){}},e.exports=i},function(e,t,n){var r=n(47),o=(new Date).valueOf().toString(36);function i(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}r.mixin(i),i.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},i.prototype.init=function(){if(this.enabled&&this.jQuery){var e=this;this.timer=setTimeout((function(){var t,n,r=[],i=e.url;if(0==e.cache.length)return e.init();for(t=0;t<e.cache.length;t++)try{JSON.stringify(e.cache[t]),r.push(e.cache[t])}catch(e){}e.jQuery.isEmptyObject(e.extras)?(n=JSON.stringify({logs:r}),i=e.url+"?client_id="+o):n=JSON.stringify(e.jQuery.extend({logs:r},e.extras)),e.jQuery.ajax(i,{type:"POST",cache:!1,processData:!1,data:n,contentType:"application/json",timeout:1e4}).success((function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))})).error((function(){e.interval=3e4})).always((function(){e.init()})),e.cache=[]}),this.interval)}},i.prototype.end=function(){},i.jQueryWait=function(e){if("undefined"!=typeof window&&(window.jQuery||window.$))return e(window.jQuery||window.$);"undefined"!=typeof window&&setTimeout((function(){i.jQueryWait(e)}),200)},e.exports=i},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(152),o=n(414);function i(t,n,a){return o()?e.exports=i=Reflect.construct:e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},i.apply(null,arguments)}e.exports=i},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";e.exports=n(417)},function(e,t,n){"use strict";
17
+ /** @license React v16.13.1
18
+ * react.production.min.js
19
+ *
20
+ * Copyright (c) Facebook, Inc. and its affiliates.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ */var r=n(221),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,a=o?Symbol.for("react.portal"):60106,u=o?Symbol.for("react.fragment"):60107,c=o?Symbol.for("react.strict_mode"):60108,s=o?Symbol.for("react.profiler"):60114,l=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.forward_ref"):60112,d=o?Symbol.for("react.suspense"):60113,h=o?Symbol.for("react.memo"):60115,y=o?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function w(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||m}function x(){}function _(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||m}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(g(85));this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=w.prototype;var k=_.prototype=new x;k.constructor=_,r(k,w.prototype),k.isPureReactComponent=!0;var O={current:null},S=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function j(e,t,n){var r,o={},a=null,u=null;if(null!=t)for(r in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,r)&&!E.hasOwnProperty(r)&&(o[r]=t[r]);var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){for(var s=Array(c),l=0;l<c;l++)s[l]=arguments[l+2];o.children=s}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===o[r]&&(o[r]=c[r]);return{$$typeof:i,type:e,key:a,ref:u,props:o,_owner:O.current}}function P(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var C=/\/+/g,T=[];function A(e,t,n,r){if(T.length){var o=T.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function D(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>T.length&&T.push(e)}function R(e,t,n){return null==e?0:function e(t,n,r,o){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var c=!1;if(null===t)c=!0;else switch(u){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case i:case a:c=!0}}if(c)return r(o,t,""===n?"."+I(t,0):n),1;if(c=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s<t.length;s++){var l=n+I(u=t[s],s);c+=e(u,l,r,o)}else if(null===t||"object"!=typeof t?l=null:l="function"==typeof(l=v&&t[v]||t["@@iterator"])?l:null,"function"==typeof l)for(t=l.call(t),s=0;!(u=t.next()).done;)c+=e(u=u.value,l=n+I(u,s++),r,o);else if("object"===u)throw r=""+t,Error(g(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return c}(e,"",t,n)}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function N(e,t){e.func.call(e.context,t,e.count++)}function z(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?M(e,r,n,(function(e){return e})):null!=e&&(P(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(C,"$&/")+"/")+n)),r.push(e))}function M(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(C,"$&/")+"/"),R(e,z,t=A(t,i,r,o)),D(t)}var F={current:null};function L(){var e=F.current;if(null===e)throw Error(g(321));return e}var U={ReactCurrentDispatcher:F,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:O,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return M(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;R(e,N,t=A(null,null,t,n)),D(t)},count:function(e){return R(e,(function(){return null}),null)},toArray:function(e){var t=[];return M(e,t,null,(function(e){return e})),t},only:function(e){if(!P(e))throw Error(g(143));return e}},t.Component=w,t.Fragment=u,t.Profiler=s,t.PureComponent=_,t.StrictMode=c,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,t.cloneElement=function(e,t,n){if(null==e)throw Error(g(267,e));var o=r({},e.props),a=e.key,u=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(u=t.ref,c=O.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)S.call(t,l)&&!E.hasOwnProperty(l)&&(o[l]=void 0===t[l]&&void 0!==s?s[l]:t[l])}var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){s=Array(l);for(var f=0;f<l;f++)s[f]=arguments[f+2];o.children=s}return{$$typeof:i,type:e.type,key:a,ref:u,props:o,_owner:c}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:l,_context:e},e.Consumer=e},t.createElement=j,t.createFactory=function(e){var t=j.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:p,render:e}},t.isValidElement=P,t.lazy=function(e){return{$$typeof:y,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return L().useCallback(e,t)},t.useContext=function(e,t){return L().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return L().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return L().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return L().useLayoutEffect(e,t)},t.useMemo=function(e,t){return L().useMemo(e,t)},t.useReducer=function(e,t,n){return L().useReducer(e,t,n)},t.useRef=function(e){return L().useRef(e)},t.useState=function(e){return L().useState(e)},t.version="16.13.1"},function(e,t,n){},function(e,t,n){n(420),n(421),n(422)},function(e,t,n){"use strict";n.r(t);var r=n(43),o=n.n(r),i=n(44),a=n.n(i),u=new o.a({id:"bottom",use:"bottom-usage",viewBox:"0 0 24 24",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="bottom">\n <g fill-rule="evenodd" transform="translate(12.285714, 12.000000) rotate(90.000000) translate(-12.285714, -12.000000)">\n <path d="M6.46026077,20.3174036 C5.84657974,20.9310847 5.84657974,21.9260582 6.46026077,22.5397392 C7.0739418,23.1534203 8.06891534,23.1534203 8.68259637,22.5397392 L18.1111678,13.1111678 C18.7248488,12.4974868 18.7248488,11.5025132 18.1111678,10.8888322 L8.68259637,1.46026077 C8.06891534,0.846579743 7.0739418,0.846579743 6.46026077,1.46026077 C5.84657974,2.0739418 5.84657974,3.06891534 6.46026077,3.68259637 L14.7776644,12 L6.46026077,20.3174036 Z" />\n </g>\n</symbol>'});a.a.add(u);t.default=u},function(e,t,n){"use strict";n.r(t);var r=n(43),o=n.n(r),i=n(44),a=n.n(i),u=new o.a({id:"cross",use:"cross-usage",viewBox:"0 0 24 24",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="cross">\n <path fill-rule="evenodd" d="M106.585786,44 L96.2928932,33.7071068 C95.9023689,33.3165825 95.9023689,32.6834175 96.2928932,32.2928932 C96.6834175,31.9023689 97.3165825,31.9023689 97.7071068,32.2928932 L108,42.5857864 L118.292893,32.2928932 C118.683418,31.9023689 119.316582,31.9023689 119.707107,32.2928932 C120.097631,32.6834175 120.097631,33.3165825 119.707107,33.7071068 L109.414214,44 L119.707107,54.2928932 C120.097631,54.6834175 120.097631,55.3165825 119.707107,55.7071068 C119.316582,56.0976311 118.683418,56.0976311 118.292893,55.7071068 L108,45.4142136 L97.7071068,55.7071068 C97.3165825,56.0976311 96.6834175,56.0976311 96.2928932,55.7071068 C95.9023689,55.3165825 95.9023689,54.6834175 96.2928932,54.2928932 L106.585786,44 Z" transform="translate(-96 -32)" />\n</symbol>'});a.a.add(u);t.default=u},function(e,t,n){"use strict";n.r(t);var r=n(43),o=n.n(r),i=n(44),a=n.n(i),u=new o.a({id:"top",use:"top-usage",viewBox:"0 0 24 24",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="top">\n <g fill-rule="evenodd" transform="translate(12.285714, 12.000000) rotate(270.000000) translate(-12.285714, -12.000000)">\n <path d="M6.46026077,20.3174036 C5.84657974,20.9310847 5.84657974,21.9260582 6.46026077,22.5397392 C7.0739418,23.1534203 8.06891534,23.1534203 8.68259637,22.5397392 L18.1111678,13.1111678 C18.7248488,12.4974868 18.7248488,11.5025132 18.1111678,10.8888322 L8.68259637,1.46026077 C8.06891534,0.846579743 7.0739418,0.846579743 6.46026077,1.46026077 C5.84657974,2.0739418 5.84657974,3.06891534 6.46026077,3.68259637 L14.7776644,12 L6.46026077,20.3174036 Z" />\n </g>\n</symbol>'});a.a.add(u);t.default=u},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(424)},function(e,t,n){"use strict";
25
+ /** @license React v16.13.1
26
+ * react-dom.production.min.js
27
+ *
28
+ * Copyright (c) Facebook, Inc. and its affiliates.
29
+ *
30
+ * This source code is licensed under the MIT license found in the
31
+ * LICENSE file in the root directory of this source tree.
32
+ */var r=n(0),o=n(221),i=n(425);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));function u(e,t,n,r,o,i,a,u,c){var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){this.onError(e)}}var c=!1,s=null,l=!1,f=null,p={onError:function(e){c=!0,s=e}};function d(e,t,n,r,o,i,a,l,f){c=!1,s=null,u.apply(p,arguments)}var h=null,y=null,v=null;function g(e,t,n){var r=e.type||"unknown-event";e.currentTarget=v(n),function(e,t,n,r,o,i,u,p,h){if(d.apply(this,arguments),c){if(!c)throw Error(a(198));var y=s;c=!1,s=null,l||(l=!0,f=y)}}(r,t,void 0,e),e.currentTarget=null}var m=null,b={};function w(){if(m)for(var e in b){var t=b[e],n=m.indexOf(e);if(!(-1<n))throw Error(a(96,e));if(!_[n]){if(!t.extractEvents)throw Error(a(97,e));for(var r in _[n]=t,n=t.eventTypes){var o=void 0,i=n[r],u=t,c=r;if(k.hasOwnProperty(c))throw Error(a(99,c));k[c]=i;var s=i.phasedRegistrationNames;if(s){for(o in s)s.hasOwnProperty(o)&&x(s[o],u,c);o=!0}else i.registrationName?(x(i.registrationName,u,c),o=!0):o=!1;if(!o)throw Error(a(98,r,e))}}}}function x(e,t,n){if(O[e])throw Error(a(100,e));O[e]=t,S[e]=t.eventTypes[n].dependencies}var _=[],k={},O={},S={};function E(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!b.hasOwnProperty(t)||b[t]!==r){if(b[t])throw Error(a(102,t));b[t]=r,n=!0}}n&&w()}var j=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),P=null,C=null,T=null;function A(e){if(e=y(e)){if("function"!=typeof P)throw Error(a(280));var t=e.stateNode;t&&(t=h(t),P(e.stateNode,e.type,t))}}function D(e){C?T?T.push(e):T=[e]:C=e}function R(){if(C){var e=C,t=T;if(T=C=null,A(e),t)for(e=0;e<t.length;e++)A(t[e])}}function I(e,t){return e(t)}function N(e,t,n,r,o){return e(t,n,r,o)}function z(){}var M=I,F=!1,L=!1;function U(){null===C&&null===T||(z(),R())}function B(e,t,n){if(L)return e(t,n);L=!0;try{return M(e,t,n)}finally{L=!1,U()}}var q=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,H=Object.prototype.hasOwnProperty,W={},Q={};function $(e,t,n,r,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){G[e]=new $(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];G[t]=new $(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){G[e]=new $(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){G[e]=new $(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){G[e]=new $(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){G[e]=new $(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){G[e]=new $(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){G[e]=new $(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){G[e]=new $(e,5,!1,e.toLowerCase(),null,!1)}));var V=/[\-:]([a-z])/g;function J(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(V,J);G[t]=new $(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(V,J);G[t]=new $(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(V,J);G[t]=new $(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){G[e]=new $(e,1,!1,e.toLowerCase(),null,!1)})),G.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){G[e]=new $(e,1,!1,e.toLowerCase(),null,!0)}));var Y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function K(e,t,n,r){var o=G.hasOwnProperty(t)?G[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!H.call(Q,e)||!H.call(W,e)&&(q.test(e)?Q[e]=!0:(W[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}Y.hasOwnProperty("ReactCurrentDispatcher")||(Y.ReactCurrentDispatcher={current:null}),Y.hasOwnProperty("ReactCurrentBatchConfig")||(Y.ReactCurrentBatchConfig={suspense:null});var X=/^(.*)[\\\/]/,Z="function"==typeof Symbol&&Symbol.for,ee=Z?Symbol.for("react.element"):60103,te=Z?Symbol.for("react.portal"):60106,ne=Z?Symbol.for("react.fragment"):60107,re=Z?Symbol.for("react.strict_mode"):60108,oe=Z?Symbol.for("react.profiler"):60114,ie=Z?Symbol.for("react.provider"):60109,ae=Z?Symbol.for("react.context"):60110,ue=Z?Symbol.for("react.concurrent_mode"):60111,ce=Z?Symbol.for("react.forward_ref"):60112,se=Z?Symbol.for("react.suspense"):60113,le=Z?Symbol.for("react.suspense_list"):60120,fe=Z?Symbol.for("react.memo"):60115,pe=Z?Symbol.for("react.lazy"):60116,de=Z?Symbol.for("react.block"):60121,he="function"==typeof Symbol&&Symbol.iterator;function ye(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=he&&e[he]||e["@@iterator"])?e:null}function ve(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case oe:return"Profiler";case re:return"StrictMode";case se:return"Suspense";case le:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ae:return"Context.Consumer";case ie:return"Context.Provider";case ce:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case fe:return ve(e.type);case de:return ve(e.render);case pe:if(e=1===e._status?e._result:null)return ve(e)}return null}function ge(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,o=e._debugSource,i=ve(e.type);n=null,r&&(n=ve(r.type)),r=i,i="",o?i=" (at "+o.fileName.replace(X,"")+":"+o.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function me(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function be(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function we(e){e._valueTracker||(e._valueTracker=function(e){var t=be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function xe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=be(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function _e(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ke(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=me(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Oe(e,t){null!=(t=t.checked)&&K(e,"checked",t,!1)}function Se(e,t){Oe(e,t);var n=me(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?je(e,t.type,n):t.hasOwnProperty("defaultValue")&&je(e,t.type,me(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Ee(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function je(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Pe(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Ce(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+me(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Te(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ae(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:me(n)}}function De(e,t){var n=me(t.value),r=me(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Ie="http://www.w3.org/1999/xhtml",Ne="http://www.w3.org/2000/svg";function ze(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Me(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ze(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Fe,Le=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Ne||"innerHTML"in e)e.innerHTML=t;else{for((Fe=Fe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Ue(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Be(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qe={animationend:Be("Animation","AnimationEnd"),animationiteration:Be("Animation","AnimationIteration"),animationstart:Be("Animation","AnimationStart"),transitionend:Be("Transition","TransitionEnd")},He={},We={};function Qe(e){if(He[e])return He[e];if(!qe[e])return e;var t,n=qe[e];for(t in n)if(n.hasOwnProperty(t)&&t in We)return He[e]=n[t];return e}j&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete qe.animationend.animation,delete qe.animationiteration.animation,delete qe.animationstart.animation),"TransitionEvent"in window||delete qe.transitionend.transition);var $e=Qe("animationend"),Ge=Qe("animationiteration"),Ve=Qe("animationstart"),Je=Qe("transitionend"),Ye="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ke=new("function"==typeof WeakMap?WeakMap:Map);function Xe(e){var t=Ke.get(e);return void 0===t&&(t=new Map,Ke.set(e,t)),t}function Ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if(Ze(e)!==e)throw Error(a(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ze(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return tt(o),e;if(i===r)return tt(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var u=!1,c=o.child;c;){if(c===n){u=!0,n=o,r=i;break}if(c===r){u=!0,r=o,n=i;break}c=c.sibling}if(!u){for(c=i.child;c;){if(c===n){u=!0,n=i,r=o;break}if(c===r){u=!0,r=i,n=o;break}c=c.sibling}if(!u)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(a(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function ot(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var it=null;function at(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)g(e,t[r],n[r]);else t&&g(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function ut(e){if(null!==e&&(it=rt(it,e)),e=it,it=null,e){if(ot(e,at),it)throw Error(a(95));if(l)throw e=f,l=!1,f=null,e}}function ct(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function st(e){if(!j)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var lt=[];function ft(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>lt.length&&lt.push(e)}function pt(e,t,n,r){if(lt.length){var o=lt.pop();return o.topLevelType=e,o.eventSystemFlags=r,o.nativeEvent=t,o.targetInst=n,o}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function dt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=jn(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var o=ct(e.nativeEvent);r=e.topLevelType;var i=e.nativeEvent,a=e.eventSystemFlags;0===n&&(a|=64);for(var u=null,c=0;c<_.length;c++){var s=_[c];s&&(s=s.extractEvents(r,t,i,o,a))&&(u=rt(u,s))}ut(u)}}function ht(e,t,n){if(!n.has(e)){switch(e){case"scroll":Vt(t,"scroll",!0);break;case"focus":case"blur":Vt(t,"focus",!0),Vt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":st(e)&&Vt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Ye.indexOf(e)&&Gt(e,t)}n.set(e,null)}}var yt,vt,gt,mt=!1,bt=[],wt=null,xt=null,_t=null,kt=new Map,Ot=new Map,St=[],Et="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),jt="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Pt(e,t,n,r,o){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:o,container:r}}function Ct(e,t){switch(e){case"focus":case"blur":wt=null;break;case"dragenter":case"dragleave":xt=null;break;case"mouseover":case"mouseout":_t=null;break;case"pointerover":case"pointerout":kt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ot.delete(t.pointerId)}}function Tt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e=Pt(t,n,r,o,i),null!==t&&(null!==(t=Pn(t))&&vt(t)),e):(e.eventSystemFlags|=r,e)}function At(e){var t=jn(e.target);if(null!==t){var n=Ze(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=et(n)))return e.blockedOn=t,void i.unstable_runWithPriority(e.priority,(function(){gt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Dt(e){if(null!==e.blockedOn)return!1;var t=Xt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=Pn(t);return null!==n&&vt(n),e.blockedOn=t,!1}return!0}function Rt(e,t,n){Dt(e)&&n.delete(t)}function It(){for(mt=!1;0<bt.length;){var e=bt[0];if(null!==e.blockedOn){null!==(e=Pn(e.blockedOn))&&yt(e);break}var t=Xt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:bt.shift()}null!==wt&&Dt(wt)&&(wt=null),null!==xt&&Dt(xt)&&(xt=null),null!==_t&&Dt(_t)&&(_t=null),kt.forEach(Rt),Ot.forEach(Rt)}function Nt(e,t){e.blockedOn===t&&(e.blockedOn=null,mt||(mt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,It)))}function zt(e){function t(t){return Nt(t,e)}if(0<bt.length){Nt(bt[0],e);for(var n=1;n<bt.length;n++){var r=bt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==wt&&Nt(wt,e),null!==xt&&Nt(xt,e),null!==_t&&Nt(_t,e),kt.forEach(t),Ot.forEach(t),n=0;n<St.length;n++)(r=St[n]).blockedOn===e&&(r.blockedOn=null);for(;0<St.length&&null===(n=St[0]).blockedOn;)At(n),null===n.blockedOn&&St.shift()}var Mt={},Ft=new Map,Lt=new Map,Ut=["abort","abort",$e,"animationEnd",Ge,"animationIteration",Ve,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Je,"transitionEnd","waiting","waiting"];function Bt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1],i="on"+(o[0].toUpperCase()+o.slice(1));i={phasedRegistrationNames:{bubbled:i,captured:i+"Capture"},dependencies:[r],eventPriority:t},Lt.set(r,t),Ft.set(r,i),Mt[o]=i}}Bt("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Bt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Bt(Ut,2);for(var qt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Ht=0;Ht<qt.length;Ht++)Lt.set(qt[Ht],0);var Wt=i.unstable_UserBlockingPriority,Qt=i.unstable_runWithPriority,$t=!0;function Gt(e,t){Vt(t,e,!1)}function Vt(e,t,n){var r=Lt.get(t);switch(void 0===r?2:r){case 0:r=Jt.bind(null,t,1,e);break;case 1:r=Yt.bind(null,t,1,e);break;default:r=Kt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Jt(e,t,n,r){F||z();var o=Kt,i=F;F=!0;try{N(o,e,t,n,r)}finally{(F=i)||U()}}function Yt(e,t,n,r){Qt(Wt,Kt.bind(null,e,t,n,r))}function Kt(e,t,n,r){if($t)if(0<bt.length&&-1<Et.indexOf(e))e=Pt(null,e,t,n,r),bt.push(e);else{var o=Xt(e,t,n,r);if(null===o)Ct(e,r);else if(-1<Et.indexOf(e))e=Pt(o,e,t,n,r),bt.push(e);else if(!function(e,t,n,r,o){switch(t){case"focus":return wt=Tt(wt,e,t,n,r,o),!0;case"dragenter":return xt=Tt(xt,e,t,n,r,o),!0;case"mouseover":return _t=Tt(_t,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return kt.set(i,Tt(kt.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Ot.set(i,Tt(Ot.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r)){Ct(e,r),e=pt(e,r,null,t);try{B(dt,e)}finally{ft(e)}}}}function Xt(e,t,n,r){if(null!==(n=jn(n=ct(r)))){var o=Ze(n);if(null===o)n=null;else{var i=o.tag;if(13===i){if(null!==(n=et(o)))return n;n=null}else if(3===i){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}e=pt(e,r,n,t);try{B(dt,e)}finally{ft(e)}return null}var Zt={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},en=["Webkit","ms","Moz","O"];function tn(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Zt.hasOwnProperty(e)&&Zt[e]?(""+t).trim():t+"px"}function nn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=tn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(Zt).forEach((function(e){en.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zt[t]=Zt[e]}))}));var rn=o({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function on(e,t){if(t){if(rn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62,""))}}function an(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var un=Ie;function cn(e,t){var n=Xe(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=S[t];for(var r=0;r<t.length;r++)ht(t[r],e,n)}function sn(){}function ln(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function fn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pn(e,t){var n,r=fn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fn(r)}}function dn(){for(var e=window,t=ln();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=ln((e=t.contentWindow).document)}return t}function hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yn=null,vn=null;function gn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function mn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var bn="function"==typeof setTimeout?setTimeout:void 0,wn="function"==typeof clearTimeout?clearTimeout:void 0;function xn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function _n(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var kn=Math.random().toString(36).slice(2),On="__reactInternalInstance$"+kn,Sn="__reactEventHandlers$"+kn,En="__reactContainere$"+kn;function jn(e){var t=e[On];if(t)return t;for(var n=e.parentNode;n;){if(t=n[En]||n[On]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=_n(e);null!==e;){if(n=e[On])return n;e=_n(e)}return t}n=(e=n).parentNode}return null}function Pn(e){return!(e=e[On]||e[En])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Cn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function Tn(e){return e[Sn]||null}function An(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Dn(e,t){var n=e.stateNode;if(!n)return null;var r=h(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}function Rn(e,t,n){(t=Dn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function In(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=An(t);for(t=n.length;0<t--;)Rn(n[t],"captured",e);for(t=0;t<n.length;t++)Rn(n[t],"bubbled",e)}}function Nn(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=Dn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function zn(e){e&&e.dispatchConfig.registrationName&&Nn(e._targetInst,null,e)}function Mn(e){ot(e,In)}var Fn=null,Ln=null,Un=null;function Bn(){if(Un)return Un;var e,t,n=Ln,r=n.length,o="value"in Fn?Fn.value:Fn.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Un=o.slice(e,1<t?1-t:void 0)}function qn(){return!0}function Hn(){return!1}function Wn(e,t,n,r){for(var o in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?qn:Hn,this.isPropagationStopped=Hn,this}function Qn(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function $n(e){if(!(e instanceof this))throw Error(a(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Gn(e){e.eventPool=[],e.getPooled=Qn,e.release=$n}o(Wn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=qn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=qn)},persist:function(){this.isPersistent=qn},isPersistent:Hn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Hn,this._dispatchInstances=this._dispatchListeners=null}}),Wn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Wn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return o(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,Gn(n),n},Gn(Wn);var Vn=Wn.extend({data:null}),Jn=Wn.extend({data:null}),Yn=[9,13,27,32],Kn=j&&"CompositionEvent"in window,Xn=null;j&&"documentMode"in document&&(Xn=document.documentMode);var Zn=j&&"TextEvent"in window&&!Xn,er=j&&(!Kn||Xn&&8<Xn&&11>=Xn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function or(e,t){switch(e){case"keyup":return-1!==Yn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ir(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ar=!1;var ur={eventTypes:nr,extractEvents:function(e,t,n,r){var o;if(Kn)e:{switch(e){case"compositionstart":var i=nr.compositionStart;break e;case"compositionend":i=nr.compositionEnd;break e;case"compositionupdate":i=nr.compositionUpdate;break e}i=void 0}else ar?or(e,n)&&(i=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=nr.compositionStart);return i?(er&&"ko"!==n.locale&&(ar||i!==nr.compositionStart?i===nr.compositionEnd&&ar&&(o=Bn()):(Ln="value"in(Fn=r)?Fn.value:Fn.textContent,ar=!0)),i=Vn.getPooled(i,t,n,r),o?i.data=o:null!==(o=ir(n))&&(i.data=o),Mn(i),o=i):o=null,(e=Zn?function(e,t){switch(e){case"compositionend":return ir(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(ar)return"compositionend"===e||!Kn&&or(e,t)?(e=Bn(),Un=Ln=Fn=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return er&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Jn.getPooled(nr.beforeInput,t,n,r)).data=e,Mn(t)):t=null,null===o?t:null===t?o:[o,t]}},cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!cr[e.type]:"textarea"===t}var lr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function fr(e,t,n){return(e=Wn.getPooled(lr.change,e,t,n)).type="change",D(n),Mn(e),e}var pr=null,dr=null;function hr(e){ut(e)}function yr(e){if(xe(Cn(e)))return e}function vr(e,t){if("change"===e)return t}var gr=!1;function mr(){pr&&(pr.detachEvent("onpropertychange",br),dr=pr=null)}function br(e){if("value"===e.propertyName&&yr(dr))if(e=fr(dr,e,ct(e)),F)ut(e);else{F=!0;try{I(hr,e)}finally{F=!1,U()}}}function wr(e,t,n){"focus"===e?(mr(),dr=n,(pr=t).attachEvent("onpropertychange",br)):"blur"===e&&mr()}function xr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return yr(dr)}function _r(e,t){if("click"===e)return yr(t)}function kr(e,t){if("input"===e||"change"===e)return yr(t)}j&&(gr=st("input")&&(!document.documentMode||9<document.documentMode));var Or={eventTypes:lr,_isInputEventSupported:gr,extractEvents:function(e,t,n,r){var o=t?Cn(t):window,i=o.nodeName&&o.nodeName.toLowerCase();if("select"===i||"input"===i&&"file"===o.type)var a=vr;else if(sr(o))if(gr)a=kr;else{a=xr;var u=wr}else(i=o.nodeName)&&"input"===i.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(a=_r);if(a&&(a=a(e,t)))return fr(a,n,r);u&&u(e,o,t),"blur"===e&&(e=o._wrapperState)&&e.controlled&&"number"===o.type&&je(o,"number",o.value)}},Sr=Wn.extend({view:null,detail:null}),Er={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Er[e])&&!!t[e]}function Pr(){return jr}var Cr=0,Tr=0,Ar=!1,Dr=!1,Rr=Sr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Pr,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Cr;return Cr=e.screenX,Ar?"mousemove"===e.type?e.screenX-t:0:(Ar=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Tr;return Tr=e.screenY,Dr?"mousemove"===e.type?e.screenY-t:0:(Dr=!0,0)}}),Ir=Rr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Nr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},zr={eventTypes:Nr,extractEvents:function(e,t,n,r,o){var i="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e;if(i&&0==(32&o)&&(n.relatedTarget||n.fromElement)||!a&&!i)return null;(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,a)?(a=t,null!==(t=(t=n.relatedTarget||n.toElement)?jn(t):null)&&(t!==Ze(t)||5!==t.tag&&6!==t.tag)&&(t=null)):a=null;if(a===t)return null;if("mouseout"===e||"mouseover"===e)var u=Rr,c=Nr.mouseLeave,s=Nr.mouseEnter,l="mouse";else"pointerout"!==e&&"pointerover"!==e||(u=Ir,c=Nr.pointerLeave,s=Nr.pointerEnter,l="pointer");if(e=null==a?i:Cn(a),i=null==t?i:Cn(t),(c=u.getPooled(c,a,n,r)).type=l+"leave",c.target=e,c.relatedTarget=i,(n=u.getPooled(s,t,n,r)).type=l+"enter",n.target=i,n.relatedTarget=e,l=t,(r=a)&&l)e:{for(s=l,a=0,e=u=r;e;e=An(e))a++;for(e=0,t=s;t;t=An(t))e++;for(;0<a-e;)u=An(u),a--;for(;0<e-a;)s=An(s),e--;for(;a--;){if(u===s||u===s.alternate)break e;u=An(u),s=An(s)}u=null}else u=null;for(s=u,u=[];r&&r!==s&&(null===(a=r.alternate)||a!==s);)u.push(r),r=An(r);for(r=[];l&&l!==s&&(null===(a=l.alternate)||a!==s);)r.push(l),l=An(l);for(l=0;l<u.length;l++)Nn(u[l],"bubbled",c);for(l=r.length;0<l--;)Nn(r[l],"captured",n);return 0==(64&o)?[c]:[c,n]}};var Mr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Fr=Object.prototype.hasOwnProperty;function Lr(e,t){if(Mr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Fr.call(t,n[r])||!Mr(e[n[r]],t[n[r]]))return!1;return!0}var Ur=j&&"documentMode"in document&&11>=document.documentMode,Br={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},qr=null,Hr=null,Wr=null,Qr=!1;function $r(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Qr||null==qr||qr!==ln(n)?null:("selectionStart"in(n=qr)&&hn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Wr&&Lr(Wr,n)?null:(Wr=n,(e=Wn.getPooled(Br.select,Hr,e,t)).type="select",e.target=qr,Mn(e),e))}var Gr={eventTypes:Br,extractEvents:function(e,t,n,r,o,i){if(!(i=!(o=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{o=Xe(o),i=S.onSelect;for(var a=0;a<i.length;a++)if(!o.has(i[a])){o=!1;break e}o=!0}i=!o}if(i)return null;switch(o=t?Cn(t):window,e){case"focus":(sr(o)||"true"===o.contentEditable)&&(qr=o,Hr=t,Wr=null);break;case"blur":Wr=Hr=qr=null;break;case"mousedown":Qr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Qr=!1,$r(n,r);case"selectionchange":if(Ur)break;case"keydown":case"keyup":return $r(n,r)}return null}},Vr=Wn.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Jr=Wn.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yr=Sr.extend({relatedTarget:null});function Kr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Xr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eo=Sr.extend({key:function(e){if(e.key){var t=Xr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Kr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Zr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Pr,charCode:function(e){return"keypress"===e.type?Kr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Kr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),to=Rr.extend({dataTransfer:null}),no=Sr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Pr}),ro=Wn.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),oo=Rr.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),io={eventTypes:Mt,extractEvents:function(e,t,n,r){var o=Ft.get(e);if(!o)return null;switch(e){case"keypress":if(0===Kr(n))return null;case"keydown":case"keyup":e=eo;break;case"blur":case"focus":e=Yr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=to;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=no;break;case $e:case Ge:case Ve:e=Vr;break;case Je:e=ro;break;case"scroll":e=Sr;break;case"wheel":e=oo;break;case"copy":case"cut":case"paste":e=Jr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Ir;break;default:e=Wn}return Mn(t=e.getPooled(o,t,n,r)),t}};if(m)throw Error(a(101));m=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),w(),h=Tn,y=Pn,v=Cn,E({SimpleEventPlugin:io,EnterLeaveEventPlugin:zr,ChangeEventPlugin:Or,SelectEventPlugin:Gr,BeforeInputEventPlugin:ur});var ao=[],uo=-1;function co(e){0>uo||(e.current=ao[uo],ao[uo]=null,uo--)}function so(e,t){uo++,ao[uo]=e.current,e.current=t}var lo={},fo={current:lo},po={current:!1},ho=lo;function yo(e,t){var n=e.type.contextTypes;if(!n)return lo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vo(e){return null!=(e=e.childContextTypes)}function go(){co(po),co(fo)}function mo(e,t,n){if(fo.current!==lo)throw Error(a(168));so(fo,t),so(po,n)}function bo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(a(108,ve(t)||"Unknown",i));return o({},n,{},r)}function wo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lo,ho=fo.current,so(fo,e),so(po,po.current),!0}function xo(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=bo(e,t,ho),r.__reactInternalMemoizedMergedChildContext=e,co(po),co(fo),so(fo,e)):co(po),so(po,n)}var _o=i.unstable_runWithPriority,ko=i.unstable_scheduleCallback,Oo=i.unstable_cancelCallback,So=i.unstable_requestPaint,Eo=i.unstable_now,jo=i.unstable_getCurrentPriorityLevel,Po=i.unstable_ImmediatePriority,Co=i.unstable_UserBlockingPriority,To=i.unstable_NormalPriority,Ao=i.unstable_LowPriority,Do=i.unstable_IdlePriority,Ro={},Io=i.unstable_shouldYield,No=void 0!==So?So:function(){},zo=null,Mo=null,Fo=!1,Lo=Eo(),Uo=1e4>Lo?Eo:function(){return Eo()-Lo};function Bo(){switch(jo()){case Po:return 99;case Co:return 98;case To:return 97;case Ao:return 96;case Do:return 95;default:throw Error(a(332))}}function qo(e){switch(e){case 99:return Po;case 98:return Co;case 97:return To;case 96:return Ao;case 95:return Do;default:throw Error(a(332))}}function Ho(e,t){return e=qo(e),_o(e,t)}function Wo(e,t,n){return e=qo(e),ko(e,t,n)}function Qo(e){return null===zo?(zo=[e],Mo=ko(Po,Go)):zo.push(e),Ro}function $o(){if(null!==Mo){var e=Mo;Mo=null,Oo(e)}Go()}function Go(){if(!Fo&&null!==zo){Fo=!0;var e=0;try{var t=zo;Ho(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),zo=null}catch(t){throw null!==zo&&(zo=zo.slice(e+1)),ko(Po,$o),t}finally{Fo=!1}}}function Vo(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Jo(e,t){if(e&&e.defaultProps)for(var n in t=o({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Yo={current:null},Ko=null,Xo=null,Zo=null;function ei(){Zo=Xo=Ko=null}function ti(e){var t=Yo.current;co(Yo),e.type._context._currentValue=t}function ni(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function ri(e,t){Ko=e,Zo=Xo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Ta=!0),e.firstContext=null)}function oi(e,t){if(Zo!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Zo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Xo){if(null===Ko)throw Error(a(308));Xo=t,Ko.dependencies={expirationTime:0,firstContext:t,responders:null}}else Xo=Xo.next=t;return e._currentValue}var ii=!1;function ai(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ui(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function ci(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function si(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function li(e,t){var n=e.alternate;null!==n&&ui(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function fi(e,t,n,r){var i=e.updateQueue;ii=!1;var a=i.baseQueue,u=i.shared.pending;if(null!==u){if(null!==a){var c=a.next;a.next=u.next,u.next=c}a=u,i.shared.pending=null,null!==(c=e.alternate)&&(null!==(c=c.updateQueue)&&(c.baseQueue=u))}if(null!==a){c=a.next;var s=i.baseState,l=0,f=null,p=null,d=null;if(null!==c)for(var h=c;;){if((u=h.expirationTime)<r){var y={expirationTime:h.expirationTime,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null};null===d?(p=d=y,f=s):d=d.next=y,u>l&&(l=u)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null}),ic(u,h.suspenseConfig);e:{var v=e,g=h;switch(u=t,y=n,g.tag){case 1:if("function"==typeof(v=g.payload)){s=v.call(y,s,u);break e}s=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null==(u="function"==typeof(v=g.payload)?v.call(y,s,u):v))break e;s=o({},s,u);break e;case 2:ii=!0}}null!==h.callback&&(e.effectTag|=32,null===(u=i.effects)?i.effects=[h]:u.push(h))}if(null===(h=h.next)||h===c){if(null===(u=i.shared.pending))break;h=a.next=u.next,u.next=c,i.baseQueue=a=u,i.shared.pending=null}}null===d?f=s:d.next=p,i.baseState=f,i.baseQueue=d,ac(l),e.expirationTime=l,e.memoizedState=s}}function pi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=o,o=n,"function"!=typeof r)throw Error(a(191,r));r.call(o)}}}var di=Y.ReactCurrentBatchConfig,hi=(new r.Component).refs;function yi(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:o({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var vi={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=$u(),o=di.suspense;(o=ci(r=Gu(r,e,o),o)).payload=t,null!=n&&(o.callback=n),si(e,o),Vu(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=$u(),o=di.suspense;(o=ci(r=Gu(r,e,o),o)).tag=1,o.payload=t,null!=n&&(o.callback=n),si(e,o),Vu(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=$u(),r=di.suspense;(r=ci(n=Gu(n,e,r),r)).tag=2,null!=t&&(r.callback=t),si(e,r),Vu(e,n)}};function gi(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!Lr(n,r)||!Lr(o,i))}function mi(e,t,n){var r=!1,o=lo,i=t.contextType;return"object"==typeof i&&null!==i?i=oi(i):(o=vo(t)?ho:fo.current,i=(r=null!=(r=t.contextTypes))?yo(e,o):lo),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=vi,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function bi(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vi.enqueueReplaceState(t,t.state,null)}function wi(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=hi,ai(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=oi(i):(i=vo(t)?ho:fo.current,o.context=yo(e,i)),fi(e,n,o,r),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(yi(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&vi.enqueueReplaceState(o,o.state,null),fi(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.effectTag|=4)}var xi=Array.isArray;function _i(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:((t=function(e){var t=r.refs;t===hi&&(t=r.refs={}),null===e?delete t[o]:t[o]=e})._stringRef=o,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function ki(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function Oi(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Ec(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function u(t){return e&&null===t.alternate&&(t.effectTag=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=Cc(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function s(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=_i(e,t,n),r.return=e,r):((r=jc(n.type,n.key,n.props,null,e.mode,r)).ref=_i(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Tc(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=Pc(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Cc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=jc(t.type,t.key,t.props,null,e.mode,n)).ref=_i(e,null,t),n.return=e,n;case te:return(t=Tc(t,e.mode,n)).return=e,t}if(xi(t)||ye(t))return(t=Pc(t,e.mode,n,null)).return=e,t;ki(e,t)}return null}function d(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:c(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===o?n.type===ne?f(e,t,n.props.children,r,o):s(e,t,n,r):null;case te:return n.key===o?l(e,t,n,r):null}if(xi(n)||ye(n))return null!==o?null:f(e,t,n,r,null);ki(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return c(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?f(t,e,r.props.children,o,r.key):s(t,e,r,o);case te:return l(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(xi(r)||ye(r))return f(t,e=e.get(n)||null,r,o,null);ki(t,r)}return null}function y(o,a,u,c){for(var s=null,l=null,f=a,y=a=0,v=null;null!==f&&y<u.length;y++){f.index>y?(v=f,f=null):v=f.sibling;var g=d(o,f,u[y],c);if(null===g){null===f&&(f=v);break}e&&f&&null===g.alternate&&t(o,f),a=i(g,a,y),null===l?s=g:l.sibling=g,l=g,f=v}if(y===u.length)return n(o,f),s;if(null===f){for(;y<u.length;y++)null!==(f=p(o,u[y],c))&&(a=i(f,a,y),null===l?s=f:l.sibling=f,l=f);return s}for(f=r(o,f);y<u.length;y++)null!==(v=h(f,o,y,u[y],c))&&(e&&null!==v.alternate&&f.delete(null===v.key?y:v.key),a=i(v,a,y),null===l?s=v:l.sibling=v,l=v);return e&&f.forEach((function(e){return t(o,e)})),s}function v(o,u,c,s){var l=ye(c);if("function"!=typeof l)throw Error(a(150));if(null==(c=l.call(c)))throw Error(a(151));for(var f=l=null,y=u,v=u=0,g=null,m=c.next();null!==y&&!m.done;v++,m=c.next()){y.index>v?(g=y,y=null):g=y.sibling;var b=d(o,y,m.value,s);if(null===b){null===y&&(y=g);break}e&&y&&null===b.alternate&&t(o,y),u=i(b,u,v),null===f?l=b:f.sibling=b,f=b,y=g}if(m.done)return n(o,y),l;if(null===y){for(;!m.done;v++,m=c.next())null!==(m=p(o,m.value,s))&&(u=i(m,u,v),null===f?l=m:f.sibling=m,f=m);return l}for(y=r(o,y);!m.done;v++,m=c.next())null!==(m=h(y,o,v,m.value,s))&&(e&&null!==m.alternate&&y.delete(null===m.key?v:m.key),u=i(m,u,v),null===f?l=m:f.sibling=m,f=m);return e&&y.forEach((function(e){return t(o,e)})),l}return function(e,r,i,c){var s="object"==typeof i&&null!==i&&i.type===ne&&null===i.key;s&&(i=i.props.children);var l="object"==typeof i&&null!==i;if(l)switch(i.$$typeof){case ee:e:{for(l=i.key,s=r;null!==s;){if(s.key===l){switch(s.tag){case 7:if(i.type===ne){n(e,s.sibling),(r=o(s,i.props.children)).return=e,e=r;break e}break;default:if(s.elementType===i.type){n(e,s.sibling),(r=o(s,i.props)).ref=_i(e,s,i),r.return=e,e=r;break e}}n(e,s);break}t(e,s),s=s.sibling}i.type===ne?((r=Pc(i.props.children,e.mode,c,i.key)).return=e,e=r):((c=jc(i.type,i.key,i.props,null,e.mode,c)).ref=_i(e,r,i),c.return=e,e=c)}return u(e);case te:e:{for(s=i.key;null!==r;){if(r.key===s){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=o(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Tc(i,e.mode,c)).return=e,e=r}return u(e)}if("string"==typeof i||"number"==typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,i)).return=e,e=r):(n(e,r),(r=Cc(i,e.mode,c)).return=e,e=r),u(e);if(xi(i))return y(e,r,i,c);if(ye(i))return v(e,r,i,c);if(l&&ki(e,i),void 0===i&&!s)switch(e.tag){case 1:case 0:throw e=e.type,Error(a(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Si=Oi(!0),Ei=Oi(!1),ji={},Pi={current:ji},Ci={current:ji},Ti={current:ji};function Ai(e){if(e===ji)throw Error(a(174));return e}function Di(e,t){switch(so(Ti,t),so(Ci,e),so(Pi,ji),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Me(null,"");break;default:t=Me(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}co(Pi),so(Pi,t)}function Ri(){co(Pi),co(Ci),co(Ti)}function Ii(e){Ai(Ti.current);var t=Ai(Pi.current),n=Me(t,e.type);t!==n&&(so(Ci,e),so(Pi,n))}function Ni(e){Ci.current===e&&(co(Pi),co(Ci))}var zi={current:0};function Mi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Fi(e,t){return{responder:e,props:t}}var Li=Y.ReactCurrentDispatcher,Ui=Y.ReactCurrentBatchConfig,Bi=0,qi=null,Hi=null,Wi=null,Qi=!1;function $i(){throw Error(a(321))}function Gi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mr(e[n],t[n]))return!1;return!0}function Vi(e,t,n,r,o,i){if(Bi=i,qi=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,Li.current=null===e||null===e.memoizedState?ga:ma,e=n(r,o),t.expirationTime===Bi){i=0;do{if(t.expirationTime=0,!(25>i))throw Error(a(301));i+=1,Wi=Hi=null,t.updateQueue=null,Li.current=ba,e=n(r,o)}while(t.expirationTime===Bi)}if(Li.current=va,t=null!==Hi&&null!==Hi.next,Bi=0,Wi=Hi=qi=null,Qi=!1,t)throw Error(a(300));return e}function Ji(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Wi?qi.memoizedState=Wi=e:Wi=Wi.next=e,Wi}function Yi(){if(null===Hi){var e=qi.alternate;e=null!==e?e.memoizedState:null}else e=Hi.next;var t=null===Wi?qi.memoizedState:Wi.next;if(null!==t)Wi=t,Hi=e;else{if(null===e)throw Error(a(310));e={memoizedState:(Hi=e).memoizedState,baseState:Hi.baseState,baseQueue:Hi.baseQueue,queue:Hi.queue,next:null},null===Wi?qi.memoizedState=Wi=e:Wi=Wi.next=e}return Wi}function Ki(e,t){return"function"==typeof t?t(e):t}function Xi(e){var t=Yi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=Hi,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var u=o.next;o.next=i.next,i.next=u}r.baseQueue=o=i,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var c=u=i=null,s=o;do{var l=s.expirationTime;if(l<Bi){var f={expirationTime:s.expirationTime,suspenseConfig:s.suspenseConfig,action:s.action,eagerReducer:s.eagerReducer,eagerState:s.eagerState,next:null};null===c?(u=c=f,i=r):c=c.next=f,l>qi.expirationTime&&(qi.expirationTime=l,ac(l))}else null!==c&&(c=c.next={expirationTime:1073741823,suspenseConfig:s.suspenseConfig,action:s.action,eagerReducer:s.eagerReducer,eagerState:s.eagerState,next:null}),ic(l,s.suspenseConfig),r=s.eagerReducer===e?s.eagerState:e(r,s.action);s=s.next}while(null!==s&&s!==o);null===c?i=r:c.next=u,Mr(r,t.memoizedState)||(Ta=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Zi(e){var t=Yi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var u=o=o.next;do{i=e(i,u.action),u=u.next}while(u!==o);Mr(i,t.memoizedState)||(Ta=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ea(e){var t=Ji();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:e}).dispatch=ya.bind(null,qi,e),[t.memoizedState,e]}function ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=qi.updateQueue)?(t={lastEffect:null},qi.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function na(){return Yi().memoizedState}function ra(e,t,n,r){var o=Ji();qi.effectTag|=e,o.memoizedState=ta(1|t,n,void 0,void 0===r?null:r)}function oa(e,t,n,r){var o=Yi();r=void 0===r?null:r;var i=void 0;if(null!==Hi){var a=Hi.memoizedState;if(i=a.destroy,null!==r&&Gi(r,a.deps))return void ta(t,n,i,r)}qi.effectTag|=e,o.memoizedState=ta(1|t,n,i,r)}function ia(e,t){return ra(516,4,e,t)}function aa(e,t){return oa(516,4,e,t)}function ua(e,t){return oa(4,2,e,t)}function ca(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function sa(e,t,n){return n=null!=n?n.concat([e]):null,oa(4,2,ca.bind(null,t,e),n)}function la(){}function fa(e,t){return Ji().memoizedState=[e,void 0===t?null:t],e}function pa(e,t){var n=Yi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Gi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function da(e,t){var n=Yi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Gi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ha(e,t,n){var r=Bo();Ho(98>r?98:r,(function(){e(!0)})),Ho(97<r?97:r,(function(){var r=Ui.suspense;Ui.suspense=void 0===t?null:t;try{e(!1),n()}finally{Ui.suspense=r}}))}function ya(e,t,n){var r=$u(),o=di.suspense;o={expirationTime:r=Gu(r,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var i=t.pending;if(null===i?o.next=o:(o.next=i.next,i.next=o),t.pending=o,i=e.alternate,e===qi||null!==i&&i===qi)Qi=!0,o.expirationTime=Bi,qi.expirationTime=Bi;else{if(0===e.expirationTime&&(null===i||0===i.expirationTime)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,u=i(a,n);if(o.eagerReducer=i,o.eagerState=u,Mr(u,a))return}catch(e){}Vu(e,r)}}var va={readContext:oi,useCallback:$i,useContext:$i,useEffect:$i,useImperativeHandle:$i,useLayoutEffect:$i,useMemo:$i,useReducer:$i,useRef:$i,useState:$i,useDebugValue:$i,useResponder:$i,useDeferredValue:$i,useTransition:$i},ga={readContext:oi,useCallback:fa,useContext:oi,useEffect:ia,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ra(4,2,ca.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ra(4,2,e,t)},useMemo:function(e,t){var n=Ji();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ji();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=ya.bind(null,qi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ji().memoizedState=e},useState:ea,useDebugValue:la,useResponder:Fi,useDeferredValue:function(e,t){var n=ea(e),r=n[0],o=n[1];return ia((function(){var n=Ui.suspense;Ui.suspense=void 0===t?null:t;try{o(e)}finally{Ui.suspense=n}}),[e,t]),r},useTransition:function(e){var t=ea(!1),n=t[0];return t=t[1],[fa(ha.bind(null,t,e),[t,e]),n]}},ma={readContext:oi,useCallback:pa,useContext:oi,useEffect:aa,useImperativeHandle:sa,useLayoutEffect:ua,useMemo:da,useReducer:Xi,useRef:na,useState:function(){return Xi(Ki)},useDebugValue:la,useResponder:Fi,useDeferredValue:function(e,t){var n=Xi(Ki),r=n[0],o=n[1];return aa((function(){var n=Ui.suspense;Ui.suspense=void 0===t?null:t;try{o(e)}finally{Ui.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Xi(Ki),n=t[0];return t=t[1],[pa(ha.bind(null,t,e),[t,e]),n]}},ba={readContext:oi,useCallback:pa,useContext:oi,useEffect:aa,useImperativeHandle:sa,useLayoutEffect:ua,useMemo:da,useReducer:Zi,useRef:na,useState:function(){return Zi(Ki)},useDebugValue:la,useResponder:Fi,useDeferredValue:function(e,t){var n=Zi(Ki),r=n[0],o=n[1];return aa((function(){var n=Ui.suspense;Ui.suspense=void 0===t?null:t;try{o(e)}finally{Ui.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Zi(Ki),n=t[0];return t=t[1],[pa(ha.bind(null,t,e),[t,e]),n]}},wa=null,xa=null,_a=!1;function ka(e,t){var n=Oc(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Oa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Sa(e){if(_a){var t=xa;if(t){var n=t;if(!Oa(e,t)){if(!(t=xn(n.nextSibling))||!Oa(e,t))return e.effectTag=-1025&e.effectTag|2,_a=!1,void(wa=e);ka(wa,n)}wa=e,xa=xn(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,_a=!1,wa=e}}function Ea(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;wa=e}function ja(e){if(e!==wa)return!1;if(!_a)return Ea(e),_a=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!mn(t,e.memoizedProps))for(t=xa;t;)ka(e,t),t=xn(t.nextSibling);if(Ea(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){xa=xn(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}xa=null}}else xa=wa?xn(e.stateNode.nextSibling):null;return!0}function Pa(){xa=wa=null,_a=!1}var Ca=Y.ReactCurrentOwner,Ta=!1;function Aa(e,t,n,r){t.child=null===e?Ei(t,null,n,r):Si(t,e.child,n,r)}function Da(e,t,n,r,o){n=n.render;var i=t.ref;return ri(t,o),r=Vi(e,t,n,r,i,o),null===e||Ta?(t.effectTag|=1,Aa(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),Va(e,t,o))}function Ra(e,t,n,r,o,i){if(null===e){var a=n.type;return"function"!=typeof a||Sc(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=jc(n.type,null,r,null,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ia(e,t,a,r,o,i))}return a=e.child,o<i&&(o=a.memoizedProps,(n=null!==(n=n.compare)?n:Lr)(o,r)&&e.ref===t.ref)?Va(e,t,i):(t.effectTag|=1,(e=Ec(a,r)).ref=t.ref,e.return=t,t.child=e)}function Ia(e,t,n,r,o,i){return null!==e&&Lr(e.memoizedProps,r)&&e.ref===t.ref&&(Ta=!1,o<i)?(t.expirationTime=e.expirationTime,Va(e,t,i)):za(e,t,n,r,i)}function Na(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function za(e,t,n,r,o){var i=vo(n)?ho:fo.current;return i=yo(t,i),ri(t,o),n=Vi(e,t,n,r,i,o),null===e||Ta?(t.effectTag|=1,Aa(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),Va(e,t,o))}function Ma(e,t,n,r,o){if(vo(n)){var i=!0;wo(t)}else i=!1;if(ri(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),mi(t,n,r),wi(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,u=t.memoizedProps;a.props=u;var c=a.context,s=n.contextType;"object"==typeof s&&null!==s?s=oi(s):s=yo(t,s=vo(n)?ho:fo.current);var l=n.getDerivedStateFromProps,f="function"==typeof l||"function"==typeof a.getSnapshotBeforeUpdate;f||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(u!==r||c!==s)&&bi(t,a,r,s),ii=!1;var p=t.memoizedState;a.state=p,fi(t,r,a,o),c=t.memoizedState,u!==r||p!==c||po.current||ii?("function"==typeof l&&(yi(t,n,l,r),c=t.memoizedState),(u=ii||gi(t,n,u,r,p,c,s))?(f||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.effectTag|=4)):("function"==typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=s,r=u):("function"==typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,ui(e,t),u=t.memoizedProps,a.props=t.type===t.elementType?u:Jo(t.type,u),c=a.context,"object"==typeof(s=n.contextType)&&null!==s?s=oi(s):s=yo(t,s=vo(n)?ho:fo.current),(f="function"==typeof(l=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(u!==r||c!==s)&&bi(t,a,r,s),ii=!1,c=t.memoizedState,a.state=c,fi(t,r,a,o),p=t.memoizedState,u!==r||c!==p||po.current||ii?("function"==typeof l&&(yi(t,n,l,r),p=t.memoizedState),(l=ii||gi(t,n,u,r,c,p,s))?(f||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,s),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,s)),"function"==typeof a.componentDidUpdate&&(t.effectTag|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof a.componentDidUpdate||u===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||u===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=s,r=l):("function"!=typeof a.componentDidUpdate||u===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||u===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=256),r=!1);return Fa(e,t,n,r,i,o)}function Fa(e,t,n,r,o,i){Na(e,t);var a=0!=(64&t.effectTag);if(!r&&!a)return o&&xo(t,n,!1),Va(e,t,i);r=t.stateNode,Ca.current=t;var u=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=Si(t,e.child,null,i),t.child=Si(t,null,u,i)):Aa(e,t,u,i),t.memoizedState=r.state,o&&xo(t,n,!0),t.child}function La(e){var t=e.stateNode;t.pendingContext?mo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&mo(0,t.context,!1),Di(e,t.containerInfo)}var Ua,Ba,qa,Ha={dehydrated:null,retryTime:0};function Wa(e,t,n){var r,o=t.mode,i=t.pendingProps,a=zi.current,u=!1;if((r=0!=(64&t.effectTag))||(r=0!=(2&a)&&(null===e||null!==e.memoizedState)),r?(u=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),so(zi,1&a),null===e){if(void 0!==i.fallback&&Sa(t),u){if(u=i.fallback,(i=Pc(null,o,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Pc(u,o,n,null)).return=t,i.sibling=n,t.memoizedState=Ha,t.child=i,n}return o=i.children,t.memoizedState=null,t.child=Ei(t,null,o,n)}if(null!==e.memoizedState){if(o=(e=e.child).sibling,u){if(i=i.fallback,(n=Ec(e,e.pendingProps)).return=t,0==(2&t.mode)&&(u=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=u;null!==u;)u.return=n,u=u.sibling;return(o=Ec(o,i)).return=t,n.sibling=o,n.childExpirationTime=0,t.memoizedState=Ha,t.child=n,o}return n=Si(t,e.child,i.children,n),t.memoizedState=null,t.child=n}if(e=e.child,u){if(u=i.fallback,(i=Pc(null,o,0,null)).return=t,i.child=e,null!==e&&(e.return=i),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Pc(u,o,n,null)).return=t,i.sibling=n,n.effectTag|=2,i.childExpirationTime=0,t.memoizedState=Ha,t.child=i,n}return t.memoizedState=null,t.child=Si(t,e,i.children,n)}function Qa(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),ni(e.return,t)}function $a(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:o,lastEffect:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailExpiration=0,a.tailMode=o,a.lastEffect=i)}function Ga(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Aa(e,t,r.children,n),0!=(2&(r=zi.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Qa(e,n);else if(19===e.tag)Qa(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(so(zi,r),0==(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Mi(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),$a(t,!1,o,n,i,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Mi(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}$a(t,!0,n,null,i,t.lastEffect);break;case"together":$a(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Va(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&ac(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Ec(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Ec(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ja(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ya(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return vo(t.type)&&go(),null;case 3:return Ri(),co(po),co(fo),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!ja(t)||(t.effectTag|=4),null;case 5:Ni(t),n=Ai(Ti.current);var i=t.type;if(null!==e&&null!=t.stateNode)Ba(e,t,i,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Ai(Pi.current),ja(t)){r=t.stateNode,i=t.type;var u=t.memoizedProps;switch(r[On]=t,r[Sn]=u,i){case"iframe":case"object":case"embed":Gt("load",r);break;case"video":case"audio":for(e=0;e<Ye.length;e++)Gt(Ye[e],r);break;case"source":Gt("error",r);break;case"img":case"image":case"link":Gt("error",r),Gt("load",r);break;case"form":Gt("reset",r),Gt("submit",r);break;case"details":Gt("toggle",r);break;case"input":ke(r,u),Gt("invalid",r),cn(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!u.multiple},Gt("invalid",r),cn(n,"onChange");break;case"textarea":Ae(r,u),Gt("invalid",r),cn(n,"onChange")}for(var c in on(i,u),e=null,u)if(u.hasOwnProperty(c)){var s=u[c];"children"===c?"string"==typeof s?r.textContent!==s&&(e=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(e=["children",""+s]):O.hasOwnProperty(c)&&null!=s&&cn(n,c)}switch(i){case"input":we(r),Ee(r,u,!0);break;case"textarea":we(r),Re(r);break;case"select":case"option":break;default:"function"==typeof u.onClick&&(r.onclick=sn)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(c=9===n.nodeType?n:n.ownerDocument,e===un&&(e=ze(i)),e===un?"script"===i?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(i,{is:r.is}):(e=c.createElement(i),"select"===i&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,i),e[On]=t,e[Sn]=r,Ua(e,t),t.stateNode=e,c=an(i,r),i){case"iframe":case"object":case"embed":Gt("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ye.length;s++)Gt(Ye[s],e);s=r;break;case"source":Gt("error",e),s=r;break;case"img":case"image":case"link":Gt("error",e),Gt("load",e),s=r;break;case"form":Gt("reset",e),Gt("submit",e),s=r;break;case"details":Gt("toggle",e),s=r;break;case"input":ke(e,r),s=_e(e,r),Gt("invalid",e),cn(n,"onChange");break;case"option":s=Pe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=o({},r,{value:void 0}),Gt("invalid",e),cn(n,"onChange");break;case"textarea":Ae(e,r),s=Te(e,r),Gt("invalid",e),cn(n,"onChange");break;default:s=r}on(i,s);var l=s;for(u in l)if(l.hasOwnProperty(u)){var f=l[u];"style"===u?nn(e,f):"dangerouslySetInnerHTML"===u?null!=(f=f?f.__html:void 0)&&Le(e,f):"children"===u?"string"==typeof f?("textarea"!==i||""!==f)&&Ue(e,f):"number"==typeof f&&Ue(e,""+f):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(O.hasOwnProperty(u)?null!=f&&cn(n,u):null!=f&&K(e,u,f,c))}switch(i){case"input":we(e),Ee(e,r,!1);break;case"textarea":we(e),Re(e);break;case"option":null!=r.value&&e.setAttribute("value",""+me(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?Ce(e,!!r.multiple,n,!1):null!=r.defaultValue&&Ce(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=sn)}gn(i,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)qa(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));n=Ai(Ti.current),Ai(Pi.current),ja(t)?(n=t.stateNode,r=t.memoizedProps,n[On]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[On]=t,t.stateNode=n)}return null;case 13:return co(zi),r=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&ja(t):(r=null!==(i=e.memoizedState),n||null===i||null!==(i=e.child.sibling)&&(null!==(u=t.firstEffect)?(t.firstEffect=i,i.nextEffect=u):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&zi.current)?ju===wu&&(ju=xu):(ju!==wu&&ju!==xu||(ju=_u),0!==Du&&null!==Ou&&(Rc(Ou,Eu),Ic(Ou,Du)))),(n||r)&&(t.effectTag|=4),null);case 4:return Ri(),null;case 10:return ti(t),null;case 17:return vo(t.type)&&go(),null;case 19:if(co(zi),null===(r=t.memoizedState))return null;if(i=0!=(64&t.effectTag),null===(u=r.rendering)){if(i)Ja(r,!1);else if(ju!==wu||null!==e&&0!=(64&e.effectTag))for(u=t.child;null!==u;){if(null!==(e=Mi(u))){for(t.effectTag|=64,Ja(r,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)u=n,(i=r).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=u,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,u=e.dependencies,i.dependencies=null===u?null:{expirationTime:u.expirationTime,firstContext:u.firstContext,responders:u.responders}),r=r.sibling;return so(zi,1&zi.current|2),t.child}u=u.sibling}}else{if(!i)if(null!==(e=Mi(u))){if(t.effectTag|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Ja(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Uo()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,i=!0,Ja(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=r.last)?n.sibling=u:t.child=u,r.last=u)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Uo()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Uo(),n.sibling=null,t=zi.current,so(zi,i?1&t|2:1&t),n):null}throw Error(a(156,t.tag))}function Ka(e){switch(e.tag){case 1:vo(e.type)&&go();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Ri(),co(po),co(fo),0!=(64&(t=e.effectTag)))throw Error(a(285));return e.effectTag=-4097&t|64,e;case 5:return Ni(e),null;case 13:return co(zi),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return co(zi),null;case 4:return Ri(),null;case 10:return ti(e),null;default:return null}}function Xa(e,t){return{value:e,source:t,stack:ge(t)}}Ua=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ba=function(e,t,n,r,i){var a=e.memoizedProps;if(a!==r){var u,c,s=t.stateNode;switch(Ai(Pi.current),e=null,n){case"input":a=_e(s,a),r=_e(s,r),e=[];break;case"option":a=Pe(s,a),r=Pe(s,r),e=[];break;case"select":a=o({},a,{value:void 0}),r=o({},r,{value:void 0}),e=[];break;case"textarea":a=Te(s,a),r=Te(s,r),e=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(s.onclick=sn)}for(u in on(n,r),n=null,a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&null!=a[u])if("style"===u)for(c in s=a[u])s.hasOwnProperty(c)&&(n||(n={}),n[c]="");else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(O.hasOwnProperty(u)?e||(e=[]):(e=e||[]).push(u,null));for(u in r){var l=r[u];if(s=null!=a?a[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(null!=l||null!=s))if("style"===u)if(s){for(c in s)!s.hasOwnProperty(c)||l&&l.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in l)l.hasOwnProperty(c)&&s[c]!==l[c]&&(n||(n={}),n[c]=l[c])}else n||(e||(e=[]),e.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(e=e||[]).push(u,l)):"children"===u?s===l||"string"!=typeof l&&"number"!=typeof l||(e=e||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(O.hasOwnProperty(u)?(null!=l&&cn(i,u),e||s===l||(e=[])):(e=e||[]).push(u,l))}n&&(e=e||[]).push("style",n),i=e,(t.updateQueue=i)&&(t.effectTag|=4)}},qa=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var Za="function"==typeof WeakSet?WeakSet:Set;function eu(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ge(n)),null!==n&&ve(n.type),t=t.value,null!==e&&1===e.tag&&ve(e.type);try{console.error(t)}catch(e){setTimeout((function(){throw e}))}}function tu(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){mc(e,t)}else t.current=null}function nu(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Jo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(a(163))}function ru(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function ou(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function iu(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void ou(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Jo(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&pi(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}pi(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&gn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&zt(n)))));case 19:case 17:case 20:case 21:return}throw Error(a(163))}function au(e,t,n){switch("function"==typeof _c&&_c(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Ho(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var o=t;try{n()}catch(e){mc(o,e)}}e=e.next}while(e!==r)}))}break;case 1:tu(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){mc(e,t)}}(t,n);break;case 5:tu(t);break;case 4:lu(e,t,n)}}function uu(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&uu(t)}function cu(e){return 5===e.tag||3===e.tag||4===e.tag}function su(e){e:{for(var t=e.return;null!==t;){if(cu(t)){var n=t;break e}t=t.return}throw Error(a(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.effectTag&&(Ue(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||cu(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?function e(t,n,r){var o=t.tag,i=5===o||6===o;if(i)t=i?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=sn));else if(4!==o&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var o=t.tag,i=5===o||6===o;if(i)t=i?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==o&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function lu(e,t,n){for(var r,o,i=t,u=!1;;){if(!u){u=i.return;e:for(;;){if(null===u)throw Error(a(160));switch(r=u.stateNode,u.tag){case 5:o=!1;break e;case 3:case 4:r=r.containerInfo,o=!0;break e}u=u.return}u=!0}if(5===i.tag||6===i.tag){e:for(var c=e,s=i,l=n,f=s;;)if(au(c,f,l),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===s)break e;for(;null===f.sibling;){if(null===f.return||f.return===s)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}o?(c=r,s=i.stateNode,8===c.nodeType?c.parentNode.removeChild(s):c.removeChild(s)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,o=!0,i.child.return=i,i=i.child;continue}}else if(au(e,i,n),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(u=!1)}i.sibling.return=i.return,i=i.sibling}}function fu(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void ru(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,o=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[Sn]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Oe(n,r),an(e,o),t=an(e,r),o=0;o<i.length;o+=2){var u=i[o],c=i[o+1];"style"===u?nn(n,c):"dangerouslySetInnerHTML"===u?Le(n,c):"children"===u?Ue(n,c):K(n,u,c,t)}switch(e){case"input":Se(n,r);break;case"textarea":De(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Ce(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Ce(n,!!r.multiple,r.defaultValue,!0):Ce(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,zt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,Iu=Uo()),null!==n)e:for(e=n;;){if(5===e.tag)i=e.stateNode,r?"function"==typeof(i=i.style).setProperty?i.setProperty("display","none","important"):i.display="none":(i=e.stateNode,o=null!=(o=e.memoizedProps.style)&&o.hasOwnProperty("display")?o.display:null,i.style.display=tn("display",o));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(i=e.child.sibling).return=e,e=i;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void pu(t);case 19:return void pu(t);case 17:return}throw Error(a(163))}function pu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Za),t.forEach((function(t){var r=wc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var du="function"==typeof WeakMap?WeakMap:Map;function hu(e,t,n){(n=ci(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zu||(zu=!0,Mu=r),eu(e,t)},n}function yu(e,t,n){(n=ci(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return eu(e,t),r(o)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Fu?Fu=new Set([this]):Fu.add(this),eu(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var vu,gu=Math.ceil,mu=Y.ReactCurrentDispatcher,bu=Y.ReactCurrentOwner,wu=0,xu=3,_u=4,ku=0,Ou=null,Su=null,Eu=0,ju=wu,Pu=null,Cu=1073741823,Tu=1073741823,Au=null,Du=0,Ru=!1,Iu=0,Nu=null,zu=!1,Mu=null,Fu=null,Lu=!1,Uu=null,Bu=90,qu=null,Hu=0,Wu=null,Qu=0;function $u(){return 0!=(48&ku)?1073741821-(Uo()/10|0):0!==Qu?Qu:Qu=1073741821-(Uo()/10|0)}function Gu(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var r=Bo();if(0==(4&t))return 99===r?1073741823:1073741822;if(0!=(16&ku))return Eu;if(null!==n)e=Vo(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=Vo(e,150,100);break;case 97:case 96:e=Vo(e,5e3,250);break;case 95:e=2;break;default:throw Error(a(326))}return null!==Ou&&e===Eu&&--e,e}function Vu(e,t){if(50<Hu)throw Hu=0,Wu=null,Error(a(185));if(null!==(e=Ju(e,t))){var n=Bo();1073741823===t?0!=(8&ku)&&0==(48&ku)?Zu(e):(Ku(e),0===ku&&$o()):Ku(e),0==(4&ku)||98!==n&&99!==n||(null===qu?qu=new Map([[e,t]]):(void 0===(n=qu.get(e))||n>t)&&qu.set(e,t))}}function Ju(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,o=null;if(null===r&&3===e.tag)o=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){o=r.stateNode;break}r=r.return}return null!==o&&(Ou===o&&(ac(t),ju===_u&&Rc(o,Eu)),Ic(o,t)),o}function Yu(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!Dc(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Ku(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Qo(Zu.bind(null,e));else{var t=Yu(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=$u();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var o=e.callbackPriority;if(e.callbackExpirationTime===t&&o>=r)return;n!==Ro&&Oo(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?Qo(Zu.bind(null,e)):Wo(r,Xu.bind(null,e),{timeout:10*(1073741821-t)-Uo()}),e.callbackNode=t}}}function Xu(e,t){if(Qu=0,t)return Nc(e,t=$u()),Ku(e),null;var n=Yu(e);if(0!==n){if(t=e.callbackNode,0!=(48&ku))throw Error(a(327));if(yc(),e===Ou&&n===Eu||nc(e,n),null!==Su){var r=ku;ku|=16;for(var o=oc();;)try{cc();break}catch(t){rc(e,t)}if(ei(),ku=r,mu.current=o,1===ju)throw t=Pu,nc(e,n),Rc(e,n),Ku(e),t;if(null===Su)switch(o=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=ju,Ou=null,r){case wu:case 1:throw Error(a(345));case 2:Nc(e,2<n?2:n);break;case xu:if(Rc(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fc(o)),1073741823===Cu&&10<(o=Iu+500-Uo())){if(Ru){var i=e.lastPingedTime;if(0===i||i>=n){e.lastPingedTime=n,nc(e,n);break}}if(0!==(i=Yu(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=bn(pc.bind(null,e),o);break}pc(e);break;case _u:if(Rc(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fc(o)),Ru&&(0===(o=e.lastPingedTime)||o>=n)){e.lastPingedTime=n,nc(e,n);break}if(0!==(o=Yu(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Tu?r=10*(1073741821-Tu)-Uo():1073741823===Cu?r=0:(r=10*(1073741821-Cu)-5e3,0>(r=(o=Uo())-r)&&(r=0),(n=10*(1073741821-n)-o)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gu(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=bn(pc.bind(null,e),r);break}pc(e);break;case 5:if(1073741823!==Cu&&null!==Au){i=Cu;var u=Au;if(0>=(r=0|u.busyMinDurationMs)?r=0:(o=0|u.busyDelayMs,r=(i=Uo()-(10*(1073741821-i)-(0|u.timeoutMs||5e3)))<=o?0:o+r-i),10<r){Rc(e,n),e.timeoutHandle=bn(pc.bind(null,e),r);break}}pc(e);break;default:throw Error(a(329))}if(Ku(e),e.callbackNode===t)return Xu.bind(null,e)}}return null}function Zu(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!=(48&ku))throw Error(a(327));if(yc(),e===Ou&&t===Eu||nc(e,t),null!==Su){var n=ku;ku|=16;for(var r=oc();;)try{uc();break}catch(t){rc(e,t)}if(ei(),ku=n,mu.current=r,1===ju)throw n=Pu,nc(e,t),Rc(e,t),Ku(e),n;if(null!==Su)throw Error(a(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Ou=null,pc(e),Ku(e)}return null}function ec(e,t){var n=ku;ku|=1;try{return e(t)}finally{0===(ku=n)&&$o()}}function tc(e,t){var n=ku;ku&=-2,ku|=8;try{return e(t)}finally{0===(ku=n)&&$o()}}function nc(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,wn(n)),null!==Su)for(n=Su.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&go();break;case 3:Ri(),co(po),co(fo);break;case 5:Ni(r);break;case 4:Ri();break;case 13:case 19:co(zi);break;case 10:ti(r)}n=n.return}Ou=e,Su=Ec(e.current,null),Eu=t,ju=wu,Pu=null,Tu=Cu=1073741823,Au=null,Du=0,Ru=!1}function rc(e,t){for(;;){try{if(ei(),Li.current=va,Qi)for(var n=qi.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Bi=0,Wi=Hi=qi=null,Qi=!1,null===Su||null===Su.return)return ju=1,Pu=t,Su=null;e:{var o=e,i=Su.return,a=Su,u=t;if(t=Eu,a.effectTag|=2048,a.firstEffect=a.lastEffect=null,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u;if(0==(2&a.mode)){var s=a.alternate;s?(a.updateQueue=s.updateQueue,a.memoizedState=s.memoizedState,a.expirationTime=s.expirationTime):(a.updateQueue=null,a.memoizedState=null)}var l=0!=(1&zi.current),f=i;do{var p;if(p=13===f.tag){var d=f.memoizedState;if(null!==d)p=null!==d.dehydrated;else{var h=f.memoizedProps;p=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!l)}}if(p){var y=f.updateQueue;if(null===y){var v=new Set;v.add(c),f.updateQueue=v}else y.add(c);if(0==(2&f.mode)){if(f.effectTag|=64,a.effectTag&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var g=ci(1073741823,null);g.tag=2,si(a,g)}a.expirationTime=1073741823;break e}u=void 0,a=t;var m=o.pingCache;if(null===m?(m=o.pingCache=new du,u=new Set,m.set(c,u)):void 0===(u=m.get(c))&&(u=new Set,m.set(c,u)),!u.has(a)){u.add(a);var b=bc.bind(null,o,c,a);c.then(b,b)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);u=Error((ve(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ge(a))}5!==ju&&(ju=2),u=Xa(u,a),f=i;do{switch(f.tag){case 3:c=u,f.effectTag|=4096,f.expirationTime=t,li(f,hu(f,c,t));break e;case 1:c=u;var w=f.type,x=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof w.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===Fu||!Fu.has(x)))){f.effectTag|=4096,f.expirationTime=t,li(f,yu(f,c,t));break e}}f=f.return}while(null!==f)}Su=lc(Su)}catch(e){t=e;continue}break}}function oc(){var e=mu.current;return mu.current=va,null===e?va:e}function ic(e,t){e<Cu&&2<e&&(Cu=e),null!==t&&e<Tu&&2<e&&(Tu=e,Au=t)}function ac(e){e>Du&&(Du=e)}function uc(){for(;null!==Su;)Su=sc(Su)}function cc(){for(;null!==Su&&!Io();)Su=sc(Su)}function sc(e){var t=vu(e.alternate,e,Eu);return e.memoizedProps=e.pendingProps,null===t&&(t=lc(e)),bu.current=null,t}function lc(e){Su=e;do{var t=Su.alternate;if(e=Su.return,0==(2048&Su.effectTag)){if(t=Ya(t,Su,Eu),1===Eu||1!==Su.childExpirationTime){for(var n=0,r=Su.child;null!==r;){var o=r.expirationTime,i=r.childExpirationTime;o>n&&(n=o),i>n&&(n=i),r=r.sibling}Su.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Su.firstEffect),null!==Su.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Su.firstEffect),e.lastEffect=Su.lastEffect),1<Su.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Su:e.firstEffect=Su,e.lastEffect=Su))}else{if(null!==(t=Ka(Su)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Su.sibling))return t;Su=e}while(null!==Su);return ju===wu&&(ju=5),null}function fc(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function pc(e){var t=Bo();return Ho(99,dc.bind(null,e,t)),null}function dc(e,t){do{yc()}while(null!==Uu);if(0!=(48&ku))throw Error(a(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var o=fc(n);if(e.firstPendingTime=o,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Ou&&(Su=Ou=null,Eu=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,o=n.firstEffect):o=n:o=n.firstEffect,null!==o){var i=ku;ku|=32,bu.current=null,yn=$t;var u=dn();if(hn(u)){if("selectionStart"in u)var c={start:u.selectionStart,end:u.selectionEnd};else e:{var s=(c=(c=u.ownerDocument)&&c.defaultView||window).getSelection&&c.getSelection();if(s&&0!==s.rangeCount){c=s.anchorNode;var l=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{c.nodeType,f.nodeType}catch(e){c=null;break e}var p=0,d=-1,h=-1,y=0,v=0,g=u,m=null;t:for(;;){for(var b;g!==c||0!==l&&3!==g.nodeType||(d=p+l),g!==f||0!==s&&3!==g.nodeType||(h=p+s),3===g.nodeType&&(p+=g.nodeValue.length),null!==(b=g.firstChild);)m=g,g=b;for(;;){if(g===u)break t;if(m===c&&++y===l&&(d=p),m===f&&++v===s&&(h=p),null!==(b=g.nextSibling))break;m=(g=m).parentNode}g=b}c=-1===d||-1===h?null:{start:d,end:h}}else c=null}c=c||{start:0,end:0}}else c=null;vn={activeElementDetached:null,focusedElem:u,selectionRange:c},$t=!1,Nu=o;do{try{hc()}catch(e){if(null===Nu)throw Error(a(330));mc(Nu,e),Nu=Nu.nextEffect}}while(null!==Nu);Nu=o;do{try{for(u=e,c=t;null!==Nu;){var w=Nu.effectTag;if(16&w&&Ue(Nu.stateNode,""),128&w){var x=Nu.alternate;if(null!==x){var _=x.ref;null!==_&&("function"==typeof _?_(null):_.current=null)}}switch(1038&w){case 2:su(Nu),Nu.effectTag&=-3;break;case 6:su(Nu),Nu.effectTag&=-3,fu(Nu.alternate,Nu);break;case 1024:Nu.effectTag&=-1025;break;case 1028:Nu.effectTag&=-1025,fu(Nu.alternate,Nu);break;case 4:fu(Nu.alternate,Nu);break;case 8:lu(u,l=Nu,c),uu(l)}Nu=Nu.nextEffect}}catch(e){if(null===Nu)throw Error(a(330));mc(Nu,e),Nu=Nu.nextEffect}}while(null!==Nu);if(_=vn,x=dn(),w=_.focusedElem,c=_.selectionRange,x!==w&&w&&w.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(w.ownerDocument.documentElement,w)){null!==c&&hn(w)&&(x=c.start,void 0===(_=c.end)&&(_=x),"selectionStart"in w?(w.selectionStart=x,w.selectionEnd=Math.min(_,w.value.length)):(_=(x=w.ownerDocument||document)&&x.defaultView||window).getSelection&&(_=_.getSelection(),l=w.textContent.length,u=Math.min(c.start,l),c=void 0===c.end?u:Math.min(c.end,l),!_.extend&&u>c&&(l=c,c=u,u=l),l=pn(w,u),f=pn(w,c),l&&f&&(1!==_.rangeCount||_.anchorNode!==l.node||_.anchorOffset!==l.offset||_.focusNode!==f.node||_.focusOffset!==f.offset)&&((x=x.createRange()).setStart(l.node,l.offset),_.removeAllRanges(),u>c?(_.addRange(x),_.extend(f.node,f.offset)):(x.setEnd(f.node,f.offset),_.addRange(x))))),x=[];for(_=w;_=_.parentNode;)1===_.nodeType&&x.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<x.length;w++)(_=x[w]).element.scrollLeft=_.left,_.element.scrollTop=_.top}$t=!!yn,vn=yn=null,e.current=n,Nu=o;do{try{for(w=e;null!==Nu;){var k=Nu.effectTag;if(36&k&&iu(w,Nu.alternate,Nu),128&k){x=void 0;var O=Nu.ref;if(null!==O){var S=Nu.stateNode;switch(Nu.tag){case 5:x=S;break;default:x=S}"function"==typeof O?O(x):O.current=x}}Nu=Nu.nextEffect}}catch(e){if(null===Nu)throw Error(a(330));mc(Nu,e),Nu=Nu.nextEffect}}while(null!==Nu);Nu=null,No(),ku=i}else e.current=n;if(Lu)Lu=!1,Uu=e,Bu=t;else for(Nu=o;null!==Nu;)t=Nu.nextEffect,Nu.nextEffect=null,Nu=t;if(0===(t=e.firstPendingTime)&&(Fu=null),1073741823===t?e===Wu?Hu++:(Hu=0,Wu=e):Hu=0,"function"==typeof xc&&xc(n.stateNode,r),Ku(e),zu)throw zu=!1,e=Mu,Mu=null,e;return 0!=(8&ku)||$o(),null}function hc(){for(;null!==Nu;){var e=Nu.effectTag;0!=(256&e)&&nu(Nu.alternate,Nu),0==(512&e)||Lu||(Lu=!0,Wo(97,(function(){return yc(),null}))),Nu=Nu.nextEffect}}function yc(){if(90!==Bu){var e=97<Bu?97:Bu;return Bu=90,Ho(e,vc)}}function vc(){if(null===Uu)return!1;var e=Uu;if(Uu=null,0!=(48&ku))throw Error(a(331));var t=ku;for(ku|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:ru(5,n),ou(5,n)}}catch(t){if(null===e)throw Error(a(330));mc(e,t)}n=e.nextEffect,e.nextEffect=null,e=n}return ku=t,$o(),!0}function gc(e,t,n){si(e,t=hu(e,t=Xa(n,t),1073741823)),null!==(e=Ju(e,1073741823))&&Ku(e)}function mc(e,t){if(3===e.tag)gc(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){gc(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Fu||!Fu.has(r))){si(n,e=yu(n,e=Xa(t,e),1073741823)),null!==(n=Ju(n,1073741823))&&Ku(n);break}}n=n.return}}function bc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Ou===e&&Eu===n?ju===_u||ju===xu&&1073741823===Cu&&Uo()-Iu<500?nc(e,Eu):Ru=!0:Dc(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Ku(e)))}function wc(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=Gu(t=$u(),e,null)),null!==(e=Ju(e,t))&&Ku(e)}vu=function(e,t,n){var r=t.expirationTime;if(null!==e){var o=t.pendingProps;if(e.memoizedProps!==o||po.current)Ta=!0;else{if(r<n){switch(Ta=!1,t.tag){case 3:La(t),Pa();break;case 5:if(Ii(t),4&t.mode&&1!==n&&o.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:vo(t.type)&&wo(t);break;case 4:Di(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,o=t.type._context,so(Yo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Wa(e,t,n):(so(zi,1&zi.current),null!==(t=Va(e,t,n))?t.sibling:null);so(zi,1&zi.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return Ga(e,t,n);t.effectTag|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null),so(zi,zi.current),!r)return null}return Va(e,t,n)}Ta=!1}}else Ta=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,o=yo(t,fo.current),ri(t,n),o=Vi(null,t,r,e,o,n),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,vo(r)){var i=!0;wo(t)}else i=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ai(t);var u=r.getDerivedStateFromProps;"function"==typeof u&&yi(t,r,u,e),o.updater=vi,t.stateNode=o,o._reactInternalFiber=t,wi(t,r,e,n),t=Fa(null,t,r,!0,i,n)}else t.tag=0,Aa(null,t,o,n),t=t.child;return t;case 16:e:{if(o=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(o),1!==o._status)throw o._result;switch(o=o._result,t.type=o,i=t.tag=function(e){if("function"==typeof e)return Sc(e)?1:0;if(null!=e){if((e=e.$$typeof)===ce)return 11;if(e===fe)return 14}return 2}(o),e=Jo(o,e),i){case 0:t=za(null,t,o,e,n);break e;case 1:t=Ma(null,t,o,e,n);break e;case 11:t=Da(null,t,o,e,n);break e;case 14:t=Ra(null,t,o,Jo(o.type,e),r,n);break e}throw Error(a(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,za(e,t,r,o=t.elementType===r?o:Jo(r,o),n);case 1:return r=t.type,o=t.pendingProps,Ma(e,t,r,o=t.elementType===r?o:Jo(r,o),n);case 3:if(La(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,ui(e,t),fi(t,r,null,n),(r=t.memoizedState.element)===o)Pa(),t=Va(e,t,n);else{if((o=t.stateNode.hydrate)&&(xa=xn(t.stateNode.containerInfo.firstChild),wa=t,o=_a=!0),o)for(n=Ei(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Aa(e,t,r,n),Pa();t=t.child}return t;case 5:return Ii(t),null===e&&Sa(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,u=o.children,mn(r,o)?u=null:null!==i&&mn(r,i)&&(t.effectTag|=16),Na(e,t),4&t.mode&&1!==n&&o.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Aa(e,t,u,n),t=t.child),t;case 6:return null===e&&Sa(t),null;case 13:return Wa(e,t,n);case 4:return Di(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Si(t,null,r,n):Aa(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Da(e,t,r,o=t.elementType===r?o:Jo(r,o),n);case 7:return Aa(e,t,t.pendingProps,n),t.child;case 8:case 12:return Aa(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,u=t.memoizedProps,i=o.value;var c=t.type._context;if(so(Yo,c._currentValue),c._currentValue=i,null!==u)if(c=u.value,0===(i=Mr(c,i)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(c,i):1073741823))){if(u.children===o.children&&!po.current){t=Va(e,t,n);break e}}else for(null!==(c=t.child)&&(c.return=t);null!==c;){var s=c.dependencies;if(null!==s){u=c.child;for(var l=s.firstContext;null!==l;){if(l.context===r&&0!=(l.observedBits&i)){1===c.tag&&((l=ci(n,null)).tag=2,si(c,l)),c.expirationTime<n&&(c.expirationTime=n),null!==(l=c.alternate)&&l.expirationTime<n&&(l.expirationTime=n),ni(c.return,n),s.expirationTime<n&&(s.expirationTime=n);break}l=l.next}}else u=10===c.tag&&c.type===t.type?null:c.child;if(null!==u)u.return=c;else for(u=c;null!==u;){if(u===t){u=null;break}if(null!==(c=u.sibling)){c.return=u.return,u=c;break}u=u.return}c=u}Aa(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(i=t.pendingProps).children,ri(t,n),r=r(o=oi(o,i.unstable_observedBits)),t.effectTag|=1,Aa(e,t,r,n),t.child;case 14:return i=Jo(o=t.type,t.pendingProps),Ra(e,t,o,i=Jo(o.type,i),r,n);case 15:return Ia(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Jo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,vo(r)?(e=!0,wo(t)):e=!1,ri(t,n),mi(t,r,o),wi(t,r,o,n),Fa(null,t,r,!0,e,n);case 19:return Ga(e,t,n)}throw Error(a(156,t.tag))};var xc=null,_c=null;function kc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Oc(e,t,n,r){return new kc(e,t,n,r)}function Sc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ec(e,t){var n=e.alternate;return null===n?((n=Oc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function jc(e,t,n,r,o,i){var u=2;if(r=e,"function"==typeof e)Sc(e)&&(u=1);else if("string"==typeof e)u=5;else e:switch(e){case ne:return Pc(n.children,o,i,t);case ue:u=8,o|=7;break;case re:u=8,o|=1;break;case oe:return(e=Oc(12,n,t,8|o)).elementType=oe,e.type=oe,e.expirationTime=i,e;case se:return(e=Oc(13,n,t,o)).type=se,e.elementType=se,e.expirationTime=i,e;case le:return(e=Oc(19,n,t,o)).elementType=le,e.expirationTime=i,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case ie:u=10;break e;case ae:u=9;break e;case ce:u=11;break e;case fe:u=14;break e;case pe:u=16,r=null;break e;case de:u=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Oc(u,n,t,o)).elementType=e,t.type=r,t.expirationTime=i,t}function Pc(e,t,n,r){return(e=Oc(7,e,r,t)).expirationTime=n,e}function Cc(e,t,n){return(e=Oc(6,e,null,t)).expirationTime=n,e}function Tc(e,t,n){return(t=Oc(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ac(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Dc(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Rc(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Ic(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Nc(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function zc(e,t,n,r){var o=t.current,i=$u(),u=di.suspense;i=Gu(i,o,u);e:if(n){t:{if(Ze(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(a(170));var c=n;do{switch(c.tag){case 3:c=c.stateNode.context;break t;case 1:if(vo(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break t}}c=c.return}while(null!==c);throw Error(a(171))}if(1===n.tag){var s=n.type;if(vo(s)){n=bo(n,s,c);break e}}n=c}else n=lo;return null===t.context?t.context=n:t.pendingContext=n,(t=ci(i,u)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),si(o,t),Vu(o,i),i}function Mc(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Fc(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Lc(e,t){Fc(e,t),(e=e.alternate)&&Fc(e,t)}function Uc(e,t,n){var r=new Ac(e,t,n=null!=n&&!0===n.hydrate),o=Oc(3,null,null,2===t?7:1===t?3:0);r.current=o,o.stateNode=r,ai(o),e[En]=r.current,n&&0!==t&&function(e,t){var n=Xe(t);Et.forEach((function(e){ht(e,t,n)})),jt.forEach((function(e){ht(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function Bc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function qc(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i._internalRoot;if("function"==typeof o){var u=o;o=function(){var e=Mc(a);u.call(e)}}zc(t,a,e,o)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Uc(e,0,t?{hydrate:!0}:void 0)}(n,r),a=i._internalRoot,"function"==typeof o){var c=o;o=function(){var e=Mc(a);c.call(e)}}tc((function(){zc(t,a,e,o)}))}return Mc(a)}function Hc(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Wc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Bc(t))throw Error(a(200));return Hc(e,t,null,n)}Uc.prototype.render=function(e){zc(e,this._internalRoot,null,null)},Uc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;zc(null,e,null,(function(){t[En]=null}))},yt=function(e){if(13===e.tag){var t=Vo($u(),150,100);Vu(e,t),Lc(e,t)}},vt=function(e){13===e.tag&&(Vu(e,3),Lc(e,3))},gt=function(e){if(13===e.tag){var t=$u();Vu(e,t=Gu(t,e,null)),Lc(e,t)}},P=function(e,t,n){switch(t){case"input":if(Se(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Tn(r);if(!o)throw Error(a(90));xe(r),Se(r,o)}}}break;case"textarea":De(e,n);break;case"select":null!=(t=n.value)&&Ce(e,!!n.multiple,t,!1)}},I=ec,N=function(e,t,n,r,o){var i=ku;ku|=4;try{return Ho(98,e.bind(null,t,n,r,o))}finally{0===(ku=i)&&$o()}},z=function(){0==(49&ku)&&(function(){if(null!==qu){var e=qu;qu=null,e.forEach((function(e,t){Nc(t,e),Ku(t)})),$o()}}(),yc())},M=function(e,t){var n=ku;ku|=2;try{return e(t)}finally{0===(ku=n)&&$o()}};var Qc,$c,Gc={Events:[Pn,Cn,Tn,E,k,Mn,function(e){ot(e,zn)},D,R,Kt,ut,yc,{current:!1}]};$c=(Qc={findFiberByHostInstance:jn,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}).findFiberByHostInstance,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);xc=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(e){}},_c=function(e){try{t.onCommitFiberUnmount(n,e)}catch(e){}}}catch(e){}}(o({},Qc,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=nt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return $c?$c(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null})),t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gc,t.createPortal=Wc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=nt(t))?null:e.stateNode},t.flushSync=function(e,t){if(0!=(48&ku))throw Error(a(187));var n=ku;ku|=1;try{return Ho(99,e.bind(null,t))}finally{ku=n,$o()}},t.hydrate=function(e,t,n){if(!Bc(t))throw Error(a(200));return qc(null,e,t,!0,n)},t.render=function(e,t,n){if(!Bc(t))throw Error(a(200));return qc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Bc(e))throw Error(a(40));return!!e._reactRootContainer&&(tc((function(){qc(null,null,e,!1,(function(){e._reactRootContainer=null,e[En]=null}))})),!0)},t.unstable_batchedUpdates=ec,t.unstable_createPortal=function(e,t){return Wc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bc(n))throw Error(a(200));if(null==e||void 0===e._reactInternalFiber)throw Error(a(38));return qc(e,t,n,!1,r)},t.version="16.13.1"},function(e,t,n){"use strict";e.exports=n(426)},function(e,t,n){"use strict";
33
+ /** @license React v0.19.1
34
+ * scheduler.production.min.js
35
+ *
36
+ * Copyright (c) Facebook, Inc. and its affiliates.
37
+ *
38
+ * This source code is licensed under the MIT license found in the
39
+ * LICENSE file in the root directory of this source tree.
40
+ */var r,o,i,a,u;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,s=null,l=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(l,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(l,0))},o=function(e,t){s=setTimeout(e,t)},i=function(){clearTimeout(s)},a=function(){return!1},u=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,h=window.setTimeout,y=window.clearTimeout;if("undefined"!=typeof console){var v=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var m=!1,b=null,w=-1,x=5,_=0;a=function(){return t.unstable_now()>=_},u=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):x=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,O=k.port2;k.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();_=e+x;try{b(!0,e)?O.postMessage(null):(m=!1,b=null)}catch(e){throw O.postMessage(null),e}}else m=!1},r=function(e){b=e,m||(m=!0,O.postMessage(null))},o=function(e,n){w=h((function(){e(t.unstable_now())}),n)},i=function(){y(w),w=-1}}function S(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<P(o,t)))break e;e[r]=t,e[n]=o,n=r}}function E(e){return void 0===(e=e[0])?null:e}function j(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,a=e[i],u=i+1,c=e[u];if(void 0!==a&&0>P(a,n))void 0!==c&&0>P(c,a)?(e[r]=c,e[u]=n,r=u):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==c&&0>P(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],T=[],A=1,D=null,R=3,I=!1,N=!1,z=!1;function M(e){for(var t=E(T);null!==t;){if(null===t.callback)j(T);else{if(!(t.startTime<=e))break;j(T),t.sortIndex=t.expirationTime,S(C,t)}t=E(T)}}function F(e){if(z=!1,M(e),!N)if(null!==E(C))N=!0,r(L);else{var t=E(T);null!==t&&o(F,t.startTime-e)}}function L(e,n){N=!1,z&&(z=!1,i()),I=!0;var r=R;try{for(M(n),D=E(C);null!==D&&(!(D.expirationTime>n)||e&&!a());){var u=D.callback;if(null!==u){D.callback=null,R=D.priorityLevel;var c=u(D.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?D.callback=c:D===E(C)&&j(C),M(n)}else j(C);D=E(C)}if(null!==D)var s=!0;else{var l=E(T);null!==l&&o(F,l.startTime-n),s=!1}return s}finally{D=null,R=r,I=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=u;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||I||(N=!0,r(L))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return E(C)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,a){var u=t.unstable_now();if("object"==typeof a&&null!==a){var c=a.delay;c="number"==typeof c&&0<c?u+c:u,a="number"==typeof a.timeout?a.timeout:U(e)}else a=U(e),c=u;return e={id:A++,callback:n,priorityLevel:e,startTime:c,expirationTime:a=c+a,sortIndex:-1},c>u?(e.sortIndex=c,S(T,e),null===E(C)&&e===E(T)&&(z?i():z=!0,o(F,c-u))):(e.sortIndex=a,S(C,e),N||I||(N=!0,r(L))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();M(e);var n=E(C);return n!==D&&null!==D&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<D.expirationTime||a()},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}}},function(e,t,n){"use strict";var r=n(428);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";
41
+ /** @license React v16.13.1
42
+ * react-is.production.min.js
43
+ *
44
+ * Copyright (c) Facebook, Inc. and its affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case a:case c:case u:case h:return e;default:switch(e=e&&e.$$typeof){case l:case d:case g:case v:case s:return e;default:return t}}case i:return t}}}function k(e){return _(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=s,t.Element=o,t.ForwardRef=d,t.Fragment=a,t.Lazy=g,t.Memo=v,t.Portal=i,t.Profiler=c,t.StrictMode=u,t.Suspense=h,t.isAsyncMode=function(e){return k(e)||_(e)===f},t.isConcurrentMode=k,t.isContextConsumer=function(e){return _(e)===l},t.isContextProvider=function(e){return _(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===g},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===c},t.isStrictMode=function(e){return _(e)===u},t.isSuspense=function(e){return _(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===c||e===u||e===h||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===s||e.$$typeof===l||e.$$typeof===d||e.$$typeof===b||e.$$typeof===w||e.$$typeof===x||e.$$typeof===m)},t.typeOf=_},function(e,t,n){"use strict";var r=n(153),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,o=e.length;r<o;r++)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},u=function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},c=function(e,t,n){for(var r in e)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))};e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),"[object Array]"===o.call(e)?a(e,t,i):"string"==typeof e?u(e,t,i):c(e,t,i)}},function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,i=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==i.call(t))throw new TypeError(r+t);for(var n,a=o.call(arguments,1),u=function(){if(this instanceof n){var r=t.apply(this,a.concat(o.call(arguments)));return Object(r)===r?r:this}return t.apply(e,a.concat(o.call(arguments)))},c=Math.max(0,t.length-a.length),s=[],l=0;l<c;l++)s.push("$"+l);if(n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(u),t.prototype){var f=function(){};f.prototype=t.prototype,n.prototype=new f,f.prototype=null}return n}},function(e,t,n){"use strict";var r=n(223),o=n(48),i=n(225),a=n(226),u=n(439),c=r(a());o(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";var r=Array.prototype.slice,o=n(224),i=Object.keys,a=i?function(e){return i(e)}:n(435),u=Object.keys;a.shim=function(){Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return o(e)?u(r.call(e)):u(e)}):Object.keys=a;return Object.keys||a},e.exports=a},function(e,t,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=n(224),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===i.call(e),r=a(e),u=t&&"[object String]"===i.call(e),p=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=s&&n;if(u&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)p.push(String(y));if(r&&e.length>0)for(var v=0;v<e.length;++v)p.push(String(v));else for(var g in e)h&&"prototype"===g||!o.call(e,g)||p.push(String(g));if(c)for(var m=function(e){if("undefined"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)m&&"constructor"===l[b]||!o.call(e,l[b])||p.push(l[b]);return p}}e.exports=r},function(e,t,n){"use strict";var r=n(113)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(113),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(113),o=n(223),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")?o(n):n}},function(e,t,n){"use strict";var r=n(48),o=n(226);e.exports=function(){var e=o();return r(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,n){var r=n(55),o=n(442),i=n(443);e.exports=function(e){var t=r(e);return i(t,o(t))+1}},function(e,t){e.exports=function(e){var t=new Date(e.getTime()),n=t.getTimezoneOffset();return t.setSeconds(0,0),6e4*n+t.getTime()%6e4}},function(e,t,n){var r=n(55);e.exports=function(e){var t=r(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}},function(e,t,n){var r=n(444);e.exports=function(e,t){var n=r(e),o=r(t),i=n.getTime()-6e4*n.getTimezoneOffset(),a=o.getTime()-6e4*o.getTimezoneOffset();return Math.round((i-a)/864e5)}},function(e,t,n){var r=n(55);e.exports=function(e){var t=r(e);return t.setHours(0,0,0,0),t}},function(e,t,n){var r=n(55),o=n(156),i=n(447);e.exports=function(e){var t=r(e),n=o(t).getTime()-i(t).getTime();return Math.round(n/6048e5)+1}},function(e,t,n){var r=n(55);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,o=r(e),i=o.getDay(),a=(i<n?7:0)+i-n;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}},function(e,t,n){var r=n(228),o=n(156);e.exports=function(e){var t=r(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),o(n)}},function(e,t,n){var r=n(227);e.exports=function(e){if(r(e))return!isNaN(e);throw new TypeError(toString.call(e)+" is not an instance of Date")}},function(e,t){throw new Error("Module parse failed: Unexpected token (1:8)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n> declare module 'date-fns/locale/en' { }\n| ")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:8)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n> declare module 'date-fns/locale/es' { }\n| ")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:8)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n> declare module 'date-fns/locale/fr' { }\n| ")},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t,n){var r=n(198);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),u=a.length;u--;){var c=a[e?u:++o];if(!1===n(i[c],c,i))break}return t}}},function(e,t){e.exports=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r}},function(e,t,n){var r=n(64),o=n(80),i=n(22),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(53),o=n(159);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t){e.exports=function(e){return e!=e}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},function(e,t,n){var r=n(210),o=n(238),i=n(142),a=r&&1/i(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=a},function(e,t,n){var r=n(57)(n(242));e.exports=r},function(e,t,n){var r=n(465),o=n(218),i=n(82),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(243),o=n(162),i=n(469),a=n(22);e.exports=function(e,t){return(a(e)?r:o)(e,i(t))}},function(e,t,n){var r=n(46);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,u=Object(n);(t?a--:++a<i)&&!1!==o(u[a],a,u););return n}}},function(e,t,n){var r=n(82);e.exports=function(e){return"function"==typeof e?e:r}},function(e,t,n){var r=n(246);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(70),o=n(79);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(70),o=n(111);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(70),o=n(143);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(70),o=n(219);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(163),o=n(477),i=n(478),a=n(479),u=n(248);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return u(e,n);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Set]":return new c;case"[object Symbol]":return a(e)}}},function(e,t,n){var r=n(163);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(64),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},function(e,t,n){var r=n(481),o=n(65),i=n(145),a=i&&i.isMap,u=a?o(a):r;e.exports=u},function(e,t,n){var r=n(66),o=n(39);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(483),o=n(65),i=n(145),a=i&&i.isSet,u=a?o(a):r;e.exports=u},function(e,t,n){var r=n(66),o=n(39);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},function(e,t,n){(function(e){!function(e){"use strict";var t,n=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),r=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),i=!n||((t=new n).append("s"," &"),"s=+%26"===t.toString()),a=l.prototype,u=!(!e.Symbol||!e.Symbol.iterator);if(!(n&&r&&o&&i)){var c;a.append=function(e,t){y(this.__URLSearchParams__,e,t)},a.delete=function(e){delete this.__URLSearchParams__[e]},a.get=function(e){var t=this.__URLSearchParams__;return this.has(e)?t[e][0]:null},a.getAll=function(e){var t=this.__URLSearchParams__;return this.has(e)?t[e].slice(0):[]},a.has=function(e){return g(this.__URLSearchParams__,e)},a.set=function(e,t){this.__URLSearchParams__[e]=[""+t]},a.toString=function(){var e,t,n,r,o=this.__URLSearchParams__,i=[];for(t in o)for(n=f(t),e=0,r=o[t];e<r.length;e++)i.push(n+"="+f(r[e]));return i.join("&")},!!o&&n&&!r&&e.Proxy?(c=new Proxy(n,{construct:function(e,t){return new e(new l(t[0]).toString())}})).toString=Function.prototype.toString.bind(l):c=l,Object.defineProperty(e,"URLSearchParams",{value:c});var s=e.URLSearchParams.prototype;s.polyfill=!0,s.forEach=s.forEach||function(e,t){var n=h(this.toString());Object.getOwnPropertyNames(n).forEach((function(r){n[r].forEach((function(n){e.call(t,n,r,this)}),this)}),this)},s.sort=s.sort||function(){var e,t,n,r=h(this.toString()),o=[];for(e in r)o.push(e);for(o.sort(),t=0;t<o.length;t++)this.delete(o[t]);for(t=0;t<o.length;t++){var i=o[t],a=r[i];for(n=0;n<a.length;n++)this.append(i,a[n])}},s.keys=s.keys||function(){var e=[];return this.forEach((function(t,n){e.push(n)})),d(e)},s.values=s.values||function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},s.entries=s.entries||function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),d(e)},u&&(s[e.Symbol.iterator]=s[e.Symbol.iterator]||s.entries)}function l(e){((e=e||"")instanceof URLSearchParams||e instanceof l)&&(e=e.toString()),this.__URLSearchParams__=h(e)}function f(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function p(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(e){return decodeURIComponent(e)}))}function d(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return u&&(n[e.Symbol.iterator]=function(){return n}),n}function h(e){var t={};if("object"==typeof e)if(v(e))for(var n=0;n<e.length;n++){var r=e[n];if(!v(r)||2!==r.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");y(t,r[0],r[1])}else for(var o in e)e.hasOwnProperty(o)&&y(t,o,e[o]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var i=e.split("&"),a=0;a<i.length;a++){var u=i[a],c=u.indexOf("=");-1<c?y(t,p(u.slice(0,c)),p(u.slice(c+1))):u&&y(t,p(u),"")}}return t}function y(e,t,n){var r="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);g(e,t)?e[t].push(r):e[t]=[r]}function v(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==e?e:"undefined"!=typeof window?window:this)}).call(this,n(33))},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(2)),a=r(n(25)),u=r(n(9));function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(){return(l=(0,u.default)(o.default.mark((function e(t,n){var r,i,u,c,l,f,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.id,i=(0,a.default)(n,["id"]),e.next=3,t.query({doctype:"io.cozy.terms",selector:{termsId:r,version:i.version},limit:1});case 3:if(u=e.sent,!(c=u.data)||!c.length){e.next=13;break}if((l=c[0]).termsId!=r||l.version!=i.version||l.url==i.url){e.next=11;break}return f=s(s({_type:"io.cozy.terms"},l),{},{url:i.url}),e.next=11,t.save(f);case 11:e.next=16;break;case 13:return p=s(s({_type:"io.cozy.terms"},i),{},{termsId:r,accepted:!0,acceptedAt:new Date}),e.next=16,t.save(p);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var f={save:function(e,t){return l.apply(this,arguments)}};t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.APP_TYPE=void 0;t.APP_TYPE={KONNECTOR:"konnector",WEBAPP:"webapp"}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.initialize=t.initializeFromDOM=t.getTemplateData=t.initializeFromRemote=t.enable=t.resetFlags=t.listFlags=void 0;var o=r(n(3)),i=r(n(7)),a=r(n(5)),u=r(n(9)),c=r(n(24)),s=r(n(488)),l=n(18);function f(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var d=new s.default,h=function(){var e=[].slice.call(arguments);return 1===e.length?d.get(e[0]):(d.set(e[0],e[1]),e[1])},y=function(){return d.keys().sort()};t.listFlags=y;var v=function(){y().forEach((function(e){return d.remove(e)}))};t.resetFlags=v;var g=function(e){var t;if(Array.isArray(e)?(console.log("flags.enable: Deprecation warning: prefer to use an object { flag1: true, flag2: true } instead of an array when using flags.enable"),t=e.map((function(e){return[e,!0]}))):"object"==typeof e&&(t=Object.entries(e)),t){var n,r=f(t);try{for(r.s();!(n=r.n()).done;){var o=(0,c.default)(n.value,2),i=o[0],a=o[1];h(i,a)}}catch(e){r.e(e)}finally{r.f()}}};t.enable=g;var m=function(){var e=(0,u.default)(a.default.mark((function e(t){var n,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.query((0,l.Q)("io.cozy.settings").getById("flags"));case 2:n=e.sent,r=n.data.attributes,g(r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.initializeFromRemote=m;var b=function(e){if("undefined"==typeof document)return null;var t,n=document.querySelector("[data-cozy]"),r=document.querySelector("[data-cozy-".concat(e,"]"));try{return n?JSON.parse(n.dataset.cozy)[e]:r?(console.warn('Prefer to use [data-cozy] to store template data. <div data-cozy="{{.CozyData}}></div>. "'),JSON.parse(r.dataset["cozy".concat((t=e,t[0].toUpperCase()+t.slice(1)))])):null}catch(e){return null}};t.getTemplateData=b;var w=function(){var e=(0,u.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b("flags")){e.next=3;break}return e.abrupt("return",!1);case 3:return g(t),e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.initializeFromDOM=w;var x=function(){var e=(0,u.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:if(0!=e.sent){e.next=6;break}return e.next=6,m(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.initialize=x;var _=function(){function e(t){(0,o.default)(this,e),this.client=t,this.handleLogin=this.handleLogin.bind(this),this.handleLogout=this.handleLogout.bind(this),this.client.on("login",this.handleLogin),this.client.on("logout",this.handleLogout),this.setupInitializing(),t.isLogged&&this.handleLogin()}var t,n,r;return(0,i.default)(e,[{key:"refresh",value:(r=(0,u.default)(a.default.mark((function e(){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h.initializeFromRemote(this.client);case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"setupInitializing",value:function(){var e=this;this.initializing=new Promise((function(t){e.resolveInitializing=t}))}},{key:"handleLogin",value:(n=(0,u.default)(a.default.mark((function e(){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h.initialize(this.client);case 2:this.resolveInitializing(),this.client.emit("plugin:flag:login");case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleLogout",value:(t=(0,u.default)(a.default.mark((function e(){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.reset(),this.setupInitializing(),this.client.emit("plugin:flag:logout");case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();_.pluginName="flags",h.store=d,h.list=y,h.reset=v,h.enable=g,h.initializeFromRemote=m,h.initializeFromDOM=w,h.initialize=x,h.plugin=_;var k=h;t.default=k},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(24)),i=r(n(3)),a=r(n(7)),u=r(n(52)),c=r(n(489)),s=function(){function e(){(0,i.default)(this,e),this.store={},"undefined"!=typeof localStorage&&(this.longtermStore=c.default),this.restore()}return(0,a.default)(e,[{key:"restore",value:function(){if(this.longtermStore)for(var e=this.longtermStore.getAll(),t=0,n=Object.entries(e);t<n.length;t++){var r=(0,o.default)(n[t],2),i=r[0],a=r[1];this.store[i]=a,this.emit("change",i)}}},{key:"keys",value:function(){return Object.keys(this.store)}},{key:"get",value:function(e){return this.store.hasOwnProperty(e)||(this.store[e]=null),this.store[e]}},{key:"set",value:function(e,t){this.longtermStore&&this.longtermStore.setItem(e,t),this.store[e]=t,this.emit("change",e)}},{key:"remove",value:function(e){delete this.store[e],this.longtermStore&&this.longtermStore.removeItem(e),this.emit("change",e)}}]),e}();u.default.mixin(s);var l=s;t.default=l},function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){c=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.getKey=t.prefix=void 0;t.prefix="flag__";var i=function(e){return"flag__"+e};t.getKey=i;var a=function(){return Object.keys(localStorage).filter((function(e){return 0===e.indexOf("flag__")})).map((function(e){return e.replace("flag__","")}))},u=function(e){var t=localStorage.getItem(i(e));return t?JSON.parse(t):t},c=function(e){return localStorage.removeItem(i(e))},s={getAll:function(){var e,t={},n=r(a());try{for(n.s();!(e=n.n()).done;){var o=e.value;t[o]=u(o)}}catch(e){n.e(e)}finally{n.f()}return t},getItem:u,setItem:function(e,t){var n=JSON.stringify(t);return localStorage.setItem(i(e),n)},clearAll:function(){var e,t=r(a());try{for(t.s();!(e=t.n()).done;){var n=e.value;c(n)}}catch(e){t.e(e)}finally{t.f()}},removeItem:c};t.default=s},function(e,t,n){var r=n(491),o=n(157),i=n(53);e.exports=function(e,t){return r(e,i(t,3),o)}},function(e,t){e.exports=function(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}},function(e,t,n){var r=n(67),o=n(252),i=n(493),a=n(68);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},function(e,t,n){var r=n(110),o=n(194);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(166);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(496),o=n(132),i=n(497),a=n(63);e.exports=function(e,t,n){return e=a(e),n=null==n?0:r(i(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}},function(e,t){e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t,n){var r=n(498);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(254);e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,n){"use strict";var r=n(500),o=n(501),i=n(255);e.exports={formats:i,parse:o,stringify:r}},function(e,t,n){"use strict";var r=n(168),o=n(255),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},u=Array.isArray,c=Array.prototype.push,s=function(e,t){c.apply(e,u(t)?t:[t])},l=Date.prototype.toISOString,f=o.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,o,i,a,c,l,f,d,h,y,v,g){var m,b=t;if("function"==typeof l?b=l(n,b):b instanceof Date?b=h(b):"comma"===o&&u(b)&&(b=r.maybeMap(b,(function(e){return e instanceof Date?h(e):e})).join(",")),null===b){if(i)return c&&!v?c(n,p.encoder,g,"key"):n;b=""}if("string"==typeof(m=b)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||r.isBuffer(b))return c?[y(v?n:c(n,p.encoder,g,"key"))+"="+y(c(b,p.encoder,g,"value"))]:[y(n)+"="+y(String(b))];var w,x=[];if(void 0===b)return x;if(u(l))w=l;else{var _=Object.keys(b);w=f?_.sort(f):_}for(var k=0;k<w.length;++k){var O=w[k],S=b[O];if(!a||null!==S){var E=u(b)?"function"==typeof o?o(n,O):n:n+(d?"."+O:"["+O+"]");s(x,e(S,E,o,i,a,c,l,f,d,h,y,v,g))}}return x};e.exports=function(e,t){var n,r=e,c=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=p.filter;return("function"==typeof e.filter||u(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof c.filter?r=(0,c.filter)("",r):u(c.filter)&&(n=c.filter);var l,f=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=a[l];n||(n=Object.keys(r)),c.sort&&n.sort(c.sort);for(var y=0;y<n.length;++y){var v=n[y];c.skipNulls&&null===r[v]||s(f,d(r[v],v,h,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.formatter,c.encodeValuesOnly,c.charset))}var g=f.join(c.delimiter),m=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),g.length>0?m+g:""}},function(e,t,n){"use strict";var r=n(168),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},u=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,u=n.depth>0&&/(\[[^[\]]*])/.exec(i),s=u?i.slice(0,u.index):i,l=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;l.push(s)}for(var f=0;n.depth>0&&null!==(u=a.exec(i))&&f<n.depth;){if(f+=1,!n.plainObjects&&o.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(u[1])}return u&&l.push("["+i.slice(u.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var a,u=e[i];if("[]"===u&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var s="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,l=parseInt(s,10);n.parseArrays||""!==s?!isNaN(l)&&u!==s&&String(l)===s&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(a=[])[l]=o:a[s]=o:a={0:o}}o=a}return o}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var n,s={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=l.split(t.delimiter,f),d=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<p.length;++n)0===p[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[n]?h="utf-8":"utf8=%26%2310003%3B"===p[n]&&(h="iso-8859-1"),d=n,n=p.length);for(n=0;n<p.length;++n)if(n!==d){var y,v,g=p[n],m=g.indexOf("]="),b=-1===m?g.indexOf("="):m+1;-1===b?(y=t.decoder(g,a.decoder,h,"key"),v=t.strictNullHandling?null:""):(y=t.decoder(g.slice(0,b),a.decoder,h,"key"),v=r.maybeMap(c(g.slice(b+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===h&&(v=u(v)),g.indexOf("[]=")>-1&&(v=i(v)?[v]:v),o.call(s,y)?s[y]=r.combine(s[y],v):s[y]=v}return s}(e,n):e,f=n.plainObjects?Object.create(null):{},p=Object.keys(l),d=0;d<p.length;++d){var h=p[d],y=s(h,l[h],n,"string"==typeof e);f=r.merge(f,y,n)}return r.compact(f)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=function(){function e(t){(0,o.default)(this,e),this.token=t||""}return(0,i.default)(e,[{key:"toAuthHeader",value:function(){return"Bearer "+this.token}},{key:"toBasicAuth",value:function(){return"user:".concat(this.token,"@")}},{key:"getAccessToken",value:function(){return this.token}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(504);e.exports=new r(n(505))},function(e,t,n){"use strict";function r(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}r.prototype.define=function(e,t){for(var n in e){var r=e[n].map((function(e){return e.toLowerCase()}));n=n.toLowerCase();for(var o=0;o<r.length;o++){if("*"!=(i=r[o])[0]){if(!t&&i in this._types)throw new Error('Attempt to change mapping for "'+i+'" extension from "'+this._types[i]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+i+'" from the list of extensions for "'+n+'".');this._types[i]=n}}if(t||!this._extensions[n]){var i=r[0];this._extensions[n]="*"!=i[0]?i:i.substr(1)}}},r.prototype.getType=function(e){var t=(e=String(e)).replace(/^.*[/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),r=t.length<e.length;return(n.length<t.length-1||!r)&&this._types[n]||null},r.prototype.getExtension=function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null},e.exports=r},function(e,t){e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["*xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/urc-ressheet+xml":["rsheet"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e,t){return null!=e&&n.call(e,t)}},function(e,t,n){var r=n(216),o=n(214);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.KONNECTORS_DOCTYPE=void 0;var i=o(n(5)),a=o(n(9)),u=o(n(3)),c=o(n(7)),s=o(n(8)),l=o(n(10)),f=o(n(6)),p=o(n(172)),d=o(n(250)),h=r(n(261)),y=n(30);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}t.KONNECTORS_DOCTYPE="io.cozy.konnectors";var g=function(e){(0,s.default)(d,e);var t,n,r,o,l,f=v(d);function d(e){var t;return(0,u.default)(this,d),(t=f.call(this,e)).doctype="io.cozy.konnectors",t.endpoint="/konnectors/",t}return(0,c.default)(d,[{key:"create",value:(l=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("create() method is not available for konnectors");case 1:case"end":return e.stop()}}),e)}))),function(){return l.apply(this,arguments)})},{key:"destroy",value:(o=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("destroy() method is not available for konnectors");case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"findTriggersBySlug",value:(r=(0,a.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new h.default(this.stackClient),e.next=3,n.all({limit:null});case 3:return r=e.sent,o=r.data,e.abrupt("return",o.map((function(e){return e.attributes})).filter((function(e){return(0,h.isForKonnector)(e,t)})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"launch",value:(n=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,c=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},r=new h.default(this.stackClient),e.next=4,this.findTriggersBySlug(t);case 4:if(o=e.sent,1!==(a=n.accountId?o.filter((function(e){return(0,h.isForAccount)(e,n.accountId)})):o).length){e.next=10;break}return e.abrupt("return",r.launch(o[0]));case 10:if(u=JSON.stringify((0,p.default)({slug:t,accountId:n.accountId})),0!==a.length){e.next=15;break}throw new Error("No trigger found for ".concat(u));case 15:if(!(a.length>1)){e.next=17;break}throw new Error("More than 1 trigger found for ".concat(u));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"update",value:(t=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,c=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=c.length>1&&void 0!==c[1]?c[1]:{},t){e.next=3;break}throw new Error("Cannot call update with no slug");case 3:return r=n.source||null,o=n.sync||!1,a=o?{headers:{Accept:"text/event-stream"}}:{},e.next=8,this.stackClient.fetchJSON("PUT","/konnectors/".concat(t)+(r?"?Source=".concat(r):""),a);case 8:return u=e.sent,e.abrupt("return",(0,y.normalizeDoc)(u));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),d}(d.default);t.default=g},function(e,t,n){var r=n(6);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.getSharingRules=t.BITWARDEN_CIPHERS_DOCTYPE=t.BITWARDEN_ORGANIZATIONS_DOCTYPE=t.SHARING_DOCTYPE=void 0;var i=o(n(5)),a=o(n(2)),u=o(n(45)),c=o(n(9)),s=o(n(3)),l=o(n(7)),f=o(n(8)),p=o(n(10)),d=o(n(6)),h=r(n(30)),y=n(171),v=n(42);function g(){var e=(0,u.default)(["/sharings/","/recipients"]);return g=function(){return e},e}function m(){var e=(0,u.default)(["/sharings/","/recipients/self"]);return m=function(){return e},e}function b(){var e=(0,u.default)(["/sharings/","/recipients/",""]);return b=function(){return e},e}function w(){var e=(0,u.default)(["/sharings/","/recipients"]);return w=function(){return e},e}function x(){var e=(0,u.default)(["/sharings/",""]);return x=function(){return e},e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(){var e=(0,u.default)(["/sharings/doctype/",""]);return O=function(){return e},e}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var o=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,p.default)(this,n)}}t.SHARING_DOCTYPE="io.cozy.sharings";t.BITWARDEN_ORGANIZATIONS_DOCTYPE="com.bitwarden.organizations";t.BITWARDEN_CIPHERS_DOCTYPE="com.bitwarden.ciphers";var E=function(e){return(0,h.normalizeDoc)(e,"io.cozy.sharings")},j=function(e){(0,f.default)(p,e);var t,n,r,o,a,u=S(p);function p(){return(0,s.default)(this,p),u.apply(this,arguments)}return(0,l.default)(p,[{key:"findByDoctype",value:(a=(0,c.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",(0,v.uri)(O(),t));case 2:return n=e.sent,e.abrupt("return",k(k({},n),{},{data:n.data.map(E)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"get",value:(o=(0,c.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,v.uri)(x(),t),e.next=3,this.stackClient.fetchJSON("GET",n);case 3:return r=e.sent,e.abrupt("return",{data:E(r.data)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"create",value:(r=(0,c.default)(i.default.mark((function e(t){var n,r,o,a,u,c,s,l,f,p,d,h,y;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.document,r=t.description,o=t.previewPath,a=t.rules,u=t.recipients,c=void 0===u?[]:u,s=t.readOnlyRecipients,l=void 0===s?[]:s,f=t.openSharing,p=t.appSlug,d={description:r,preview_path:o,open_sharing:f,rules:a||C(n)},h={},p&&(h={app_slug:p}),e.next=6,this.stackClient.fetchJSON("POST","/sharings/",{data:{type:"io.cozy.sharings",attributes:k(k({},d),h),relationships:k(k({},c.length>0&&{recipients:{data:c.map(z)}}),l.length>0&&{read_only_recipients:{data:l.map(z)}})}});case 6:return y=e.sent,e.abrupt("return",{data:E(y.data)});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"share",value:(n=(0,c.default)(i.default.mark((function e(t,n,r,o){var a,u,c=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=c.length>4&&void 0!==c[4]?c[4]:null,console.warn("SharingCollection.share is deprecated, use SharingCollection.create instead"),u="two-way"===r?{recipients:n}:{readOnlyRecipients:n},e.abrupt("return",this.create(k(k({document:t},u),{},{description:o,previewPath:a,openSharing:"two-way"===r,rules:C(t,r)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o){return n.apply(this,arguments)})},{key:"getDiscoveryLink",value:function(e,t){return this.stackClient.fullpath("/sharings/".concat(e,"/discovery?sharecode=").concat(t))}},{key:"addRecipients",value:(t=(0,c.default)(i.default.mark((function e(t){var n,r,o,a,u,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.document,r=t.recipients,o=void 0===r?[]:r,a=t.readOnlyRecipients,u=void 0===a?[]:a,e.next=3,this.stackClient.fetchJSON("POST",(0,v.uri)(w(),n._id),{data:{type:"io.cozy.sharings",id:n._id,relationships:k(k({},o.length>0&&{recipients:{data:o.map(z)}}),u.length>0&&{read_only_recipients:{data:u.map(z)}})}});case 3:return c=e.sent,e.abrupt("return",{data:E(c.data)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"revokeRecipient",value:function(e,t){return this.stackClient.fetchJSON("DELETE",(0,v.uri)(b(),e._id,t))}},{key:"revokeSelf",value:function(e){return this.stackClient.fetchJSON("DELETE",(0,v.uri)(m(),e._id))}},{key:"revokeAllRecipients",value:function(e){return this.stackClient.fetchJSON("DELETE",(0,v.uri)(g(),e._id))}}]),p}(h.default);j.normalizeDoctype=h.default.normalizeDoctypeJsonApi;var P=function(e,t){return(0,y.isFile)(e)?R(e,t):"com.bitwarden.organizations"===e._type?N(e):T(e,t)},C=function(e,t){return t&&console.warn("sharingType is deprecated and will be removed. We now set this default rules: ".concat(P(e),"} \n \n If this default rules do not fill your need, please set custom rules \n by using the 'rules' object of the SharingCollection.create() method")),P(e,t)};t.getSharingRules=C;var T=function(e,t){var n=e._id,r=e._type;return[k({title:"collection",doctype:r,values:[n]},D(t)),k({title:"items",doctype:"io.cozy.files",values:["".concat(r,"/").concat(n)],selector:"referenced_by"},A(t))]},A=function(e){return"two-way"===e?{add:"sync",update:"sync",remove:"sync"}:{add:"push",update:"none",remove:"push"}},D=function(e){return e?"two-way"===e?{update:"sync",remove:"revoke"}:{update:"push",remove:"revoke"}:{update:"sync",remove:"revoke"}},R=function(e,t){var n=e._id;return[k({title:e.name,doctype:"io.cozy.files",values:[n]},I(e,t))]},I=function(e,t){return(0,y.isDirectory)(e)?t?"two-way"===t?{add:"sync",update:"sync",remove:"sync"}:{add:"push",update:"push",remove:"push"}:{add:"sync",update:"sync",remove:"sync"}:t?"two-way"===t?{update:"sync",remove:"revoke"}:{update:"push",remove:"revoke"}:{update:"sync",remove:"revoke"}},N=function(e){var t=e._id;return[{title:e.name,doctype:"com.bitwarden.organizations",values:[t],add:"sync",update:"sync",remove:"revoke"},{title:"Ciphers",doctype:"com.bitwarden.ciphers",values:[t],add:"sync",update:"sync",remove:"sync",selector:"organization_id"}]},z=function(e){return{id:e._id,type:e._type}},M=j;t.default=M},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.getPermissionsFor=void 0;var i=o(n(31)),a=o(n(2)),u=o(n(25)),c=o(n(5)),s=o(n(45)),l=o(n(9)),f=o(n(3)),p=o(n(7)),d=o(n(8)),h=o(n(10)),y=o(n(6)),v=r(n(30)),g=n(171),m=n(42);function b(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(){var e=(0,s.default)(["/permissions/doctype/","/shared-by-link"]);return k=function(){return e},e}function O(){var e=(0,s.default)(["/permissions/",""]);return O=function(){return e},e}function S(){var e=(0,s.default)(["/permissions/",""]);return S=function(){return e},e}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,y.default)(e);if(t){var o=(0,y.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,h.default)(this,n)}}var j=function(e){return(0,v.normalizeDoc)(e,"io.cozy.permissions")},P=function(e){(0,d.default)(P,e);var t,n,r,o,a,s,h,y,v,g,w,x=E(P);function P(){return(0,f.default)(this,P),x.apply(this,arguments)}return(0,p.default)(P,[{key:"get",value:(w=(0,l.default)(c.default.mark((function e(t){var n;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",(0,m.uri)(S(),t));case 2:return n=e.sent,e.abrupt("return",{data:j(n.data)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"create",value:(g=(0,l.default)(c.default.mark((function e(t){var n,r,o,i,a,s,l;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t._id,t._type,n=t.codes,r=void 0===n?"code":n,o=t.ttl,i=t.tiny,a=(0,u.default)(t,["_id","_type","codes","ttl","tiny"]),(s=new URLSearchParams).append("codes",r),o&&s.append("ttl",o),i&&s.append("tiny",!0),e.next=7,this.stackClient.fetchJSON("POST","/permissions?".concat(s),{data:{type:"io.cozy.permissions",attributes:a}});case 7:return l=e.sent,e.abrupt("return",{data:j(l.data)});case 9:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"add",value:(v=(0,l.default)(c.default.mark((function e(t,n){var r,o;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t._type,e.next="io.cozy.apps"===e.t0?3:"io.cozy.konnectors"===e.t0?5:"io.cozy.permissions"===e.t0?7:9;break;case 3:return r="/permissions/apps/".concat(t.slug),e.abrupt("break",10);case 5:return r="/permissions/konnectors/".concat(t.slug),e.abrupt("break",10);case 7:return r="/permissions/".concat(t._id),e.abrupt("break",10);case 9:throw new Error("Permissions can only be added on existing permissions, apps and konnectors.");case 10:return e.next=12,this.stackClient.fetchJSON("PATCH",r,{data:{type:"io.cozy.permissions",attributes:{permissions:n}}});case 12:return o=e.sent,e.abrupt("return",{data:j(o.data)});case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"destroy",value:function(e){return this.stackClient.fetchJSON("DELETE",(0,m.uri)(O(),e.id))}},{key:"findLinksByDoctype",value:(y=(0,l.default)(c.default.mark((function e(t){var n;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",(0,m.uri)(k(),t));case 2:return n=e.sent,e.abrupt("return",_(_({},n),{},{data:n.data.map(j)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"findApps",value:(h=(0,l.default)(c.default.mark((function e(){var t;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET","/apps/");case 2:return t=e.sent,e.abrupt("return",_(_({},t),{},{data:t.data.map((function(e){return _({_id:e.id},e)}))}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"createSharingLink",value:(s=(0,l.default)(c.default.mark((function e(t){var n,r,o,i=arguments;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},r=n.verbs,e.next=4,this.stackClient.fetchJSON("POST","/permissions?codes=email",{data:{type:"io.cozy.permissions",attributes:{permissions:C(t,!0,r?{verbs:r}:{})}}});case 4:return o=e.sent,e.abrupt("return",{data:j(o.data)});case 6:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"fetchPermissionsByLink",value:(a=(0,l.default)(c.default.mark((function e(t){return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.links||!t.links.next){e.next=4;break}return e.next=3,this.stackClient.fetchJSON("GET",t.links.next);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"fetchAllLinks",value:(o=(0,l.default)(c.default.mark((function e(t){var n,r,o;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.findLinksByDoctype(t._type);case 2:n=e.sent,r=n;case 4:if(!r.links||!r.links.next){e.next=11;break}return e.next=7,this.fetchPermissionsByLink(r);case 7:r=e.sent,(o=n.data).push.apply(o,(0,i.default)(r.data.map(j))),e.next=4;break;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"revokeSharingLink",value:(r=(0,l.default)(c.default.mark((function e(t){var n,r,o,i,a;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetchAllLinks(t);case 2:n=e.sent,r=n.data.filter((function(e){return T(e,t)})),o=b(r),e.prev=5,o.s();case 7:if((i=o.n()).done){e.next=13;break}return a=i.value,e.next=11,this.destroy(a);case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),o.e(e.t0);case 18:return e.prev=18,o.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[5,15,18,21]])}))),function(e){return r.apply(this,arguments)})},{key:"getOwnPermissions",value:(n=(0,l.default)(c.default.mark((function e(){return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("getOwnPermissions is deprecated, please use fetchOwnPermissions instead"),e.abrupt("return",this.fetchOwnPermissions());case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"fetchOwnPermissions",value:(t=(0,l.default)(c.default.mark((function e(){var t;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET","/permissions/self");case 2:return t=e.sent,e.abrupt("return",{data:j(t.data),included:t.included?t.included.map(j):[]});case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),P}(v.default),C=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e._id,o=e._type,i=n.verbs?n.verbs:t?["GET"]:["ALL"];return(0,g.isFile)(e)?{files:{type:"io.cozy.files",verbs:i,values:[r]}}:{collection:{type:o,verbs:i,values:[r]},files:{type:"io.cozy.files",verbs:i,values:["".concat(o,"/").concat(r)],selector:"referenced_by"}}};t.getPermissionsFor=C,P.normalizeDoctype=v.default.normalizeDoctypeJsonApi;var T=function(e,t){var n=t._id;return(0,g.isFile)(t)?-1!==e.attributes.permissions.files.values.indexOf(n):-1!==e.attributes.permissions.collection.values.indexOf(n)},A=P;t.default=A},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SETTINGS_DOCTYPE=void 0;var o=r(n(5)),i=r(n(2)),a=r(n(9)),u=r(n(3)),c=r(n(7)),s=r(n(8)),l=r(n(10)),f=r(n(6)),p=r(n(30));function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}t.SETTINGS_DOCTYPE="io.cozy.settings";var v=function(e){(0,s.default)(r,e);var t,n=y(r);function r(e){return(0,u.default)(this,r),n.call(this,"io.cozy.settings",e)}return(0,c.default)(r,[{key:"get",value:(t=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET","/settings/".concat(t));case 2:return n=e.sent,e.abrupt("return",{data:p.default.normalizeDoctypeJsonApi("io.cozy.settings")(h({id:"/settings/".concat(t)},n.data),n)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),r}(p.default);v.normalizeDoctype=p.default.normalizeDoctypeJsonApi;var g=v;t.default=g},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.NOTES_URL_DOCTYPE=t.NOTES_DOCTYPE=void 0;var o=r(n(45)),i=r(n(5)),a=r(n(9)),u=r(n(3)),c=r(n(7)),s=r(n(8)),l=r(n(10)),f=r(n(6)),p=r(n(2)),d=r(n(30)),h=n(42),y=n(514);function v(){var e=(0,o.default)(["/notes/","/open"]);return v=function(){return e},e}function g(){var e=(0,o.default)(["/files/",""]);return g=function(){return e},e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){(0,p.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.NOTES_DOCTYPE="io.cozy.notes";t.NOTES_URL_DOCTYPE="io.cozy.notes.url";var x=d.default.normalizeDoctypeJsonApi("io.cozy.notes"),_=function(e){return w(w({},x(e,"io.cozy.notes")),e.attributes)},k=function(e){(0,s.default)(f,e);var t,n,r,o,l=m(f);function f(e){return(0,u.default)(this,f),l.call(this,"io.cozy.notes",e)}return(0,c.default)(f,[{key:"all",value:(o=(0,a.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET","/notes");case 2:return t=e.sent,e.abrupt("return",w(w({},t),{},{data:t.data.map(_)}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"destroy",value:(r=(0,a.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t._id,e.next=3,this.stackClient.fetchJSON("DELETE",(0,h.uri)(g(),n));case 3:return r=e.sent,e.abrupt("return",{data:w(w({},_(r.data)),{},{_deleted:!0})});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"create",value:(n=(0,a.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.dir_id,e.next=3,this.stackClient.fetchJSON("POST","/notes",{data:{type:"io.cozy.notes.documents",attributes:{title:"",schema:(0,y.getDefaultSchema)(),dir_id:n}}});case 3:return r=e.sent,e.abrupt("return",w(w({},r),{},{data:_(r.data)}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"fetchURL",value:(t=(0,a.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t._id,e.next=3,this.stackClient.fetchJSON("GET",(0,h.uri)(v(),n));case 3:return r=e.sent,e.abrupt("return",{data:(o=r.data,w(w({},d.default.normalizeDoctypeJsonApi("io.cozy.notes.url")(o)),o.attributes))});case 5:case"end":return e.stop()}var o}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getDefaultSchema",value:function(){return(0,y.getDefaultSchema)()}}]),f}(d.default);k.normalizeDoctype=d.default.normalizeDoctypeJsonApi;var O=k;t.default=O},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultSchema=t.marks=t.nodes=void 0;var r=[["doc",{content:"(block)+",marks:"link"}],["paragraph",{content:"inline*",group:"block",marks:"strong code em link strike subsup textColor typeAheadQuery underline",parseDOM:[{tag:"p"}]}],["text",{group:"inline"}],["bulletList",{group:"block",content:"listItem+",parseDOM:[{tag:"ul"}]}],["orderedList",{group:"block",content:"listItem+",parseDOM:[{tag:"ol"}]}],["listItem",{content:"(paragraph ) (paragraph | bulletList | orderedList )*",defining:!0,parseDOM:[{tag:"li"}]}],["heading",{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}]}],["blockquote",{content:"paragraph+",group:"block",defining:!0,selectable:!1,parseDOM:[{tag:"blockquote"}]}],["rule",{group:"block",parseDOM:[{tag:"hr"}]}],["panel",{group:"block",content:"(paragraph | heading | bulletList | orderedList)+",attrs:{panelType:{default:"info"}},parseDOM:[{tag:"div[data-panel-type]"}]}],["confluenceUnsupportedBlock",{group:"block",attrs:{cxhtml:{default:null}},parseDOM:[{tag:'div[data-node-type="confluenceUnsupportedBlock"]'}]}],["confluenceUnsupportedInline",{group:"inline",inline:!0,atom:!0,attrs:{cxhtml:{default:null}},parseDOM:[{tag:'div[data-node-type="confluenceUnsupportedInline"]'}]}],["unsupportedBlock",{inline:!1,group:"block",atom:!0,selectable:!0,attrs:{originalValue:{default:{}}},parseDOM:[{tag:'[data-node-type="unsupportedBlock"]'}]}],["unsupportedInline",{inline:!0,group:"inline",selectable:!0,attrs:{originalValue:{default:{}}},parseDOM:[{tag:'[data-node-type="unsupportedInline"]'}]}],["hardBreak",{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}]}],["table",{content:"tableRow+",attrs:{isNumberColumnEnabled:{default:!1},layout:{default:"default"},__autoSize:{default:!1}},tableRole:"table",isolating:!0,selectable:!1,group:"block",parseDOM:[{tag:"table"}]}],["tableHeader",{content:"(paragraph | panel | blockquote | orderedList | bulletList | rule | heading )+",attrs:{colspan:{default:1},rowspan:{default:1},colwidth:{default:null},background:{default:null}},tableRole:"header_cell",isolating:!0,marks:"",parseDOM:[{tag:"th"}]}],["tableRow",{content:"(tableCell | tableHeader)+",tableRole:"row",parseDOM:[{tag:"tr"}]}],["tableCell",{content:"(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | unsupportedBlock)+",attrs:{colspan:{default:1},rowspan:{default:1},colwidth:{default:null},background:{default:null}},tableRole:"cell",marks:"",isolating:!0,parseDOM:[{tag:".ak-renderer-table-number-column",ignore:!0},{tag:"td"}]}]];t.nodes=r;var o=[["link",{excludes:"color",group:"link",attrs:{href:{},__confluenceMetadata:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]"}]}],["em",{inclusive:!0,group:"fontStyle",parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}]}],["strong",{inclusive:!0,group:"fontStyle",parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight"}]}],["textColor",{attrs:{color:{}},inclusive:!0,group:"color",parseDOM:[{style:"color"}]}],["strike",{inclusive:!0,group:"fontStyle",parseDOM:[{tag:"strike"},{tag:"s"},{tag:"del"},{style:"text-decoration"}]}],["subsup",{inclusive:!0,group:"fontStyle",attrs:{type:{default:"sub"}},parseDOM:[{tag:"sub",attrs:{type:"sub"}},{tag:"sup",attrs:{type:"sup"}}]}],["underline",{inclusive:!0,group:"fontStyle",parseDOM:[{tag:"u"},{style:"text-decoration"}]}],["code",{excludes:"fontStyle link searchQuery color",inclusive:!0,parseDOM:[{tag:"span.code",preserveWhitespace:!0},{tag:"code",preserveWhitespace:!0},{tag:"tt",preserveWhitespace:!0},{tag:"span",preserveWhitespace:!0}]}],["typeAheadQuery",{excludes:"searchQuery",inclusive:!0,group:"searchQuery",parseDOM:[{tag:"span[data-type-ahead-query]"}],attrs:{trigger:{default:""}}}]];t.marks=o;t.getDefaultSchema=function(){return{nodes:r,marks:o}}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OAUTH_CLIENTS_DOCTYPE=void 0;var i=o(n(5)),a=o(n(45)),u=o(n(9)),c=o(n(3)),s=o(n(7)),l=o(n(8)),f=o(n(10)),p=o(n(6)),d=o(n(2)),h=o(n(16)),y=o(n(30)),v=n(42),g=r(n(170)),m=n(71),b=n(58);function w(){var e=(0,a.default)(["/settings/clients/",""]);return w=function(){return e},e}function x(){var e=(0,a.default)(["/settings/clients/",""]);return x=function(){return e},e}function _(){var e=(0,a.default)(["/settings/clients"]);return _=function(){return e},e}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var o=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,f.default)(this,n)}}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,d.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.OAUTH_CLIENTS_DOCTYPE="io.cozy.oauth.clients";var E=y.default.normalizeDoctypeJsonApi("io.cozy.oauth.clients"),j=function(e){return S(S({},E(e,"io.cozy.oauth.clients")),e.attributes)},P=function(e){(0,l.default)(a,e);var t,n,r,o=k(a);function a(e){return(0,c.default)(this,a),o.call(this,"io.cozy.oauth.clients",e)}return(0,s.default)(a,[{key:"all",value:(r=(0,u.default)(i.default.mark((function e(){var t,n,r,o,a,u,c,s,l,f,p,d,y,b,w,x=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=x.length>0&&void 0!==x[0]?x[0]:{},n=t.limit,r=void 0===n?100:n,o=t.bookmark,a=t.keys,u={"page[limit]":r,"page[cursor]":o},c=(0,v.uri)(_()),s=g.buildURL(c,u),e.prev=5,e.next=8,this.stackClient.fetchJSON("GET",s);case 8:l=e.sent,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return",(0,m.dontThrowNotFoundError)(e.t0));case 14:if(f=(0,h.default)(l,"links.next",""),p=new URL("".concat(this.stackClient.uri).concat(f)),d=p.searchParams.get("page[cursor]")||void 0,y=void 0!==d,!a){e.next=24;break}return b=l.data.filter((function(e){return a.includes(e.id)})).map((function(e){return j(e)})),w=S(S({},l.meta),{},{count:b.length}),e.abrupt("return",{data:b,meta:w,next:a.length>b.length&&y,bookmark:d});case 24:return e.abrupt("return",{data:l.data.map((function(e){return j(e)})),meta:l.meta,next:y,bookmark:d});case 25:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return r.apply(this,arguments)})},{key:"get",value:(n=(0,u.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all({keys:[t]});case 2:n=e.sent;case 3:if(!n.next){e.next=9;break}return e.next=6,this.all({keys:[t],bookmark:n.bookmark});case 6:n=e.sent,e.next=3;break;case 9:if(!n.data.length){e.next=13;break}return e.abrupt("return",{data:j(n.data[0])});case 13:throw n.url=(0,v.uri)(x(),t),n.status="404",new b.FetchError(n,"Not Found");case 16:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"destroy",value:(t=(0,u.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t._id,e.next=3,this.stackClient.fetchJSON("DELETE",(0,v.uri)(w(),n));case 3:return e.abrupt("return",{data:S(S({},j(t)),{},{_deleted:!0})});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),a}(y.default);P.normalizeDoctype=y.default.normalizeDoctypeJsonApi;var C=P;t.default=C},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SHORTCUTS_DOCTYPE=void 0;var o=r(n(5)),i=r(n(45)),a=r(n(9)),u=r(n(3)),c=r(n(7)),s=r(n(8)),l=r(n(10)),f=r(n(6)),p=r(n(30)),d=n(42),h=n(259);function y(){var e=(0,i.default)(["/shortcuts/",""]);return y=function(){return e},e}function v(){var e=(0,i.default)(["/shortcuts"]);return v=function(){return e},e}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}t.SHORTCUTS_DOCTYPE="io.cozy.files.shortcuts";var m=function(e){(0,s.default)(i,e);var t,n,r=g(i);function i(e){return(0,u.default)(this,i),r.call(this,"io.cozy.files.shortcuts",e)}return(0,c.default)(i,[{key:"create",value:(n=(0,a.default)(o.default.mark((function e(t){var n,r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type||(t.type="io.cozy.files.shortcuts"),t.name&&t.name.trim()&&t.url&&t.dir_id){e.next=3;break}throw new Error("you need at least a name, an url and a dir_id attributes to create a shortcut");case 3:if("."!==(n=t.name.trim())&&".."!==n){e.next=6;break}throw new Error("Invalid filename: ".concat(n));case 6:if(!(r=(0,h.getIllegalCharacters)(n)).length){e.next=9;break}throw new Error("Invalid filename containing illegal character(s): ".concat(r));case 9:return i=(0,d.uri)(v()),e.next=12,this.stackClient.fetchJSON("POST",i,{data:{attributes:t,type:"io.cozy.files.shortcuts"}});case 12:return a=e.sent,e.abrupt("return",{data:p.default.normalizeDoctypeJsonApi("io.cozy.files.shortcuts")(a.data,a)});case 14:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"get",value:(t=(0,a.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,d.uri)(y(),t),e.next=3,this.stackClient.fetchJSON("GET",n);case 3:return r=e.sent,e.abrupt("return",{data:p.default.normalizeDoctypeJsonApi("io.cozy.files.shortcuts")(r.data,r)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(p.default);m.normalizeDoctype=p.default.normalizeDoctypeJsonApi;var b=m;t.default=b},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CONTACTS_DOCTYPE=void 0;var i=o(n(5)),a=o(n(9)),u=o(n(3)),c=o(n(7)),s=o(n(91)),l=o(n(8)),f=o(n(10)),p=o(n(6)),d=o(n(2)),h=r(n(30));function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var o=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,f.default)(this,n)}}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,d.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=function(e){return g(g(g({},(0,h.normalizeDoc)(e.data,w)),e.data.attributes),{},{_rev:e.data.meta.rev})},b=function(e){(0,l.default)(o,e);var t,n,r=y(o);function o(){return(0,u.default)(this,o),r.apply(this,arguments)}return(0,c.default)(o,[{key:"find",value:(n=(0,a.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==Object.values(t).length||1!=t.me){e.next=4;break}return e.abrupt("return",this.findMyself());case 4:return e.abrupt("return",(0,s.default)((0,p.default)(o.prototype),"find",this).call(this,t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"findMyself",value:(t=(0,a.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("POST","/contacts/myself");case 2:return t=e.sent,n={data:[m(t)],next:!1,meta:null,bookmark:!1},e.abrupt("return",n);case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),o}(h.default),w="io.cozy.contacts";t.CONTACTS_DOCTYPE=w;var x=b;t.default=x},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getIconURL=t.default=void 0;var i=o(n(5)),a=o(n(9)),u=r(n(519));function c(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l={gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},f=function(e){if(!e.icon)throw new Error("".concat(e.name,": Cannot detect icon mime type since app has no icon"));var t=e.icon.split(".").pop();if(!t)throw new Error("".concat(e.name,": Unable to detect icon mime type from extension (").concat(e.icon,")"));return t},p=function(){var e=(0,a.default)(i.default.mark((function e(t,n){var r,o,a,u,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=c(t),e.prev=1,o.s();case 3:if((a=o.n()).done){e.next=18;break}return u=a.value,e.prev=5,e.next=8,u();case 8:return s=e.sent,n&&n(s),e.abrupt("return",s);case 13:e.prev=13,e.t0=e.catch(5),r=e.t0;case 16:e.next=3;break;case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(1),o.e(e.t1);case 23:return e.prev=23,o.f(),e.finish(23);case 26:throw r;case 27:case"end":return e.stop()}}),e,null,[[1,20,23,26],[5,13]])})));return function(t,n){return e.apply(this,arguments)}}(),d=function(e,t,n){return e.fetchJSON("GET","/".concat(t,"s/").concat(n)).then((function(e){return e.data.attributes}))},h=function(e,t,n){return e.fetchJSON("GET","/registry/".concat(n)).then((function(e){return e.latest_version.manifest}))},y=function(){var e=(0,a.default)(i.default.mark((function e(t,n){var r,o,a,u,c,s,y,v,g,m,b;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.type,o=n.slug,a=n.appData,u=n.priority,s=[function(){return t.fetch("GET","/".concat(r,"s/").concat(o,"/icon"))},function(){return t.fetch("GET","/registry/".concat(o,"/icon"))}],"registry"===(c=void 0===u?"stack":u)&&s.reverse(),e.next=5,p(s,(function(e){if(!e.ok)throw new Error("Error while fetching icon ".concat(e.statusText))}));case 5:return y=e.sent,e.next=8,y.blob();case 8:if((v=e.sent).type){e.next=25;break}if(m=[function(){return d(t,r,o)},function(){return h(t,0,o)}],"registry"===c&&m.reverse(),e.t1=a,e.t1){e.next=17;break}return e.next=16,p(m);case 16:e.t1=e.sent;case 17:if(e.t0=e.t1,e.t0){e.next=20;break}e.t0={};case 20:if(g=e.t0,b=f(g),l[b]){e.next=24;break}throw new Error('Unknown image extension "'.concat(b,'" for app ').concat(g.name));case 24:v=new Blob([v],{type:l[b]});case 25:return e.abrupt("return",URL.createObjectURL(v));case 26:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),v=function(){return y.apply(this,arguments).catch((function(e){return new u.ErrorReturned}))};t.getIconURL=v;var g=(0,u.default)(v,{maxDuration:3e5,key:function(e,t){var n=t.type,r=t.slug,o=t.priority;return e.uri+NaN+n+":"+r+":"+o}});t.default=g},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorReturned=t.default=void 0;var o=r(n(3)),i=r(n(8)),a=r(n(10)),u=r(n(6));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var s=function(e){(0,i.default)(n,e);var t=c(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return n}((0,r(n(35)).default)(String));t.ErrorReturned=s;var l=function(e,t){for(var n=Date.now(),r=0,o=Object.keys(e);r<o.length;r++){var i=o[r];n-e[i].date>t&&delete e[i]}},f=function(e){return"object"==typeof e&&"function"==typeof e.then},p=function(e,t){var n={};return function(){var r=t.key.apply(null,arguments);l(n,t.maxDuration);var o=n[r];if(o)return o.result;var i=e.apply(this,arguments);return n[r]={result:i,date:Date.now()},f(i)&&i.then((function(e){e instanceof s&&delete n[r]})).catch((function(e){delete n[r]})),i}};t.default=p},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.shouldXMLHTTPRequestBeUsed=t.fetchWithXMLHttpRequest=void 0;var o=r(n(5)),i=r(n(24)),a=r(n(9)),u=r(n(123)),c=function(){var e=(0,a.default)(o.default.mark((function e(t,n){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,r){var o=new XMLHttpRequest;n.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",n.onUploadProgress,!1),o.onload=function(){4==this.readyState?e(this):r(this)},o.onerror=function(e){r(e)},o.open(n.method,t,!0),o.withCredentials=!0;for(var a=0,u=Object.entries(n.headers);a<u.length;a++){var c=(0,i.default)(u[a],2),s=c[0],l=c[1];o.setRequestHeader(s,l)}o.send(n.body)}));case 2:return r=e.sent,e.abrupt("return",{headers:(u=r.getAllResponseHeaders(),new Headers(u.split("\r\n").map((function(e){return e.split(":",2)})).filter((function(e){return 2==e.length})))),ok:r.status>=200&&r.status<300,text:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.responseText);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),json:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",JSON.parse(r.responseText));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),status:r.status,statusText:r.statusText});case 4:case"end":return e.stop()}var u}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchWithXMLHttpRequest=c;var s=(0,u.default)((function(){var e=new XMLHttpRequest;return"onload"in e&&"onprogress"in e}));t.shouldXMLHTTPRequestBeUsed=function(e,t,n){return Boolean(n.onUploadProgress)&&s()}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(35)),i=r(n(5)),a=r(n(9)),u=r(n(2)),c=r(n(25)),s=r(n(3)),l=r(n(7)),f=r(n(91)),p=r(n(8)),d=r(n(10)),h=r(n(6)),y=r(n(245)),v=r(n(257)),g=r(n(262));function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,u.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,h.default)(e);if(t){var o=(0,h.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,d.default)(this,n)}}var x={clientID:"",clientName:"",clientKind:"",clientSecret:"",clientURI:"",registrationAccessToken:"",redirectURI:"",softwareID:"",softwareVersion:"",logoURI:"",policyURI:"",notificationPlatform:"",notificationDeviceToken:""},_=function(e){(0,p.default)(_,e);var t,n,r,o,u,d,y,m=w(_);function _(e){var t,n=e.oauth,r=e.scope,o=void 0===r?[]:r,i=e.onTokenRefresh,a=(0,c.default)(e,["oauth","scope","onTokenRefresh"]);return(0,s.default)(this,_),(t=m.call(this,a)).setOAuthOptions(b(b({},x),n)),n.token&&t.setToken(n.token),t.scope=o,t.onTokenRefresh=i,t}return(0,l.default)(_,[{key:"isRegistered",value:function(){return""!==this.oauthOptions.clientID}},{key:"snakeCaseOAuthData",value:function(e){var t={softwareID:"software_id",softwareVersion:"software_version",clientID:"client_id",clientName:"client_name",clientKind:"client_kind",clientURI:"client_uri",logoURI:"logo_uri",policyURI:"policy_uri",notificationPlatform:"notification_platform",notificationDeviceToken:"notification_device_token",redirectURI:"redirect_uris"},n={};return Object.keys(e).forEach((function(r){var o=t[r]||r,i=e[r];n[o]=i})),n.redirect_uris&&n.redirect_uris instanceof Array==!1&&(n.redirect_uris=[n.redirect_uris]),n}},{key:"camelCaseOAuthData",value:function(e){var t={client_id:"clientID",client_name:"clientName",client_secret:"clientSecret",registration_access_token:"registrationAccessToken",software_id:"softwareID",redirect_uris:"redirectURI"},n={};return Object.keys(e).forEach((function(r){var o=t[r]||r,i=e[r];n[o]=i})),n}},{key:"doRegistration",value:function(){return this.fetchJSON("POST","/auth/register",this.snakeCaseOAuthData({redirectURI:this.oauthOptions.redirectURI,clientName:this.oauthOptions.clientName,softwareID:this.oauthOptions.softwareID,clientKind:this.oauthOptions.clientKind,clientURI:this.oauthOptions.clientURI,logoURI:this.oauthOptions.logoURI,policyURI:this.oauthOptions.policyURI,softwareVersion:this.oauthOptions.softwareVersion,notificationPlatform:this.oauthOptions.notificationPlatform,notificationDeviceToken:this.oauthOptions.notificationDeviceToken}))}},{key:"register",value:(y=(0,a.default)(i.default.mark((function e(){var t,n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isRegistered()){e.next=2;break}throw new Error("Client already registered");case 2:if(t=["redirectURI"],n=Object.keys(this.oauthOptions),!((r=t.filter((function(e){return n[e]}))).length>0)){e.next=7;break}throw new Error("Can't register client : missing ".concat(r," fields"));case 7:return e.next=9,this.doRegistration();case 9:return o=e.sent,this.setOAuthOptions(b(b({},this.oauthOptions),{},{client_id:o.client_id,client_name:o.client_name,client_secret:o.client_secret,registration_access_token:o.registration_access_token,software_id:o.software_id})),e.abrupt("return",this.oauthOptions);case 12:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"unregister",value:(d=(0,a.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isRegistered()){e.next=2;break}throw new k;case 2:return t=this.oauthOptions.clientID,this.oauthOptions.clientID="",e.abrupt("return",this.fetchJSON("DELETE","/auth/register/".concat(t),null,{headers:{Authorization:this.registrationAccessTokenToAuthHeader()}}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"fetchInformation",value:(u=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isRegistered()){e.next=2;break}throw new k;case 2:return e.abrupt("return",this.fetchJSON("GET","/auth/register/".concat(this.oauthOptions.clientID),null,{headers:{Authorization:this.registrationAccessTokenToAuthHeader()}}));case 3:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"updateInformation",value:(o=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]&&u[1],this.isRegistered()){e.next=3;break}throw new k;case 3:return r={clientID:this.oauthOptions.clientID,clientName:this.oauthOptions.clientName,redirectURI:this.oauthOptions.redirectURI,softwareID:this.oauthOptions.softwareID},o=this.snakeCaseOAuthData(b(b({},r),t)),n&&(o.client_secret=this.oauthOptions.clientSecret),e.next=8,this.fetchJSON("PUT","/auth/register/".concat(this.oauthOptions.clientID),o,{headers:{Authorization:this.registrationAccessTokenToAuthHeader()}});case 8:return a=e.sent,this.setOAuthOptions(b(b({},o),a)),e.abrupt("return",this.oauthOptions);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"generateStateCode",value:function(){var e;if("undefined"!=typeof window&&void 0!==window.crypto&&"function"==typeof window.crypto.getRandomValues)e=new Uint8Array(16),window.crypto.getRandomValues(e);else{e=new Array(16);for(var t=0;t<e.length;t++)e[t]=Math.floor(255*Math.random())}return btoa(String.fromCharCode.apply(null,e)).replace(/=+$/,"").replace(/\//g,"_").replace(/\+/g,"-")}},{key:"getAuthCodeURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scope;if(!this.isRegistered())throw new k;var n={client_id:this.oauthOptions.clientID,redirect_uri:this.oauthOptions.redirectURI,state:e,response_type:"code",scope:t.join(" ")};return this.oauthOptions.registerToken&&(n=b(b({},n),{},{registerToken:this.oauthOptions.registerToken})),"".concat(this.uri,"/auth/authorize?").concat(this.dataToQueryString(n))}},{key:"dataToQueryString",value:function(e){return Object.keys(e).map((function(t){return"".concat(t,"=").concat(encodeURIComponent(e[t]))})).join("&")}},{key:"getAccessCodeFromURL",value:function(e,t){if(!t)throw new Error("Missing state code");var n=new URL(e).searchParams,r=n.get("state"),o=n.get("access_code");if(t!==r)throw new Error("Given state does not match url query state");return o}},{key:"fetchAccessToken",value:(r=(0,a.default)(i.default.mark((function e(t,n,r){var o,a,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isRegistered()||n){e.next=2;break}throw new k;case 2:return o=n||this.oauthOptions,a={grant_type:"authorization_code",code:t,client_id:o.clientID,client_secret:o.clientSecret},e.next=6,this.fetchJSON("POST",(r||"")+"/auth/access_token",this.dataToQueryString(a),{headers:{"Content-Type":"application/x-www-form-urlencoded"}});case 6:return u=e.sent,e.abrupt("return",new v.default(u));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"fetchSessionCode",value:(n=(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.fetchJSON("POST","/auth/session_code"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"refreshToken",value:(t=(0,a.default)(i.default.mark((function e(){var t,n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isRegistered()){e.next=2;break}throw new k;case 2:if(this.token){e.next=4;break}throw new Error("No token to refresh");case 4:return t={grant_type:"refresh_token",refresh_token:this.token.refreshToken,client_id:this.oauthOptions.clientID,client_secret:this.oauthOptions.clientSecret},e.next=7,(0,f.default)((0,h.default)(_.prototype),"fetchJSON",this).call(this,"POST","/auth/access_token",this.dataToQueryString(t),{headers:{"Content-Type":"application/x-www-form-urlencoded"}});case 7:return n=e.sent,r=new v.default(b({refresh_token:this.token.refreshToken},n)),this.onTokenRefresh&&"function"==typeof this.onTokenRefresh&&this.onTokenRefresh(r),e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"exchangeOAuthSecret",value:function(e,t){return this.fetchJSON("POST",e+"/auth/secret_exchange",{secret:t})}},{key:"setToken",value:function(e){this.token=e?e instanceof v.default?e:new v.default(e):null}},{key:"setCredentials",value:function(e){return(0,g.default)("setCredentials is deprecated, please replace by setToken"),this.setToken(e)}},{key:"setOAuthOptions",value:function(e){this.oauthOptions=this.camelCaseOAuthData(e)}},{key:"resetClientId",value:function(){this.oauthOptions.clientID=""}},{key:"resetClient",value:function(){this.resetClientId(),this.setUri(null),this.setToken(null)}},{key:"registrationAccessTokenToAuthHeader",value:function(){if(!this.oauthOptions.registrationAccessToken)throw new Error("No registration access token");return"Bearer "+this.oauthOptions.registrationAccessToken}}]),_}(y.default),k=function(e){(0,p.default)(n,e);var t=w(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Client not registered or missing OAuth information";return(0,s.default)(this,n),(e=t.call(this,r)).message=r,e.name="NotRegisteredException",e}return n}((0,o.default)(Error)),O=_;t.default=O},function(e,t,n){var r=n(240),o=n(41),i=n(242);e.exports=function(e,t){if(!e||!e.length)return[];var n=i(e);return null==t?n:o(n,(function(e){return r(t,void 0,e)}))}},function(e,t){e.exports=function(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}},function(e,t,n){var r=n(162);e.exports=function(e,t,n,o){return r(e,(function(e,r,i){t(o,e,n(e),i)})),o}},function(e,t,n){var r=n(526),o=r.enable,i=r.disable,a="undefined"!=typeof navigator&&/chrome/i.test(navigator.userAgent),u=n(528);if(r.defaultBackend=a?u.minilog:u,"undefined"!=typeof window){try{r.enable(JSON.parse(window.localStorage.minilogSettings))}catch(e){}if(window.location&&window.location.search){var c=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);c&&r.enable(decodeURIComponent(c[1]))}}r.enable=function(){o.call(r,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(e){}return this},r.disable=function(){i.call(r);try{delete window.localStorage.minilogSettings}catch(e){}return this},(e.exports=r).backends={array:n(531),browser:r.defaultBackend,localStorage:n(532),jQuery:n(533)}},function(e,t,n){var r=n(49),o=n(527),i=new r,a=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return i.write(e,void 0,a.call(arguments)),n};return n.debug=function(){return i.write(e,"debug",a.call(arguments)),n},n.info=function(){return i.write(e,"info",a.call(arguments)),n},n.warn=function(){return i.write(e,"warn",a.call(arguments)),n},n.error=function(){return i.write(e,"error",a.call(arguments)),n},n.group=function(){return i.write(e,"group",a.call(arguments)),n},n.groupEnd=function(){return i.write(e,"groupEnd",a.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=i.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return i.pipe(e)},t.end=t.unpipe=t.disable=function(e){return i.unpipe(e)},t.Transform=r,t.Filter=o,t.suggest=new o,t.enable=function(){return t.defaultFormatter?i.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):i.pipe(t.suggest).pipe(t.defaultBackend)}},function(e,t,n){var r=n(49),o={debug:1,info:2,warn:3,error:4};function i(){this.enabled=!0,this.defaultResult=!0,this.clear()}function a(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(i),i.prototype.allow=function(e,t){return this._white.push({n:e,l:o[t]}),this},i.prototype.deny=function(e,t){return this._black.push({n:e,l:o[t]}),this},i.prototype.clear=function(){return this._white=[],this._black=[],this},i.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n<r;n++){if(this._white[n]&&a(this._white[n],e)&&o[t]>=this._white[n].l)return!0;if(this._black[n]&&a(this._black[n],e)&&o[t]<=this._black[n].l)return!1}return this.defaultResult},i.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=i},function(e,t,n){var r=n(49),o=/\n+$/,i=new r;i.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(o,""));try{for(r=0;r<n.length;r++)n[r]=JSON.stringify(n[r])}catch(e){}console.log(n.join(" "))}}},i.formatters=["color","minilog"],i.color=n(529),i.minilog=n(530),e.exports=i},function(e,t,n){var r=n(49),o=n(270),i={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},a=new r;a.write=function(e,t,n){console.log;console[t]&&console[t].apply&&console[t].apply(console,["%c"+e+" %c"+t,o("gray"),o.apply(o,i[t])].concat(n))},a.pipe=function(){},e.exports=a},function(e,t,n){var r=n(49),o=n(270),i={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},a=new r;a.write=function(e,t,n){var r=console.log;"debug"!=t&&console[t]&&(r=console[t]);var a=0;if("info"!=t){for(;a<n.length&&"string"==typeof n[a];a++);r.apply(console,["%c"+e+" "+n.slice(0,a).join(" "),o.apply(o,i[t])].concat(n.slice(a)))}else r.apply(console,["%c"+e,o.apply(o,i[t])].concat(n))},a.pipe=function(){},e.exports=a},function(e,t,n){var r=n(49),o=[],i=new r;i.write=function(e,t,n){o.push([e,t,n])},i.get=function(){return o},i.empty=function(){o=[]},e.exports=i},function(e,t,n){var r=n(49),o=!1,i=new r;i.write=function(e,t,n){if("undefined"!=typeof window&&"undefined"!=typeof JSON&&JSON.stringify&&JSON.parse)try{o||(o=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),o.push([(new Date).toString(),e,t,n]),window.localStorage.minilog=JSON.stringify(o)}catch(e){}},e.exports=i},function(e,t,n){var r=n(49),o=(new Date).valueOf().toString(36);function i(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}r.mixin(i),i.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},i.prototype.init=function(){if(this.enabled&&this.jQuery){var e=this;this.timer=setTimeout((function(){var t,n,r=[],i=e.url;if(0==e.cache.length)return e.init();for(t=0;t<e.cache.length;t++)try{JSON.stringify(e.cache[t]),r.push(e.cache[t])}catch(e){}e.jQuery.isEmptyObject(e.extras)?(n=JSON.stringify({logs:r}),i=e.url+"?client_id="+o):n=JSON.stringify(e.jQuery.extend({logs:r},e.extras)),e.jQuery.ajax(i,{type:"POST",cache:!1,processData:!1,data:n,contentType:"application/json",timeout:1e4}).success((function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))})).error((function(){e.interval=3e4})).always((function(){e.init()})),e.cache=[]}),this.interval)}},i.prototype.end=function(){},i.jQueryWait=function(e){if("undefined"!=typeof window&&(window.jQuery||window.$))return e(window.jQuery||window.$);"undefined"!=typeof window&&setTimeout((function(){i.jQueryWait(e)}),200)},e.exports=i},function(e,t,n){var r=n(535),o=n(116),i=n(57),a=n(117),u=i((function(e,t){return a(e)?r(e,o(t,1,a,!0)):[]}));e.exports=u},function(e,t,n){var r=n(103),o=n(160),i=n(161),a=n(41),u=n(65),c=n(104);e.exports=function(e,t,n,s){var l=-1,f=o,p=!0,d=e.length,h=[],y=t.length;if(!d)return h;n&&(t=a(t,u(n))),s?(f=i,p=!1):t.length>=200&&(f=c,p=!1,t=new r(t));e:for(;++l<d;){var v=e[l],g=null==n?v:n(v);if(v=s||0!==v?v:0,p&&g==g){for(var m=y;m--;)if(t[m]===g)continue e;h.push(v)}else f(t,g,s)||h.push(v)}return h}},function(e,t,n){var r=n(105),o=n(116),i=n(118),a=n(22);e.exports=function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],u=e;u--;)t[u-1]=arguments[u];return r(a(n)?i(n):[n],o(t,1))}},function(e,t,n){var r=n(275),o=n(22);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},function(e,t,n){var r=n(162),o=n(46);e.exports=function(e,t){var n=-1,i=o(e)?Array(e.length):[];return r(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}},function(e,t){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},function(e,t,n){var r=n(541);e.exports=function(e,t,n){for(var o=-1,i=e.criteria,a=t.criteria,u=i.length,c=n.length;++o<u;){var s=r(i[o],a[o]);if(s)return o>=c?s:s*("desc"==n[o]?-1:1)}return e.index-t.index}},function(e,t,n){var r=n(77);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,i=e==e,a=r(e),u=void 0!==t,c=null===t,s=t==t,l=r(t);if(!c&&!l&&!a&&e>t||a&&u&&s&&!c&&!l||o&&u&&s||!n&&s||!i)return 1;if(!o&&!a&&!l&&e<t||l&&n&&i&&!o&&!a||c&&n&&i||!u&&i||!s)return-1}return 0}},function(e,t,n){!function(){"use strict";function n(e){return"function"==typeof e}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function o(e){return e instanceof Date?e.getTime():r(e)?e.map(o):e&&"function"==typeof e.toJSON?e.toJSON():e}function i(e,t){return n(e.get)?e.get(t):e[t]}function a(e){return function(t,n){if(!r(n)||!n.length)return e(t,n);for(var o=0,a=n.length;o<a;o++)if(e(t,i(n,o)))return!0;return!1}}function u(e,t,n,r){return e.v(e.a,t,n,r)}var c,s={$eq:a((function(e,t){return e(t)})),$ne:(c=function(e,t){return!e(t)},function(e,t){if(!r(t)||!t.length)return c(e,t);for(var n=0,o=t.length;n<o;n++)if(!c(e,i(t,n)))return!1;return!0}),$gt:a((function(e,t){return g.compare(o(t),e)>0})),$gte:a((function(e,t){return g.compare(o(t),e)>=0})),$lt:a((function(e,t){return g.compare(o(t),e)<0})),$lte:a((function(e,t){return g.compare(o(t),e)<=0})),$mod:a((function(e,t){return t%e[0]==e[1]})),$in:function(e,t){if(!(t instanceof Array)){var n=o(t);if(n===t&&"object"==typeof t)for(a=e.length;a--;)if(String(e[a])===String(t)&&"[object Object]"!==String(t))return!0;if(void 0===n)for(a=e.length;a--;)if(null==e[a])return!0;for(a=e.length;a--;){var r=u(v(i(e,a),void 0),t,a,e);if(r&&"[object Object]"!==String(r)&&"[object Object]"!==String(t))return!0}return!!~e.indexOf(n)}for(var a=t.length;a--;)if(~e.indexOf(o(i(t,a))))return!0;return!1},$nin:function(e,t,n,r){return!s.$in(e,t,n,r)},$not:function(e,t,n,r){return!u(e,t,n,r)},$type:function(e,t){return null!=t&&(t instanceof e||t.constructor==e)},$all:function(e,t,n,r){return s.$and(e,t,n,r)},$size:function(e,t){return!!t&&e===t.length},$or:function(e,t,n,r){for(var o=0,a=e.length;o<a;o++)if(u(i(e,o),t,n,r))return!0;return!1},$nor:function(e,t,n,r){return!s.$or(e,t,n,r)},$and:function(e,t,n,r){for(var o=0,a=e.length;o<a;o++)if(!u(i(e,o),t,n,r))return!1;return!0},$regex:a((function(e,t){return"string"==typeof t&&e.test(t)})),$where:function(e,t,n,r){return e.call(t,t,n,r)},$elemMatch:function(e,t,n,o){return r(t)?!!~f(t,e):u(e,t,n,o)},$exists:function(e,t,n,r){return r.hasOwnProperty(n)===e}},l={$eq:function(e){return e instanceof RegExp?function(t){return"string"==typeof t&&e.test(t)}:e instanceof Function?e:r(e)&&!e.length?function(e){return r(e)&&!e.length}:null===e?function(e){return null==e}:function(t){return 0===g.compare(o(t),e)}},$ne:function(e){return l.$eq(e)},$and:function(e){return e.map(y)},$all:function(e){return l.$and(e)},$or:function(e){return e.map(y)},$nor:function(e){return e.map(y)},$not:function(e){return y(e)},$regex:function(e,t){return new RegExp(e,t.$options)},$where:function(e){return"string"==typeof e?new Function("obj","return "+e):e},$elemMatch:function(e){return y(e)},$exists:function(e){return!!e}};function f(e,t){for(var n=0;n<e.length;n++){i(e,n);if(u(t,i(e,n)))return n}return-1}function p(e,t){return{a:e,v:t}}function d(e,t){var n=[];if(function e(t,n,o,a,u){if(o===n.length||null==t)return void u.push([t,n[o-1],a]);var c=i(n,o);if(r(t)&&isNaN(Number(c)))for(var s=0,l=t.length;s<l;s++)e(i(t,s),n,o,t,u);else e(i(t,c),n,o+1,t,u)}(t,e.k,0,t,n),1===n.length){var o=n[0];return u(e.nv,o[0],o[1],o[2])}for(var a=e&&e.q&&void 0!==e.q.$ne,c=a,s=0;s<n.length;s++){var l=n[s],f=u(e.nv,l[0],l[1],l[2]);a?c&=f:c|=f}return c}function h(e,t,n){return{a:{k:e,nv:t,q:n},v:d}}function y(e){var t;(e=o(e))&&((t=e)&&t.constructor===Object)||(e={$eq:e});var n=[];for(var r in e){var i=e[r];if("$options"!==r)if(s[r])l[r]&&(i=l[r](i,e)),n.push(p(o(i),s[r]));else{if(36===r.charCodeAt(0))throw new Error("Unknown operation "+r);n.push(h(r.split("."),y(i),i))}}return 1===n.length?n[0]:p(n,s.$and)}function v(e,t){var n=y(e);return t&&(n={a:n,v:function(e,n,r,o){return u(e,t(n),r,o)}}),n}function g(e,t,r){n(t)&&(r=t,t=void 0);var o=v(e,r);function i(e,t,n){return u(o,e,t,n)}return t?t.filter(i):i}g.use=function(e){if(n(e))return e(g);for(var t in e)36===t.charCodeAt(0)&&(s[t]=e[t])},g.indexOf=function(e,t,n){return f(t,v(e,n))},g.compare=function(e,t){if(e===t)return 0;if(typeof e==typeof t){if(e>t)return 1;if(e<t)return-1}},void 0!==e.exports&&(Object.defineProperty(t,"__esModule",{value:!0}),e.exports=g,t.default=e.exports.default=g),"undefined"!=typeof window&&(window.sift=g)}()},function(e,t,n){var r=n(98),o=n(277),i=n(236),a=n(544),u=n(34),c=n(111),s=n(278);e.exports=function e(t,n,l,f,p){t!==n&&i(n,(function(i,c){if(p||(p=new r),u(i))a(t,n,c,l,e,f,p);else{var d=f?f(s(t,c),i,c+"",t,n,p):void 0;void 0===d&&(d=i),o(t,c,d)}}),c)}},function(e,t,n){var r=n(277),o=n(247),i=n(248),a=n(118),u=n(249),c=n(80),s=n(22),l=n(117),f=n(81),p=n(139),d=n(34),h=n(166),y=n(108),v=n(278),g=n(545);e.exports=function(e,t,n,m,b,w,x){var _=v(e,n),k=v(t,n),O=x.get(k);if(O)r(e,n,O);else{var S=w?w(_,k,n+"",e,t,x):void 0,E=void 0===S;if(E){var j=s(k),P=!j&&f(k),C=!j&&!P&&y(k);S=k,j||P||C?s(_)?S=_:l(_)?S=a(_):P?(E=!1,S=o(k,!0)):C?(E=!1,S=i(k,!0)):S=[]:h(k)||c(k)?(S=_,c(_)?S=g(_):d(_)&&!p(_)||(S=u(k))):E=!1}E&&(x.set(k,S),b(S,k,m,w,x),x.delete(k)),r(e,n,S)}}},function(e,t,n){var r=n(70),o=n(111);e.exports=function(e){return r(e,o(e))}},function(e,t,n){var r=n(57),o=n(279);e.exports=function(e){return r((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t}))}},function(e,t,n){var r=n(217);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(7)),a=r(n(91)),u=r(n(8)),c=r(n(10)),s=r(n(6)),l=r(n(92)),f=n(18);function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var d=function(e){(0,u.default)(n,e);var t=p(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return(0,i.default)(n,[{key:"data",get:function(){var e=this;return(0,a.default)((0,s.default)(n.prototype),"data",this).filter((function(t){return t.slug===e.target.slug}))}}],[{key:"query",value:function(e,t){return(0,f.Q)("io.cozy.triggers").where({worker:"konnector"})}}]),n}(l.default);t.default=d},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.authFunction=t.authenticateWithCordova=void 0;var o=r(n(5)),i=r(n(9)),a=n(59),u=n(23),c=(n(19),"undefined"!=typeof window?window:null),s=function(e){return new Promise((function(t,n){c.SafariViewController.show({url:e,transition:"curl"},(function(e){"closed"===e.event&&n(new Error(a.REGISTRATION_ABORT))}),(function(e){console.log("KO: "+e),n(new Error(a.REGISTRATION_ABORT))}));var r=c.handleOpenURL;c.handleOpenURL=function(e){c.SafariViewController.hide(),t(e),r&&(c.handleOpenURL=r)}}))},l=function(e){return new Promise((function(t,n){var r=c.cordova.InAppBrowser.open(e,"_blank","clearcache=yes,zoom=no"),o=function(){r.removeEventListener("loadstart",i),r.removeEventListener("exit",u)},i=function(e){var n=e.url,i=/\?access_code=(.+)$/.test(n),a=/\?state=(.+)$/.test(n);(i||a)&&(t(n),o(),r.close())},u=function(){n(new Error(a.REGISTRATION_ABORT)),o(),r.close()};r.addEventListener("loadstart",i),r.addEventListener("exit",u)}))},f=function(){var e=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=(0,u.isIOSApp)(),!e.t0){e.next=5;break}return e.next=4,(0,u.hasSafariPlugin)();case 4:e.t0=e.sent;case 5:if(!e.t0){e.next=9;break}return e.abrupt("return",s(t));case 9:if(!(0,u.hasInAppBrowserPlugin)()){e.next=13;break}return e.abrupt("return",l(t));case 13:return console.log(t),e.abrupt("return",new Promise((function(e){setTimeout((function(){var t=prompt("Paste the url here:");e(t)}),5e3)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.authenticateWithCordova=f;var p=f;t.authFunction=p},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(72)),i=r(n(271)),a=r(n(158)),u=r(n(169)),c=r(n(119)),s=r(n(551)),l=n(18),f=function(e){var t=(0,i.default)(e,(function(e){return(t=e).id||t.ids?"idQueries":"others";var t})),n=t.idQueries,r=void 0===n?[]:n,o=t.others,f=void 0===o?[]:o,p=r.length>0?new l.QueryDefinition({doctype:e[0].doctype,ids:(0,c.default)((0,a.default)(r.map((function(e){return e.id||e.ids}))))}):[];return(0,s.default)(f,u.default).concat(p)},p=function(e){var t=(0,i.default)(e,(function(e){return e.doctype}));return(0,a.default)(Object.values((0,o.default)(t,f)))};t.default=p},function(e,t,n){var r=n(159);e.exports=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?r(e,void 0,t):[]}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(3)),u=r(n(7)),c=r(n(2)),s=r(n(268)),l=r(n(72)),f=r(n(121)),p=r(n(553)),d=r(n(557)),h=n(120);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function(e){var t=(0,l.default)(e.relationships||{},(function(e,t){return v(v({},e),{},{name:t,type:(0,h.resolveClass)(e.doctype,e.type)})}));return v(v({},e),{},{relationships:(0,p.default)(t)>0?(0,s.default)(t,"name"):null})},m=function(e,t){if(!e)throw new Error(t)},b=function(e,t){var n=(0,d.default)(e,t,(function(e){return e.name}));m(0===n.length,"Duplicated names in schemas being added: ".concat(n.map((function(e){return e.name})).join(", ")));var r=(0,d.default)(e,t,(function(e){return e.doctype}));m(0===r.length,"Duplicated doctypes in schemas being added: ".concat(r.map((function(e){return e.name})).join(", ")))},w=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,a.default)(this,e),this.byDoctype={},this.add(t),this.client=n}var t,n;return(0,u.default)(e,[{key:"add",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,l.default)(e,(function(e,t){return v({name:t},g(e))}));b(Object.values(t),Object.values(this.byDoctype)),(0,f.default)(this.byDoctype,(0,s.default)(t,(function(e){return e.doctype})))}},{key:"getDoctypeSchema",value:function(e){var t=this.byDoctype[e];return t||(t=g({name:e,doctype:e}),this.byDoctype[e]=t),t}},{key:"getRelationship",value:function(e,t){if(!e)throw new TypeError("Invalid doctype ".concat(e));var n=this.getDoctypeSchema(e);if(!n)throw new Error("Cannot find doctype ".concat(e," in schema"));if(!n.relationships)throw new Error("Schema for doctype ".concat(e," has no relationships"));return n.relationships[t]}},{key:"validate",value:(n=(0,i.default)(o.default.mark((function e(t){var n,r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={},r=this.byDoctype[t._type]){e.next=4;break}return e.abrupt("return",!0);case 4:if(r.attributes){e.next=6;break}return e.abrupt("return",!0);case 6:e.t0=o.default.keys(r.attributes);case 7:if((e.t1=e.t0()).done){e.next=15;break}return i=e.t1.value,e.next=11,this.validateAttribute(t,i,r.attributes[i]);case 11:!0!==(a=e.sent)&&(n[i]=a),e.next=7;break;case 15:if(0!==Object.keys(n).length){e.next=17;break}return e.abrupt("return",!0);case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"validateAttribute",value:(t=(0,i.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.unique||!this.client){e.next=6;break}return e.next=3,this.client.collection(t._type).checkUniquenessOf(n,t[n]);case 3:if(!0===e.sent){e.next=6;break}return e.abrupt("return","must be unique");case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=w},function(e,t,n){var r=n(146),o=n(66),i=n(46),a=n(176),u=n(554);e.exports=function(e){if(null==e)return 0;if(i(e))return a(e)?u(e):e.length;var t=o(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},function(e,t,n){var r=n(555),o=n(133),i=n(556);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t,n){var r=n(148)("length");e.exports=r},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+r+"|"+o+")"+"?",s="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[i,a,u].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),l="(?:"+[i+r+"?",r,a,u,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+l+s,"g");e.exports=function(e){for(var t=f.lastIndex=0;f.test(e);)++t;return t}},function(e,t,n){var r=n(41),o=n(273),i=n(53),a=n(57),u=n(274),c=n(252),s=a((function(e){var t=c(e),n=r(e,u);return t===c(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?o(n,i(t,2)):[]}));e.exports=s},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.CozyClient=void 0;var o=r(n(8)),i=r(n(10)),a=r(n(6)),u=r(n(3));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.default)(e);if(t){var o=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,i.default)(this,n)}}var s=function(e){(0,o.default)(n,e);var t=c(n);function n(){return(0,u.default)(this,n),t.apply(this,arguments)}return n}((function e(t){(0,u.default)(this,e),Object.assign(this,t)}));t.CozyClient=s},function(e,t,n){var r="undefined"!=typeof JSON?JSON:n(560);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n=t.space||"";"number"==typeof n&&(n=Array(n+1).join(" "));var a,u="boolean"==typeof t.cycles&&t.cycles,c=t.replacer||function(e,t){return t},s=t.cmp&&(a=t.cmp,function(e){return function(t,n){var r={key:t,value:e[t]},o={key:n,value:e[n]};return a(r,o)}}),l=[];return function e(t,a,f,p){var d=n?"\n"+new Array(p+1).join(n):"",h=n?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),void 0!==(f=c.call(t,a,f))){if("object"!=typeof f||null===f)return r.stringify(f);if(o(f)){for(var y=[],v=0;v<f.length;v++){var g=e(f,v,f[v],p+1)||r.stringify(null);y.push(d+n+g)}return"["+y.join(",")+d+"]"}if(-1!==l.indexOf(f)){if(u)return r.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}l.push(f);var m=i(f).sort(s&&s(f));for(y=[],v=0;v<m.length;v++){var b=e(f,a=m[v],f[a],p+1);if(b){var w=r.stringify(a)+h+b;y.push(d+n+w)}}return l.splice(l.indexOf(f),1),"{"+y.join(",")+d+"}"}}({"":e},"",e,0)};var o=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},i=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},n=[];for(var r in e)t.call(e,r)&&n.push(r);return n}},function(e,t,n){t.parse=n(561),t.stringify=n(562)},function(e,t){var n,r,o,i,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=function(e){throw{name:"SyntaxError",message:e,at:n,text:o}},c=function(e){return e&&e!==r&&u("Expected '"+e+"' instead of '"+r+"'"),r=o.charAt(n),n+=1,r},s=function(){var e,t="";for("-"===r&&(t="-",c("-"));r>="0"&&r<="9";)t+=r,c();if("."===r)for(t+=".";c()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,c(),"-"!==r&&"+"!==r||(t+=r,c());r>="0"&&r<="9";)t+=r,c();if(e=+t,isFinite(e))return e;u("Bad number")},l=function(){var e,t,n,o="";if('"'===r)for(;c();){if('"'===r)return c(),o;if("\\"===r)if(c(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(c(),16),isFinite(e));t+=1)n=16*n+e;o+=String.fromCharCode(n)}else{if("string"!=typeof a[r])break;o+=a[r]}else o+=r}u("Bad string")},f=function(){for(;r&&r<=" ";)c()};i=function(){switch(f(),r){case"{":return function(){var e,t={};if("{"===r){if(c("{"),f(),"}"===r)return c("}"),t;for(;r;){if(e=l(),f(),c(":"),Object.hasOwnProperty.call(t,e)&&u('Duplicate key "'+e+'"'),t[e]=i(),f(),"}"===r)return c("}"),t;c(","),f()}}u("Bad object")}();case"[":return function(){var e=[];if("["===r){if(c("["),f(),"]"===r)return c("]"),e;for(;r;){if(e.push(i()),f(),"]"===r)return c("]"),e;c(","),f()}}u("Bad array")}();case'"':return l();case"-":return s();default:return r>="0"&&r<="9"?s():function(){switch(r){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null}u("Unexpected '"+r+"'")}()}},e.exports=function(e,t){var a;return o=e,n=0,r=" ",a=i(),f(),r&&u("Syntax error"),"function"==typeof t?function e(n,r){var o,i,a=n[r];if(a&&"object"==typeof a)for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(void 0!==(i=e(a,o))?a[o]=i:delete a[o]);return t.call(n,r,a)}({"":a},""):a}},function(e,t){var n,r,o,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function u(e){return i.lastIndex=0,i.test(e)?'"'+e.replace(i,(function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}e.exports=function(e,t,i){var a;if(n="",r="","number"==typeof i)for(a=0;a<i;a+=1)r+=" ";else"string"==typeof i&&(r=i);if(o=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return function e(t,i){var a,c,s,l,f,p=n,d=i[t];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(t)),"function"==typeof o&&(d=o.call(i,t,d)),typeof d){case"string":return u(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(n+=r,f=[],"[object Array]"===Object.prototype.toString.apply(d)){for(l=d.length,a=0;a<l;a+=1)f[a]=e(a,d)||"null";return s=0===f.length?"[]":n?"[\n"+n+f.join(",\n"+n)+"\n"+p+"]":"["+f.join(",")+"]",n=p,s}if(o&&"object"==typeof o)for(l=o.length,a=0;a<l;a+=1)"string"==typeof(c=o[a])&&(s=e(c,d))&&f.push(u(c)+(n?": ":":")+s);else for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&(s=e(c,d))&&f.push(u(c)+(n?": ":":")+s);return s=0===f.length?"{}":n?"{\n"+n+f.join(",\n"+n)+"\n"+p+"}":"{"+f.join(",")+"}",n=p,s}}("",{"":e})}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(3)),u=r(n(7)),c=function(){function e(){(0,a.default)(this,e),this.pending={}}var t;return(0,u.default)(e,[{key:"exec",value:(t=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n(),(i=this.pending[r])?a=i:(a=t(),this.pending[r]=a),e.prev=3,e.next=6,a;case 6:return u=e.sent,e.abrupt("return",u);case 8:return e.prev=8,this.pending[r]=null,e.finish(8);case 11:case"end":return e.stop()}}),e,this,[[3,,8,11]])}))),function(e,n){return t.apply(this,arguments)})},{key:"get",value:function(e){var t=e(),n=this.pending[t];return n||null}}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.certifyFlagship=void 0;var o=r(n(5)),i=r(n(9)),a=(r(n(40)),n(565)),u=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.getStackClient(),e.next=4,n.fetchJSON("POST","/auth/clients/".concat(n.oauthOptions.clientID,"/challenge"),null,{headers:{Authorization:n.registrationAccessTokenToAuthHeader()}});case 4:return r=e.sent,e.abrupt("return",r.nonce);case 8:throw e.prev=8,e.t0=e.catch(0),new Error("[FLAGSHIP_CERTIFICATION] Something went wrong while requesting a challenge from CozyStack:\n"+e.t0.message);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=t.platform,a=t.attestation,u=t.keyId,c=r.getStackClient(),e.next=5,c.fetchJSON("POST","/auth/clients/".concat(c.oauthOptions.clientID,"/attestation"),{platform:i,attestation:a,challenge:n,keyId:u},{headers:{Authorization:c.registrationAccessTokenToAuthHeader()}});case 5:e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(0),new Error("[FLAGSHIP_CERTIFICATION] Something went wrong while giving attestation to CozyStack:\n"+e.t0.message);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,n,r){return e.apply(this,arguments)}}(),s=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("[FLAGSHIP_CERTIFICATION] Certification configuration is not set");case 2:return e.next=4,u(n);case 4:return r=e.sent,e.next=7,(0,a.getAppAttestationFromStore)(r,t);case 7:return i=e.sent,e.next=10,c(i,r,n);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.certifyFlagship=s},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getAppAttestationFromStore=void 0;var o=r(n(5)),i=r(n(9)),a=function(){var e=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("validateApp can only be called from a React Native container");case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.getAppAttestationFromStore=a},function(e,t,n){var r=n(285)();e.exports=r},function(e,t,n){var r=n(211),o=r&&new r;e.exports=o},function(e,t){e.exports={}},function(e,t,n){var r=n(182),o=n(286),i=n(287),a=n(570);e.exports=function(e){var t=i(e),n=a[t];if("function"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var u=o(n);return!!u&&e===u[0]}},function(e,t,n){var r=n(182),o=n(180),i=n(181),a=n(22),u=n(39),c=n(571),s=Object.prototype.hasOwnProperty;function l(e){if(u(e)&&!a(e)&&!(e instanceof r)){if(e instanceof o)return e;if(s.call(e,"__wrapped__"))return c(e)}return new o(e)}l.prototype=i.prototype,l.prototype.constructor=l,e.exports=l},function(e,t,n){var r=n(182),o=n(180),i=n(118);e.exports=function(e){if(e instanceof r)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasQueryBeenLoaded=t.isQueryLoading=t.cancelable=void 0;t.cancelable=function(e){var t,n=new Promise((function(n,r){t=r,e.then(n),e.catch(r)}));return n.cancel=function(){t({canceled:!0})},n};t.isQueryLoading=function(e){return e?"loading"===e.fetchStatus||"pending"===e.fetchStatus:(console.warn("isQueryLoading called on falsy value."),!1)};t.hasQueryBeenLoaded=function(e){return e.lastFetch}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(2)),u=n(0),c=r(n(122)),s=n(18),l=n(60);r(n(40)),n(19);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function(e,t,n,r){var o=function(e,t){return p({id:e._id,_type:t},e)}(n,t),i={data:o};e.dispatch((0,l.receiveMutationResult)(e.generateRandomId(),i,{},r(o)))},h=function(e){var t=e.doctype,n=(0,c.default)();return(0,u.useEffect)((function(){var e=n.plugins.realtime;if(!e)throw new Error("You must include the realtime plugin to use RealTimeQueries");var r=function(e){d(n,t,e,s.Mutations.createDocument)},a=function(e){d(n,t,e,s.Mutations.updateDocument)},u=function(e){d(n,t,p(p({},e),{},{_deleted:!0}),s.Mutations.deleteDocument)};return function(){var n=(0,i.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.subscribe("created",t,r);case 2:return n.next=4,e.subscribe("updated",t,a);case 4:return n.next=6,e.subscribe("deleted",t,u);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()(),function(){e.unsubscribe("created",t,r),e.unsubscribe("updated",t,a),e.unsubscribe("deleted",t,u)}}),[n,t]),null},y=(0,u.memo)(h);t.default=y},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeCategories=u,t.areTermsValid=c,t.isPartnershipValid=s,t.sanitize=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);!e.categories&&e.category&&"string"==typeof e.category&&(t.categories=[e.category],delete t.category);t.categories=u(t.categories),"object"==typeof e.name&&(t.name=e.name.en);e.available_version&&(t.availableVersion=e.available_version,delete t.available_version);e.latest_version&&(t.latestVersion=e.latestVersion,delete t.latest_version);t.terms&&!c(t.terms)&&delete t.terms;t.partnership&&!s(t.partnership)&&delete t.partnership;return t};var o=r(n(2));n(19);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var a=["banking","cozy","energy","health","host_provider","insurance","isp","mes_infos","online_services","others","partners","press","productivity","ptnb","public_service","shopping","social","telecom","transport"];function u(e){if(!e)return["others"];var t=e.filter((function(e){return a.includes(e)}));return t.length?t:["others"]}function c(e){return Boolean(e&&e.id&&e.url&&e.version)}function s(e){return Boolean(e&&e.description)}},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(3)),a=o(n(7)),u=o(n(8)),c=o(n(10)),s=o(n(6)),l=o(n(2)),f=r(n(0)),p=o(n(1)),d=o(n(183));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var y=p.default.shape({subscribe:p.default.func.isRequired,dispatch:p.default.func.isRequired,getState:p.default.func.isRequired}),v=function(e){(0,u.default)(n,e);var t=h(n);function n(e,r){var o;if((0,i.default)(this,n),o=t.call(this,e,r),!e.client)throw new Error("CozyProvider was not passed a client instance.");return e.store&&e.client.setStore(e.store),o}return(0,a.default)(n,[{key:"getChildContext",value:function(){return{store:this.props.store||this.context.store||this.props.client.store,client:this.props.client}}},{key:"render",value:function(){return f.default.createElement(d.default.Provider,{value:this.getChildContext()},this.props.children)}}]),n}(f.Component);t.default=v,(0,l.default)(v,"propTypes",{store:y,client:p.default.object.isRequired,children:p.default.element.isRequired}),(0,l.default)(v,"childContextTypes",{store:p.default.object,client:p.default.object.isRequired}),(0,l.default)(v,"contextTypes",{store:p.default.object})},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(26)),a=o(n(3)),u=o(n(7)),c=o(n(11)),s=o(n(8)),l=o(n(10)),f=o(n(6)),p=o(n(2)),d=r(n(0)),h=o(n(1));function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}var v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.displayName||n.name||"Component",o=function(o){(0,s.default)(f,o);var l=y(f);function f(n,o){var i;if((0,a.default)(this,f),i=l.call(this,n,o),(0,p.default)((0,c.default)(i),"mutate",(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return i.client.mutate(e.apply(null,r),t)})),i.client=n.client||o.client,!i.client)throw new Error('Could not find "client" in either the context or props of '.concat(r));return i}return(0,u.default)(f,[{key:"render",value:function(){var e=(0,p.default)({},t.name||"mutate",this.mutate);return d.default.createElement(n,(0,i.default)({},e,this.props))}}]),f}(d.Component);return(0,p.default)(o,"contextTypes",{client:h.default.object}),o.displayName="WithMutation(".concat(r,")"),o}};t.default=v},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(26)),a=o(n(3)),u=o(n(7)),c=o(n(8)),s=o(n(10)),l=o(n(6)),f=o(n(2)),p=o(n(31)),d=o(n(121)),h=r(n(0)),y=o(n(1));function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,f.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var b=function(e,t,n){return d.default.apply(void 0,(0,p.default)(e.map((function(e){return"function"==typeof e?e(t,n):e}))))},w=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",r=function(r){(0,c.default)(s,r);var o=m(s);function s(e,r){var i;(0,a.default)(this,s),i=o.call(this,e,r);var u=e.client||r.client;if(console.warn("Deprecation: withMutations will be removed in the near future, prefer to use withClient to access the client. See https://github.com/cozy/cozy-client/pull/638 for more information."),!u)throw new Error('Could not find "client" in either the context or props of '.concat(n));return i.mutations=g({createDocument:u.create.bind(u),saveDocument:u.save.bind(u),deleteDocument:u.destroy.bind(u)},b(t,u,e)),i}return(0,u.default)(s,[{key:"render",value:function(){return h.default.createElement(e,(0,i.default)({},this.mutations,this.props))}}]),s}(h.Component);return(0,f.default)(r,"contextTypes",{client:y.default.object}),r.displayName="WithMutations(".concat(n,")"),r}};t.default=w},function(e,t,n){"use strict";var r=n(17),o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.queryConnectFlat=t.queryConnect=t.withClient=void 0;var i=o(n(2)),a=o(n(26)),u=r(n(0)),c=o(n(1)),s=o(n(579)),l=o(n(288)),f=o(n(122)),p=n(289);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.withClient=function(e){var t=function(t){var n=(0,f.default)();return u.default.createElement(e,(0,a.default)({},t,{client:n}))};return t.displayName="withClient(".concat(e.displayName||e.name,")"),t};t.queryConnect=function(e){return function(t){var n=Object.keys(e).map((function(n){return function(e,t,n){if(!t)throw new Error("withQuery has no options for ".concat(e," (wrapping ").concat(n.name,")"));return function(n){var r=function(r,o){if(!o.client)throw new Error("Should be used with client in context (use CozyProvider to set context)");var a="function"==typeof t?t(r):t;return t.doc?(console.warn("queryOpts.doc is deprecated"),u.default.createElement(n,h((0,i.default)({},e,a.doc),r))):u.default.createElement(l.default,a,(function(t){return u.default.createElement(n,h((0,i.default)({},e,t),r))}))};return r.contextTypes={client:c.default.object},r.displayName="withQuery(".concat(n.displayName||n.name,")"),r}}(n,e[n],t)}));return s.default.apply(null,n)(t)}};t.queryConnectFlat=function(e){return function(t){var n=function(n){var r=(0,p.useQueries)(e);return u.default.createElement(t,(0,a.default)({},n,r))};return n.displayName="queryConnectFlat(".concat(t.displayName||t.name,")"),n}}},function(e,t,n){var r=n(285)(!0);e.exports=r},function(e,t,n){"use strict";var r=n(17);Object.defineProperty(t,"__esModule",{value:!0}),t.timeseries=t.document=t.contact=t.utils=t.permission=t.note=t.account=t.folder=t.file=t.applications=t.instance=t.trigger=t.accounts=t.triggers=void 0;var o=r(n(581));t.trigger=o;var i=r(n(582));t.instance=i;var a=r(n(291));t.applications=a;var u=r(n(292));t.file=u;var c=r(n(587));t.folder=c;var s=r(n(290));t.account=s;var l=r(n(589));t.note=l;var f=r(n(590));t.permission=f;var p=r(n(591));t.utils=p;var d=r(n(592));t.contact=d;var h=r(n(594));t.document=h;var y=r(n(644));t.timeseries=y;var v=o;t.triggers=v;var g=s;t.accounts=g},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.triggers=t.triggerStates=void 0;var o=r(n(16)),i=n(290),a=["CHALLENGE_ASKED","DISK_QUOTA_EXCEEDED","TERMS_VERSION_MISMATCH","USER_ACTION_NEEDED","USER_ACTION_NEEDED.CHANGE_PASSWORD","USER_ACTION_NEEDED.ACCOUNT_REMOVED","USER_ACTION_NEEDED.WEBAUTH_REQUIRED","USER_ACTION_NEEDED.SCA_REQUIRED","LOGIN_FAILED"],u={getLastExecution:function(e){return(0,o.default)(e,"current_state.last_execution")},getLastsuccess:function(e){return console.warn("Deprecated, please use getLastSuccess instead of getLastsuccess"),(0,o.default)(e,"current_state.last_success")},getLastSuccess:function(e){return(0,o.default)(e,"current_state.last_success")},isErrored:function(e){return"errored"===(0,o.default)(e,"current_state.status")},getLastErrorType:function(e){return(0,o.default)(e,"current_state.last_error")}};t.triggerStates=u;var c={isKonnectorWorker:function(e){return"konnector"===e.worker},getKonnector:function(e){return c.isKonnectorWorker(e)?e.message&&e.message.konnector?e.message.konnector:e.message&&e.message.Data?JSON.parse(atob(e.message.Data)).konnector:void 0:null},getAccountId:function(e){var t=(0,o.default)(e,"message.Data");return t?JSON.parse(atob(t)).account:(0,o.default)(e,"message.account")},isLatestErrorMuted:function(e,t){var n=u.getLastErrorType(e),r=u.getLastSuccess(e),o=r?new Date(r):new Date;return(0,i.getMutedErrors)(t).some((function(e){return e.type===n&&(!r||new Date(e.mutedAt)>o)}))},hasActionableError:function(e){return a.includes(e.current_state.last_error)}};t.triggers=c},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.buildPremiumLink=t.hasAnOffer=t.shouldDisplayOffers=t.getUuid=t.isFreemiumUser=t.arePremiumLinksEnabled=t.isSelfHosted=void 0;var o=r(n(16)),i=function(e){return!(0,o.default)(e,"context.data.attributes.manager_url")};t.isSelfHosted=i;var a=function(e){return!!(0,o.default)(e,"context.data.attributes.enable_premium_links")};t.arePremiumLinksEnabled=a;var u=function(e){var t=(0,o.default)(e,"diskUsage.data.attributes.quota",!1);return parseInt(t)<=5e10};t.isFreemiumUser=u;var c=function(e){return(0,o.default)(e,"instance.data.attributes.uuid")};t.getUuid=c;t.shouldDisplayOffers=function(e){return!i(e)&&a(e)&&c(e)&&u(e)};t.hasAnOffer=function(e){return!i(e)&&a(e)&&c(e)&&!u(e)};t.buildPremiumLink=function(e){var t=(0,o.default)(e,"context.data.attributes.manager_url",!1),n=c(e);return t&&n?"".concat(t,"/cozy/instances/").concat(n,"/premium"):null}},function(e,t,n){var r=n(132),o=n(193),i=n(584),a=n(195),u=n(63),c=/\s+$/;e.exports=function(e,t,n){if((e=u(e))&&(n||void 0===t))return e.replace(c,"");if(!e||!(t=r(t)))return e;var s=a(e),l=i(s,a(t))+1;return o(s,0,l).join("")}},function(e,t,n){var r=n(237);e.exports=function(e,t){for(var n=e.length;n--&&r(t,e[n],0)>-1;);return n}},function(e,t,n){(function(e,r){var o;
49
+ /**
50
+ * @license
51
+ * Lodash <https://lodash.com/>
52
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
53
+ * Released under MIT license <https://lodash.com/license>
54
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
55
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
56
+ */(function(){var i="Expected a function",a="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",s="[object Array]",l="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Function]",h="[object GeneratorFunction]",y="[object Map]",v="[object Number]",g="[object Object]",m="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",_="[object WeakMap]",k="[object ArrayBuffer]",O="[object DataView]",S="[object Float32Array]",E="[object Float64Array]",j="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",A="[object Uint16Array]",D="[object Uint32Array]",R=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(z.source),L=RegExp(M.source),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,G=RegExp($.source),V=/^\s+|\s+$/g,J=/^\s+/,Y=/\s+$/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,oe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,ue=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,fe=/['\n\r\u2028\u2029\\]/g,pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",he="[\\ud800-\\udfff]",ye="["+de+"]",ve="["+pe+"]",ge="\\d+",me="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",we="[^\\ud800-\\udfff"+de+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",xe="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",ke="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="(?:"+be+"|"+we+")",je="(?:"+Se+"|"+we+")",Pe="(?:"+ve+"|"+xe+")"+"?",Ce="[\\ufe0e\\ufe0f]?"+Pe+("(?:\\u200d(?:"+[_e,ke,Oe].join("|")+")[\\ufe0e\\ufe0f]?"+Pe+")*"),Te="(?:"+[me,ke,Oe].join("|")+")"+Ce,Ae="(?:"+[_e+ve+"?",ve,ke,Oe,he].join("|")+")",De=RegExp("['’]","g"),Re=RegExp(ve,"g"),Ie=RegExp(xe+"(?="+xe+")|"+Ae+Ce,"g"),Ne=RegExp([Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ye,Se,"$"].join("|")+")",je+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ye,Se+Ee,"$"].join("|")+")",Se+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Te].join("|"),"g"),ze=RegExp("[\\u200d\\ud800-\\udfff"+pe+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Le=-1,Ue={};Ue[S]=Ue[E]=Ue[j]=Ue[P]=Ue[C]=Ue[T]=Ue["[object Uint8ClampedArray]"]=Ue[A]=Ue[D]=!0,Ue[c]=Ue[s]=Ue[k]=Ue[l]=Ue[O]=Ue[f]=Ue[p]=Ue[d]=Ue[y]=Ue[v]=Ue[g]=Ue[m]=Ue[b]=Ue[w]=Ue[_]=!1;var Be={};Be[c]=Be[s]=Be[k]=Be[O]=Be[l]=Be[f]=Be[S]=Be[E]=Be[j]=Be[P]=Be[C]=Be[y]=Be[v]=Be[g]=Be[m]=Be[b]=Be[w]=Be[x]=Be[T]=Be["[object Uint8ClampedArray]"]=Be[A]=Be[D]=!0,Be[p]=Be[d]=Be[_]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},He=parseFloat,We=parseInt,Qe="object"==typeof e&&e&&e.Object===Object&&e,$e="object"==typeof self&&self&&self.Object===Object&&self,Ge=Qe||$e||Function("return this")(),Ve=t&&!t.nodeType&&t,Je=Ve&&"object"==typeof r&&r&&!r.nodeType&&r,Ye=Je&&Je.exports===Ve,Ke=Ye&&Qe.process,Xe=function(){try{var e=Je&&Je.require&&Je.require("util").types;return e||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ze=Xe&&Xe.isArrayBuffer,et=Xe&&Xe.isDate,tt=Xe&&Xe.isMap,nt=Xe&&Xe.isRegExp,rt=Xe&&Xe.isSet,ot=Xe&&Xe.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function ut(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function st(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function lt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function ft(e,t){return!!(null==e?0:e.length)&&xt(e,t,0)>-1}function pt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function dt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ht(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function yt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function vt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function gt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=St("length");function bt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function wt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function xt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):wt(e,kt,n)}function _t(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function kt(e){return e!=e}function Ot(e,t){var n=null==e?0:e.length;return n?Pt(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Et(e){return function(t){return null==e?void 0:e[t]}}function jt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Pt(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Tt(e){return function(t){return e(t)}}function At(e,t){return dt(t,(function(t){return e[t]}))}function Dt(e,t){return e.has(t)}function Rt(e,t){for(var n=-1,r=e.length;++n<r&&xt(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&&xt(t,e[n],0)>-1;);return n}function Nt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var zt=Et({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mt=Et({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ft(e){return"\\"+qe[e]}function Lt(e){return ze.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Bt(e,t){return function(n){return e(t(n))}}function qt(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n];u!==t&&u!==a||(e[n]=a,i[o++]=n)}return i}function Ht(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function Wt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function Qt(e){return Lt(e)?function(e){var t=Ie.lastIndex=0;for(;Ie.test(e);)++t;return t}(e):mt(e)}function $t(e){return Lt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}var Gt=Et({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Vt=function e(t){var n,r=(t=null==t?Ge:Vt.defaults(Ge.Object(),t,Vt.pick(Ge,Fe))).Array,o=t.Date,pe=t.Error,de=t.Function,he=t.Math,ye=t.Object,ve=t.RegExp,ge=t.String,me=t.TypeError,be=r.prototype,we=de.prototype,xe=ye.prototype,_e=t["__core-js_shared__"],ke=we.toString,Oe=xe.hasOwnProperty,Se=0,Ee=(n=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",je=xe.toString,Pe=ke.call(ye),Ce=Ge._,Te=ve("^"+ke.call(Oe).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=Ye?t.Buffer:void 0,Ie=t.Symbol,ze=t.Uint8Array,qe=Ae?Ae.allocUnsafe:void 0,Qe=Bt(ye.getPrototypeOf,ye),$e=ye.create,Ve=xe.propertyIsEnumerable,Je=be.splice,Ke=Ie?Ie.isConcatSpreadable:void 0,Xe=Ie?Ie.iterator:void 0,mt=Ie?Ie.toStringTag:void 0,Et=function(){try{var e=ei(ye,"defineProperty");return e({},"",{}),e}catch(e){}}(),Jt=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Yt=o&&o.now!==Ge.Date.now&&o.now,Kt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Xt=he.ceil,Zt=he.floor,en=ye.getOwnPropertySymbols,tn=Ae?Ae.isBuffer:void 0,nn=t.isFinite,rn=be.join,on=Bt(ye.keys,ye),an=he.max,un=he.min,cn=o.now,sn=t.parseInt,ln=he.random,fn=be.reverse,pn=ei(t,"DataView"),dn=ei(t,"Map"),hn=ei(t,"Promise"),yn=ei(t,"Set"),vn=ei(t,"WeakMap"),gn=ei(ye,"create"),mn=vn&&new vn,bn={},wn=ji(pn),xn=ji(dn),_n=ji(hn),kn=ji(yn),On=ji(vn),Sn=Ie?Ie.prototype:void 0,En=Sn?Sn.valueOf:void 0,jn=Sn?Sn.toString:void 0;function Pn(e){if(Wa(e)&&!Ra(e)&&!(e instanceof Dn)){if(e instanceof An)return e;if(Oe.call(e,"__wrapped__"))return Pi(e)}return new An(e)}var Cn=function(){function e(){}return function(t){if(!Ha(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function An(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Dn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function In(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Nn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new In(e);this.size=t.size}function Fn(e,t){var n=Ra(e),r=!n&&Da(e),o=!n&&!r&&Ma(e),i=!n&&!r&&!o&&Xa(e),a=n||r||o||i,u=a?Ct(e.length,ge):[],c=u.length;for(var s in e)!t&&!Oe.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ui(s,c))||u.push(s);return u}function Ln(e){var t=e.length;return t?e[zr(0,t-1)]:void 0}function Un(e,t){return Oi(mo(e),Jn(t,0,e.length))}function Bn(e){return Oi(mo(e))}function qn(e,t,n){(void 0!==n&&!Ca(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var r=e[t];Oe.call(e,t)&&Ca(r,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(Ca(e[n][0],t))return n;return-1}function Qn(e,t,n,r){return er(e,(function(e,o,i){t(r,e,n(e),i)})),r}function $n(e,t){return e&&bo(t,wu(t),e)}function Gn(e,t,n){"__proto__"==t&&Et?Et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vn(e,t){for(var n=-1,o=t.length,i=r(o),a=null==e;++n<o;)i[n]=a?void 0:yu(e,t[n]);return i}function Jn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Yn(e,t,n,r,o,i){var a,u=1&t,s=2&t,p=4&t;if(n&&(a=o?n(e,r,o,i):n(e)),void 0!==a)return a;if(!Ha(e))return e;var _=Ra(e);if(_){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return mo(e,a)}else{var R=ri(e),I=R==d||R==h;if(Ma(e))return fo(e,u);if(R==g||R==c||I&&!o){if(a=s||I?{}:ii(e),!u)return s?function(e,t){return bo(e,ni(e),t)}(e,function(e,t){return e&&bo(t,xu(t),e)}(a,e)):function(e,t){return bo(e,ti(e),t)}(e,$n(a,e))}else{if(!Be[R])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case k:return po(e);case l:case f:return new r(+e);case O:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case E:case j:case P:case C:case T:case"[object Uint8ClampedArray]":case A:case D:return ho(e,n);case y:return new r;case v:case w:return new r(e);case m:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case x:return o=e,En?ye(En.call(o)):{}}var o}(e,R,u)}}i||(i=new Mn);var N=i.get(e);if(N)return N;i.set(e,a),Ja(e)?e.forEach((function(r){a.add(Yn(r,t,n,r,e,i))})):Qa(e)&&e.forEach((function(r,o){a.set(o,Yn(r,t,n,o,e,i))}));var z=_?void 0:(p?s?Go:$o:s?xu:wu)(e);return ut(z||e,(function(r,o){z&&(r=e[o=r]),Hn(a,o,Yn(r,t,n,o,e,i))})),a}function Kn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ye(e);r--;){var o=n[r],i=t[o],a=e[o];if(void 0===a&&!(o in e)||!i(a))return!1}return!0}function Xn(e,t,n){if("function"!=typeof e)throw new me(i);return wi((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var o=-1,i=ft,a=!0,u=e.length,c=[],s=t.length;if(!u)return c;n&&(t=dt(t,Tt(n))),r?(i=pt,a=!1):t.length>=200&&(i=Dt,a=!1,t=new zn(t));e:for(;++o<u;){var l=e[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,a&&f==f){for(var p=s;p--;)if(t[p]===f)continue e;c.push(l)}else i(t,f,r)||c.push(l)}return c}Pn.templateSettings={escape:U,evaluate:B,interpolate:q,variable:"",imports:{_:Pn}},Pn.prototype=Tn.prototype,Pn.prototype.constructor=Pn,An.prototype=Cn(Tn.prototype),An.prototype.constructor=An,Dn.prototype=Cn(Tn.prototype),Dn.prototype.constructor=Dn,Rn.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Oe.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:Oe.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&void 0===t?"__lodash_hash_undefined__":t,this},In.prototype.clear=function(){this.__data__=[],this.size=0},In.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Je.call(t,n,1),--this.size,!0)},In.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},In.prototype.has=function(e){return Wn(this.__data__,e)>-1},In.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Nn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(dn||In),string:new Rn}},Nn.prototype.delete=function(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t},Nn.prototype.get=function(e){return Xo(this,e).get(e)},Nn.prototype.has=function(e){return Xo(this,e).has(e)},Nn.prototype.set=function(e,t){var n=Xo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},zn.prototype.add=zn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},zn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new In,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof In){var r=n.__data__;if(!dn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(e,t),this.size=n.size,this};var er=_o(cr),tr=_o(sr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],a=t(i);if(null!=a&&(void 0===u?a==a&&!Ka(a):n(a,u)))var u=a,c=i}return c}function or(e,t){var n=[];return er(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function ir(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ai),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?ir(u,t-1,n,r,o):ht(o,u):r||(o[o.length]=u)}return o}var ar=ko(),ur=ko(!0);function cr(e,t){return e&&ar(e,t,wu)}function sr(e,t){return e&&ur(e,t,wu)}function lr(e,t){return lt(t,(function(t){return Ua(e[t])}))}function fr(e,t){for(var n=0,r=(t=uo(t,e)).length;null!=e&&n<r;)e=e[Ei(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ra(e)?r:ht(r,n(e))}function dr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":mt&&mt in ye(e)?function(e){var t=Oe.call(e,mt),n=e[mt];try{e[mt]=void 0;var r=!0}catch(e){}var o=je.call(e);r&&(t?e[mt]=n:delete e[mt]);return o}(e):function(e){return je.call(e)}(e)}function hr(e,t){return e>t}function yr(e,t){return null!=e&&Oe.call(e,t)}function vr(e,t){return null!=e&&t in ye(e)}function gr(e,t,n){for(var o=n?pt:ft,i=e[0].length,a=e.length,u=a,c=r(a),s=1/0,l=[];u--;){var f=e[u];u&&t&&(f=dt(f,Tt(t))),s=un(f.length,s),c[u]=!n&&(t||i>=120&&f.length>=120)?new zn(u&&f):void 0}f=e[0];var p=-1,d=c[0];e:for(;++p<i&&l.length<s;){var h=f[p],y=t?t(h):h;if(h=n||0!==h?h:0,!(d?Dt(d,y):o(l,y,n))){for(u=a;--u;){var v=c[u];if(!(v?Dt(v,y):o(e[u],y,n)))continue e}d&&d.push(y),l.push(h)}}return l}function mr(e,t,n){var r=null==(e=vi(e,t=uo(t,e)))?e:e[Ei(Li(t))];return null==r?void 0:it(r,e,n)}function br(e){return Wa(e)&&dr(e)==c}function wr(e,t,n,r,o){return e===t||(null==e||null==t||!Wa(e)&&!Wa(t)?e!=e&&t!=t:function(e,t,n,r,o,i){var a=Ra(e),u=Ra(t),d=a?s:ri(e),h=u?s:ri(t),_=(d=d==c?g:d)==g,S=(h=h==c?g:h)==g,E=d==h;if(E&&Ma(e)){if(!Ma(t))return!1;a=!0,_=!1}if(E&&!_)return i||(i=new Mn),a||Xa(e)?Wo(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!i(new ze(e),new ze(t)));case l:case f:case v:return Ca(+e,+t);case p:return e.name==t.name&&e.message==t.message;case m:case w:return e==t+"";case y:var u=Ut;case b:var c=1&r;if(u||(u=Ht),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var d=Wo(u(e),u(t),r,o,i,a);return a.delete(e),d;case x:if(En)return En.call(e)==En.call(t)}return!1}(e,t,d,n,r,o,i);if(!(1&n)){var j=_&&Oe.call(e,"__wrapped__"),P=S&&Oe.call(t,"__wrapped__");if(j||P){var C=j?e.value():e,T=P?t.value():t;return i||(i=new Mn),o(C,T,n,r,i)}}if(!E)return!1;return i||(i=new Mn),function(e,t,n,r,o,i){var a=1&n,u=$o(e),c=u.length,s=$o(t).length;if(c!=s&&!a)return!1;var l=c;for(;l--;){var f=u[l];if(!(a?f in t:Oe.call(t,f)))return!1}var p=i.get(e),d=i.get(t);if(p&&d)return p==t&&d==e;var h=!0;i.set(e,t),i.set(t,e);var y=a;for(;++l<c;){f=u[l];var v=e[f],g=t[f];if(r)var m=a?r(g,v,f,t,e,i):r(v,g,f,e,t,i);if(!(void 0===m?v===g||o(v,g,n,r,i):m)){h=!1;break}y||(y="constructor"==f)}if(h&&!y){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i)}(e,t,n,r,wr,o))}function xr(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=ye(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=n[o])[0],s=e[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var f=new Mn;if(r)var p=r(s,l,c,e,t,f);if(!(void 0===p?wr(l,s,3,r,f):p))return!1}}return!0}function _r(e){return!(!Ha(e)||(t=e,Ee&&Ee in t))&&(Ua(e)?Te:ae).test(ji(e));var t}function kr(e){return"function"==typeof e?e:null==e?$u:"object"==typeof e?Ra(e)?Cr(e[0],e[1]):Pr(e):tc(e)}function Or(e){if(!pi(e))return on(e);var t=[];for(var n in ye(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Sr(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var n in ye(e))t.push(n);return t}(e);var t=pi(e),n=[];for(var r in e)("constructor"!=r||!t&&Oe.call(e,r))&&n.push(r);return n}function Er(e,t){return e<t}function jr(e,t){var n=-1,o=Na(e)?r(e.length):[];return er(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Pr(e){var t=Zo(e);return 1==t.length&&t[0][2]?hi(t[0][0],t[0][1]):function(n){return n===e||xr(n,e,t)}}function Cr(e,t){return si(e)&&di(t)?hi(Ei(e),t):function(n){var r=yu(n,e);return void 0===r&&r===t?vu(n,e):wr(t,r,3)}}function Tr(e,t,n,r,o){e!==t&&ar(t,(function(i,a){if(o||(o=new Mn),Ha(i))!function(e,t,n,r,o,i,a){var u=mi(e,n),c=mi(t,n),s=a.get(c);if(s)return void qn(e,n,s);var l=i?i(u,c,n+"",e,t,a):void 0,f=void 0===l;if(f){var p=Ra(c),d=!p&&Ma(c),h=!p&&!d&&Xa(c);l=c,p||d||h?Ra(u)?l=u:za(u)?l=mo(u):d?(f=!1,l=fo(c,!0)):h?(f=!1,l=ho(c,!0)):l=[]:Ga(c)||Da(c)?(l=u,Da(u)?l=au(u):Ha(u)&&!Ua(u)||(l=ii(c))):f=!1}f&&(a.set(c,l),o(l,c,r,i,a),a.delete(c));qn(e,n,l)}(e,t,a,n,Tr,r,o);else{var u=r?r(mi(e,a),i,a+"",e,t,o):void 0;void 0===u&&(u=i),qn(e,a,u)}}),xu)}function Ar(e,t){var n=e.length;if(n)return ui(t+=t<0?n:0,n)?e[t]:void 0}function Dr(e,t,n){t=t.length?dt(t,(function(e){return Ra(e)?function(t){return fr(t,1===e.length?e[0]:e)}:e})):[$u];var r=-1;return t=dt(t,Tt(Ko())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(jr(e,(function(e,n,o){return{criteria:dt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,u=n.length;for(;++r<a;){var c=yo(o[r],i[r]);if(c){if(r>=u)return c;var s=n[r];return c*("desc"==s?-1:1)}}return e.index-t.index}(e,t,n)}))}function Rr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],u=fr(e,a);n(u,a)&&Br(i,uo(a,e),u)}return i}function Ir(e,t,n,r){var o=r?_t:xt,i=-1,a=t.length,u=e;for(e===t&&(t=mo(t)),n&&(u=dt(e,Tt(n)));++i<a;)for(var c=0,s=t[i],l=n?n(s):s;(c=o(u,l,c,r))>-1;)u!==e&&Je.call(u,c,1),Je.call(e,c,1);return e}function Nr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ui(o)?Je.call(e,o,1):Zr(e,o)}}return e}function zr(e,t){return e+Zt(ln()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fr(e,t){return xi(yi(e,t,$u),e+"")}function Lr(e){return Ln(Cu(e))}function Ur(e,t){var n=Cu(e);return Oi(n,Jn(t,0,n.length))}function Br(e,t,n,r){if(!Ha(e))return e;for(var o=-1,i=(t=uo(t,e)).length,a=i-1,u=e;null!=u&&++o<i;){var c=Ei(t[o]),s=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=u[c];void 0===(s=r?r(l,c,u):void 0)&&(s=Ha(l)?l:ui(t[o+1])?[]:{})}Hn(u,c,s),u=u[c]}return e}var qr=mn?function(e,t){return mn.set(e,t),e}:$u,Hr=Et?function(e,t){return Et(e,"toString",{configurable:!0,enumerable:!1,value:Hu(t),writable:!0})}:$u;function Wr(e){return Oi(Cu(e))}function Qr(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function $r(e,t){var n;return er(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!Ka(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return Vr(e,t,$u,n)}function Vr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,u=null===t,c=Ka(t),s=void 0===t;o<i;){var l=Zt((o+i)/2),f=n(e[l]),p=void 0!==f,d=null===f,h=f==f,y=Ka(f);if(a)var v=r||h;else v=s?h&&(r||p):u?h&&p&&(r||!d):c?h&&p&&!d&&(r||!y):!d&&!y&&(r?f<=t:f<t);v?o=l+1:i=l}return un(i,4294967294)}function Jr(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],u=t?t(a):a;if(!n||!Ca(u,c)){var c=u;i[o++]=0===a?0:a}}return i}function Yr(e){return"number"==typeof e?e:Ka(e)?NaN:+e}function Kr(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,Kr)+"";if(Ka(e))return jn?jn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xr(e,t,n){var r=-1,o=ft,i=e.length,a=!0,u=[],c=u;if(n)a=!1,o=pt;else if(i>=200){var s=t?null:Fo(e);if(s)return Ht(s);a=!1,o=Dt,c=new zn}else c=t?[]:u;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var p=c.length;p--;)if(c[p]===f)continue e;t&&c.push(f),u.push(l)}else o(c,f,n)||(c!==u&&c.push(f),u.push(l))}return u}function Zr(e,t){return null==(e=vi(e,t=uo(t,e)))||delete e[Ei(Li(t))]}function eo(e,t,n,r){return Br(e,t,n(fr(e,t)),r)}function to(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?Qr(e,r?0:i,r?i+1:o):Qr(e,r?i+1:0,r?o:i)}function no(e,t){var n=e;return n instanceof Dn&&(n=n.value()),yt(t,(function(e,t){return t.func.apply(t.thisArg,ht([e],t.args))}),n)}function ro(e,t,n){var o=e.length;if(o<2)return o?Xr(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var u=e[i],c=-1;++c<o;)c!=i&&(a[i]=Zn(a[i]||u,e[c],t,n));return Xr(ir(a,1),t,n)}function oo(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;){var u=r<i?t[r]:void 0;n(a,e[r],u)}return a}function io(e){return za(e)?e:[]}function ao(e){return"function"==typeof e?e:$u}function uo(e,t){return Ra(e)?e:si(e,t)?[e]:Si(uu(e))}var co=Fr;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Qr(e,t,n)}var lo=Jt||function(e){return Ge.clearTimeout(e)};function fo(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function ho(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function yo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Ka(e),a=void 0!==t,u=null===t,c=t==t,s=Ka(t);if(!u&&!s&&!i&&e>t||i&&a&&c&&!u&&!s||r&&a&&c||!n&&c||!o)return 1;if(!r&&!i&&!s&&e<t||s&&n&&o&&!r&&!i||u&&n&&o||!a&&o||!c)return-1}return 0}function vo(e,t,n,o){for(var i=-1,a=e.length,u=n.length,c=-1,s=t.length,l=an(a-u,0),f=r(s+l),p=!o;++c<s;)f[c]=t[c];for(;++i<u;)(p||i<a)&&(f[n[i]]=e[i]);for(;l--;)f[c++]=e[i++];return f}function go(e,t,n,o){for(var i=-1,a=e.length,u=-1,c=n.length,s=-1,l=t.length,f=an(a-c,0),p=r(f+l),d=!o;++i<f;)p[i]=e[i];for(var h=i;++s<l;)p[h+s]=t[s];for(;++u<c;)(d||i<a)&&(p[h+n[u]]=e[i++]);return p}function mo(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function bo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var u=t[i],c=r?r(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),o?Gn(n,u,c):Hn(n,u,c)}return n}function wo(e,t){return function(n,r){var o=Ra(n)?at:Qn,i=t?t():{};return o(n,e,Ko(r,2),i)}}function xo(e){return Fr((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ci(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=ye(t);++r<o;){var u=n[r];u&&e(t,u,r,i)}return t}))}function _o(e,t){return function(n,r){if(null==n)return n;if(!Na(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=ye(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function ko(e){return function(t,n,r){for(var o=-1,i=ye(t),a=r(t),u=a.length;u--;){var c=a[e?u:++o];if(!1===n(i[c],c,i))break}return t}}function Oo(e){return function(t){var n=Lt(t=uu(t))?$t(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function So(e){return function(t){return yt(Uu(Du(t).replace(De,"")),e,"")}}function Eo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Cn(e.prototype),r=e.apply(n,t);return Ha(r)?r:n}}function jo(e){return function(t,n,r){var o=ye(t);if(!Na(t)){var i=Ko(n,3);t=wu(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[i?t[a]:a]:void 0}}function Po(e){return Qo((function(t){var n=t.length,r=n,o=An.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new me(i);if(o&&!u&&"wrapper"==Jo(a))var u=new An([],!0)}for(r=u?r:n;++r<n;){var c=Jo(a=t[r]),s="wrapper"==c?Vo(a):void 0;u=s&&li(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?u[Jo(s[0])].apply(u,s[3]):1==a.length&&li(a)?u[c]():u.thru(a)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&Ra(r))return u.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function Co(e,t,n,o,i,a,u,c,s,l){var f=128&t,p=1&t,d=2&t,h=24&t,y=512&t,v=d?void 0:Eo(e);return function g(){for(var m=arguments.length,b=r(m),w=m;w--;)b[w]=arguments[w];if(h)var x=Yo(g),_=Nt(b,x);if(o&&(b=vo(b,o,i,h)),a&&(b=go(b,a,u,h)),m-=_,h&&m<l){var k=qt(b,x);return zo(e,t,Co,g.placeholder,n,b,k,c,s,l-m)}var O=p?n:this,S=d?O[e]:e;return m=b.length,c?b=gi(b,c):y&&m>1&&b.reverse(),f&&s<m&&(b.length=s),this&&this!==Ge&&this instanceof g&&(S=v||Eo(S)),S.apply(O,b)}}function To(e,t){return function(n,r){return function(e,t,n,r){return cr(e,(function(e,o,i){t(r,n(e),o,i)})),r}(n,e,t(r),{})}}function Ao(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Kr(n),r=Kr(r)):(n=Yr(n),r=Yr(r)),o=e(n,r)}return o}}function Do(e){return Qo((function(t){return t=dt(t,Tt(Ko())),Fr((function(n){var r=this;return e(t,(function(e){return it(e,r,n)}))}))}))}function Ro(e,t){var n=(t=void 0===t?" ":Kr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Xt(e/Qt(t)));return Lt(t)?so($t(r),0,e).join(""):r.slice(0,e)}function Io(e){return function(t,n,o){return o&&"number"!=typeof o&&ci(t,n,o)&&(n=o=void 0),t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n,o){for(var i=-1,a=an(Xt((t-e)/(n||1)),0),u=r(a);a--;)u[o?a:++i]=e,e+=n;return u}(t,n,o=void 0===o?t<n?1:-1:nu(o),e)}}function No(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=iu(t),n=iu(n)),e(t,n)}}function zo(e,t,n,r,o,i,a,u,c,s){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var f=[e,t,o,l?i:void 0,l?a:void 0,l?void 0:i,l?void 0:a,u,c,s],p=n.apply(void 0,f);return li(e)&&bi(p,f),p.placeholder=r,_i(p,e,t)}function Mo(e){var t=he[e];return function(e,n){if(e=iu(e),(n=null==n?0:un(ru(n),292))&&nn(e)){var r=(uu(e)+"e").split("e");return+((r=(uu(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Fo=yn&&1/Ht(new yn([,-0]))[1]==1/0?function(e){return new yn(e)}:Ku;function Lo(e){return function(t){var n=ri(t);return n==y?Ut(t):n==b?Wt(t):function(e,t){return dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Uo(e,t,n,o,u,c,s,l){var f=2&t;if(!f&&"function"!=typeof e)throw new me(i);var p=o?o.length:0;if(p||(t&=-97,o=u=void 0),s=void 0===s?s:an(ru(s),0),l=void 0===l?l:ru(l),p-=u?u.length:0,64&t){var d=o,h=u;o=u=void 0}var y=f?void 0:Vo(e),v=[e,t,n,o,u,d,h,c,s,l];if(y&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,u=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!u)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var s=e[3];e[3]=s?vo(s,c,t[4]):c,e[4]=s?qt(e[3],a):t[4]}(c=t[5])&&(s=e[5],e[5]=s?go(s,c,t[6]):c,e[6]=s?qt(e[5],a):t[6]);(c=t[7])&&(e[7]=c);128&r&&(e[8]=null==e[8]?t[8]:un(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(v,y),e=v[0],t=v[1],n=v[2],o=v[3],u=v[4],!(l=v[9]=void 0===v[9]?f?0:e.length:an(v[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var o=Eo(e);return function i(){for(var a=arguments.length,u=r(a),c=a,s=Yo(i);c--;)u[c]=arguments[c];var l=a<3&&u[0]!==s&&u[a-1]!==s?[]:qt(u,s);if((a-=l.length)<n)return zo(e,t,Co,i.placeholder,void 0,u,l,void 0,void 0,n-a);var f=this&&this!==Ge&&this instanceof i?o:e;return it(f,this,u)}}(e,t,l):32!=t&&33!=t||u.length?Co.apply(void 0,v):function(e,t,n,o){var i=1&t,a=Eo(e);return function t(){for(var u=-1,c=arguments.length,s=-1,l=o.length,f=r(l+c),p=this&&this!==Ge&&this instanceof t?a:e;++s<l;)f[s]=o[s];for(;c--;)f[s++]=arguments[++u];return it(p,i?n:this,f)}}(e,t,n,o);else var g=function(e,t,n){var r=1&t,o=Eo(e);return function t(){var i=this&&this!==Ge&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,n);return _i((y?qr:bi)(g,v),e,t)}function Bo(e,t,n,r){return void 0===e||Ca(e,xe[n])&&!Oe.call(r,n)?t:e}function qo(e,t,n,r,o,i){return Ha(e)&&Ha(t)&&(i.set(t,e),Tr(e,t,void 0,qo,i),i.delete(t)),e}function Ho(e){return Ga(e)?void 0:e}function Wo(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),l=i.get(t);if(s&&l)return s==t&&l==e;var f=-1,p=!0,d=2&n?new zn:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var h=e[f],y=t[f];if(r)var v=a?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==v){if(v)continue;p=!1;break}if(d){if(!gt(t,(function(e,t){if(!Dt(d,t)&&(h===e||o(h,e,n,r,i)))return d.push(t)}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Qo(e){return xi(yi(e,void 0,Ii),e+"")}function $o(e){return pr(e,wu,ti)}function Go(e){return pr(e,xu,ni)}var Vo=mn?function(e){return mn.get(e)}:Ku;function Jo(e){for(var t=e.name+"",n=bn[t],r=Oe.call(bn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function Yo(e){return(Oe.call(Pn,"placeholder")?Pn:e).placeholder}function Ko(){var e=Pn.iteratee||Gu;return e=e===Gu?kr:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Zo(e){for(var t=wu(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,di(o)]}return t}function ei(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _r(n)?n:void 0}var ti=en?function(e){return null==e?[]:(e=ye(e),lt(en(e),(function(t){return Ve.call(e,t)})))}:oc,ni=en?function(e){for(var t=[];e;)ht(t,ti(e)),e=Qe(e);return t}:oc,ri=dr;function oi(e,t,n){for(var r=-1,o=(t=uo(t,e)).length,i=!1;++r<o;){var a=Ei(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&qa(o)&&ui(a,o)&&(Ra(e)||Da(e))}function ii(e){return"function"!=typeof e.constructor||pi(e)?{}:Cn(Qe(e))}function ai(e){return Ra(e)||Da(e)||!!(Ke&&e&&e[Ke])}function ui(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ce.test(e))&&e>-1&&e%1==0&&e<t}function ci(e,t,n){if(!Ha(n))return!1;var r=typeof t;return!!("number"==r?Na(n)&&ui(t,n.length):"string"==r&&t in n)&&Ca(n[t],e)}function si(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ka(e))||(W.test(e)||!H.test(e)||null!=t&&e in ye(t))}function li(e){var t=Jo(e),n=Pn[t];if("function"!=typeof n||!(t in Dn.prototype))return!1;if(e===n)return!0;var r=Vo(n);return!!r&&e===r[0]}(pn&&ri(new pn(new ArrayBuffer(1)))!=O||dn&&ri(new dn)!=y||hn&&"[object Promise]"!=ri(hn.resolve())||yn&&ri(new yn)!=b||vn&&ri(new vn)!=_)&&(ri=function(e){var t=dr(e),n=t==g?e.constructor:void 0,r=n?ji(n):"";if(r)switch(r){case wn:return O;case xn:return y;case _n:return"[object Promise]";case kn:return b;case On:return _}return t});var fi=_e?Ua:ic;function pi(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xe)}function di(e){return e==e&&!Ha(e)}function hi(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in ye(n)))}}function yi(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=an(o.length-t,0),u=r(a);++i<a;)u[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(u),it(e,this,c)}}function vi(e,t){return t.length<2?e:fr(e,Qr(t,0,-1))}function gi(e,t){for(var n=e.length,r=un(t.length,n),o=mo(e);r--;){var i=t[r];e[r]=ui(i,n)?o[i]:void 0}return e}function mi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var bi=ki(qr),wi=Kt||function(e,t){return Ge.setTimeout(e,t)},xi=ki(Hr);function _i(e,t,n){var r=t+"";return xi(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return ut(u,(function(n){var r="_."+n[0];t&n[1]&&!ft(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Z):[]}(r),n)))}function ki(e){var t=0,n=0;return function(){var r=cn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Oi(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=zr(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Si=function(e){var t=ka(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,(function(e,n,r,o){t.push(r?o.replace(te,"$1"):n||e)})),t}));function Ei(e){if("string"==typeof e||Ka(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ji(e){if(null!=e){try{return ke.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pi(e){if(e instanceof Dn)return e.clone();var t=new An(e.__wrapped__,e.__chain__);return t.__actions__=mo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ci=Fr((function(e,t){return za(e)?Zn(e,ir(t,1,za,!0)):[]})),Ti=Fr((function(e,t){var n=Li(t);return za(n)&&(n=void 0),za(e)?Zn(e,ir(t,1,za,!0),Ko(n,2)):[]})),Ai=Fr((function(e,t){var n=Li(t);return za(n)&&(n=void 0),za(e)?Zn(e,ir(t,1,za,!0),void 0,n):[]}));function Di(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ru(n);return o<0&&(o=an(r+o,0)),wt(e,Ko(t,3),o)}function Ri(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ru(n),o=n<0?an(r+o,0):un(o,r-1)),wt(e,Ko(t,3),o,!0)}function Ii(e){return(null==e?0:e.length)?ir(e,1):[]}function Ni(e){return e&&e.length?e[0]:void 0}var zi=Fr((function(e){var t=dt(e,io);return t.length&&t[0]===e[0]?gr(t):[]})),Mi=Fr((function(e){var t=Li(e),n=dt(e,io);return t===Li(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gr(n,Ko(t,2)):[]})),Fi=Fr((function(e){var t=Li(e),n=dt(e,io);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gr(n,void 0,t):[]}));function Li(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ui=Fr(Bi);function Bi(e,t){return e&&e.length&&t&&t.length?Ir(e,t):e}var qi=Qo((function(e,t){var n=null==e?0:e.length,r=Vn(e,t);return Nr(e,dt(t,(function(e){return ui(e,n)?+e:e})).sort(yo)),r}));function Hi(e){return null==e?e:fn.call(e)}var Wi=Fr((function(e){return Xr(ir(e,1,za,!0))})),Qi=Fr((function(e){var t=Li(e);return za(t)&&(t=void 0),Xr(ir(e,1,za,!0),Ko(t,2))})),$i=Fr((function(e){var t=Li(e);return t="function"==typeof t?t:void 0,Xr(ir(e,1,za,!0),void 0,t)}));function Gi(e){if(!e||!e.length)return[];var t=0;return e=lt(e,(function(e){if(za(e))return t=an(e.length,t),!0})),Ct(t,(function(t){return dt(e,St(t))}))}function Vi(e,t){if(!e||!e.length)return[];var n=Gi(e);return null==t?n:dt(n,(function(e){return it(t,void 0,e)}))}var Ji=Fr((function(e,t){return za(e)?Zn(e,t):[]})),Yi=Fr((function(e){return ro(lt(e,za))})),Ki=Fr((function(e){var t=Li(e);return za(t)&&(t=void 0),ro(lt(e,za),Ko(t,2))})),Xi=Fr((function(e){var t=Li(e);return t="function"==typeof t?t:void 0,ro(lt(e,za),void 0,t)})),Zi=Fr(Gi);var ea=Fr((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Vi(e,n)}));function ta(e){var t=Pn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=Qo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Vn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Dn&&ui(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new An(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(o)}));var oa=wo((function(e,t,n){Oe.call(e,n)?++e[n]:Gn(e,n,1)}));var ia=jo(Di),aa=jo(Ri);function ua(e,t){return(Ra(e)?ut:er)(e,Ko(t,3))}function ca(e,t){return(Ra(e)?ct:tr)(e,Ko(t,3))}var sa=wo((function(e,t,n){Oe.call(e,n)?e[n].push(t):Gn(e,n,[t])}));var la=Fr((function(e,t,n){var o=-1,i="function"==typeof t,a=Na(e)?r(e.length):[];return er(e,(function(e){a[++o]=i?it(t,e,n):mr(e,t,n)})),a})),fa=wo((function(e,t,n){Gn(e,n,t)}));function pa(e,t){return(Ra(e)?dt:jr)(e,Ko(t,3))}var da=wo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ha=Fr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ci(e,t[0],t[1])?t=[]:n>2&&ci(t[0],t[1],t[2])&&(t=[t[0]]),Dr(e,ir(t,1),[])})),ya=Yt||function(){return Ge.Date.now()};function va(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var n;if("function"!=typeof t)throw new me(i);return e=ru(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ma=Fr((function(e,t,n){var r=1;if(n.length){var o=qt(n,Yo(ma));r|=32}return Uo(e,r,t,n,o)})),ba=Fr((function(e,t,n){var r=3;if(n.length){var o=qt(n,Yo(ba));r|=32}return Uo(t,r,e,n,o)}));function wa(e,t,n){var r,o,a,u,c,s,l=0,f=!1,p=!1,d=!0;if("function"!=typeof e)throw new me(i);function h(t){var n=r,i=o;return r=o=void 0,l=t,u=e.apply(i,n)}function y(e){return l=e,c=wi(g,t),f?h(e):u}function v(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-l>=a}function g(){var e=ya();if(v(e))return m(e);c=wi(g,function(e){var n=t-(e-s);return p?un(n,a-(e-l)):n}(e))}function m(e){return c=void 0,d&&r?h(e):(r=o=void 0,u)}function b(){var e=ya(),n=v(e);if(r=arguments,o=this,s=e,n){if(void 0===c)return y(s);if(p)return lo(c),c=wi(g,t),h(s)}return void 0===c&&(c=wi(g,t)),u}return t=iu(t)||0,Ha(n)&&(f=!!n.leading,a=(p="maxWait"in n)?an(iu(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==c&&lo(c),l=0,r=s=o=c=void 0},b.flush=function(){return void 0===c?u:m(ya())},b}var xa=Fr((function(e,t){return Xn(e,1,t)})),_a=Fr((function(e,t,n){return Xn(e,iu(t)||0,n)}));function ka(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(ka.Cache||Nn),n}function Oa(e){if("function"!=typeof e)throw new me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ka.Cache=Nn;var Sa=co((function(e,t){var n=(t=1==t.length&&Ra(t[0])?dt(t[0],Tt(Ko())):dt(ir(t,1),Tt(Ko()))).length;return Fr((function(r){for(var o=-1,i=un(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return it(e,this,r)}))})),Ea=Fr((function(e,t){return Uo(e,32,void 0,t,qt(t,Yo(Ea)))})),ja=Fr((function(e,t){return Uo(e,64,void 0,t,qt(t,Yo(ja)))})),Pa=Qo((function(e,t){return Uo(e,256,void 0,void 0,void 0,t)}));function Ca(e,t){return e===t||e!=e&&t!=t}var Ta=No(hr),Aa=No((function(e,t){return e>=t})),Da=br(function(){return arguments}())?br:function(e){return Wa(e)&&Oe.call(e,"callee")&&!Ve.call(e,"callee")},Ra=r.isArray,Ia=Ze?Tt(Ze):function(e){return Wa(e)&&dr(e)==k};function Na(e){return null!=e&&qa(e.length)&&!Ua(e)}function za(e){return Wa(e)&&Na(e)}var Ma=tn||ic,Fa=et?Tt(et):function(e){return Wa(e)&&dr(e)==f};function La(e){if(!Wa(e))return!1;var t=dr(e);return t==p||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function Ua(e){if(!Ha(e))return!1;var t=dr(e);return t==d||t==h||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ba(e){return"number"==typeof e&&e==ru(e)}function qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wa(e){return null!=e&&"object"==typeof e}var Qa=tt?Tt(tt):function(e){return Wa(e)&&ri(e)==y};function $a(e){return"number"==typeof e||Wa(e)&&dr(e)==v}function Ga(e){if(!Wa(e)||dr(e)!=g)return!1;var t=Qe(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ke.call(n)==Pe}var Va=nt?Tt(nt):function(e){return Wa(e)&&dr(e)==m};var Ja=rt?Tt(rt):function(e){return Wa(e)&&ri(e)==b};function Ya(e){return"string"==typeof e||!Ra(e)&&Wa(e)&&dr(e)==w}function Ka(e){return"symbol"==typeof e||Wa(e)&&dr(e)==x}var Xa=ot?Tt(ot):function(e){return Wa(e)&&qa(e.length)&&!!Ue[dr(e)]};var Za=No(Er),eu=No((function(e,t){return e<=t}));function tu(e){if(!e)return[];if(Na(e))return Ya(e)?$t(e):mo(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=ri(e);return(t==y?Ut:t==b?Ht:Cu)(e)}function nu(e){return e?(e=iu(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ru(e){var t=nu(e),n=t%1;return t==t?n?t-n:t:0}function ou(e){return e?Jn(ru(e),0,4294967295):0}function iu(e){if("number"==typeof e)return e;if(Ka(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(V,"");var n=ie.test(e);return n||ue.test(e)?We(e.slice(2),n?2:8):oe.test(e)?NaN:+e}function au(e){return bo(e,xu(e))}function uu(e){return null==e?"":Kr(e)}var cu=xo((function(e,t){if(pi(t)||Na(t))bo(t,wu(t),e);else for(var n in t)Oe.call(t,n)&&Hn(e,n,t[n])})),su=xo((function(e,t){bo(t,xu(t),e)})),lu=xo((function(e,t,n,r){bo(t,xu(t),e,r)})),fu=xo((function(e,t,n,r){bo(t,wu(t),e,r)})),pu=Qo(Vn);var du=Fr((function(e,t){e=ye(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&ci(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=xu(i),u=-1,c=a.length;++u<c;){var s=a[u],l=e[s];(void 0===l||Ca(l,xe[s])&&!Oe.call(e,s))&&(e[s]=i[s])}return e})),hu=Fr((function(e){return e.push(void 0,qo),it(ku,void 0,e)}));function yu(e,t,n){var r=null==e?void 0:fr(e,t);return void 0===r?n:r}function vu(e,t){return null!=e&&oi(e,t,vr)}var gu=To((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=n}),Hu($u)),mu=To((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Oe.call(e,t)?e[t].push(n):e[t]=[n]}),Ko),bu=Fr(mr);function wu(e){return Na(e)?Fn(e):Or(e)}function xu(e){return Na(e)?Fn(e,!0):Sr(e)}var _u=xo((function(e,t,n){Tr(e,t,n)})),ku=xo((function(e,t,n,r){Tr(e,t,n,r)})),Ou=Qo((function(e,t){var n={};if(null==e)return n;var r=!1;t=dt(t,(function(t){return t=uo(t,e),r||(r=t.length>1),t})),bo(e,Go(e),n),r&&(n=Yn(n,7,Ho));for(var o=t.length;o--;)Zr(n,t[o]);return n}));var Su=Qo((function(e,t){return null==e?{}:function(e,t){return Rr(e,t,(function(t,n){return vu(e,n)}))}(e,t)}));function Eu(e,t){if(null==e)return{};var n=dt(Go(e),(function(e){return[e]}));return t=Ko(t),Rr(e,n,(function(e,n){return t(e,n[0])}))}var ju=Lo(wu),Pu=Lo(xu);function Cu(e){return null==e?[]:At(e,wu(e))}var Tu=So((function(e,t,n){return t=t.toLowerCase(),e+(n?Au(t):t)}));function Au(e){return Lu(uu(e).toLowerCase())}function Du(e){return(e=uu(e))&&e.replace(se,zt).replace(Re,"")}var Ru=So((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Iu=So((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Nu=Oo("toLowerCase");var zu=So((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Mu=So((function(e,t,n){return e+(n?" ":"")+Lu(t)}));var Fu=So((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Lu=Oo("toUpperCase");function Uu(e,t,n){return e=uu(e),void 0===(t=n?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Ne)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Bu=Fr((function(e,t){try{return it(e,void 0,t)}catch(e){return La(e)?e:new pe(e)}})),qu=Qo((function(e,t){return ut(t,(function(t){t=Ei(t),Gn(e,t,ma(e[t],e))})),e}));function Hu(e){return function(){return e}}var Wu=Po(),Qu=Po(!0);function $u(e){return e}function Gu(e){return kr("function"==typeof e?e:Yn(e,1))}var Vu=Fr((function(e,t){return function(n){return mr(n,e,t)}})),Ju=Fr((function(e,t){return function(n){return mr(e,n,t)}}));function Yu(e,t,n){var r=wu(t),o=lr(t,r);null!=n||Ha(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=lr(t,wu(t)));var i=!(Ha(n)&&"chain"in n&&!n.chain),a=Ua(e);return ut(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=mo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ht([this.value()],arguments))})})),e}function Ku(){}var Xu=Do(dt),Zu=Do(st),ec=Do(gt);function tc(e){return si(e)?St(Ei(e)):function(e){return function(t){return fr(t,e)}}(e)}var nc=Io(),rc=Io(!0);function oc(){return[]}function ic(){return!1}var ac=Ao((function(e,t){return e+t}),0),uc=Mo("ceil"),cc=Ao((function(e,t){return e/t}),1),sc=Mo("floor");var lc,fc=Ao((function(e,t){return e*t}),1),pc=Mo("round"),dc=Ao((function(e,t){return e-t}),0);return Pn.after=function(e,t){if("function"!=typeof t)throw new me(i);return e=ru(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=va,Pn.assign=cu,Pn.assignIn=su,Pn.assignInWith=lu,Pn.assignWith=fu,Pn.at=pu,Pn.before=ga,Pn.bind=ma,Pn.bindAll=qu,Pn.bindKey=ba,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Pn.chain=ta,Pn.chunk=function(e,t,n){t=(n?ci(e,t,n):void 0===t)?1:an(ru(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,u=r(Xt(o/t));i<o;)u[a++]=Qr(e,i,i+=t);return u},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return ht(Ra(n)?mo(n):[n],ir(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,n=Ko();return e=t?dt(e,(function(e){if("function"!=typeof e[1])throw new me(i);return[n(e[0]),e[1]]})):[],Fr((function(n){for(var r=-1;++r<t;){var o=e[r];if(it(o[0],this,n))return it(o[1],this,n)}}))},Pn.conforms=function(e){return function(e){var t=wu(e);return function(n){return Kn(n,e,t)}}(Yn(e,1))},Pn.constant=Hu,Pn.countBy=oa,Pn.create=function(e,t){var n=Cn(e);return null==t?n:$n(n,t)},Pn.curry=function e(t,n,r){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Pn.curryRight=function e(t,n,r){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Pn.debounce=wa,Pn.defaults=du,Pn.defaultsDeep=hu,Pn.defer=xa,Pn.delay=_a,Pn.difference=Ci,Pn.differenceBy=Ti,Pn.differenceWith=Ai,Pn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,(t=n||void 0===t?1:ru(t))<0?0:t,r):[]},Pn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,0,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!0):[]},Pn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ci(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ru(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ru(r))<0&&(r+=o),r=n>r?0:ou(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Pn.filter=function(e,t){return(Ra(e)?lt:or)(e,Ko(t,3))},Pn.flatMap=function(e,t){return ir(pa(e,t),1)},Pn.flatMapDeep=function(e,t){return ir(pa(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ru(n),ir(pa(e,t),n)},Pn.flatten=Ii,Pn.flattenDeep=function(e){return(null==e?0:e.length)?ir(e,1/0):[]},Pn.flattenDepth=function(e,t){return(null==e?0:e.length)?ir(e,t=void 0===t?1:ru(t)):[]},Pn.flip=function(e){return Uo(e,512)},Pn.flow=Wu,Pn.flowRight=Qu,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Pn.functions=function(e){return null==e?[]:lr(e,wu(e))},Pn.functionsIn=function(e){return null==e?[]:lr(e,xu(e))},Pn.groupBy=sa,Pn.initial=function(e){return(null==e?0:e.length)?Qr(e,0,-1):[]},Pn.intersection=zi,Pn.intersectionBy=Mi,Pn.intersectionWith=Fi,Pn.invert=gu,Pn.invertBy=mu,Pn.invokeMap=la,Pn.iteratee=Gu,Pn.keyBy=fa,Pn.keys=wu,Pn.keysIn=xu,Pn.map=pa,Pn.mapKeys=function(e,t){var n={};return t=Ko(t,3),cr(e,(function(e,r,o){Gn(n,t(e,r,o),e)})),n},Pn.mapValues=function(e,t){var n={};return t=Ko(t,3),cr(e,(function(e,r,o){Gn(n,r,t(e,r,o))})),n},Pn.matches=function(e){return Pr(Yn(e,1))},Pn.matchesProperty=function(e,t){return Cr(e,Yn(t,1))},Pn.memoize=ka,Pn.merge=_u,Pn.mergeWith=ku,Pn.method=Vu,Pn.methodOf=Ju,Pn.mixin=Yu,Pn.negate=Oa,Pn.nthArg=function(e){return e=ru(e),Fr((function(t){return Ar(t,e)}))},Pn.omit=Ou,Pn.omitBy=function(e,t){return Eu(e,Oa(Ko(t)))},Pn.once=function(e){return ga(2,e)},Pn.orderBy=function(e,t,n,r){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=r?void 0:n)||(n=null==n?[]:[n]),Dr(e,t,n))},Pn.over=Xu,Pn.overArgs=Sa,Pn.overEvery=Zu,Pn.overSome=ec,Pn.partial=Ea,Pn.partialRight=ja,Pn.partition=da,Pn.pick=Su,Pn.pickBy=Eu,Pn.property=tc,Pn.propertyOf=function(e){return function(t){return null==e?void 0:fr(e,t)}},Pn.pull=Ui,Pn.pullAll=Bi,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ir(e,t,Ko(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ir(e,t,void 0,n):e},Pn.pullAt=qi,Pn.range=nc,Pn.rangeRight=rc,Pn.rearg=Pa,Pn.reject=function(e,t){return(Ra(e)?lt:or)(e,Oa(Ko(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Ko(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Nr(e,o),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new me(i);return Fr(e,t=void 0===t?t:ru(t))},Pn.reverse=Hi,Pn.sampleSize=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:ru(t),(Ra(e)?Un:Ur)(e,t)},Pn.set=function(e,t,n){return null==e?e:Br(e,t,n)},Pn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Br(e,t,n,r)},Pn.shuffle=function(e){return(Ra(e)?Bn:Wr)(e)},Pn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ci(e,t,n)?(t=0,n=r):(t=null==t?0:ru(t),n=void 0===n?r:ru(n)),Qr(e,t,n)):[]},Pn.sortBy=ha,Pn.sortedUniq=function(e){return e&&e.length?Jr(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Jr(e,Ko(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ci(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=uu(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=Kr(t))&&Lt(e)?so($t(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new me(i);return t=null==t?0:an(ru(t),0),Fr((function(n){var r=n[t],o=so(n,0,t);return r&&ht(o,r),it(e,this,o)}))},Pn.tail=function(e){var t=null==e?0:e.length;return t?Qr(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?Qr(e,0,(t=n||void 0===t?1:ru(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t,r):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?to(e,Ko(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new me(i);return Ha(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),wa(e,t,{leading:r,maxWait:t,trailing:o})},Pn.thru=na,Pn.toArray=tu,Pn.toPairs=ju,Pn.toPairsIn=Pu,Pn.toPath=function(e){return Ra(e)?dt(e,Ei):Ka(e)?[e]:mo(Si(uu(e)))},Pn.toPlainObject=au,Pn.transform=function(e,t,n){var r=Ra(e),o=r||Ma(e)||Xa(e);if(t=Ko(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Ha(e)&&Ua(i)?Cn(Qe(e)):{}}return(o?ut:cr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Pn.unary=function(e){return va(e,1)},Pn.union=Wi,Pn.unionBy=Qi,Pn.unionWith=$i,Pn.uniq=function(e){return e&&e.length?Xr(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Xr(e,Ko(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xr(e,void 0,t):[]},Pn.unset=function(e,t){return null==e||Zr(e,t)},Pn.unzip=Gi,Pn.unzipWith=Vi,Pn.update=function(e,t,n){return null==e?e:eo(e,t,ao(n))},Pn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:eo(e,t,ao(n),r)},Pn.values=Cu,Pn.valuesIn=function(e){return null==e?[]:At(e,xu(e))},Pn.without=Ji,Pn.words=Uu,Pn.wrap=function(e,t){return Ea(ao(t),e)},Pn.xor=Yi,Pn.xorBy=Ki,Pn.xorWith=Xi,Pn.zip=Zi,Pn.zipObject=function(e,t){return oo(e||[],t||[],Hn)},Pn.zipObjectDeep=function(e,t){return oo(e||[],t||[],Br)},Pn.zipWith=ea,Pn.entries=ju,Pn.entriesIn=Pu,Pn.extend=su,Pn.extendWith=lu,Yu(Pn,Pn),Pn.add=ac,Pn.attempt=Bu,Pn.camelCase=Tu,Pn.capitalize=Au,Pn.ceil=uc,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=iu(n))==n?n:0),void 0!==t&&(t=(t=iu(t))==t?t:0),Jn(iu(e),t,n)},Pn.clone=function(e){return Yn(e,4)},Pn.cloneDeep=function(e){return Yn(e,5)},Pn.cloneDeepWith=function(e,t){return Yn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Yn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Kn(e,t,wu(t))},Pn.deburr=Du,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cc,Pn.endsWith=function(e,t,n){e=uu(e),t=Kr(t);var r=e.length,o=n=void 0===n?r:Jn(ru(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Pn.eq=Ca,Pn.escape=function(e){return(e=uu(e))&&L.test(e)?e.replace(M,Mt):e},Pn.escapeRegExp=function(e){return(e=uu(e))&&G.test(e)?e.replace($,"\\$&"):e},Pn.every=function(e,t,n){var r=Ra(e)?st:nr;return n&&ci(e,t,n)&&(t=void 0),r(e,Ko(t,3))},Pn.find=ia,Pn.findIndex=Di,Pn.findKey=function(e,t){return bt(e,Ko(t,3),cr)},Pn.findLast=aa,Pn.findLastIndex=Ri,Pn.findLastKey=function(e,t){return bt(e,Ko(t,3),sr)},Pn.floor=sc,Pn.forEach=ua,Pn.forEachRight=ca,Pn.forIn=function(e,t){return null==e?e:ar(e,Ko(t,3),xu)},Pn.forInRight=function(e,t){return null==e?e:ur(e,Ko(t,3),xu)},Pn.forOwn=function(e,t){return e&&cr(e,Ko(t,3))},Pn.forOwnRight=function(e,t){return e&&sr(e,Ko(t,3))},Pn.get=yu,Pn.gt=Ta,Pn.gte=Aa,Pn.has=function(e,t){return null!=e&&oi(e,t,yr)},Pn.hasIn=vu,Pn.head=Ni,Pn.identity=$u,Pn.includes=function(e,t,n,r){e=Na(e)?e:Cu(e),n=n&&!r?ru(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Ya(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&xt(e,t,n)>-1},Pn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ru(n);return o<0&&(o=an(r+o,0)),xt(e,t,o)},Pn.inRange=function(e,t,n){return t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n){return e>=un(t,n)&&e<an(t,n)}(e=iu(e),t,n)},Pn.invoke=bu,Pn.isArguments=Da,Pn.isArray=Ra,Pn.isArrayBuffer=Ia,Pn.isArrayLike=Na,Pn.isArrayLikeObject=za,Pn.isBoolean=function(e){return!0===e||!1===e||Wa(e)&&dr(e)==l},Pn.isBuffer=Ma,Pn.isDate=Fa,Pn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Ga(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Na(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Xa(e)||Da(e)))return!e.length;var t=ri(e);if(t==y||t==b)return!e.size;if(pi(e))return!Or(e).length;for(var n in e)if(Oe.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return wr(e,t)},Pn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?wr(e,t,void 0,n):!!r},Pn.isError=La,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=Ua,Pn.isInteger=Ba,Pn.isLength=qa,Pn.isMap=Qa,Pn.isMatch=function(e,t){return e===t||xr(e,t,Zo(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,xr(e,t,Zo(t),n)},Pn.isNaN=function(e){return $a(e)&&e!=+e},Pn.isNative=function(e){if(fi(e))throw new pe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _r(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=$a,Pn.isObject=Ha,Pn.isObjectLike=Wa,Pn.isPlainObject=Ga,Pn.isRegExp=Va,Pn.isSafeInteger=function(e){return Ba(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Ja,Pn.isString=Ya,Pn.isSymbol=Ka,Pn.isTypedArray=Xa,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Wa(e)&&ri(e)==_},Pn.isWeakSet=function(e){return Wa(e)&&"[object WeakSet]"==dr(e)},Pn.join=function(e,t){return null==e?"":rn.call(e,t)},Pn.kebabCase=Ru,Pn.last=Li,Pn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ru(n))<0?an(r+o,0):un(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):wt(e,kt,o,!0)},Pn.lowerCase=Iu,Pn.lowerFirst=Nu,Pn.lt=Za,Pn.lte=eu,Pn.max=function(e){return e&&e.length?rr(e,$u,hr):void 0},Pn.maxBy=function(e,t){return e&&e.length?rr(e,Ko(t,2),hr):void 0},Pn.mean=function(e){return Ot(e,$u)},Pn.meanBy=function(e,t){return Ot(e,Ko(t,2))},Pn.min=function(e){return e&&e.length?rr(e,$u,Er):void 0},Pn.minBy=function(e,t){return e&&e.length?rr(e,Ko(t,2),Er):void 0},Pn.stubArray=oc,Pn.stubFalse=ic,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=fc,Pn.nth=function(e,t){return e&&e.length?Ar(e,ru(t)):void 0},Pn.noConflict=function(){return Ge._===this&&(Ge._=Ce),this},Pn.noop=Ku,Pn.now=ya,Pn.pad=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Ro(Zt(o),n)+e+Ro(Xt(o),n)},Pn.padEnd=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;return t&&r<t?e+Ro(t-r,n):e},Pn.padStart=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;return t&&r<t?Ro(t-r,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(uu(e).replace(J,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ci(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nu(e),void 0===t?(t=e,e=0):t=nu(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=ln();return un(e+o*(t-e+He("1e-"+((o+"").length-1))),t)}return zr(e,t)},Pn.reduce=function(e,t,n){var r=Ra(e)?yt:jt,o=arguments.length<3;return r(e,Ko(t,4),n,o,er)},Pn.reduceRight=function(e,t,n){var r=Ra(e)?vt:jt,o=arguments.length<3;return r(e,Ko(t,4),n,o,tr)},Pn.repeat=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:ru(t),Mr(uu(e),t)},Pn.replace=function(){var e=arguments,t=uu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var r=-1,o=(t=uo(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[Ei(t[r])];void 0===i&&(r=o,i=n),e=Ua(i)?i.call(e):i}return e},Pn.round=pc,Pn.runInContext=e,Pn.sample=function(e){return(Ra(e)?Ln:Lr)(e)},Pn.size=function(e){if(null==e)return 0;if(Na(e))return Ya(e)?Qt(e):e.length;var t=ri(e);return t==y||t==b?e.size:Or(e).length},Pn.snakeCase=zu,Pn.some=function(e,t,n){var r=Ra(e)?gt:$r;return n&&ci(e,t,n)&&(t=void 0),r(e,Ko(t,3))},Pn.sortedIndex=function(e,t){return Gr(e,t)},Pn.sortedIndexBy=function(e,t,n){return Vr(e,t,Ko(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ca(e[r],t))return r}return-1},Pn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Vr(e,t,Ko(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=Gr(e,t,!0)-1;if(Ca(e[n],t))return n}return-1},Pn.startCase=Mu,Pn.startsWith=function(e,t,n){return e=uu(e),n=null==n?0:Jn(ru(n),0,e.length),t=Kr(t),e.slice(n,n+t.length)==t},Pn.subtract=dc,Pn.sum=function(e){return e&&e.length?Pt(e,$u):0},Pn.sumBy=function(e,t){return e&&e.length?Pt(e,Ko(t,2)):0},Pn.template=function(e,t,n){var r=Pn.templateSettings;n&&ci(e,t,n)&&(t=void 0),e=uu(e),t=lu({},t,r,Bo);var o,i,a=lu({},t.imports,r.imports,Bo),u=wu(a),c=At(a,u),s=0,l=t.interpolate||le,f="__p += '",p=ve((t.escape||le).source+"|"+l.source+"|"+(l===q?ne:le).source+"|"+(t.evaluate||le).source+"|$","g"),d="//# sourceURL="+(Oe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Le+"]")+"\n";e.replace(p,(function(t,n,r,a,u,c){return r||(r=a),f+=e.slice(s,c).replace(fe,Ft),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),u&&(i=!0,f+="';\n"+u+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t})),f+="';\n";var h=Oe.call(t,"variable")&&t.variable;h||(f="with (obj) {\n"+f+"\n}\n"),f=(i?f.replace(R,""):f).replace(I,"$1").replace(N,"$1;"),f="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var y=Bu((function(){return de(u,d+"return "+f).apply(void 0,c)}));if(y.source=f,La(y))throw y;return y},Pn.times=function(e,t){if((e=ru(e))<1||e>9007199254740991)return[];var n=4294967295,r=un(e,4294967295);e-=4294967295;for(var o=Ct(r,t=Ko(t));++n<e;)t(n);return o},Pn.toFinite=nu,Pn.toInteger=ru,Pn.toLength=ou,Pn.toLower=function(e){return uu(e).toLowerCase()},Pn.toNumber=iu,Pn.toSafeInteger=function(e){return e?Jn(ru(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=uu,Pn.toUpper=function(e){return uu(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(V,"");if(!e||!(t=Kr(t)))return e;var r=$t(e),o=$t(t);return so(r,Rt(r,o),It(r,o)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Kr(t)))return e;var r=$t(e);return so(r,0,It(r,$t(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(J,"");if(!e||!(t=Kr(t)))return e;var r=$t(e);return so(r,Rt(r,$t(t))).join("")},Pn.truncate=function(e,t){var n=30,r="...";if(Ha(t)){var o="separator"in t?t.separator:o;n="length"in t?ru(t.length):n,r="omission"in t?Kr(t.omission):r}var i=(e=uu(e)).length;if(Lt(e)){var a=$t(e);i=a.length}if(n>=i)return e;var u=n-Qt(r);if(u<1)return r;var c=a?so(a,0,u).join(""):e.slice(0,u);if(void 0===o)return c+r;if(a&&(u+=c.length-u),Va(o)){if(e.slice(u).search(o)){var s,l=c;for(o.global||(o=ve(o.source,uu(re.exec(o))+"g")),o.lastIndex=0;s=o.exec(l);)var f=s.index;c=c.slice(0,void 0===f?u:f)}}else if(e.indexOf(Kr(o),u)!=u){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Pn.unescape=function(e){return(e=uu(e))&&F.test(e)?e.replace(z,Gt):e},Pn.uniqueId=function(e){var t=++Se;return uu(e)+t},Pn.upperCase=Fu,Pn.upperFirst=Lu,Pn.each=ua,Pn.eachRight=ca,Pn.first=Ni,Yu(Pn,(lc={},cr(Pn,(function(e,t){Oe.call(Pn.prototype,t)||(lc[t]=e)})),lc),{chain:!1}),Pn.VERSION="4.17.19",ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Pn[e].placeholder=Pn})),ut(["drop","take"],(function(e,t){Dn.prototype[e]=function(n){n=void 0===n?1:an(ru(n),0);var r=this.__filtered__&&!t?new Dn(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Dn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),ut(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Dn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ko(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),ut(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Dn.prototype[e]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Dn.prototype[e]=function(){return this.__filtered__?new Dn(this):this[n](1)}})),Dn.prototype.compact=function(){return this.filter($u)},Dn.prototype.find=function(e){return this.filter(e).head()},Dn.prototype.findLast=function(e){return this.reverse().find(e)},Dn.prototype.invokeMap=Fr((function(e,t){return"function"==typeof e?new Dn(this):this.map((function(n){return mr(n,e,t)}))})),Dn.prototype.reject=function(e){return this.filter(Oa(Ko(e)))},Dn.prototype.slice=function(e,t){e=ru(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Dn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ru(t))<0?n.dropRight(-t):n.take(t-e)),n)},Dn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Dn.prototype.toArray=function(){return this.take(4294967295)},cr(Dn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Pn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Dn,c=a[0],s=u||Ra(t),l=function(e){var t=o.apply(Pn,ht([e],a));return r&&f?t[0]:t};s&&n&&"function"==typeof c&&1!=c.length&&(u=s=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&s){t=h?t:new Dn(this);var y=e.apply(t,a);return y.__actions__.push({func:na,args:[l],thisArg:void 0}),new An(y,f)}return d&&h?e.apply(this,a):(y=this.thru(l),d?r?y.value()[0]:y.value():y)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[n]((function(n){return t.apply(Ra(n)?n:[],e)}))}})),cr(Dn.prototype,(function(e,t){var n=Pn[t];if(n){var r=n.name+"";Oe.call(bn,r)||(bn[r]=[]),bn[r].push({name:t,func:n})}})),bn[Co(void 0,2).name]=[{name:"wrapper",func:void 0}],Dn.prototype.clone=function(){var e=new Dn(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e},Dn.prototype.reverse=function(){if(this.__filtered__){var e=new Dn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Dn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=un(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,u=i.end,c=u-a,s=r?u:a-1,l=this.__iteratees__,f=l.length,p=0,d=un(c,this.__takeCount__);if(!n||!r&&o==c&&d==c)return no(e,this.__actions__);var h=[];e:for(;c--&&p<d;){for(var y=-1,v=e[s+=t];++y<f;){var g=l[y],m=g.iteratee,b=g.type,w=m(v);if(2==b)v=w;else if(!w){if(1==b)continue e;break e}}h[p++]=v}return h},Pn.prototype.at=ra,Pn.prototype.chain=function(){return ta(this)},Pn.prototype.commit=function(){return new An(this.value(),this.__chain__)},Pn.prototype.next=function(){void 0===this.__values__&&(this.__values__=tu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var r=Pi(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Dn){var t=e;return this.__actions__.length&&(t=new Dn(this)),(t=t.reverse()).__actions__.push({func:na,args:[Hi],thisArg:void 0}),new An(t,this.__chain__)}return this.thru(Hi)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return no(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,Xe&&(Pn.prototype[Xe]=function(){return this}),Pn}();Ge._=Vt,void 0===(o=function(){return Vt}.call(t,n,t,r))||(r.exports=o)}).call(this)}).call(this,n(33),n(106)(e))},function(e){e.exports=JSON.parse('{"qualifications":[{"label":"identity_photo","purpose":"attestation","subjects":["identity"]},{"label":"national_id_card","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity"]},{"label":"passport","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity"]},{"label":"residence_permit","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"immigration","subjects":["permit","identity"]},{"label":"family_record_book","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"birth_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity","family"]},{"label":"driver_license","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"transport","subjects":["permit","driving"]},{"label":"other_identity_document","purpose":"attestation","subjects":["identity"]},{"label":"wedding","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"pacs","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"divorce","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"large_family_card","purpose":"attestation","sourceCategory":"transport","subjects":["right"]},{"label":"caf","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"family","subjects":["right"]},{"label":"other_family_document","subjects":["family"]},{"label":"diploma","purpose":"attestation","sourceCategory":"education","subjects":["achievement"]},{"label":"work_contract","purpose":"contract","sourceCategory":"employer","subjects":["work","employment"]},{"label":"pay_sheet","purpose":"attestation","sourceCategory":"employer","subjects":["work","revenues"]},{"label":"unemployment_benefit","purpose":"attestation","sourceCategory":"gov","subjects":["revenues"]},{"label":"pension","purpose":"attestation","sourceCategory":"gov","subjects":["revenues"]},{"label":"other_revenue","purpose":"attestation","subjects":["revenues"]},{"label":"gradebook","purpose":"report","sourceCategory":"education","subjects":["history"]},{"label":"student_card","purpose":"attestation","sourceCategory":"education","subjects":["identity","right","employment","education"]},{"label":"resume","purpose":"description","subjects":["employment"]},{"label":"motivation_letter","purpose":"description","subjects":["employment"]},{"label":"other_work_document","purpose":"employment"},{"label":"health_book","purpose":"attestation","sourceCategory":"health","subjects":["capacity","vaccine"]},{"label":"health_certificate","purpose":"attestation","sourceCategory":"health","subjects":["capacity","vaccine"]},{"label":"pregnancy_medical_certificate","purpose":"attestation","sourceCategory":"health","subjects":["pregnancy"]},{"label":"work_disability_recognition","purpose":"attestation","sourceCategory":"health","subjects":["right"]},{"label":"national_health_insurance_card","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"health","subjects":["insurance"]},{"label":"national_health_insurance_right_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"health","subjects":["right","insurance"]},{"label":"health_insurance_card","purpose":"attestation","sourceCategory":"insurance","sourceSubCategory":"health","subjects":["insurance"]},{"label":"prescription","purpose":"attestation","sourceCategory":"health","subjects":["right","medecine"]},{"label":"health_invoice","purpose":"invoice","sourceCategory":"health"},{"label":"other_health_document","subjects":["health"]},{"label":"vehicle_registration","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"transport","subjects":["vehicule","identity","right"]},{"label":"car_insurance","purpose":"attestation","sourceCategory":"insurance","sourceSubCategory":"transport","subjects":["insurance","car"]},{"label":"mechanic_invoice","purpose":"invoice","sourceCategory":"transport"},{"label":"transport_invoice","purpose":"invoice","sourceCategory":"transport"},{"label":"other_transport_document","sourceCategory":"transport"},{"label":"house_sale_agreeement","purpose":"contract","sourceCategory":"real_estate","subjects":["house"]},{"label":"building_permit","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"real_estate","subjects":["permit","house"]},{"label":"technical_diagnostic_record","purpose":"report","sourceCategory":"real_estate","subjects":["compliance","house"]},{"label":"lease","purpose":"contract","sourceCategory":"real_estate","subjects":["house"]},{"label":"rent_receipt","purpose":"invoice","sourceCategory":"real_estate","subjects":["house"]},{"label":"house_insurance","purpose":"contract","sourceCategory":"insurance","sourceSubCategory":"real_estate","subjects":["insurance","house"]},{"label":"work_quote","purpose":"description","sourceCategory":"building","subjects":["building","house"]},{"label":"work_invoice","purpose":"invoice","sourceCategory":"building","subjects":["building","house"]},{"label":"other_house_document","subjects":["house"]},{"label":"phone_invoice","purpose":"invoice","sourceCategory":"telecom","sourceSubCategory":"mobile"},{"label":"isp_invoice","purpose":"invoice","sourceCategory":"telecom","sourceSubCategory":"internet","subjects":["subscription"]},{"label":"telecom_invoice","purpose":"invoice","sourceCategory":"telecom"},{"label":"energy_invoice","purpose":"invoice","sourceCategory":"energy"},{"label":"water_invoice","purpose":"invoice","sourceCategory":"water"},{"label":"appliance_invoice","purpose":"invoice","sourceCategory":"retail"},{"label":"web_service_invoice","purpose":"invoice","sourceCategory":"web"},{"label":"restaurant_invoice","purpose":"invoice","sourceCategory":"alimentation"},{"label":"other_invoice","purpose":"invoice"},{"label":"tax_return","purpose":"report","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"tax_notice","purpose":"invoice","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"tax_timetable","purpose":"report","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"other_tax_document","subjects":["tax"]},{"label":"bank_details","purpose":"attestation","sourceCategory":"bank","subjects":["bank_account"]},{"label":"bank_statement","purpose":"report","sourceCategory":"bank","subjects":["history"]},{"label":"loan_agreement","purpose":"contract","sourceCategory":"bank"},{"label":"other_bank_document","sourceCategory":"bank"},{"label":"receipt","purpose":"report"},{"label":"payment_proof_family_allowance","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["subvention"]},{"label":"school_attendance_certificate","purpose":"attestation","sourceCategory":"education","subjects":["identity","right","education"]},{"label":"unfit_for_habitation_declaration","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"real_estate","subjects":["compliance"]},{"label":"accommodation_proof","purpose":"attestation","sourceCategory":"individual","subjects":["address"]},{"label":"citizen_registration_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["achievement","education"]},{"label":"personal_sporting_licence","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"sport","subjects":["permit","invoice"]},{"label":"other_activity_document","sourceSubCategory":"sport","subjects":["permit","invoice"]}],"purposeKnownValues":["attestation","contract","invoice","report","description","evaluation","employment"],"sourceCategoryKnownValues":["bank","insurance","retail","telecom","energy","water","health","gov","association","education","employer","transport","goods","alimentation","building","real_estate","web","individual"],"sourceSubCategoryKnownValues":["civil_registration","immigration","transport","family","tax","health","real_estate","mobile","internet","citizen","sport"],"subjectsKnownValues":["identity","permit","family","address","driving","right","subvention","achievement","degree","work","employment","revenues","history","insurance","medical_act","vehicule","car","moto","truck","boat","subscription","buy/sale","house","compliance","building","food","real_estate","tax","address","education","statement","course","internet","phone","vaccine","capacity","health","drugs","child","pregnancy","bank_account"]}')},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getReferencedFolder=t.createFolderWithReference=t.ensureMagicFolder=t.MAGIC_FOLDERS=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(588)),u=(r(n(40)),n(19),n(59)),c={ADMINISTRATIVE:"".concat("io.cozy.apps","/").concat("administrative"),PHOTOS:"".concat("io.cozy.apps","/").concat("photos"),PHOTOS_BACKUP:"".concat("io.cozy.apps","/").concat("photos","/mobile"),PHOTOS_UPLOAD:"".concat("io.cozy.apps","/").concat("photos","/upload"),NOTES:"".concat("io.cozy.apps","/notes"),HOME:"".concat("io.cozy.apps","/home"),PAPERS:"".concat("io.cozy.apps","/").concat("administrative","/papers")};t.MAGIC_FOLDERS=c;var s=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={_type:"io.cozy.apps",_id:n},e.next=3,f(t,i);case 3:if(!(a=e.sent)){e.next=6;break}return e.abrupt("return",a);case 6:if((u=Object.values(c)).includes(n)){e.next=9;break}throw new Error("Cannot create Magic folder with id ".concat(n,". Allowed values are ").concat(u.join(", "),"."));case 9:if(r){e.next=11;break}throw new Error("Magic folder default path must be defined");case 11:return e.abrupt("return",l(t,r,i));case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.ensureMagicFolder=s;var l=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.collection(u.DOCTYPE_FILES),e.next=3,i.ensureDirectoryExists(n);case 3:return a=e.sent,e.next=6,i.addReferencesTo(r,[{_id:a}]);case 6:return e.next=8,i.get(a);case 8:return c=e.sent,s=c.data,e.abrupt("return",s);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.createFolderWithReference=l;var f=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.collection(u.DOCTYPE_FILES).findReferencedBy(n);case 2:return r=e.sent,i=r.included,c=i.filter((function(e){return!/^\/\.cozy_trash/.test(e.attributes.path)})),e.abrupt("return",c.length>0?(0,a.default)(c,"created_at").pop():null);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.getReferencedFolder=f},function(e,t,n){var r=n(116),o=n(275),i=n(57),a=n(279),u=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=u},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchURL=t.generateUrlForNote=t.generatePrivateUrl=void 0;var o=r(n(5)),i=r(n(9)),a=n(179),u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.returnUrl,o=new URL(e);return r&&o.searchParams.set("returnUrl",r),o.hash="#/n/".concat(t.id),o.toString()};t.generatePrivateUrl=u;t.generateUrlForNote=function(e,t){return console.warn("generateUrlForNote is deprecated. Please use models.note.generatePrivateUrl instead"),u(e,t)};var c=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,u,c,s,l,f,p,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getStackClient().collection("io.cozy.notes").fetchURL({_id:n.id});case 2:if(r=e.sent,i=r.data,u=i.note_id,c=i.subdomain,s=i.protocol,l=i.instance,f=i.sharecode,p=i.public_name,!f){e.next=17;break}return(d=[["id",u]]).push(["sharecode",f]),p&&d.push(["username",p]),e.abrupt("return",(0,a.generateWebLink)({cozyUrl:"".concat(s,"://").concat(l),searchParams:d,pathname:"/public/",slug:"notes",subDomainType:c}));case 17:return e.abrupt("return",(0,a.generateWebLink)({cozyUrl:"".concat(s,"://").concat(l),pathname:"",slug:"notes",subDomainType:c,hash:"/n/".concat(u)}));case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchURL=c},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.isReadOnly=y,t.fetchOwn=v,t.isForType=m,t.isDocumentReadOnly=function(e){return x.apply(this,arguments)},t.isShortcutCreatedOnTheRecipientCozy=void 0;var o=r(n(2)),i=r(n(5)),a=r(n(9)),u=r(n(31)),c=r(n(272)),s=r(n(16)),l=(r(n(40)),n(18)),f=n(292),p=n(59);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.writability,r=void 0===n?["PATCH","POST","PUT","DELETE"]:n;return e.verbs&&e.verbs.length>0&&0===(0,c.default)(e.verbs,["ALL"].concat((0,u.default)(r))).length}function v(e){return g.apply(this,arguments)}function g(){return(g=(0,a.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.collection("io.cozy.permissions"),e.next=3,n.fetchOwnPermissions();case 3:if(r=e.sent,o=(0,s.default)(r,"data.attributes.permissions")){e.next=7;break}throw"Can't get self permissions";case 7:return e.abrupt("return",Object.values(o));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e,t){return e.type===t||e.type+".*"===t}function b(e){return w.apply(this,arguments)}function w(){return(w=(0,a.default)(i.default.mark((function e(t){var n,r,o,u,c,s,d,y,g,b,w,x;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x=function(){return(x=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.doc,r=t.client,o=t.perms,!(a=o.find((function(e){if(e.values){var t=e.selector||"id",r=n[t];return e.values.includes(r)}return!0})))){e.next=6;break}return e.abrupt("return",a);case 6:if(c!==p.DOCTYPE_FILES){e.next=16;break}if(u=(0,f.getParentFolderId)(n),e.t0=u,!e.t0){e.next=13;break}return e.next=12,g(u);case 12:e.t0=e.sent;case 13:if(!(s=e.t0)){e.next=16;break}return e.abrupt("return",w({doc:s,perms:o,client:r}));case 16:return e.abrupt("return",void 0);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)},w=function(e){return x.apply(this,arguments)},b=function(){return(b=(0,a.default)(i.default.mark((function e(t){var n,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,l.Q)(p.DOCTYPE_FILES).getById(t),e.next=3,r.query(n);case 3:return o=e.sent,e.abrupt("return",o&&o.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e){return b.apply(this,arguments)},n=t.document,r=t.client,o=t.permissions,u=n._id||n.id,c=n._type||n.type,s=h(h({},n),{},{id:u,type:c}),!o){e.next=12;break}e.t0=o,e.next=15;break;case 12:return e.next=14,v(r);case 14:e.t0=e.sent;case 15:return d=e.t0,y=d.filter((function(e){return m(e,c)})),e.abrupt("return",w({doc:s,client:r,perms:y}));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(){return(x=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.document,r=t.client,o=t.writability,void 0!==(a=t.permissions)){e.next=10;break}return e.next=7,v(r);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=a;case 11:if(!((u=e.t0).length<=1)){e.next=16;break}e.t1=u[0],e.next=19;break;case 16:return e.next=18,b({document:n,client:r,permissions:u});case 18:e.t1=e.sent;case 19:if(!(c=e.t1)){e.next=24;break}return e.abrupt("return",y(c,{writability:o}));case 24:return console.warn("can't find the document in current attached permissions"),e.abrupt("return",void 0);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.isShortcutCreatedOnTheRecipientCozy=function(e){if(!e.included)return!1;var t=e.included.find((function(e){return"io.cozy.sharings.members"===e.type}));return!(!t||!t.attributes.instance)}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getCreatedByApp=t.hasBeenUpdatedByApp=void 0;var o=r(n(16));t.hasBeenUpdatedByApp=function(e,t){var n=(0,o.default)(e,"cozyMetadata.updatedByApps");return Boolean(n&&n.find((function(e){return e.slug===t})))};t.getCreatedByApp=function(e){return(0,o.default)(e,"cozyMetadata.createdByApp")}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getIndexByFamilyNameGivenNameEmailCozyUrl=t.getDefaultSortIndexValue=t.makeDefaultSortIndexValue=t.getDisplayName=t.makeDisplayName=t.getFullname=t.makeFullname=t.getPrimaryAddress=t.getPrimaryPhone=t.getPrimaryCozyDomain=t.getPrimaryCozy=t.getPrimaryEmail=t.getInitials=t.getPrimaryOrFirst=void 0;var o=r(n(16)),i=r(n(593)),a=function(e){return function(t){return t[e]&&0!==t[e].length?t[e].find((function(e){return e.primary}))||t[e][0]:""}};t.getPrimaryOrFirst=a;t.getInitials=function(e){if(e.name&&!(0,i.default)(e.name))return["givenName","familyName"].map((function(t){return(0,o.default)(e,["name",t,0],"")})).join("").toUpperCase();var t=u(e);if(t)return t[0].toUpperCase();var n=s(e);return n?n[0].toUpperCase():""};var u=function(e){return Array.isArray(e.email)?a("email")(e).address||"":e.email};t.getPrimaryEmail=u;var c=function(e){return Array.isArray(e.cozy)?a("cozy")(e).url||"":e.url};t.getPrimaryCozy=c;var s=function(e){try{return new URL(c(e)).hostname.replace(/^(www.)/g,"")}catch(t){return c(e)}};t.getPrimaryCozyDomain=s;t.getPrimaryPhone=function(e){return a("phone")(e).number||""};t.getPrimaryAddress=function(e){return a("address")(e).formattedAddress||""};var l=function(e){return e.name?["namePrefix","givenName","additionalName","familyName","nameSuffix"].map((function(t){return e.name[t]})).filter((function(e){return void 0!==e})).join(" ").trim():""};t.makeFullname=l;t.getFullname=function(e){return(0,o.default)(e,"fullname")?e.fullname:l(e)};var f=function(e){var t=l(e),n=u(e),r=s(e);return t&&t.length>0?t:n&&n.length>0?n:r&&r.length>0?r:""};t.makeDisplayName=f;t.getDisplayName=function(e){return(0,o.default)(e,"displayName")?e.displayName:f(e)};var p=function(e){var t=[(0,o.default)(e,"name.familyName",""),(0,o.default)(e,"name.givenName",""),u(e),s(e)].join("").trim().toLowerCase();return 0===t.length?null:t};t.makeDefaultSortIndexValue=p;var d=function(e){var t=(0,o.default)(e,"indexes.byFamilyNameGivenNameEmailCozyUrl",null);return null!==t?(0,i.default)(t)?null:t:p(e)};t.getDefaultSortIndexValue=d;t.getIndexByFamilyNameGivenNameEmailCozyUrl=function(e){return console.warn("Deprecation: `getIndexByFamilyNameGivenNameEmailCozyUrl` is deprecated, please use `getDefaultSortIndexValue` instead"),d(e)}},function(e,t,n){var r=n(146),o=n(66),i=n(80),a=n(22),u=n(46),c=n(81),s=n(109),l=n(108),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(u(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||l(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!r(e).length;for(var n in e)if(f.call(e,n))return!1;return!0}},function(e,t,n){"use strict";var r=n(17);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Qualification",{enumerable:!0,get:function(){return o.Qualification}}),Object.defineProperty(t,"setQualification",{enumerable:!0,get:function(){return o.setQualification}}),Object.defineProperty(t,"getQualification",{enumerable:!0,get:function(){return o.getQualification}}),t.helpers=t.themes=t.locales=void 0;var o=n(184),i=r(n(595));t.locales=i;var a=r(n(304));t.themes=a;var u=r(n(643));t.helpers=u},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundT=void 0;for(var o=r(n(596)),i={},a=0,u=["fr","en"];a<u.length;a++){var c=u[a],s={};try{s=n(640)("./".concat(c,".json"))}catch(e){}var l=new o.default;l.extend(s),i[c]=l}t.getBoundT=function(e){var t=i[e]||i.en;return t.t.bind(t)}},function(e,t,n){"use strict";var r=n(597),o=n(634),i=n(222),a=n(154),u=n(637),c=function(e){i(!1,e)},s=String.prototype.replace,l=String.prototype.split,f=function(e){var t=e%100,n=t%10;return 11!==t&&1===n?0:2<=n&&n<=4&&!(t>=12&&t<=14)?1:2},p={pluralTypes:{arabic:function(e){if(e<3)return e;var t=e%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:f,chinese:function(){return 0},croatian:f,french:function(e){return e>=2?1:0},german:function(e){return 1!==e?1:0},russian:f,lithuanian:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?1:2},czech:function(e){return 1===e?0:e>=2&&e<=4?1:2},polish:function(e){if(1===e)return 0;var t=e%10;return 2<=t&&t<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!=1||e%100==11?1:0},slovenian:function(e){var t=e%100;return 1===t?0:2===t?1:3===t||4===t?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}};function d(e,t){var n,i,a=(n=e.pluralTypeToLanguages,i={},r(o(n),(function(e){var t=e[0],n=e[1];r(n,(function(e){i[e]=t}))})),i);return a[t]||a[l.call(t,/-/,1)[0]]||a.en}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var y,v=(y={},function(e,t){var n=y[t];return n&&!e.pluralTypes[n]&&(n=null,y[t]=n),n||(n=d(e,t))&&(y[t]=n),n}),g=/%\{(.*?)\}/g;function m(e,t,n,r,o){if("string"!=typeof e)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==t)return e;var i=e,c=r||g,f="number"==typeof t?{smart_count:t}:t;if(null!=f.smart_count&&e){var d=o||p,h=l.call(e,"||||"),y=function(e,t,n){return e.pluralTypes[t](n)}(d,v(d,n||"en"),f.smart_count);i=u(h[y]||h[0])}return i=s.call(i,c,(function(e,t){return a(f,t)&&null!=f[t]?f[t]:e}))}function b(e){var t=e||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var n=t.allowMissing?m:null;this.onMissingKey="function"==typeof t.onMissingKey?t.onMissingKey:n,this.warn=t.warn||c,this.tokenRegex=function(e){var t=e&&e.prefix||"%{",n=e&&e.suffix||"}";if("||||"===t||"||||"===n)throw new RangeError('"||||" token is reserved for pluralization');return new RegExp(h(t)+"(.*?)"+h(n),"g")}(t.interpolation),this.pluralRules=t.pluralRules||p}b.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},b.prototype.extend=function(e,t){r(o(e||{}),(function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;"object"==typeof r?this.extend(r,o):this.phrases[o]=r}),this)},b.prototype.unset=function(e,t){"string"==typeof e?delete this.phrases[e]:r(o(e||{}),(function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;"object"==typeof r?this.unset(r,o):delete this.phrases[o]}),this)},b.prototype.clear=function(){this.phrases={}},b.prototype.replace=function(e){this.clear(),this.extend(e)},b.prototype.t=function(e,t){var n,r,o=null==t?{}:t;if("string"==typeof this.phrases[e])n=this.phrases[e];else if("string"==typeof o._)n=o._;else if(this.onMissingKey){r=(0,this.onMissingKey)(e,o,this.currentLocale,this.tokenRegex,this.pluralRules)}else this.warn('Missing translation for key: "'+e+'"'),r=e;return"string"==typeof n&&(r=m(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},b.prototype.has=function(e){return a(this.phrases,e)},b.transformPhrase=function(e,t,n){return m(e,t,n)},e.exports=b},function(e,t,n){"use strict";var r=n(48),o=n(93),i=n(62),a=n(293),u=n(294),c=n(298),s=c(),l=n(633),f=i("Array.prototype.slice"),p=o.apply(s),d=function(e,t){return a(e),p(e,f(arguments,1))};r(d,{getPolyfill:c,implementation:u,shim:l}),e.exports=d},function(e,t,n){"use strict";var r=n(27)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(27),o=n(62),i=r("%TypeError%"),a=n(600),u=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");e.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(e,t,n)}},function(e,t,n){"use strict";var r=n(27)("%Array%"),o=!r.isArray&&n(62)("Object.prototype.toString");e.exports=r.isArray||function(e){return"[object Array]"===o(e)}},function(e,t,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,v=Function.prototype.toString,g=String.prototype.match,m=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,_=RegExp.prototype.test,k=Array.prototype.concat,O=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,j="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,D=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||_.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=m.call(t,o.length+1);return b.call(o,n,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,n,"$&_")}var N=n(602).custom,z=N&&U(N)?N:null;function M(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return b.call(String(e),/"/g,"&quot;")}function L(e){return!("[object Array]"!==H(e)||A&&"object"==typeof e&&A in e)}function U(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var u=n||{};if(q(u,"quoteStyle")&&"single"!==u.quoteStyle&&"double"!==u.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(u,"maxStringLength")&&("number"==typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!q(u,"customInspect")||u.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(u,"numericSeparator")&&"boolean"!=typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=u.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,n){if(t.length>n.maxStringLength){var r=t.length-n.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return e(m.call(t,0,n.maxStringLength),n)+o}return M(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Q),"single",n)}(t,u);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return y?I(t,w):w}if("bigint"==typeof t){var _=String(t)+"n";return y?I(t,_):_}var E=void 0===u.depth?5:u.depth;if(void 0===r&&(r=0),r>=E&&E>0&&"object"==typeof t)return L(t)?"[Array]":"[Object]";var P=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=O.call(Array(e.indent+1)," ")}return{base:n,prev:O.call(Array(t+1),n)}}(u,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function N(t,n,i){if(n&&(o=S.call(o)).push(n),i){var a={depth:u.depth};return q(u,"quoteStyle")&&(a.quoteStyle=u.quoteStyle),e(t,a,r+1,o)}return e(t,u,r+1,o)}if("function"==typeof t){var B=function(e){if(e.name)return e.name;var t=g.call(v.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),K=Y(t,N);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(K.length>0?" { "+O.call(K,", ")+" }":"")}if(U(t)){var X=T?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||T?X:$(X)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var Z="<"+x.call(String(t.nodeName)),ee=t.attributes||[],te=0;te<ee.length;te++)Z+=" "+ee[te].name+"="+M(F(ee[te].value),"double",u);return Z+=">",t.childNodes&&t.childNodes.length&&(Z+="..."),Z+="</"+x.call(String(t.nodeName))+">"}if(L(t)){if(0===t.length)return"[]";var ne=Y(t,N);return P&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ne)?"["+J(ne,P)+"]":"[ "+O.call(ne,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)){var re=Y(t,N);return"cause"in t&&!D.call(t,"cause")?"{ ["+String(t)+"] "+O.call(k.call("[cause]: "+N(t.cause),re),", ")+" }":0===re.length?"["+String(t)+"]":"{ ["+String(t)+"] "+O.call(re,", ")+" }"}if("object"==typeof t&&c){if(z&&"function"==typeof t[z])return t[z]();if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{s.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var oe=[];return a.call(t,(function(e,n){oe.push(N(n,t,!0)+" => "+N(e,t))})),V("Map",i.call(t),oe,P)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ie=[];return l.call(t,(function(e){ie.push(N(e,t))})),V("Set",s.call(t),ie,P)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return G("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return G("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return G("WeakRef");if(function(e){return!("[object Number]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(N(Number(t)));if(function(e){if(!e||"object"!=typeof e||!j)return!1;try{return j.call(e),!0}catch(e){}return!1}(t))return $(N(j.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(h.call(t));if(function(e){return!("[object String]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(N(String(t)));if(!function(e){return!("[object Date]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)&&!function(e){return!("[object RegExp]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Y(t,N),ue=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",se=!ue&&A&&Object(t)===t&&A in t?m.call(H(t),8,-1):ce?"Object":"",le=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(se||ce?"["+O.call(k.call([],se||[],ce||[]),": ")+"] ":"");return 0===ae.length?le+"{}":P?le+"{"+J(ae,P)+"}":le+"{ "+O.call(ae,", ")+" }"}return String(t)};var B=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return B.call(e,t)}function H(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Q(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function $(e){return"Object("+e+")"}function G(e){return e+" { ? }"}function V(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):O.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+O.call(e,","+n)+"\n"+t.prev}function Y(e,t){var n=L(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=q(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(T){i={};for(var u=0;u<a.length;u++)i["$"+a[u]]=a[u]}for(var c in e)q(e,c)&&(n&&String(Number(c))===c&&c<e.length||T&&i["$"+c]instanceof Symbol||(_.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var s=0;s<a.length;s++)D.call(e,a[s])&&r.push("["+t(a[s])+"]: "+t(e[a[s]],e));return r}},function(e,t){},function(e,t,n){"use strict";e.exports=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(296),i=n(185);e.exports=function(e,t){if("Object"!==i(e))throw new r("Assertion failed: `O` must be an Object");if(!o(t))throw new r("Assertion failed: `P` must be a Property Key");return t in e}},function(e,t,n){"use strict";e.exports=n(606)},function(e,t,n){"use strict";var r,o,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={},a((function(){throw 42}),null,r)}catch(e){e!==o&&(a=null)}else a=null;var u=/^\s*class\b/,c=function(e){try{var t=i.call(e);return u.test(t)}catch(e){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,f="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=a?function(e){if(e===f)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{a(e,null,r)}catch(e){if(e!==o)return!1}return!c(e)}:function(e){if(e===f)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(l)return function(e){try{return!c(e)&&(i.call(e),!0)}catch(e){return!1}}(e);if(c(e))return!1;var t=s.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(295),i=n(608),a=n(185);e.exports=function(e){if("Object"!==a(e))throw new r("Assertion failed: `obj` must be an Object");return i(o(e,"length"))}},function(e,t,n){"use strict";var r=n(609),o=n(610);e.exports=function(e){var t=o(e);return t<=0?0:t>r?r:t}},function(e,t,n){"use strict";var r=n(27),o=r("%Math%"),i=r("%Number%");e.exports=i.MAX_SAFE_INTEGER||o.pow(2,53)-1},function(e,t,n){"use strict";var r=n(611),o=n(620);e.exports=function(e){var t=o(e);return 0!==t&&(t=r(t)),0===t?0:t}},function(e,t,n){"use strict";var r=n(612),o=n(613),i=n(614),a=n(617),u=n(618),c=n(619);e.exports=function(e){var t=i(e);return a(t)?0:0!==t&&u(t)?c(t)*o(r(t)):t}},function(e,t,n){"use strict";var r=n(27)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(615);e.exports=function(e){var t=r(e,Number);if("string"!=typeof t)return+t;var n=t.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},function(e,t,n){"use strict";e.exports=n(616)},function(e,t,n){"use strict";var r=Object.prototype.toString,o=n(297),i=n(153),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,a,u=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<u.length;++a)if(i(e[u[a]])&&(n=e[u[a]](),o(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};e.exports=function(e){return o(e)?e:arguments.length>1?a(e,arguments[1]):a(e)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,n){"use strict";var r=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!r(e)&&e!==1/0&&e!==-1/0}},function(e,t,n){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,n){"use strict";var r=n(27),o=r("%TypeError%"),i=r("%Number%"),a=r("%RegExp%"),u=r("%parseInt%"),c=n(62),s=n(621),l=n(622),f=c("String.prototype.slice"),p=s(/^0b[01]+$/i),d=s(/^0o[0-7]+$/i),h=s(/^[-+]0x[0-9a-f]+$/i),y=s(new a("["+["…","​","￾"].join("")+"]","g")),v=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),g=new RegExp("(^["+v+"]+)|(["+v+"]+$)","g"),m=c("String.prototype.replace"),b=n(623);e.exports=function e(t){var n=l(t)?t:b(t,i);if("symbol"==typeof n)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(p(n))return e(u(f(n,2),2));if(d(n))return e(u(f(n,2),8));if(y(n)||h(n))return NaN;var r=function(e){return m(e,g,"")}(n);if(r!==n)return e(r)}return i(n)}},function(e,t,n){"use strict";var r=n(27)("RegExp.prototype.test"),o=n(93);e.exports=function(e){return o(r,e)}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=n(624);e.exports=function(e){return arguments.length>1?r(e,arguments[1]):r(e)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(297),i=n(153),a=n(625),u=n(626),c=function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var n,r,a,u="string"===t?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<u.length;++a)if(n=e[u[a]],i(n)&&(r=n.call(e),o(r)))return r;throw new TypeError("No default value")},s=function(e,t){var n=e[t];if(null!=n){if(!i(n))throw new TypeError(n+" returned for property "+t+" of object "+e+" is not a function");return n}};e.exports=function(e){if(o(e))return e;var t,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?t=s(e,Symbol.toPrimitive):u(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var i=t.call(e,n);if(o(i))return i;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(e)||u(e))&&(n="string"),c(e,"default"===n?"number":n)}},function(e,t,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(155)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=n(27)("%Object%"),o=n(293);e.exports=function(e){return o(e),r(e)}},function(e,t,n){"use strict";var r=n(27),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i=n(630)();e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";var r=n(631);e.exports=function(){return r()&&!!Symbol.toStringTag}},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t){e.exports=function(e){var t=!0,n=!0,r=!1;if("function"==typeof e){try{e.call("f",(function(e,n,r){"object"!=typeof r&&(t=!1)})),e.call([null],(function(){"use strict";n="string"==typeof this}),"x")}catch(e){r=!0}return!r&&t&&n}return!1}},function(e,t,n){"use strict";var r=n(48),o=n(298);e.exports=function(){var e=o();return r(Array.prototype,{forEach:e},{forEach:function(){return Array.prototype.forEach!==e}}),e}},function(e,t,n){"use strict";var r=n(48),o=n(93),i=n(299),a=n(301),u=n(636),c=o(a(),Object);r(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";var r=n(27)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(301),o=n(48);e.exports=function(){var e=r();return o(Object,{entries:e},{entries:function(){return Object.entries!==e}}),e}},function(e,t,n){"use strict";var r=n(93),o=n(48),i=n(302),a=n(303),u=n(639),c=r(a());o(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";var r=n(27),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(48),o=n(303);e.exports=function(){var e=o();return r(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,n){var r={"./en.json":641,"./fr.json":642};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=640},function(e){e.exports=JSON.parse('{"Scan":{"scan_a_doc":"Scan a doc","save_doc":"Save the doc","filename":"Filename","save":"Save","cancel":"Cancel","qualify":"Describe","apply":"Apply","error":{"offline":"You are currently offline and you can\'t use this functionality. Please, try again later.","uploading":"You are already uploading a file. Please wait until the end of this upload and try again.","generic":"Something went wrong. Please try again."},"successful":{"qualified_ok":"You just have successfully described your file! "},"items":{"identity":"Identity","family":"Family","work_study":"Work & Study","health":"Health","home":"Home","transport":"Transport","invoice":"Invoice","others":"Others","identity_photo":"Identity photo","national_id_card":"ID card","passport":"Passeport","residence_permit":"Residence permit","family_record_book":"Family record book","birth_certificate":"Birth certificate","citizen_registration_certificate":"Certificate of citizen registration","driver_license":"Driving license","other_identity_document":"Other document of identity","wedding":"Wedding contract","pacs":"Civil union","divorce":"Divorce","large_family_card":" Large Family Card","caf":"Social benefit rate","payment_proof_family_allowance":"family allowance payment proof","other_family_document":"Other family document","diploma":"Diploma","work_contract":"Work contract","pay_sheet":"Pay sheet","unemployment_benefit":"Unemployment benefit","pension":"Pension","other_revenue":"Other revenues","gradebook":"Gradebook","student_card":"Student card","school_attendance_certificate":"Certificate of school attendance","resume":"Resume","motivation_letter":"Motivation letter","other_work_document":"Other work document","health_book":"Health book","health_certificate":"Health/Vaccination certificate","disability_recognition":"Recognition of disability","pregnancy_medical_certificate":"Certificate of pregnancy","national_health_insurance_card":"National health insurance card","national_health_insurance_right_certificate":"National health insurance right certificate","health_insurance_card":"Insurance card","prescription":"Prescription","health_invoice":"Health invoice","other_health_document":"Other health document","vehicle_registration":"Vehicle registration","car_insurance":"Car insurance certificate","mechanic_invoice":"Repair bill","transport_invoice":"Transport invoice","other_transport_document":"Other transport document","phone_invoice":"Phone invoice","isp_invoice":"ISP invoice","telecom_invoice":"Telecom invoice","energy_invoice":"Energy invoice","water_invoice":"Water invoice","web_service_invoice":"Web service invoice","appliance_invoice":"Appliance invoice","restaurant_invoice":"Restaurant invoice","house_sale_agreeement":"House sale agreement","building_permit":"Building permit","technical_diagnostic_record":"Technical diagnostic record","lease":"Lease","house_insurance":"Home insurance","unfit_for_habitation_declaration":"Declaration of unfit for habitation","rent_receipt":"Rent receipt","accommodation_proof":"Proof of accommodation","work_quote":"Work quote","work_invoice":"Work invoice","other_house_document":"Other house document","tax_return":"Tax return","tax_notice":"Tax notice","tax_timetable":"Payment Plans Installment Agreements","receipt":"Receipt","other_tax_document":"Other tax document","bank_details":"IBAN","bank_statement":"Bank statement","loan_agreement":"Loan agreement","other_bank_document":"Other banking document","invoices":"Invoices","personal_sporting_licence":"Sporting licence","other_invoice":"Other invoice","other_activity_document":"Other sports document"},"themes":{"identity":"Identity","family":"Family","work_study":"Work & Study","health":"Health","home":"Home","transport":"Transport","invoice":"Invoice","others":"Others","undefined":"Undefined","finance":"Finance","activity":"Activities"}}}')},function(e){e.exports=JSON.parse('{"Scan":{"scan_a_doc":"Numériser un doc","save_doc":"Enregistrer le document","filename":"Nom du fichier","save":"Sauvegarder","cancel":"Annuler","qualify":"Qualifier","apply":"Appliquer","error":{"offline":"Vous êtes actuellement déconnecté, vous ne pouvez donc pas utiliser cette fonctionnalité. Connectez-vous à internet et recommencez. ","uploading":"Vous avez déjà un fichier en cours de téléchargement. Attendez la fin et recommencez.","generic":"Un problème est survenu. Veuillez réessayer. "},"successful":{"qualified_ok":"Vous venez de qualifier votre fichier avec succès !"},"items":{"identity":"Identité","family":"Famille","work_study":"Travail & Études","health":"Santé","home":"Logement","transport":"Transport","invoice":"Factures","others":"Autres","identity_photo":"Photo d\'identité","national_id_card":"Carte d\'identité","passport":"Passeport","residence_permit":"Titre de séjour","family_record_book":"Livret de famille","birth_certificate":"Certificat de naissance","citizen_registration_certificate":"Attestation de recensement citoyen","driver_license":"Permis","other_identity_document":"Autre document d\'identité","wedding":"Contrat de mariage","pacs":"Attestation de PACS","divorce":"Attestation de divorce","large_family_card":"Carte famille nombreuse","caf":"Attestation de quotient familial (CAF)","payment_proof_family_allowance":"Attestation de paiement CAF","other_family_document":"Autre document de famille","diploma":"Diplôme","work_contract":"Contrat de travail","pay_sheet":"Fiche de paie","unemployment_benefit":"Allocations chômage","pension":"Retraite","other_revenue":"Autres revenues","gradebook":"Bulletin de notes","student_card":"Carte d\'étudiant","school_attendance_certificate":"Certificat de scolarité","resume":"CV","motivation_letter":"Lettre de motivation","other_work_document":"Autre document de travail","health_book":"Carnet de santé","health_certificate":"Certificat de santé/vaccination","work_disability_recognition":"Reconnaissance de handicap - RQTH","pregnancy_medical_certificate":"Certificat de grossesse","national_health_insurance_card":"Carte vitale","national_health_insurance_right_certificate":"Attestation de droits de l\'Assurance Maladie (vitale)","health_insurance_card":"Carte de mutuelle","prescription":"Ordonnance","health_invoice":"Facture médicale","other_health_document":"Autre document de santé","vehicle_registration":"Carte grise","car_insurance":"Attestation d\'assurance auto","mechanic_invoice":"Facture de réparation","transport_invoice":"Facture de transport","other_transport_document":"Autre document de transport","phone_invoice":"Facture de téléphone","isp_invoice":"Facture d\'internet","telecom_invoice":"Facture de télécom","energy_invoice":"Facture d\'électricité","water_invoice":"Facture d\'eau","web_service_invoice":"Facture de service web","appliance_invoice":"Facture d\'électroménager","restaurant_invoice":"Facture de restaurant","house_sale_agreeement":"Compromis de vente","building_permit":"Permis de construire","technical_diagnostic_record":"Dossier de diagnostic technique","lease":"Bail","unfit_for_habitation_declaration":"Arrêté d\'insalubrité","house_insurance":"Assurance logement","rent_receipt":"Quittance de loyer","accommodation_proof":"Attestation d\'hébergement","work_quote":"Devis de travaux","work_invoice":"Facture de travaux","other_house_document":"Autre document de logement","tax_return":"Impôts - Déclaration de revenus","tax_notice":"Impôts - Avis d\'imposition","tax_timetable":"Impôts - Echéancier","receipt":"Accusé de réception","other_tax_document":"Impôts - Autre document","bank_details":"IBAN","bank_statement":"Relevé de compte","loan_agreement":"Contrat de prêt","other_bank_document":"Autre document bancaire","invoices":"Factures","personal_sporting_licence":"Licences sportives","other_invoice":"Autre facture","other_activity_document":"Autre document sportif"},"themes":{"identity":"Identité","family":"Famille","work_study":"Travail & Études","health":"Santé","home":"Logement","transport":"Transport","invoice":"Factures","others":"Autres","undefined":"Indéfini","finance":"Finances","activity":"Activités & loisirs"}}}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeByItem=void 0;n(19);var r=n(304);t.getThemeByItem=function(e){var t=function(e){return r.themesList.find((function(t){return t.defaultItems&&t.defaultItems.includes(e.label)}))}(e);return t||r.themesList.find((function(t){return t.items.some((function(t){return t.label===e.label}))}))}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchTimeSeriesByIntervalAndSource=t.saveTimeSeries=void 0;var o=r(n(5)),i=r(n(9)),a=n(18),u=(n(19),function(e){if(!e.startDate||!e.endDate)throw new Error("You must specify a startDate and endDate for the time serie");if(!Date.parse(e.startDate)||!Date.parse(e.endDate))throw new Error("Invalid date format for the time serie");if(!e.dataType)throw new Error("You must specify a dataType for the time serie");if(!e.series||!Array.isArray(e.series))throw new Error("You must specify a series array for the time serie")}),c=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,c,s,l,f,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.dataType,i=n.series,a=n.startDate,c=n.endDate,s=n.source,l=n.theme,u({dataType:r,series:i,startDate:a,endDate:c,source:s}),f="io.cozy.timeseries.".concat(r),p={_type:f,startDate:a,endDate:c,source:s,theme:l,series:i},e.abrupt("return",t.save(p));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.saveTimeSeries=c;var s=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,u,c,s,l,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.startDate,i=n.endDate,u=n.dataType,c=n.source,s=n.limit,l="io.cozy.timeseries.".concat(u),f=(0,a.Q)(l).where({source:c,startDate:{$gte:r},endDate:{$lte:i}}).indexFields(["source","startDate","endDate"]).sortBy([{source:"desc"},{startDate:"desc"},{endDate:"desc"}]).limitBy(s||5),e.abrupt("return",t.query(f));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchTimeSeriesByIntervalAndSource=s},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.createMockClient=void 0;var o=r(n(24)),i=r(n(2)),a=r(n(25)),u=r(n(40)),c=n(60),s=n(244),l=n(18);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var p=function(e,t,n){var r=n.definition,o=n.doctype,u=n.data,p=(0,a.default)(n,["definition","doctype","data"]);e.store.dispatch((0,c.initQuery)(t,r||(0,l.Q)(o))),e.store.dispatch((0,c.receiveQueryResult)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:u?u.map((function(e){return(0,s.normalizeDoc)(e,o)})):u},p)))};t.createMockClient=function(e){var t,n=e.queries,r=e.remote,i=e.clientOptions,a=new u.default(i||{});a.ensureStore();for(var c=0,s=Object.entries(n||{});c<s.length;c++){var l=(0,o.default)(s[c],2),f=l[0],d=l[1];p(a,f,d)}return a.query=jest.fn().mockImplementation((t=r,function(e){return t?t[e.doctype]?{data:t[e.doctype]}:{data:[]}:{data:null}})),a.save=jest.fn(),a.saveAll=jest.fn(),a.stackClient.fetchJSON=jest.fn(),a}},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useAppLinkWithStoreFallback",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"useCapabilities",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"useFetchShortcut",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"useClient",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useQuery",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"useAppsInMaintenance",{enumerable:!0,get:function(){return s.default}});var o=r(n(647)),i=r(n(648)),a=r(n(649)),u=r(n(122)),c=r(n(289)),s=r(n(650))},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(24)),u=n(0),c=n(18),s=n(291),l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(0,u.useState)("loading"),l=(0,a.default)(r,2),f=l[0],p=l[1],d=(0,u.useState)(!0),h=(0,a.default)(d,2),y=h[0],v=h[1],g=(0,u.useState)(null),m=(0,a.default)(g,2),b=m[0],w=m[1];return(0,u.useEffect)((function(){(function(){var r=(0,i.default)(o.default.mark((function r(){var i,a,u;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t.query((0,c.Q)("io.cozy.apps"));case 3:i=r.sent,a={slug:e},u=(0,s.isInstalled)(i.data,a),v(!!u),w(u?(0,s.getUrl)(u)+n:(0,s.getStoreURL)(i.data,a)),p("loaded"),r.next=14;break;case 11:r.prev=11,r.t0=r.catch(0),p("errored");case 14:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}})()()}),[t,e,n]),{fetchStatus:f,isInstalled:y,url:b}};t.default=l},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(24)),u=n(0),c=n(18),s=function(e){var t=(0,u.useState)(),n=(0,a.default)(t,2),r=n[0],s=n[1],l=(0,u.useState)("idle"),f=(0,a.default)(l,2),p=f[0],d=f[1];return(0,u.useEffect)((function(){(function(){var t=(0,i.default)(o.default.mark((function t(){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d("loading"),t.prev=1,t.next=4,e.query((0,c.Q)("io.cozy.settings").getById("capabilities"));case 4:n=t.sent,s(n),d("loaded"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),d("failed");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(){return t.apply(this,arguments)}})()()}),[e]),{capabilities:r,fetchStatus:p}};t.default=s},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(24)),u=n(0),c=function(e,t){var n=(0,u.useState)(null),r=(0,a.default)(n,2),c=r[0],s=r[1],l=(0,u.useState)(null),f=(0,a.default)(l,2),p=f[0],d=f[1],h=(0,u.useState)("idle"),y=(0,a.default)(h,2),v=y[0],g=y[1];return(0,u.useEffect)((function(){(function(){var n=(0,i.default)(o.default.mark((function n(){var r,i,a;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return g("loading"),n.prev=1,n.next=4,e.getStackClient().fetchJSON("GET","/shortcuts/".concat(t));case 4:r=n.sent,i=new URL(r.data.attributes.url),a="".concat(e.getStackClient().uri,"/bitwarden/icons/").concat(i.host,"/icon.png"),d(a),s(r),g("loaded"),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),g("failed");case 15:case"end":return n.stop()}}),n,null,[[1,12]])})));return function(){return n.apply(this,arguments)}})()()}),[e,t]),{shortcutInfos:c,shortcutImg:p,fetchStatus:v}};t.default=c},function(e,t,n){"use strict";var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(9)),a=r(n(24)),u=n(0),c=r(n(165)),s=(r(n(40)),n(19),function(e){var t=(0,u.useState)([]),n=(0,a.default)(t,2),r=n[0],s=n[1];return(0,u.useEffect)((function(){(function(){var t=(0,i.default)(o.default.mark((function t(){var n,r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new c.default({client:e}),t.next=3,n.fetchAppsInMaintenance();case 3:r=t.sent,s(r||[]);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}})()()}),[e]),r});t.default=s},function(e,t,n){var r=n(34),o=n(652),i=n(254),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,s,l,f,p,d,h=0,y=!1,v=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=c,r=s;return c=s=void 0,h=t,f=e.apply(r,n)}function b(e){return h=e,p=setTimeout(x,t),y?m(e):f}function w(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-h>=l}function x(){var e=o();if(w(e))return _(e);p=setTimeout(x,function(e){var n=t-(e-d);return v?u(n,l-(e-h)):n}(e))}function _(e){return p=void 0,g&&c?m(e):(c=s=void 0,f)}function k(){var e=o(),n=w(e);if(c=arguments,s=this,d=e,n){if(void 0===p)return b(d);if(v)return clearTimeout(p),p=setTimeout(x,t),m(d)}return void 0===p&&(p=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(y=!!n.leading,l=(v="maxWait"in n)?a(i(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=d=s=p=void 0},k.flush=function(){return void 0===p?f:_(o())},k}},function(e,t,n){var r=n(38);e.exports=function(){return r.Date.now()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=f(i),u=f(n(1)),c=f(n(654)),s=f(n(655)),l=n(663);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return h.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,c.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,i=n.highlightFirstSuggestion;if(!(0,c.default)(r,e.suggestions)&&r.length>0&&i)this.highlightFirstSuggestion();else if(o){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&o({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,u=t.renderSuggestion,c=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,h=t.id,y=t.getSectionSuggestions,v=t.theme,g=t.getSuggestionValue,m=t.alwaysRenderSuggestions,b=t.highlightFirstSuggestion,w=this.state,x=w.isFocused,_=w.isCollapsed,k=w.highlightedSectionIndex,O=w.highlightedSuggestionIndex,S=w.valueBeforeUpDown,E=m?p:this.props.shouldRenderSuggestions,j=c.value,P=c.onFocus,C=c.onKeyDown,T=this.willRenderSuggestions(this.props),A=m||x&&!_&&T,D=A?n:[],R=r({},c,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(j);e.setState({isFocused:!0,isCollapsed:!n}),P&&P(t),n&&i({value:j,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=E(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},b?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(_)E(j)&&(i({value:j,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,u=r.newHighlightedItemIndex,c=void 0;c=null===u?null===S?j:S:e.getSuggestionValueByIndex(a,u),e.updateHighlightedSuggestion(a,u,j),e.maybeCallOnChange(t,c,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var s=e.getHighlightedSuggestion();if(A&&!m&&e.closeSuggestions(),null!=s){var l=g(s);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:l,suggestionIndex:O,sectionIndex:k,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:A&&t.preventDefault();var f=A&&!m;if(null===S){if(!f){e.maybeCallOnChange(t,"","escape"),E("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,S,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}C&&C(t)}}),I={query:this.getQuery()};return a.default.createElement(s.default,{multiSection:f,items:D,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:u,renderItemData:I,renderSectionTitle:d,getSectionItems:y,highlightedSectionIndex:k,highlightedItemIndex:O,inputProps:R,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(v),id:h,ref:this.storeAutowhateverRef})}}]),t}(i.Component);d.propTypes={suggestions:u.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:u.default.func,onSuggestionHighlighted:u.default.func,renderInputComponent:u.default.func,renderSuggestionsContainer:u.default.func,getSuggestionValue:u.default.func.isRequired,renderSuggestion:u.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:u.default.func,alwaysRenderSuggestions:u.default.bool,multiSection:u.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:u.default.bool,highlightFirstSuggestion:u.default.bool,theme:u.default.object,id:u.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var h=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;i&&i(t,n),o?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=i.sectionIndex,u=i.suggestionIndex,c=e.getSuggestion(a,u),s=e.props.getSuggestionValue(c);e.maybeCallOnChange(t,s,"click"),e.onSuggestionSelected(t,{suggestion:c,suggestionValue:s,suggestionIndex:u,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,a=e.getHighlightedSuggestion(),u=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!u}),i&&i(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(656).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),u=d(a),c=d(n(1)),s=d(n(657)),l=d(n(658)),f=d(n(660)),p=d(n(661));function d(e){return e&&e.__esModule?e:{default:e}}var h={},y=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,i=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var u="ArrowDown"===e.key?"next":"prev",c=n.sectionIterator[u]([i,a]),s=o(c,2),l=s[0],f=s[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:i,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,s.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,a=n.renderItemData,c=n.renderSectionTitle,s=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return o.map((function(n,o){var h="react-autowhatever-"+r+"-",y=h+"section-"+o+"-",v=0===o;return u.default.createElement("div",t(y+"container","sectionContainer",v&&"sectionContainerFirst"),u.default.createElement(f.default,{section:n,renderSectionTitle:c,theme:t,sectionKeyPrefix:y}),u.default.createElement(p.default,{items:e.sectionsItems[o],itemProps:d,renderItem:i,renderItemData:a,sectionIndex:o,highlightedItemIndex:s===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:h,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,a=n.highlightedSectionIndex,c=n.highlightedItemIndex,s=n.itemProps;return u.default.createElement(p.default,{items:e,itemProps:s,renderItem:o,renderItemData:i,highlightedItemIndex:null===a?c:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,i=t.renderInputComponent,a=t.renderItemsContainer,c=t.highlightedSectionIndex,s=t.highlightedItemIndex,l=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(c,s),h="react-autowhatever-"+n,y=r({role:"combobox","aria-haspopup":"listbox","aria-owns":h,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),v=i(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":h,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),g=a({containerProps:r({id:h,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return u.default.createElement("div",y,v,g)}}]),t}(a.Component);y.propTypes={id:c.default.string,multiSection:c.default.bool,renderInputComponent:c.default.func,renderItemsContainer:c.default.func,items:c.default.array.isRequired,renderItem:c.default.func,renderItemData:c.default.object,renderSectionTitle:c.default.func,getSectionItems:c.default.func,containerProps:c.default.object,inputProps:c.default.object,itemProps:c.default.oneOfType([c.default.object,c.default.func]),highlightedSectionIndex:c.default.number,highlightedItemIndex:c.default.number,theme:c.default.oneOfType([c.default.object,c.default.array])},y.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return u.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return u.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:h,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:h,inputProps:h,itemProps:h,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=y},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||a===t[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(i))?[null,null]:[i,0]:[i,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:o,prev:function(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||0===a?null===(i=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,t[i]-1]:[i,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===o(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i,a=n(659),u=(i=a)&&i.__esModule?i:{default:i},c=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),i=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var s=n.map((function(e){return i[e]})).filter(c);return"string"==typeof s[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,o(s)):s.join(" ")}:{key:e,style:u.default.apply(void 0,[{}].concat(o(s)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function i(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=o(e),u=1;u<arguments.length;u++){n=arguments[u],r=i(Object(n));for(var c=0;c<r.length;c++)a[r[c]]=n[r[c]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=c(o),a=c(n(1)),u=c(n(186));function c(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return s(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,a=n(t);return a?i.default.createElement("div",r(o+"title","sectionTitle"),a):null}}]),t}(o.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=l(i),u=l(n(1)),c=l(n(662)),s=l(n(186));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,i=t.renderItem,u=t.renderItemData,s=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,h=null===s?d:d+"section-"+s+"-",y="function"==typeof o;return a.default.createElement("ul",r({role:"listbox"},p(h+"items-list","itemsList")),n.map((function(t,n){var d=0===n,v=n===l,g=h+"item-"+n,m=y?o({sectionIndex:s,itemIndex:n}):o,b=r({id:f(s,n),"aria-selected":v},p(g,"item",d&&"itemFirst",v&&"itemHighlighted"),m);return v&&(b.ref=e.storeHighlightedItemReference),a.default.createElement(c.default,r({},b,{sectionIndex:s,isHighlighted:v,itemIndex:n,item:t,renderItem:i,renderItemData:u}))})))}}]),t}(i.Component);d.propTypes={items:u.default.array.isRequired,itemProps:u.default.oneOfType([u.default.object,u.default.func]),renderItem:u.default.func.isRequired,renderItemData:u.default.object.isRequired,sectionIndex:u.default.number,highlightedItemIndex:u.default.number,onHighlightedItemChange:u.default.func.isRequired,getItemId:u.default.func.isRequired,theme:u.default.func.isRequired,keyPrefix:u.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=s(i),u=s(n(1)),c=s(n(186));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete u.sectionIndex,delete u.itemIndex,"function"==typeof u.onMouseEnter&&(u.onMouseEnter=this.onMouseEnter),"function"==typeof u.onMouseLeave&&(u.onMouseLeave=this.onMouseLeave),"function"==typeof u.onMouseDown&&(u.onMouseDown=this.onMouseDown),"function"==typeof u.onClick&&(u.onClick=this.onClick),a.default.createElement("li",r({role:"option"},u,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},i)))}}]),t}(i.Component);p.propTypes={sectionIndex:u.default.number,isHighlighted:u.default.bool.isRequired,itemIndex:u.default.number.isRequired,item:u.default.any.isRequired,renderItem:u.default.func.isRequired,renderItemData:u.default.object.isRequired,onMouseEnter:u.default.func,onMouseLeave:u.default.func,onMouseDown:u.default.func,onClick:u.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";(function(t){var r=n(665),o=n(666),i={_isShim:!0,track:function(){},push:function(e){},setUserId:function(e){},trackError:function(e){},connectToHistory:function(e,t){return e},disconnectFromHistory:function(){}},a=null,u=null;"undefined"==typeof window?e.exports=function(){return i}:e.exports=function(e){var n=function(){return t&&Object({USE_REACT:!0})?"production".toLowerCase():"development"},c=function(){if(void 0===window._paq||"function"!=typeof window._paq.push)return!1;var e=!1,t=!1;if(void 0===window._paq.length)return!0;for(var n=0,r=window._paq.length;n<r;n++)if(~window._paq[n].indexOf("setSiteId")&&(e=!0),~window._paq[n].indexOf("setTrackerUrl")&&(t=!0),t&&e)return!0;return!1};(e=e||{}).trackErrors=void 0!==e.trackErrors&&e.trackErrors,e.trackErrorHandler=void 0!==e.trackErrorHandler?e.trackErrorHandler:function(e,t){d(["trackEvent",t=t||"JavaScript Error",e.message,e.filename+": "+e.lineno])},e.enableLinkTracking=void 0===e.enableLinkTracking||e.enableLinkTracking,e.updateDocumentTitle=void 0===e.updateDocumentTitle||e.updateDocumentTitle,e.ignoreInitialVisit=void 0!==e.ignoreInitialVisit&&e.ignoreInitialVisit,e.injectScript=void 0===e.injectScript||e.injectScript,e.clientTrackerName=void 0!==e.clientTrackerName?e.clientTrackerName:"piwik.js",e.serverTrackerName=void 0!==e.serverTrackerName?e.serverTrackerName:"piwik.php";var s=c();window._paq=window._paq||[];var l=!(e.url&&e.siteId||s),f=!e.injectScript&&!s;if(l||f)return"test"!==n()&&r(null,"PiwikTracker cannot be initialized! You haven't passed a url and siteId to it."),i;var p=function(t){var n;n=t.path?t.path:t.basename?o(t.basename,t.pathname,t.search):o(t.pathname,t.search),a!==n&&(e.updateDocumentTitle&&d(["setDocumentTitle",document.title]),d(["setCustomUrl",n]),d(["trackPageView"]),a=n)},d=function(e){window._paq.push(e)},h=function(e){window._paq.push(["setUserId",e])};return e.trackErrors&&(window.addEventListener?window.addEventListener("error",e.trackErrorHandler,!1):window.attachEvent?window.attachEvent("onerror",e.trackErrorHandler):window.onerror=e.trackErrorHandler),function(){var t,n=c();if(!n){var r=-1!==(t=e.url).indexOf("http://")||-1!==t.indexOf("https://")?t+"/":"https:"==document.location.protocol?"https://"+t+"/":"http://"+t+"/";d(["setSiteId",e.siteId]),d(["setTrackerUrl",r+e.serverTrackerName])}if(e.userId&&h(e.userId),e.enableLinkTracking&&d(["enableLinkTracking"]),e.injectScript&&!n){var o=document,i=o.createElement("script"),a=o.getElementsByTagName("script")[0];i.type="text/javascript",i.defer=!0,i.async=!0,i.src=r+e.clientTrackerName,a.parentNode.insertBefore(i,a)}}(),{_isShim:!1,track:p,push:d,setUserId:h,trackError:e.trackErrorHandler,connectToHistory:function(t,o){o="function"==typeof o?o:function(e){return e};var i=function(e,t){var o=e(t);void 0!==o?p(o):"development"===n()&&r(null,"The modifier given to .connectToHistory did not return any object. Please make sure to return the modified location object in your modifier.")};return u=t.listen((function(e){i(o,e)})),!e.ignoreInitialVisit&&t.location&&i(o,t.location),t},disconnectFromHistory:function(){return!!u&&(u(),!0)}}}}).call(this,n(233))},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){var r,o,i;i=function(){function e(e,t){return e=(e=(e=(e=e.replace(/:\//g,"://")).replace(/([^:\s])\/+/g,"$1/")).replace(/\/(\?|&|#[^!])/g,"$1")).replace(/(\?.+)\?/g,"$1&")}return function(){var t=arguments;"object"==typeof arguments[0]&&(t=arguments[0]);var n=[].slice.call(t,0).join("/");return e(n)}},e.exports?e.exports=i():void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){var r={"./de":305,"./de.json":305,"./en":306,"./en.json":306,"./es":307,"./es.json":307,"./fr":308,"./fr.json":308,"./it":309,"./it.json":309,"./ja":310,"./ja.json":310,"./nl_NL":311,"./nl_NL.json":311,"./pl":312,"./pl.json":312,"./ru":313,"./ru.json":313,"./sq":314,"./sq.json":314,"./zh_CN":315,"./zh_CN.json":315};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=667},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t=(0,i.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var r,o=n(669),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(){}t.default=function(e){var t=e+"Storage";return function(e){if("object"!==("undefined"==typeof self?"undefined":r(self))||!(e in self))return!1;try{var t=self[e],n="redux-persist "+e+" test";t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(e){return!1}return!0}(t)?self[t]:i};var i={getItem:o,setItem:o,removeItem:o}},function(e,t,n){"use strict";n.r(t);var r=n(13),o=n.n(r),i=n(3),a=n.n(i),u=n(7),c=n.n(u),s=n(11),l=n.n(s),f=n(8),p=n.n(f),d=n(10),h=n.n(d),y=n(6),v=n.n(y),g=n(2),m=n.n(g),b=n(0),w=n.n(b),x=n(37),_=n(20),k=n(26),O=n.n(k),S=n(25),E=n.n(S),j=n(1),P=n.n(j),C=n(191),T=n.n(C),A=n(14),D=n.n(A);function R(e){var t=e.icon,n=e.width,r=e.height,o=e.color,i=e.className,a=e.preserveColor,u=e.rotate,c=e.size,s=e.spin,l=E()(e,["icon","width","height","color","className","preserveColor","rotate","size","spin"]),f=Object(b.useMemo)((function(){return t instanceof Function?t:function(e){var t;return(t=e.id?"#".concat(e.id):"#"===e[0]?e:"#"+e)?function(e){return w.a.createElement("svg",e,w.a.createElement("use",{xlinkHref:t}))}:(console.warn("Icon not found ".concat(e,".")),null)}(t)}),[t]),p=e.style;p=Object.assign({},p),o&&(p.fill=o),u&&(p.transform="rotate(".concat(u,"deg)"));var d=a?"icon--preserveColor":"icon",h=D()(i,T.a[d],m()({},T.a["icon--spin"],s));return f?w.a.createElement(f,O()({className:h,style:p,width:n||c||"16",height:r||c||"16"},l)):null}R.isProperIcon=function(e){return e&&!!e.id||"string"==typeof e};var I=P.a.oneOfType([P.a.string,P.a.object,P.a.func]);R.propTypes={icon:I.isRequired,width:P.a.oneOfType([P.a.string,P.a.number]),height:P.a.oneOfType([P.a.string,P.a.number]),color:P.a.oneOfType([P.a.string,P.a.object]),className:P.a.string,preserveColor:P.a.bool,size:P.a.oneOfType([P.a.string,P.a.number]),spin:P.a.bool},R.defaultProps={spin:!1};var N=R,z=n(123),M=null,F=n.n(z)()((function(){var e=document.querySelector("[role=application]");if(e&&e.dataset){var t=e.dataset.cozyTracking;if(""===t||"true"===t)return!0;if("false"===t)return!1}})),L=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!F())return null;if(null!==M)return M;try{!1===o&&Piwik.getTracker();var i=n(664);return M=i({url:e||"https://matomo.cozycloud.cc",siteId:t||8,injectScript:o}),r&&U(),M}catch(e){return console.warn(e),M=null,null}},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!==M){var t,n,r=document.querySelector("[role=application]");if(r&&r.dataset){n=r.dataset.cozyAppName;var o=(t=r.dataset.cozyDomain||"").indexOf(":");o>=0&&(t=t.substring(0,o))}e=Object.assign({userId:t,appDimensionId:1,app:n,heartbeat:15},e),parseInt(e.heartbeat)>0&&M.push(["enableHeartBeatTimer",parseInt(e.heartbeat)]),M.push(["setUserId",e.userId]),M.push(["setCustomDimension",e.appDimensionId,e.app])}},B=n(23),q=n(5),H=n.n(q),W=n(9),Q=n.n(W),$=n(29),G=n(76),V=n.n(G),J=n(74),Y=n.n(J),K={},X=function(){var e=Q()(H.a.mark((function e(t,n,r){var o;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Cannot fetch icon: missing domain");case 2:if(o=Z(t,n,r)){e.next=5;break}throw new Error("Cannot get icon source for app ".concat(t.name));case 5:return e.abrupt("return",new Promise((function(e,t){var n=document.createElement("img");n.onload=function(){K[o]=!0,e(o)},n.onerror=function(){var e=new Error("Error while preloading ".concat(o));console.error(e.message),t(e)},n.src=o})));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Z=function(e,t,n){if(!t)return null;var r=ee(e);return(r=r||te(e))?"".concat(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return"http".concat(e?"s":"",":")}(n),"//").concat(t).concat(r):null},ee=function(e){return e.links&&e.links.icon},te=function(e){return"string"==typeof e?"/registry/".concat(e,"/icon"):e.latest_version&&e.latest_version.version&&"/registry/".concat(e.slug,"/").concat(e.latest_version.version,"/icon")},ne=P.a.shape({name:P.a.string,slug:P.a.string,developer:P.a.object,links:P.a.shape({icon:P.a.string}),latest_version:P.a.shape({version:P.a.string})});P.a.shape({_id:P.a.string,class:P.a.string,mime:P.a.string,name:P.a.string});function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var oe=function(e){p()(r,e);var t,n=re(r);function r(e,t){var o;a()(this,r),(o=n.call(this,e,t)).isUnmounting=!1,o.handleError=o.handleError.bind(l()(o));try{var i=e.app,u=e.client,c=new URL(u.getStackClient().uri);o.domain=c.host,o.secure="https:"===c.protocol;var s=function(e,t,n){var r=Z(e,t,n);return r&&K[r]?r:null}(i,o.domain,o.secure);o.state={error:null,icon:s,status:s?"done":"fetching"}}catch(e){o.state={error:e,status:"errored"}}return o}return c()(r,[{key:"componentWillUnmount",value:function(){this.isUnmounting=!0}},{key:"componentDidMount",value:function(){this.isUnmounting=!1,this.load()}},{key:"componentDidUpdate",value:function(e){this.props.fetchIcon!==e.fetchIcon&&this.load()}},{key:"load",value:(t=Q()(H.a.mark((function e(){var t,n,r,o,i,a,u;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.app,r=t.fetchIcon,o=t.onReady,i=r||X,e.prev=2,e.next=5,i(n,this.domain,this.secure);case 5:a=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),u=e.t0;case 11:this.isUnmounting||(this.setState({error:u,icon:a,status:u?"errored":"done"}),"function"==typeof o&&o());case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(){return t.apply(this,arguments)})},{key:"handleError",value:function(){this.setState({status:"errored"})}},{key:"render",value:function(){var e=this.props,t=e.alt,n=e.className,r=e.fallbackIcon,o=this.state,i=o.icon;switch(o.status){case"fetching":return w.a.createElement("div",{className:D()(V.a["c-loading-placeholder"],V.a["c-app-icon"],n)});case"done":return w.a.createElement("img",{alt:t,className:D()(V.a["c-app-icon"],n),src:i,onError:this.handleError});case"errored":default:return w.a.createElement(N,{className:D()(V.a["c-app-icon"],V.a["c-app-icon-default"],n),height:"100%",icon:r||"cube",width:"100%",color:Y.a.coolGrey})}}}]),r}(b.Component);oe.propTypes={alt:P.a.string,app:P.a.oneOfType([ne,P.a.string]),fallbackIcon:I,fetchIcon:P.a.func,client:P.a.object.isRequired,className:P.a.string,onReady:P.a.func};var ie=Object($.withClient)(oe),ae=n(21),ue=n(43),ce=n.n(ue),se=n(44),le=n.n(se),fe=new ce.a({id:"icon-cozy-home",use:"icon-cozy-home-usage",viewBox:"0 0 32 32",content:'<symbol viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="icon-cozy-home">\n <defs></defs>\n <g id="icon-cozy-home_📦-components" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="icon-cozy-home_components/header/2_1" transform="translate(-16.000000, -12.000000)">\n <g id="icon-cozy-home_icon-cozy-home" transform="translate(16.000000, 12.000000)">\n <g id="icon-cozy-home_logo">\n <g id="icon-cozy-home_logo/cozypastille">\n <circle id="icon-cozy-home_Oval" fill="#297EF2" fill-rule="nonzero" cx="16" cy="16" r="16" />\n <path d="M19.31364,17.56136 C19.15384,17.81024 18.79956,17.88504 18.55544,17.72184 C18.53436,17.70892 18.51396,17.69464 18.49492,17.68036 C17.78296,18.23864 16.90644,18.54328 15.99524,18.54328 C15.08608,18.54328 14.2116,18.24 13.501,17.68376 C13.48264,17.69668 13.46428,17.71028 13.44524,17.72184 C13.19364,17.88572 12.8448,17.80752 12.68636,17.5634 C12.52588,17.31588 12.59592,16.98064 12.84208,16.8154 C13.0556,16.67464 13.07056,16.3938 13.07056,16.39108 C13.076,16.2442 13.13992,16.10412 13.24668,16.00552 C13.35276,15.90692 13.48604,15.8498 13.63292,15.86136 C13.92736,15.86816 14.16672,16.11568 14.16128,16.41352 C14.16128,16.4176 14.1606,16.56652 14.10688,16.77324 C15.20508,17.68512 16.79696,17.68172 17.89108,16.76576 C17.85096,16.60732 17.84076,16.48084 17.83804,16.42236 C17.83532,16.26936 17.88972,16.13064 17.9924,16.02524 C18.09304,15.92188 18.22904,15.8634 18.37388,15.86068 L18.3834,15.86068 C18.67784,15.86068 18.92196,16.098 18.92876,16.39312 C18.92876,16.39312 18.9444,16.67532 19.15588,16.81472 C19.4034,16.97792 19.47412,17.3118 19.31364,17.56136 M21.63584,11.19248 C21.47876,9.86376 20.89056,8.63568 19.94604,7.6864 C18.8628,6.59772 17.4314,6 15.91636,6 C14.40132,6 12.9706,6.59772 11.88736,7.68708 C10.93876,8.63976 10.3492,9.87464 10.19552,11.21084 C8.89468,11.3686 7.69176,11.97448 6.76288,12.94756 C5.70344,14.05936 5.12,15.52884 5.12,17.08468 C5.12,20.34664 7.704,23 10.88164,23 L21.11768,23 C24.29396,23 26.88,20.34664 26.88,17.08468 C26.88,14.00224 24.57072,11.46244 21.63584,11.19248" id="icon-cozy-home_Fill-1" fill="#FFFFFF" fill-rule="evenodd" />\n </g>\n </g>\n </g>\n </g>\n </g>\n</symbol>'}),pe=(le.a.add(fe),fe);function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var he=function(e){p()(n,e);var t=de(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props.className;return w.a.createElement(ie,{fetchIcon:function(){return"".concat(ae.b.get.cozyURL(),"/assets/images/icon-cozy-home.svg")},fallbackIcon:pe,className:e})}}]),n}(b.PureComponent),ye=function(e){var t=e.webviewContext,n=e.homeHref;return t?w.a.createElement("button",{onClick:function(){t.call("backToHome")},className:"coz-nav-apps-btns-home --flagship"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"})):n?w.a.createElement("a",{href:n,className:"coz-nav-apps-btns-home"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"})):w.a.createElement("span",{className:"coz-nav-apps-btns-home"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"}))},ve=n(50),ge=n.n(ve),me=function(e){var t,n=e.className,r=e.extension,o=e.size,i=e.theme,a=e.variant,u=e.round,c=e.align;return D()(ge.a["c-btn"],(t={},m()(t,ge.a["c-btn--".concat(i)],i),m()(t,ge.a["c-btn--".concat(o)],"normal"!==o),m()(t,ge.a["c-btn--".concat(a)],a),m()(t,ge.a["c-btn--".concat(r)],r),m()(t,ge.a["c-btn--".concat(c)],c),m()(t,ge.a["c-btn--round"],u),t),n)},be=function(e){return function(t){var n=t.busy,r=t.disabled,o=E()(t,["busy","disabled"]);return n&&(o["aria-busy"]=!0),r&&(o["aria-disabled"]=!0),"button"===e&&r&&(o.disabled=!0),o}},we={button:be("button"),a:be("a")},xe=function(e){return e},_e={tiny:8,small:12,large:18},ke=function(e){var t=e.children,n=e.icon,r=e.iconOnly,o=e.label,i=e.subtle,a=e.className,u=e.extension,c=e.round,s=e.size,l=e.theme,f=e.align,p=e.extraRight,d=e.tag,h=E()(e,["children","icon","iconOnly","label","subtle","className","extension","round","size","theme","align","extraRight","tag"]),y=we[d]||xe,v=r?o:null,g=r?"u-visuallyhidden":null;return w.a.createElement(d,O()({},y(h),{className:me({extension:u,align:f,round:c,size:s,theme:l,className:a,variant:i&&"subtle"}),title:v}),w.a.createElement("span",null,N.isProperIcon(n)?w.a.createElement(N,{size:_e[s],icon:n,"aria-hidden":!0,focusable:"false"}):n,o&&w.a.createElement("span",{className:g},o),t,p&&w.a.createElement("span",{className:"u-ml-auto"},p),h.busy&&w.a.createElement(N,{size:_e[s],icon:"spinner",spin:!0,className:"u-ml-half","aria-hidden":!0,focusable:"false"})))},Oe=function(e){return w.a.createElement(ke,e)},Se=function(e){return w.a.createElement(ke,e)};function Ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}Oe.propTypes={children:P.a.node,label:P.a.node.isRequired,icon:P.a.oneOfType([P.a.node,I]),iconOnly:P.a.bool,theme:P.a.string,size:P.a.oneOf(["tiny","small","large","normal"]),extension:P.a.oneOf(["narrow","full"]),align:P.a.oneOf(["left","right","center"]),round:P.a.bool,className:P.a.string,onClick:P.a.func,extraRight:P.a.PropTypes.node,busy:P.a.bool,disabled:P.a.bool,type:P.a.oneOf(["button","reset","submit"]),subtle:P.a.bool},Oe.defaultProps={type:"submit",tag:"button",size:"normal",align:"center"},Se.defaultProps={tag:"a"};var je=function(e){p()(n,e);var t=Ee(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).state={unmounted:!0},r.animate=r.animate.bind(l()(r)),r}return c()(n,[{key:"animate",value:function(){var e=this;return setTimeout((function(){e.setState((function(){return{unmounted:!1}}))}),100)}},{key:"componentDidMount",value:function(){this.animate()}},{key:"render",value:function(){var e=this.props,t=e.t,n=e.code,r=e.links,o=this.state.unmounted;return w.a.createElement("div",{className:"coz-bar-banner".concat(o?" unmounted":"")},w.a.createElement("p",null,t("banner.".concat(n,".description"))),w.a.createElement(Se,{className:"coz-bar-banner-button",size:"tiny",href:r,label:t("banner.".concat(n,".CTA"))}))}}]),n}(b.Component),Pe=Object(_.translate)()(je),Ce=n(128),Te=n.n(Ce),Ae=n(325),De=n.n(Ae),Re=n(24),Ie=n.n(Re),Ne=n(72),ze=n.n(Ne),Me=function(e){var t=window.innerWidth;return ze()(e,(function(e){var n=Ie()(e,2),r=n[0],o=n[1];return t>=r&&(void 0===o||t<=o)}))},Fe={isExtraLarge:[1201],isLarge:[1024,1200],isMedium:[769,1023],isSmall:[544,768],isTiny:[0,543],isDesktop:[1024],isTablet:[769,1023],isMobile:[0,768]};function Le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}P.a.shape(Object.keys(Fe).reduce((function(e,t){return e[t]=P.a.bool.isRequired,e}),{}));var Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fe;return function(t){var n=function(n){p()(o,n);var r=Le(o);function o(t){var n;return a()(this,o),(n=r.call(this,t)).state={breakpoints:Me(e)},n.checkBreakpoints=De()((function(){n.setState({breakpoints:Me(e)})}),100,{trailing:!0}),n}return c()(o,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.checkBreakpoints)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.checkBreakpoints)}},{key:"render",value:function(){var e=this.props,n=this.state.breakpoints;return w.a.createElement(t,O()({},e,{breakpoints:n}))}}]),o}(b.Component);return n.displayName="withBreakpoints(".concat(t.displayName||t.name,")"),n}},Be=n(12),qe=n(16),He=n.n(qe),We=P.a.shape({slug:P.a.string.isRequired,name:P.a.string.isRequired,namePrefix:P.a.string,comingSoon:P.a.bool,href:P.a.string,links:P.a.shape({icon:P.a.string.isRequired})}),Qe={drive:{appId:"io.cozy.drive.mobile",uri:"cozydrive://",name:"Cozy Drive"},banks:{appId:Object(B.isAndroidApp)()?"io.cozy.banks.mobile":"io.cozy.banks",uri:"cozybanks://",name:"Cozy Banks"}},$e=function(e){return e?e.startsWith("/")?e:"/"+e:"/"},Ge=function(e){var t=e.slug,n=e.cozyUrl,r=e.subDomainType,o=e.fallbackUrl,i=e.nativePath;if(i=$e(i),!n&&!o)throw new Error("Must have either cozyUrl or fallbackUrl to generate universal link.");n&&!o&&(o=function(e){var t=e.cozyUrl,n=e.nativePath,r=e.slug,o=e.subDomainType;n=$e(n);var i=new URL(t);return i.host="nested"===o?"".concat(r,".").concat(i.host):i.host.split(".").map((function(e,t){return 0===t?e+"-"+r:e})).join("."),i.hash=n,i.toString()}({cozyUrl:n,nativePath:i,slug:t,subDomainType:r}));var a=new URL("https://links.mycozy.cloud/"+t+i);return a.searchParams.append("fallback",o),a.toString()};function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Je,Ye,Ke,Xe,Ze=(Je=function(e){return Object(B.checkApp)(e).catch((function(){return!1}))},Ye=1e4,Ke=function(e){return e.appId},Xe={},function(e){var t=Ke(e),n=Xe[t];return n&&n.result&&n.date-Date.now()<Ye||(Xe[t]={result:Je(e),date:Date.now()}),Xe[t].result}),et=function(e){p()(r,e);var t,n=Ve(r);function r(e){var t;return a()(this,r),t=n.call(this,e),m()(l()(t),"state",{nativeAppIsAvailable:null,isFetchingAppInfo:!1}),t}return c()(r,[{key:"componentDidMount",value:function(){Object(B.isMobileApp)()&&this.checkAppAvailability()}},{key:"checkAppAvailability",value:(t=Q()(H.a.mark((function e(){var t,n,r;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.slug,!(n=Qe[t])){e.next=9;break}return e.t0=Boolean,e.next=6,Ze(n);case 6:e.t1=e.sent,r=(0,e.t0)(e.t1),this.setState({nativeAppIsAvailable:r});case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.props,t=e.children,n=e.slug,i=this.state.nativeAppIsAvailable,a=Qe[n],u=r.getOnClickHref(this.props,i),c=u.href,s=u.onClick;return t(o()({},a,{onClick:s,href:c}))}}],[{key:"getOnClickHref",value:function(e,t){var n=e.slug,o=e.nativePath,i=e.href,a=null,u=Object(B.isMobileApp)(),c=Qe[n];if(u)t?(a=r.openNativeFromNative.bind(this,e),i="#"):a=r.openWeb.bind(this,e);else if(Object(B.isMobile)()&&c)if(Object(B.isAndroid)())a=r.openNativeFromWeb.bind(this,e);else try{i=Ge({slug:n,nativePath:o,fallbackUrl:i})}catch(e){console.error(e),i="#"}return{href:i,onClick:a}}},{key:"openNativeFromWeb",value:function(e,t){var n=e.href,o=e.slug,i=e.nativePath,a=e.onAppSwitch,u=Qe[o];t&&t.preventDefault(),r.onAppSwitch(a),Object(B.openDeeplinkOrRedirect)(u.uri+("/"===i?"":i),(function(){window.location.href=n}))}},{key:"onAppSwitch",value:function(e){"function"==typeof e&&e()}},{key:"openNativeFromNative",value:function(e,t){var n=e.slug,o=e.onAppSwitch;t&&t.preventDefault();var i=Qe[n];r.onAppSwitch(o),Object(B.startApp)(i).catch((function(e){console.error("AppLinker: Could not open native app",e)}))}},{key:"openWeb",value:function(e){r.onAppSwitch(e.onAppSwitch)}}]),r}(w.a.Component);et.defaultProps={nativePath:"/"},et.propTypes={slug:P.a.string.isRequired,href:P.a.string.isRequired,nativePath:P.a.string,onAppSwitch:P.a.func};var tt=et;function nt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var rt=He()($.models,"applications.getAppDisplayName",(function(e){return e.namePrefix&&"cozy"!==e.namePrefix.toLowerCase()?"".concat(e.namePrefix," ").concat(e.name):e.name})),ot=function(e){p()(n,e);var t=nt(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).onAppSwitch=r.onAppSwitch.bind(l()(r)),r}return c()(n,[{key:"componentWillUnmount",value:function(){this.switchTimeout&&clearTimeout(this.switchTimeout)}},{key:"buildAppUrl",value:function(e){var t;try{t=new URL(e)}catch(e){return console.error(e.message),null}var r=n.buildQueryParams(this.props,this.context);if(r)for(var o in r)t.searchParams.append(o,r[o]);return t.toString()}},{key:"onAppSwitch",value:function(){var e=this.props.onAppSwitch;"function"==typeof e&&(this.switchTimeout=setTimeout((function(){e()}),1e3))}},{key:"render",value:function(){var e=this.props,t=e.useHomeIcon,n=e.app,r=n.slug?"icon-".concat(n.slug):"",o=rt(n);return w.a.createElement(tt,{onAppSwitch:this.onAppSwitch,slug:n.slug,href:this.buildAppUrl(n.href)||""},(function(e){var i=e.onClick,a=e.href;return w.a.createElement("li",{className:"coz-nav-apps-item".concat(n.isCurrentApp?" --current":"")},w.a.createElement("a",{role:"menuitem",href:a,"data-icon":r,title:o,onClick:i},t?w.a.createElement(he,{className:"coz-nav-apps-item-icon"}):w.a.createElement(ie,O()({app:n,className:"coz-nav-apps-item-icon",key:n.slug},ae.b.get.iconProps())),w.a.createElement("p",{className:"coz-label"},o)))}))}}]),n}(w.a.Component);m()(ot,"buildQueryParams",(function(){return null})),ot.propTypes={app:We.isRequired,useHomeIcon:P.a.bool};var it=ot,at=function(){return w.a.createElement("li",{className:"coz-nav-apps-item"},w.a.createElement("span",{role:"menuitem",disabled:!0},w.a.createElement("div",{className:"coz-nav-apps-item-icon coz-loading-placeholder"}),w.a.createElement("p",{className:"coz-label coz-loading-placeholder"})))},ut=n(324),ct=n.n(ut);function st(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var lt=function(e){p()(n,e);var t=st(n);function n(e,r){var o;return a()(this,n),(o=t.call(this,e,r)).translateApp=ft(o.props.t),o}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.t,n=e.apps,r=e.breakpoints,o=e.homeApp,i=e.isFetchingApps,a=e.onAppSwitch,u=r.isMobile,c=o&&o.isCurrentApp,s=o&&o.slug;return i||n&&n.length?w.a.createElement("div",{className:"coz-nav-pop-content"},w.a.createElement("ul",{className:"coz-nav-group"},u&&o&&w.a.createElement(it,{app:o,useHomeIcon:!0,onAppSwitch:a}),i?new Array(3).fill({}).map((function(e,t){return w.a.createElement(at,{key:t})})):n.filter((function(e){return e.slug!==s})).sort(function(e){return function(t,n){return e(t)>e(n)}}(this.translateApp)).map((function(e,t){return w.a.createElement(it,{app:e,key:t,onAppSwitch:a})}))),o&&!u&&!c&&w.a.createElement("a",{role:"menuitem",href:o.href,className:"coz-apps-home-btn"},w.a.createElement("img",{src:ct.a}),t("menu.home"))):w.a.createElement("p",{className:"coz-nav--error coz-nav-group"},t("no_apps"))}}]),n}(b.Component);lt.propTypes={homeApp:P.a.shape({isCurrentApp:P.a.bool,slug:P.a.string}),apps:P.a.array,isFetchingApps:P.a.bool.isRequired};var ft=function(e){return function(t){var n=t.namePrefix?e("".concat(t.slug,".namePrefix"),{_:t.namePrefix}):null,r=e("".concat(t.slug,".name"),{_:t.name});return n?"".concat(n," ").concat(r):"".concat(r)}},pt=Object(x.connect)((function(e){return{apps:Object(Be.d)(e),homeApp:Object(Be.f)(e),isFetchingApps:Object(Be.n)(e)}}))(Object(_.translate)()(Ue()(lt))),dt=Object(_.translate)()((function(e){var t=e.t,n=e.data,r=Number.isInteger(n.quota)?(n.quota/1e9).toFixed(2):n.quota,o=Number.isInteger(n.usage)?(n.usage/1e9).toFixed(2):n.usage;return w.a.createElement("div",{className:"coz-nav-storage"},w.a.createElement("p",{className:"coz-nav-storage-text"},t("storage_phrase",{diskUsage:o,diskQuota:r})),w.a.createElement("progress",{className:"cozy-nav-storage-bar",value:o,max:r,min:"0"}))})),ht=function(e){var t=e.t,n=e.onLogOut,r=e.settingsAppURL,o=e.storageData,i=e.onClaudy,a=e.isDrawer,u=void 0!==a&&a,c=e.isClaudyLoading,s=e.toggleSupport,l=e.shoulDisplayViewOfferButton,f=e.managerUrlPremiumLink,p=e.viewOfferButtonText;return w.a.createElement("div",{className:"coz-nav-pop-content"},u&&w.a.createElement("hr",null),r&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem",href:"".concat(r,"#/profile"),target:"_self","data-icon":"icon-profile",title:t("profile")},w.a.createElement("p",{className:"coz-label"},t("profile")))),w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem",href:"".concat(r,"#/connectedDevices"),target:"_self","data-icon":"icon-connectedDevices",title:t("connectedDevices")},w.a.createElement("p",{className:"coz-label"},t("connectedDevices"))))),u&&i&&!Object(B.isMobileApp)()&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Oe,{type:"button",role:"menuitem",className:"coz-nav-settings-item-btn",icon:"cloud",busy:c,onClick:i,title:t("claudy.title"),label:t("claudy.title")}))),!u&&o&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem","data-icon":"icon-storage",target:"_self",title:t("storage"),href:"".concat(r,"#/storage")},t("storage"),w.a.createElement(dt,{data:o})))),(!u||!Object(B.isMobileApp)())&&l&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Se,{subtle:!0,role:"menuitem",className:"coz-nav-settings-item-btn",icon:"cloud-happy",title:p,label:p,href:f}))),!Object(B.isMobileApp)()&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Oe,{type:"button",role:"menuitem",className:"coz-nav-settings-item-btn",onClick:s,icon:"help",title:t("help"),label:t("help")}))),w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("button",{type:"button",role:"menuitem","data-icon":"icon-logout",onClick:n,title:t("logout")},t("logout")))))};ht.defaultProps={shoulDisplayViewOfferButton:!1},ht.propTypes={shoulDisplayViewOfferButton:P.a.bool,t:P.a.func.isRequired,onLogOut:P.a.func.isRequired,settingsAppURL:P.a.string,storageData:P.a.object,onClaudy:P.a.oneOfType([P.a.bool,P.a.func]),isDrawer:P.a.bool,isClaudyLoading:P.a.bool,toggleSupport:P.a.func.isRequired,viewOfferButtonText:P.a.string};var yt=Object(_.translate)()(ht);function vt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var gt=function(e){p()(o,e);var t,n,r=vt(o);function o(e){var t;return a()(this,o),t=r.call(this,e),m()(l()(t),"onDrawerClick",(function(e){e.target===t.wrapperRef&&t.close()})),m()(l()(t),"onTransitionEnd",(function(){t.props.visible?(t.gesturesHandler||t.attachGestures(),t.preventBackgroundScrolling()):(t.restoreBackgroundScrolling(),t.setState({isClosing:!1})),t.props.drawerListener()})),m()(l()(t),"componentWillReceiveProps",function(){var e=Q()(H.a.mark((function e(n){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.UNSAFE_componentWillReceiveProps(n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),m()(l()(t),"UNSAFE_componentWillReceiveProps",function(){var e=Q()(H.a.mark((function e(n){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.props.visible||!n.visible){e.next=3;break}return e.next=3,t.props.fetchSettingsData();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),m()(l()(t),"close",(function(){t.state.isClosing||(t.detachGestures(),t.setState((function(){return{isClosing:!0}})),t.turnTransitionsOn(),t.props.onClose(),t.asideRef.style.transform="")})),t.state={isScrolling:!1,isClosing:!1},t.handleLogout=t.handleLogout.bind(l()(t)),t}return c()(o,[{key:"componentDidMount",value:(n=Q()(H.a.mark((function e(){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.turnTransitionsOn();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"turnTransitionsOn",value:function(){this.asideRef.classList.add("with-transition"),this.asideRef.addEventListener("transitionend",this.onTransitionEnd)}},{key:"turnTransitionsOff",value:function(){this.asideRef.classList.remove("with-transition"),this.asideRef.removeEventListener("transitionend",this.onTransitionEnd)}},{key:"preventBackgroundScrolling",value:function(){document.body.style.overflow="hidden"}},{key:"restoreBackgroundScrolling",value:function(){document.body.style.overflow="auto"}},{key:"detachGestures",value:function(){this.gesturesHandler.destroy(),this.gesturesHandler=null}},{key:"attachGestures",value:function(){var e=this;this.gesturesHandler=new Te.a.Manager(document.documentElement,{recognizers:[[Te.a.Pan,{direction:Te.a.DIRECTION_ALL}]]});var t=this.asideRef.getBoundingClientRect().width,n=null;this.gesturesHandler.on("panstart",(function(t){e.state.isClosing||("panup"===t.additionalEvent||"pandown"===t.additionalEvent?e.setState({isScrolling:!0}):(e.turnTransitionsOff(),n=0))})),this.gesturesHandler.on("pan",(function(r){e.state.isClosing||e.state.isScrolling||(n=-r.deltaX/t,e.applyTransformation(n))})),this.gesturesHandler.on("panend",(function(n){if(!e.state.isClosing)if(e.state.isScrolling)e.setState({isScrolling:!1});else{var r=-n.deltaX/t>=.4,o=n.velocity<0&&Math.abs(n.velocity)>=.2;r||o?e.close():(e.turnTransitionsOn(),e.applyTransformation(0))}}))}},{key:"applyTransformation",value:function(e){e=Math.min(1.1,Math.max(0,e)),this.asideRef.style.transform="translateX(-"+100*e+"%)"}},{key:"handleLogout",value:(t=Q()(H.a.mark((function e(){var t,n,r,o;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props,n=t.onLogOut,r=t.logOut,!n||"function"!=typeof n){e.next=6;break}if(!((o=n())instanceof Promise)){e.next=6;break}return e.next=6,o;case 6:r();case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props,n=t.onClaudy,r=t.visible,o=t.isClaudyLoading,i=t.toggleSupport,a=t.settingsAppURL,u=t.storageData;return w.a.createElement("div",{className:"coz-drawer-wrapper",onClick:this.onDrawerClick,"aria-hidden":r?"false":"true",ref:function(t){e.wrapperRef=t}},w.a.createElement("aside",{ref:function(t){e.asideRef=t}},w.a.createElement("nav",{className:"coz-drawer--apps"},w.a.createElement(pt,{onAppSwitch:this.close})),w.a.createElement("hr",{className:"coz-sep-flex"}),w.a.createElement("nav",{className:"coz-drawer--settings"},w.a.createElement(yt,{onLogOut:this.handleLogout,storageData:u,settingsAppURL:a,isClaudyLoading:o,onClaudy:n,toggleSupport:i,isDrawer:!0}))))}}]),o}(b.Component),mt=Object(x.connect)((function(e){return{storageData:Object(Be.i)(e),settingsAppURL:Object(Be.h)(e)}}),(function(e){return{fetchSettingsData:function(){return e(Object(Be.c)())},logOut:function(){return e(Object(Be.q)())}}}))(gt),bt=n(32),wt={query:function(){return Object($.Q)("io.cozy.settings").getById("instance")},as:"instanceQuery"},xt={query:function(){return Object($.Q)("io.cozy.settings").getById("context")},as:"contextQuery"},_t={query:function(){return Object($.Q)("io.cozy.settings").getById("disk-usage")},as:"diskUsageQuery"},kt=n(126),Ot=function(){return Object(kt.a)("8.3.0")};function St(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Et=void 0,jt=void 0,Pt=void 0;$.models&&(Et=$.models.instance,Pt=function(e){var t=He()(e,"diskUsage.data.attributes.quota",!1);return parseInt(t)<5e10},jt=function(e){return!Et.isSelfHosted(e)&&Et.arePremiumLinksEnabled(e)&&Et.getUuid(e)&&!Pt(e)});var Ct=function(e){p()(n,e);var t=St(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"onClickOutside",(function(e){(r.props.isFetching||r.state.opened)&&(r.rootRef.contains(e.target)||(r.setState({opened:!1}),e.stopPropagation()))})),m()(l()(r),"toggleMenu",(function(){if(r.state.opened)return r.setState({opened:!1});r.props.fetchSettingsData(),r.setState({opened:!0})})),r.state={opened:!1},r}return c()(n,[{key:"componentDidMount",value:function(){document.body.addEventListener("click",this.onClickOutside)}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onClickOutside)}},{key:"render",value:function(){var e,t,n=this,r=this.props,o=r.isBusy,i=r.logOut,a=r.onLogOut,u=r.t,c=r.toggleSupport,s=r.diskUsageQuery,l=r.instanceQuery,f=r.contextQuery,p=r.storageData,d=r.settingsAppURL,h=r.isFetching,y=!1,v="",g=Ot();if(g&&!(t=[s,l,f].some((function(e){return"loading"===e.fetchStatus})))){var m={context:f,diskUsage:s,instance:l};(y=Et.shouldDisplayOffers(m)||jt(m))&&!jt(m)?v=u("view_offers"):jt(m)&&(v=u("view_my_offer")),e=Et.buildPremiumLink(m)}var b=!1;b=g?!t&&!h:!h;var x=this.state.opened&&b;return w.a.createElement("div",{className:"coz-nav coz-nav-settings",ref:function(e){n.rootRef=e}},w.a.createElement(Oe,{type:"button",theme:"text",onClick:this.toggleMenu,className:"coz-nav-settings-btn","aria-controls":"coz-nav-pop--settings",busy:o,icon:"gear",label:u("menu.settings")}),w.a.createElement("div",{className:"coz-nav-pop coz-nav-pop--settings",id:"coz-nav-pop--settings","aria-hidden":!x},b&&w.a.createElement(w.a.Fragment,null,w.a.createElement(yt,{onLogOut:function(){a&&"function"==typeof a?a():i()},toggleSupport:c,storageData:p,settingsAppURL:d,shoulDisplayViewOfferButton:y,managerUrlPremiumLink:e,viewOfferButtonText:v}))))}}]),n}(b.Component),Tt=function(e){return{storageData:Object(Be.i)(e),settingsAppURL:Object(Be.h)(e),isBusy:Object(Be.p)(e),isFetching:Object(Be.o)(e)}},At=function(e){return{fetchSettingsData:function(){return e(Object(Be.c)())},logOut:function(){return e(Object(Be.q)())}}},Dt=Ot()?Object(bt.d)(Object(_.translate)(),Object($.queryConnect)({instanceQuery:wt,contextQuery:xt,diskUsageQuery:_t}),Object(x.connect)(Tt,At))(Ct):Object(bt.d)(Object(_.translate)(),Object(x.connect)(Tt,At))(Ct);function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var It=function(e){p()(n,e);var t=Rt(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.homeApp,n=e.handleClick,r=e.appName,o=e.appNamePrefix,i=e.appSlug,a=e.iconPath,u=e.isFetchingApps,c=e.isPublic,s=e.opened,l=e.t,f=t&&t.isCurrentApp;if(!c&&u)return w.a.createElement("div",{className:"coz-nav-apps-btns --loading"},w.a.createElement("div",{className:"coz-nav-apps-btns-home coz-loading-placeholder"}),w.a.createElement("div",{className:"coz-nav-apps-btns-main coz-loading-placeholder"}));var p=!f&&o?[l("".concat(i,".name_prefix"),{_:o}),l("".concat(i,".name"),{_:r})].join(" "):l("".concat(i,".name"),{_:r}),d=!c&&t&&t.href;return w.a.createElement("div",{className:"coz-nav-apps-btns".concat(f?" --currentHome":"")},w.a.createElement(ye,{homeHref:d}),!f&&w.a.createElement("span",{className:"coz-nav-apps-btns-sep"}),w.a.createElement("button",{type:"button",onClick:c?null:n,className:"coz-nav-apps-btns-main","aria-controls":"coz-nav-pop--apps","data-tutorial":"apps",disabled:c},!f&&w.a.createElement("img",{className:"coz-bar-hide-sm",src:a,width:"28",alt:""}),w.a.createElement("span",{className:"coz-nav-app-name"},p),!c&&w.a.createElement(N,{icon:s?"top":"bottom",color:"#95999d",size:"12"})))}}]),n}(b.Component),Nt=Object(x.connect)((function(e){return{homeApp:Object(Be.f)(e),isFetchingApps:Object(Be.n)(e)}}),(function(){return{}}))(Object(_.translate)()(It));function zt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Mt=function(e){p()(n,e);var t=zt(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"onClickOutside",(function(e){r.state.opened&&(r.rootRef.contains(e.target)||r.modalContainer.contains(e.target)||(r.setState({opened:!1}),e.stopPropagation()))})),m()(l()(r),"toggleMenu",(function(){r.setState({opened:!r.state.opened})})),r.state={opened:!1},r}return c()(n,[{key:"componentDidMount",value:function(){document.body.addEventListener("click",this.onClickOutside),this.modalContainer=document.getElementById("cozy-bar-modal-dom-place")}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onClickOutside)}},{key:"render",value:function(){var e=this,t=this.props,n=t.replaceTitleOnMobile,r=t.appName,o=t.appNamePrefix,i=t.appSlug,a=t.iconPath,u=t.isPublic,c=this.state.opened;return w.a.createElement("nav",{className:"coz-nav coz-nav-apps".concat(n?" coz-bar-hide-sm":""),ref:function(t){e.rootRef=t}},w.a.createElement(Nt,{appName:r,appNamePrefix:o,appSlug:i,iconPath:a,handleClick:this.toggleMenu,opened:c,isPublic:u}),w.a.createElement("div",{className:"coz-nav-pop coz-nav-pop--apps",id:"coz-nav-pop--apps","aria-hidden":!c},w.a.createElement(pt,null)))}}]),n}(b.Component),Ft=n(31),Lt=n.n(Ft),Ut=n(326),Bt=n.n(Ut),qt=n(327),Ht=n.n(qt);var Wt=n(125);function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var $t=function(e){return e.toString().toLowerCase().replace(/\//g," ").normalize("NFD").replace(/[\u0300-\u036f]/g,"").split(" ")},Gt=function(e,t){var n=$t(t),r=$t(e),o=[],i=0;r.forEach((function(e){n.forEach((function(t){var n=e.indexOf(t);n>=0&&o.push({from:i+n,to:i+n+t.length})})),i+=e.length+1}));for(var a=o.sort((function(e,t){return e.from>t.from})).reduce((function(e,t){return 0===e.length||e[e.length-1].to<t.from?e.push(t):e[e.length-1].to<t.to&&(e[e.length-1].to=t.to),e}),[]),u=a.length>0?[e.slice(0,a[0].from)]:e,c=0,s=a.length;c<s;++c)u.push(w.a.createElement("b",null,e.slice(a[c].from,a[c].to))),c+1<s&&u.push(e.slice(a[c].to,a[c+1].from));return a.length>0&&u.push(e.slice(a[a.length-1].to,e.length)),u},Vt=function(e){p()(n,e);var t=Qt(n);function n(){var e;a()(this,n);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return e=t.call.apply(t,[this].concat(i)),m()(l()(e),"state",{input:"",query:null,searching:!1,focused:!1,suggestionsBySource:[],sourceURLs:[]}),m()(l()(e),"sources",[]),m()(l()(e),"onMessageFromSource",(function(e){return function(t){var n=e.find((function(e){return e.origin===t.origin}));if(!n)return null;t.data.type==="intent-".concat(n.id,":ready")?(n.ready=!0,n.window=t.source,n.window.postMessage({},t.origin)):t.data.type==="intent-".concat(n.id,":data")&&n.resolvers[t.data.id]?(n.resolvers[t.data.id]({id:n.id,suggestions:t.data.suggestions}),delete n.resolvers[t.data.id]):Wt.a.log("unhandled message:",t)}})),m()(l()(e),"onChange",(function(t,n){var r=n.newValue;e.setState({input:r})})),m()(l()(e),"changeFocusState",(function(t){e.setState({focused:t})})),m()(l()(e),"clearSuggestions",(function(){e.setState({suggestionsBySource:[]})})),m()(l()(e),"onSuggestionsFetchRequested",(function(t){var n=t.value,r=e.sources.filter((function(e){return e.ready}));r.length>0&&(e.setState((function(e){return o()({},e,{searching:!0})})),r.forEach(function(){var t=Q()(H.a.mark((function t(r){var i,a,u,c;return H.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(e){var t=(new Date).getTime().toString();r.resolvers[t]=e,r.window.postMessage({query:n,id:t},r.origin)}));case 2:i=t.sent,a=i.id,u=i.suggestions,c=e.sources.find((function(e){return e.id===a})).slug,e.state.query!==n?e.setState((function(e){return o()({},e,{searching:!1,query:n,suggestionsBySource:[{title:c,suggestions:u}]})})):e.setState((function(e){return o()({},e,{suggestionsBySource:[].concat(Lt()(e.suggestionsBySource),[{title:c,suggestions:u}])})}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()))})),m()(l()(e),"onSuggestionsClearRequested",(function(){e.clearSuggestions(),e.debouncedOnSuggestionsFetchRequested.cancel(),e.setState({query:null,searching:!1})})),m()(l()(e),"onSuggestionSelected",(function(t,n){var r=n.suggestion.onSelect;if(/^open:/.test(r)){var o=r.substr(5);window.location.href=o}else console.log("suggestion onSelect ("+r+") could not be executed");e.setState({input:"",query:null})})),m()(l()(e),"getSectionSuggestions",(function(e){return e.suggestions.slice(0,10)})),m()(l()(e),"getSuggestionValue",(function(e){return e.subtitle})),m()(l()(e),"renderSectionTitle",(function(){return null})),m()(l()(e),"renderSuggestion",(function(t){return w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-item"},t.icon&&w.a.createElement("img",{className:"coz-searchbar-autosuggest-suggestion-icon",src:t.icon,alt:"icon"}),w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-content"},w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-title"},Gt(t.title,e.state.query)),t.subtitle&&w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-subtitle"},Gt(t.subtitle,e.state.query))))})),e}return c()(n,[{key:"componentWillMount",value:function(){this.debouncedOnSuggestionsFetchRequested=Ht()(this.onSuggestionsFetchRequested,250)}},{key:"componentDidMount",value:function(){var e=this;(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object(ae.a)(null,"POST","/intents",{data:{type:"io.cozy.intents",attributes:{action:e,type:t,data:n,permissions:r}}})})("OPEN","io.cozy.suggestions").then((function(t){var n=t.attributes.services;if(!n)return null;e.sources=n.map((function(n){var r=n.href;e.setState((function(e){return o()({},e,{sourceURLs:[].concat(Lt()(e.sourceURLs),[r])})}));var i=r.split("/",3).join("/");return{slug:n.slug,origin:i,id:t._id,ready:!1,window:null,resolvers:{}}})),window.addEventListener("message",e.onMessageFromSource(e.sources))}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.input,r=t.query,o=t.searching,i=t.focused,a=t.suggestionsBySource,u=t.sourceURLs;if(0===u.length)return null;var c=this.props.t,s=""!==n&&null===r,l=a.reduce((function(e,t){return e+t.suggestions.length}),0)>0,f={placeholder:c("searchbar.placeholder"),value:n,onChange:this.onChange,onFocus:function(){return e.changeFocusState(!0)},onBlur:function(){return e.changeFocusState(!1)}},p={container:"coz-searchbar-autosuggest-container"+(o?" --searching":"")+(i?" --focused":""),input:"coz-searchbar-autosuggest-input",inputFocused:"coz-searchbar-autosuggest-input-focused",suggestionsContainer:"coz-searchbar-autosuggest-suggestions-container",suggestionsContainerOpen:"coz-searchbar-autosuggest-suggestions-container--open",suggestionsList:"coz-searchbar-autosuggest-suggestions-list",suggestion:"coz-searchbar-autosuggest-suggestion",suggestionHighlighted:"coz-searchbar-autosuggest-suggestion-highlighted",sectionTitle:"coz-searchbar-autosuggest-section-title"};return w.a.createElement("div",{className:"coz-searchbar",role:"search"},u.map((function(e,t){return w.a.createElement("iframe",{src:e,style:{visibility:"hidden",height:"0px",width:"0px"},key:e+t})})),w.a.createElement(Bt.a,{theme:p,suggestions:a,multiSection:!0,onSuggestionsFetchRequested:this.debouncedOnSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,getSuggestionValue:this.getSuggestionValue,getSectionSuggestions:this.getSectionSuggestions,renderSectionTitle:this.renderSectionTitle,renderSuggestion:this.renderSuggestion,inputProps:f,focusInputOnSuggestionClick:!1}),""!==n&&!s&&i&&!l&&w.a.createElement("div",{className:"coz-searchbar-autosuggest-status-container"},c("searchbar.empty",{query:n})))}}]),n}(b.Component),Jt=Object(_.translate)()(Vt);function Yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Kt=function(e){p()(n,e);var t=Yt(n);function n(e,r){var o;return a()(this,n),o=t.call(this,e),m()(l()(o),"toggle",(function(){o.props.opened||o.intentWrapperRef.childNodes.length?(o.setState({isActive:!o.state.isActive}),o.props.onToggle()):(o.setState({isLoading:!0}),o.intents.create("CLAUDY","io.cozy.settings",{exposeIntentFrameRemoval:!0}).start(o.intentWrapperRef,(function(){o.setState({isLoading:!1,isActive:!0}),o.props.onToggle()})).then((function(e){var t=e.removeIntentIframe;o.intentWrapperRef.addEventListener("transitionend",(function e(n){"transform"===n.propertyName&&(t(),o.setState({isActive:!1}),n.target.removeEventListener("transitionend",e))}),!1),o.props.onToggle()})))})),o.store=r.barStore,o.state={isLoading:!1,isActive:!1},o.intents=Object(ae.c)(),o}return c()(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.claudyFired&&this.toggle()}},{key:"componentWillReceiveProps",value:function(e){return this.UNSAFE_componentWillReceiveProps(e)}},{key:"render",value:function(){var e=this,t=this.props.opened,n=this.state,r=n.isLoading,o=n.isActive;return w.a.createElement("div",{className:"coz-claudy ".concat(t?"coz-claudy--opened":"")},w.a.createElement("button",{type:"button",className:"coz-claudy-icon coz-bar-hide-sm","data-claudy-opened":o,"data-claudy-loading":r,onClick:this.toggle}),w.a.createElement("div",{className:"coz-claudy-intent-wrapper",ref:function(t){e.intentWrapperRef=t}}))}}]),n}(b.Component),Xt=n(329),Zt=n.n(Xt),en=n(73),tn=n.n(en),nn=n(129);function rn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var on=["onEscape","children","className"],an=function(e){p()(n,e);var t=rn(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),m()(l()(e),"handleKeydown",(function(t){27===t.keyCode&&e.props.onEscape()})),m()(l()(e),"handleClick",(function(t){e.props.onClick&&t.target===t.currentTarget&&e.props.onClick()})),e}return c()(n,[{key:"componentDidMount",value:function(){document.body.getBoundingClientRect().height>window.innerHeight&&(Object(nn.disableBodyScroll)(document.body),Object(nn.disableBodyScroll)(document.body.parentNode)),this.props.onEscape&&document.addEventListener("keydown",this.handleKeydown)}},{key:"componentWillUnmount",value:function(){Object(nn.clearAllBodyScrollLocks)(),this.props.onEscape&&document.removeEventListener("keydown",this.handleKeydown)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=tn()(this.props,on);return w.a.createElement("div",O()({onClick:this.handleClick,className:D()(Zt.a["c-overlay"],n)},r),t)}}]),n}(b.Component);an.propTypes={className:P.a.string,children:P.a.node,onEscape:P.a.func};var un=an;function cn(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return sn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ln;if(Object({USE_REACT:!0}).USE_PREACT)try{ln=n(!function(){var e=new Error("Cannot find module 'preact-portal'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}else{var fn=n(112);ln=function(e){var t=e.into,n=e.children,r=document.querySelector(t);return fn.createPortal(n,r)}}var pn=ln,dn=n(328),hn=n.n(dn),yn=n(15),vn=n.n(yn);function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var mn=function(e){p()(n,e);var t=gn(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){return this.props.children}}]),n}(b.Component);function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var wn=function(e){p()(n,e);var t=bn(n);function n(e){var r;a()(this,n),r=t.call(this,e),m()(l()(r),"UNSAFE_componentWillUpdate",(function(e){var t=e.children;r.refreshComputedParts(t)})),m()(l()(r),"handleScroll",(function(){if(r.contentHeader){var e=l()(r).headerHeight;e||!r.contentHeader.clientHeight?!r.state.displayGhostHeader&&r.scrollingContent.scrollTop>e-20?r.setState((function(){return{displayGhostHeader:!0}})):r.state.displayGhostHeader&&r.scrollingContent.scrollTop<e-20&&r.setState((function(){return{displayGhostHeader:!1}})):r.headerHeight=r.contentHeader.clientHeight}}));var o=r.props.children;return r.refreshComputedParts(o),r.state={displayGhostHeader:!1},r}return c()(n,[{key:"componentWillUpdate",value:function(e,t){this.UNSAFE_componentWillUpdate(e,t)}},{key:"refreshComputedParts",value:function(e){var t=function(e){return w.a.Children.toArray(e).find((function(e){return e&&e.nodeName===mn}))}(e);this.animatedHeader=t,this.childrenToRender=t?function(e){return w.a.Children.map(e,(function(e){return e&&e.nodeName!==mn?e:null}))}(e):e}},{key:"componentDidMount",value:function(){this.scrollingContent.addEventListener("scroll",this.handleScroll,{passive:!0})}},{key:"componentWillUnmount",value:function(){this.scrollingContent.removeEventListener("scroll",this.handleScroll)}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.fixed,o=this.state.displayGhostHeader,i=this.animatedHeader,a=this.childrenToRender;return w.a.createElement("div",{className:D()(vn.a["c-modal-content".concat(r?"-fixed":"")],n),ref:function(t){e.scrollingContent=t}},i&&w.a.createElement("div",{className:i.attributes.className,ref:function(t){e.contentHeader=t}},w.a.createElement("h2",{className:vn.a["c-modal-illu-header"]},i.children),w.a.createElement("div",{className:D()(vn.a["c-modal-illu-header--ghost"],i.attributes.activeClassName,m()({},vn.a["is-active"],o))},i.children)),a)}}]),n}(b.Component),xn=function(e){var t=e.children,n=e.className;return w.a.createElement("div",{className:D()(vn.a["c-modal-content"],vn.a["c-modal-section"],n)},t)},_n=function(e){var t=e.title,n=e.children,r=e.className,o=e.appIcon,i=e.appName,a=e.appEditor,u=e.style,c=e.id,s="string"==typeof n;return w.a.createElement("div",{className:D()(vn.a["c-modal-header"],r),style:u,id:c},t&&w.a.createElement("h2",null,t),s?w.a.createElement("h2",null,n):n,i&&w.a.createElement("h2",{className:vn.a["c-modal-app"]},o&&w.a.createElement("img",{className:vn.a["c-modal-app-icon"],src:o}),a&&w.a.createElement("span",{className:vn.a["c-app-editor"]},a," "),i))},kn=function(e){var t=e.logo,n=e.bg,r=e.className,i=e.style,a=void 0===i?{}:i;return w.a.createElement("h2",{className:D()(vn.a["c-modal-header--branded"],r),style:o()({background:n},a)},w.a.createElement("img",{src:t,alt:""}))},On=Ue()((function(e){var t=e.onClick,n=e.color,r=e.className,o=e.breakpoints.isMobile;return w.a.createElement("button",{className:D()(vn.a["c-modal-close"],r),onClick:t,type:"button","aria-label":"close"},w.a.createElement(N,{icon:"cross",size:o?"16":"24",color:n||Y.a.coolGrey}))})),Sn=function(e){var t=e.children,n=e.className;return w.a.createElement("div",{className:D()(vn.a["c-modal-footer"],n)},t)},En=function(e){var t=e.secondaryText,n=e.secondaryAction,r=e.secondaryType,o=e.primaryText,i=e.primaryAction,a=e.primaryType,u=e.children,c=e.className;return w.a.createElement("div",{className:D()("u-flex","u-flex-wrap-reverse","u-flex-justify-end",vn.a["c-modal-footer--button"],c)},u,t&&n&&w.a.createElement(Oe,{theme:r,onClick:n,label:t,className:"u-flex-auto-s"}),o&&i&&w.a.createElement(Oe,{theme:a,onClick:i,label:o,className:"u-flex-auto-s"}))};En.defaultProps={primaryType:"regular",secondaryType:"secondary"};var jn=En,Pn=Ue()((function(e){var t=e.breakpoints.isMobile,n=e.className,r=E()(e,["breakpoints","className"]);return w.a.createElement(Oe,O()({icon:"previous",iconOnly:!0,extension:"narrow",theme:"text",label:"back",className:D()(vn.a["c-modal-back-button"],"u-m-0 u-pos-absolute",{"u-p-1":t,"u-p-half":!t,"u-h-3":t},n)},r))})),Cn=Object(b.createContext)();function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var An=wn,Dn=function(e){p()(n,e);var t=Tn(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"handleOutsideClick",(function(e){e.target===e.currentTarget&&r.props.dismissAction&&r.props.dismissAction()})),r.titleID=hn()("modal_"),r}return c()(n,[{key:"componentDidMount",value:function(){this.props.title||this.props["aria-label"]||console.warn("If your modal does not provide a `title` prop, please provide the `aria-label` prop for a11y purposes."),document.body.classList.contains("has-modal")||(document.body.classList.add("has-modal"),this.shouldRemoveBodyClass=!0)}},{key:"componentWillUnmount",value:function(){this.shouldRemoveBodyClass&&document.body.classList.remove("has-modal")}},{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.description,o=t.title,i=t.closable,a=t.dismissAction,u=t.overflowHidden,c=t.className,s=t.closeBtnClassName,l=t.closeBtnColor,f=t.into,p=t.size,d=t.height,h=t.width,y=t.spacing,v=t.mobileFullscreen,g=t.overlayClassName,x=t.wrapperClassName,_=t.primaryText,k=t.primaryAction,S=t.primaryType,j=t.secondaryText,P=t.secondaryAction,C=t.secondaryType,T=t.containerClassName,A=E()(t,["children","description","title","closable","dismissAction","overflowHidden","className","closeBtnClassName","closeBtnColor","into","size","height","width","spacing","mobileFullscreen","overlayClassName","wrapperClassName","primaryText","primaryAction","primaryType","secondaryText","secondaryAction","secondaryType","containerClassName"]),R=this.titleID,I=Object.assign({},d&&{height:d},h&&{width:h}),N=Object(b.createRef)();return w.a.createElement(Cn.Provider,{value:N},w.a.createElement(pn,{into:f},w.a.createElement("div",{className:D()(vn.a["c-modal-container"],T)},w.a.createElement(un,{onEscape:i?a:void 0,className:g},w.a.createElement("div",{className:D()(vn.a["c-modal-wrapper"],m()({},vn.a["c-modal-wrapper--fullscreen"],v),x),onClick:i?this.handleOutsideClick:void 0},w.a.createElement("div",{ref:N}),w.a.createElement("div",O()({className:D()(vn.a["c-modal"],vn.a["c-modal--".concat(p)],(e={},m()(e,vn.a["c-modal--overflowHidden"],u),m()(e,vn.a["c-modal--".concat(y,"-spacing")],y),m()(e,vn.a["c-modal--fullscreen"],v),m()(e,vn.a["c-modal--closable"],i),e),c),style:I,role:"dialog","aria-modal":"true","aria-labelledby":o?R:null},A),i&&w.a.createElement(On,{className:D()(s,m()({},vn.a["c-modal-close--notitle"],!o)),onClick:a,color:l}),o&&w.a.createElement(_n,{title:o,id:R}),r&&w.a.createElement(An,null,r),n,_&&k||j&&P?w.a.createElement(Sn,null,w.a.createElement(jn,{primaryText:_,primaryAction:k,primaryType:S,secondaryText:j,secondaryAction:P,secondaryType:C})):null))))))}}]),n}(b.Component);Dn.propTypes={title:P.a.node,description:P.a.node,secondaryType:P.a.string,secondaryText:P.a.string,secondaryAction:P.a.func,primaryType:P.a.string,primaryText:P.a.string,primaryAction:P.a.func,closable:P.a.bool,overflowHidden:P.a.bool,className:P.a.string,closeBtnClassName:P.a.string,closeBtnColor:P.a.string,into:P.a.string,size:P.a.oneOf(["xsmall","small","medium","large","xlarge","xxlarge"]),height:P.a.string,width:P.a.string,spacing:P.a.oneOf(["small","large"]),mobileFullscreen:P.a.bool,overlayClassName:P.a.string,wrapperClassName:P.a.string,containerClassName:P.a.string,dismissAction:P.a.func},Dn.defaultProps={primaryType:"regular",secondaryType:"secondary",closable:!0,overflowHidden:!1,size:"small",into:"body",mobileFullscreen:!1},kn.propTypes={bg:P.a.string.isRequired,logo:P.a.string.isRequired},_n.propTypes={appIcon:P.a.string,appEditor:P.a.string,appName:P.a.string},wn.propTypes={iconSrc:P.a.node,iconDest:P.a.node,fixed:P.a.bool};var Rn,In=(Rn=[{src:"withCross",dest:"closable"},{src:"crossClassName",dest:"closeBtnClassName"},{src:"crossColor",dest:"closeBtnColor"},{fn:function(e){var t;return e.secondaryAction&&!e.dismissAction?((t=o()({},e)).dismissAction=e.secondaryAction,[t,"In the future, `secondaryAction` will not be bound to closing actions (clicking on cross, clicking outside), please use `dismissAction` for that"]):[e,null]}}],function(e){var t=function(t){var n=function(e,t){var n,r,i,a=cn(t);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(u.src&&u.dest){var c=u.src,s=u.dest;if(void 0===e[c])continue;(n=n||o()({},e))[s]=e[c],delete n[c],r="`".concat(c,"` is deprecated and has been migrated automatically, you should use `").concat(s,"` now")}else if(u.fn){var l=u.fn(n||e);if(2!==l.length)throw new Error("migrateOption `fn` should return [newProps, msg].");var f=Ie()(l,2);n=f[0],r=f[1]}else console.warn("migrateProps option is not valid, valid properties are `src`, `dest`, `fn`. You passed",u);window.SHOW_DEPRECATION_WARNINGS&&r&&(console.warn("Deprecation: ".concat(r)),r=null)}}catch(e){a.e(e)}finally{a.f()}return n||e}(t,Rn);return w.a.createElement(e,n)};return t.displayName=e.displayName||e.name,t})(Dn);In.propTypes=Dn.propTypes,In.defaultProps=Dn.defaultProps,Object.assign(In,{ModalContent:wn,ModalSection:xn,ModalFooter:Sn,ModalHeader:_n,AnimatedContentHeader:mn,ModalBrandedHeader:kn,ModalDescription:An,ModalBackButton:Pn});var Nn=In,zn=n(130),Mn=n.n(zn),Fn=function(e){var t,n=e.t,r=e.loadingType,o=e.middle,i=e.noMargin,a=e.color,u=e.size,c=e.className,s={tiny:8,small:12,medium:16,large:24,xlarge:36,xxlarge:80}[u];return w.a.createElement("div",{className:D()(Mn.a["c-spinner"],(t={},m()(t,Mn.a["c-spinner--middle"],o),m()(t,Mn.a["c-spinner--nomargin"],i),t),c)},w.a.createElement(N,{icon:"spinner",color:a,spin:!0,size:s}),r&&w.a.createElement("p",null,n("loading.".concat(r))))};Fn.propTypes={loadingType:P.a.string,middle:P.a.bool,noMargin:P.a.bool,color:P.a.string,size:P.a.oneOf(["tiny","small","medium","large","xlarge","xxlarge"]),className:P.a.string},Fn.defaultProps={loadingType:"",middle:!1,noMargin:!1,color:Y.a.primaryColor,size:"medium",className:""};var Ln=Object(_.translate)()(Fn);function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Bn=function(e){p()(n,e);var t=Un(n);function n(e,r){var o;return a()(this,n),o=t.call(this,e),m()(l()(o),"toggle",(function(){o.setState({isLoading:!0}),o.intents.create("SUPPORT","io.cozy.settings").start(o.intentWrapperRef,(function(){o.setState({isLoading:!1})}))})),o.store=r.barStore,o.state={isLoading:!1},o.intents=Object(ae.c)(),o}return c()(n,[{key:"componentDidMount",value:function(){this.toggle()}},{key:"render",value:function(){var e=this,t=this.state.isLoading;return w.a.createElement("div",null,w.a.createElement(Nn,{secondaryAction:this.props.onClose,className:"coz-support-modal",into:"#cozy-bar-modal-dom-place",closeBtnClassName:"coz-support-modal-close"},w.a.createElement(wn,{className:"coz-support-modal-wrapper u-mt-1"},w.a.createElement("div",{className:"coz-support-modal-content"},t&&w.a.createElement(Ln,{size:"xxlarge",middle:!0}),w.a.createElement("div",{className:"coz-support-intent-wrapper".concat(t?" coz-hidden":""),ref:function(t){e.intentWrapperRef=t}})))))}}]),n}(b.Component),qn=new ce.a({id:"icon-apps",use:"icon-apps-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="icon-apps"><path d="M0 0h4v4H0V0zm0 6h4v4H0V6zm0 6h4v4H0v-4zM6 0h4v4H6V0zm0 6h4v4H6V6zm0 6h4v4H6v-4zm6-12h4v4h-4V0zm0 6h4v4h-4V6zm0 6h4v4h-4v-4z" fill-rule="evenodd" /></symbol>'}),Hn=(le.a.add(qn),qn);function Wn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v()(e);if(t){var o=v()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}n.d(t,"Bar",(function(){return Qn})),n.d(t,"mapStateToProps",(function(){return $n})),n.d(t,"mapDispatchToProps",(function(){return Gn}));var Qn=function(e){p()(n,e);var t=Wn(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"toggleDrawer",(function(){if(!r.state.claudyOpened&&!r.state.claudyFired){var e=!r.state.drawerVisible;e&&r.props.onDrawer(e),r.setState({drawerVisible:e})}})),m()(l()(r),"toggleClaudy",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(r.props.claudyEnabled){var t=r.state,n=t.usageTracker,o=t.claudyOpened;if(e&&!o)return r.setState({claudyFired:!0});r.state.claudyFired&&r.setState({claudyFired:!1}),n&&n.push(["trackEvent","Claudy",o?"close":"open","claudy"]),r.setState({claudyOpened:!o})}})),m()(l()(r),"toggleSupport",(function(){var e=r.state.supportDisplayed;r.setState({supportDisplayed:!e})})),m()(l()(r),"renderLeft",(function(){var e=r.props,t=e.t,n=e.isPublic,o=e.webviewContext;return o?w.a.createElement(ye,{webviewContext:o}):n?null:w.a.createElement("button",{type:"button",className:"coz-bar-btn coz-bar-burger",onClick:r.toggleDrawer,"data-tutorial":"apps-mobile"},w.a.createElement(N,{icon:Hn,width:16,height:16,color:"currentColor"}),w.a.createElement("span",{className:"coz-bar-hidden"},t("drawer")))})),m()(l()(r),"renderRight",(function(){return r.props.isPublic?null:w.a.createElement(Dt,{toggleSupport:r.toggleSupport,onLogOut:r.props.onLogOut})})),r.state={claudyFired:!1,claudyOpened:!1,drawerVisible:!1,usageTracker:null,supportDisplayed:!1,searchBarEnabled:e.isDrive&&!e.isPublic&&!Object(B.isMobileApp)()},r.fetchApps=r.fetchApps.bind(l()(r)),r.fetchInitialData=r.fetchInitialData.bind(l()(r)),r.handleTokenRefreshed=r.handleTokenRefreshed.bind(l()(r)),r}return c()(n,[{key:"componentDidMount",value:function(){F()&&this.initPiwikTracker(),this.fetchInitialData(),this.props.cozyClient.on("tokenRefreshed",this.handleTokenRefreshed)}},{key:"componentWillUnmount",value:function(){this.props.cozyClient.removeListener("tokenRefreshed",this.handleTokenRefreshed)}},{key:"componentDidUpdate",value:function(e,t){!this.props.hasFetchedApps&&this.state.drawerVisible&&t.drawerVisible!==this.state.drawerVisible&&this.fetchApps()}},{key:"handleTokenRefreshed",value:function(){this.fetchInitialData()}},{key:"initPiwikTracker",value:function(){var e=L("https://matomo.cozycloud.cc",8,!1,!1);U({appDimensionId:1,app:"Cozy Bar",heartbeat:0}),this.setState({usageTracker:e})}},{key:"fetchApps",value:function(){this.props.fetchApps()}},{key:"fetchInitialData",value:function(){this.props.isPublic||(this.props.fetchContext(),this.props.fetchSettingsData(!1),this.fetchApps())}},{key:"renderCenter",value:function(){var e=this.props,t=e.appName,n=e.appNamePrefix,r=e.appSlug,o=e.iconPath,i=e.replaceTitleOnMobile,a=e.isPublic;return w.a.createElement(Mt,{appName:t,appNamePrefix:n,appSlug:r,iconPath:o,replaceTitleOnMobile:i,isPublic:a})}},{key:"render",value:function(){var e=this,t=this.state,n=t.claudyFired,r=t.claudyOpened,i=t.drawerVisible,a=t.searchBarEnabled,u=t.supportDisplayed,c=t.usageTracker,s=this.props,l=s.theme,f=s.themeOverrides,p=s.barLeft,d=s.barRight,h=s.barCenter,y=s.barSearch,v=s.claudyEnabled,g=s.onDrawer,m=s.isPublic,b=s.onLogOut,x=s.userActionRequired,_=f.primaryColor,k=f.primaryContrastTextColor,O=_?{"--cozBarThemePrimaryColor":_}:{},S=k?{"--cozBarThemePrimaryContrastTextColor":k}:{},E=o()({},O,S);return w.a.createElement("div",{className:"coz-bar-wrapper coz-theme-".concat(l),style:E},w.a.createElement("div",{id:"cozy-bar-modal-dom-place"}),w.a.createElement("div",{className:"coz-bar-container"},p||this.renderLeft(),h||this.renderCenter(),w.a.createElement("div",{className:"u-flex-grow"},y||(a?w.a.createElement(Jt,null):null)),d||this.renderRight(),m?null:w.a.createElement(mt,{visible:i,onClose:this.toggleDrawer,onClaudy:v&&function(){return e.toggleClaudy(!0)}||!1,isClaudyLoading:n,drawerListener:function(){return g(i)},toggleSupport:this.toggleSupport,onLogOut:b}),v&&w.a.createElement(Kt,{usageTracker:c,claudyFired:n,onToggle:function(){return e.toggleClaudy(!1)},opened:r}),u&&w.a.createElement(Bn,{onClose:this.toggleSupport})),x&&w.a.createElement(Pe,x))}}]),n}(b.Component),$n=function(e){return{theme:Object(Be.j)(e).name,themeOverrides:Object(Be.j)(e).overrides,barLeft:Object(Be.e)(e,"left"),barRight:Object(Be.e)(e,"right"),barCenter:Object(Be.e)(e,"center"),barSearch:Object(Be.e)(e,"search"),isDrive:Object(Be.m)(e,{slug:"drive"}),claudyEnabled:Object(Be.z)(e),hasFetchedApps:Object(Be.l)(e),webviewContext:Object(Be.k)(e)}},Gn=function(e){return{fetchApps:function(){return e(Object(Be.a)())},fetchContext:function(){return e(Object(Be.b)())},fetchSettingsData:function(t){return e(Object(Be.c)(t))}}};t.default=Object(_.translate)()(Object(x.connect)($n,Gn)(Qn))},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=(n(1),o.a.createContext(null));var a=function(e){e()},u={notify:function(){}};function c(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var s=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=u,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=c())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=u)},e}();var l=function(e){var t=e.store,n=e.context,a=e.children,u=Object(r.useMemo)((function(){var e=new s(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),c=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=u.subscription;return e.trySubscribe(),c!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[u,c]);var l=n||i;return o.a.createElement(l.Provider,{value:u},a)},f=n(28),p=n(36),d=n(96),h=n.n(d),y=n(95),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,g=[],m=[null,null];function b(e,t){var n=e[1];return[t.payload,n+1]}function w(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function x(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function _(e,t,n,r,o,i,a,u,c,s){if(e){var l=!1,f=null,p=function(){if(!l){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,f=e}n||(f=null),e===i.current?a.current||c():(i.current=e,u.current=e,a.current=!0,s({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var k=function(){return[null,0]};function O(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,u=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,c=n.methodName,l=void 0===c?"connectAdvanced":c,d=n.renderCountProp,v=void 0===d?void 0:d,O=n.shouldHandleStateChanges,S=void 0===O||O,E=n.storeKey,j=void 0===E?"store":E,P=(n.withRef,n.forwardRef),C=void 0!==P&&P,T=n.context,A=void 0===T?i:T,D=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),R=A;return function(t){var n=t.displayName||t.name||"Component",i=u(n),a=Object(f.a)({},D,{getDisplayName:u,methodName:l,renderCountProp:v,shouldHandleStateChanges:S,storeKey:j,displayName:i,wrappedComponentName:n,WrappedComponent:t}),c=D.pure;var d=c?r.useMemo:function(e){return e()};function O(n){var i=Object(r.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),u=i[0],c=i[1],l=i[2],h=Object(r.useMemo)((function(){return u&&u.Consumer&&Object(y.isContextConsumer)(o.a.createElement(u.Consumer,null))?u:R}),[u,R]),v=Object(r.useContext)(h),O=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(v)&&Boolean(v.store);var E=O?n.store:v.store,j=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,a)}(E)}),[E]),P=Object(r.useMemo)((function(){if(!S)return m;var e=new s(E,O?null:v.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[E,O,v]),C=P[0],T=P[1],A=Object(r.useMemo)((function(){return O?v:Object(f.a)({},v,{subscription:C})}),[O,v,C]),D=Object(r.useReducer)(b,g,k),I=D[0][0],N=D[1];if(I&&I.error)throw I.error;var z=Object(r.useRef)(),M=Object(r.useRef)(l),F=Object(r.useRef)(),L=Object(r.useRef)(!1),U=d((function(){return F.current&&l===M.current?F.current:j(E.getState(),l)}),[E,I,l]);w(x,[M,z,L,l,U,F,T]),w(_,[S,E,C,j,M,z,L,F,T,N],[E,C,j]);var B=Object(r.useMemo)((function(){return o.a.createElement(t,Object(f.a)({},U,{ref:c}))}),[c,t,U]);return Object(r.useMemo)((function(){return S?o.a.createElement(h.Provider,{value:A},B):B}),[h,B,A])}var E=c?o.a.memo(O):O;if(E.WrappedComponent=t,E.displayName=i,C){var P=o.a.forwardRef((function(e,t){return o.a.createElement(E,Object(f.a)({},e,{forwardedRef:t}))}));return P.displayName=i,P.WrappedComponent=t,h()(P,t)}return h()(E,t)}}function S(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(S(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!S(e[n[o]],t[n[o]]))return!1;return!0}var j=n(188);function P(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function C(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function T(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=C(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=C(o),o=r(t,n)),o},r}}var A=[function(e){return"function"==typeof e?T(e):void 0},function(e){return e?void 0:P((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?P((function(t){return Object(j.bindActionCreators)(e,t)})):void 0}];var D=[function(e){return"function"==typeof e?T(e):void 0},function(e){return e?void 0:P((function(){return{}}))}];function R(e,t,n){return Object(f.a)({},n,{},e,{},t)}var I=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,u){var c=e(t,n,u);return a?o&&i(c,r)||(r=c):(a=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return R}}];function N(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function z(e,t,n,r,o){var i,a,u,c,s,l=o.areStatesEqual,f=o.areOwnPropsEqual,p=o.areStatePropsEqual,d=!1;function h(o,d){var h,y,v=!f(d,a),g=!l(o,i);return i=o,a=d,v&&g?(u=e(i,a),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):v?(e.dependsOnOwnProps&&(u=e(i,a)),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):g?(h=e(i,a),y=!p(h,u),u=h,y&&(s=n(u,c,a)),s):s}return function(o,l){return d?h(o,l):(u=e(i=o,a=l),c=t(r,a),s=n(u,c,a),d=!0,s)}}function M(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=Object(p.a)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=n(e,i),u=r(e,i),c=o(e,i);return(i.pure?z:N)(a,u,c,e,i)}function F(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function L(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?O:n,o=t.mapStateToPropsFactories,i=void 0===o?D:o,a=t.mapDispatchToPropsFactories,u=void 0===a?A:a,c=t.mergePropsFactories,s=void 0===c?I:c,l=t.selectorFactory,d=void 0===l?M:l;return function(e,t,n,o){void 0===o&&(o={});var a=o,c=a.pure,l=void 0===c||c,h=a.areStatesEqual,y=void 0===h?L:h,v=a.areOwnPropsEqual,g=void 0===v?E:v,m=a.areStatePropsEqual,b=void 0===m?E:m,w=a.areMergedPropsEqual,x=void 0===w?E:w,_=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),k=F(e,i,"mapStateToProps"),O=F(t,u,"mapDispatchToProps"),S=F(n,s,"mergeProps");return r(d,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:O,initMergeProps:S,pure:l,areStatesEqual:y,areOwnPropsEqual:g,areStatePropsEqual:b,areMergedPropsEqual:x},_))}}var B=U();function q(){return Object(r.useContext)(i)}function H(e){void 0===e&&(e=i);var t=e===i?q:function(){return Object(r.useContext)(e)};return function(){return t().store}}var W=H();function Q(e){void 0===e&&(e=i);var t=e===i?W:H(e);return function(){return t().dispatch}}var $=Q(),G=function(e,t){return e===t};function V(e){void 0===e&&(e=i);var t=e===i?q:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=G);var o=t();return function(e,t,n,o){var i,a=Object(r.useReducer)((function(e){return e+1}),0)[1],u=Object(r.useMemo)((function(){return new s(n,o)}),[n,o]),c=Object(r.useRef)(),l=Object(r.useRef)(),f=Object(r.useRef)();try{i=e!==l.current||c.current?e(n.getState()):f.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return v((function(){l.current=e,f.current=i,c.current=void 0})),v((function(){function e(){try{var e=l.current(n.getState());if(t(e,f.current))return;f.current=e}catch(e){c.current=e}a({})}return u.onStateChange=e,u.trySubscribe(),e(),function(){return u.tryUnsubscribe()}}),[n,u]),i}(e,n,o.store,o.subscription)}}var J,Y=V(),K=n(112);n.d(t,"Provider",(function(){return l})),n.d(t,"connectAdvanced",(function(){return O})),n.d(t,"ReactReduxContext",(function(){return i})),n.d(t,"connect",(function(){return B})),n.d(t,"batch",(function(){return K.unstable_batchedUpdates})),n.d(t,"useDispatch",(function(){return $})),n.d(t,"createDispatchHook",(function(){return Q})),n.d(t,"useSelector",(function(){return Y})),n.d(t,"createSelectorHook",(function(){return V})),n.d(t,"useStore",(function(){return W})),n.d(t,"createStoreHook",(function(){return H})),n.d(t,"shallowEqual",(function(){return E})),J=K.unstable_batchedUpdates,a=J},function(e,t,n){"use strict";n.r(t);var r=n(13),o=n.n(r),i=n(32),a=n(2),u=n.n(a),c=n(94),s=n(75),l=function(e){return function(t){var n=t.langs,r=t.locales,o=n&&n.length;if(!o)return t;var i=o&&n.includes(e)?e:n[0],a=r&&Object.keys(r);return a&&a.length&&a.includes(i)?(Object(c.a)(u()({},t.slug,r[i])),t):t}},f=function(e){var t=e.getState;return function(e){return function(n){var r=t();switch(n.type){case s.a:!function(e,t){e&&e.forEach(l(t))}(r.apps&&r.apps.apps,n.lang);break;case"RECEIVE_APP_LIST":n.apps&&n.apps.length&&n.apps.forEach(l(r.locale));break;case"RECEIVE_APP":n.app&&l(r.locale&&r.locale.lang)(n.app)}return e(n)}}},p=n(187),d="persist/REHYDRATE",h="persist/REGISTER",y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function g(e,t,n,r){r.debug;var o=v({},n);return e&&"object"===(void 0===e?"undefined":y(e))&&Object.keys(e).forEach((function(r){"_persist"!==r&&t[r]===n[r]&&(o[r]=e[r])})),o}function m(e){var t=e.blacklist||null,n=e.whitelist||null,r=e.transforms||[],o=e.throttle||0,i=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key,a=e.storage,u=!1===e.serialize?function(e){return e}:b,c={},s={},l=[],f=null,p=null;function d(){if(0===l.length)return f&&clearInterval(f),void(f=null);var e=l.shift(),t=r.reduce((function(t,n){return n.in(t,e,c)}),c[e]);if(void 0!==t)try{s[e]=u(t)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete s[e];0===l.length&&(Object.keys(s).forEach((function(e){void 0===c[e]&&delete s[e]})),p=a.setItem(i,u(s)).catch(h))}function h(e){0}return{update:function(e){Object.keys(e).forEach((function(r){(function(e){return(!n||-1!==n.indexOf(e)||"_persist"===e)&&(!t||-1===t.indexOf(e))})(r)&&c[r]!==e[r]&&-1===l.indexOf(r)&&l.push(r)})),Object.keys(c).forEach((function(t){void 0===e[t]&&l.push(t)})),null===f&&(f=setInterval(d,o)),c=e},flush:function(){for(;0!==l.length;)d();return p||Promise.resolve()}}}function b(e){return JSON.stringify(e)}function w(e){var t=e.transforms||[],n=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key,r=e.storage,o=(e.debug,!1===e.serialize?function(e){return e}:x);return r.getItem(n).then((function(e){if(e)try{var n={},r=o(e);return Object.keys(r).forEach((function(e){n[e]=t.reduceRight((function(t,n){return n.out(t,e,r)}),o(r[e]))})),n}catch(e){throw e}}))}function x(e){return JSON.parse(e)}function _(e){0}var k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function O(e,t){var n=void 0!==e.version?e.version:-1,r=(e.debug,void 0===e.stateReconciler?g:e.stateReconciler),o=e.getStoredState||w,i=void 0!==e.timeout?e.timeout:5e3,a=null,u=!1,c=!0,s=function(e){return e._persist.rehydrated&&a&&!c&&a.update(e),e};return function(l,f){var p=l||{},h=p._persist,y=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(p,["_persist"]);if("persist/PERSIST"===f.type){var v=!1,g=function(t,n){v||(f.rehydrate(e.key,t,n),v=!0)};if(i&&setTimeout((function(){!v&&g(void 0,new Error('redux-persist: persist timed out for persist key "'+e.key+'"'))}),i),c=!1,a||(a=m(e)),h)return l;if("function"!=typeof f.rehydrate||"function"!=typeof f.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(e.key),o(e).then((function(t){(e.migrate||function(e,t){return Promise.resolve(e)})(t,n).then((function(e){g(e)}),(function(e){g(void 0,e)}))}),(function(e){g(void 0,e)})),k({},t(y,f),{_persist:{version:n,rehydrated:!1}})}if("persist/PURGE"===f.type)return u=!0,f.result(function(e){var t=e.storage,n=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key;return t.removeItem(n,_)}(e)),k({},t(y,f),{_persist:h});if("persist/FLUSH"===f.type)return f.result(a&&a.flush()),k({},t(y,f),{_persist:h});if("persist/PAUSE"===f.type)c=!0;else if(f.type===d){if(u)return k({},y,{_persist:k({},h,{rehydrated:!0})});if(f.key===e.key){var b=t(y,f),w=f.payload,x=!1!==r&&void 0!==w?r(w,l,b,e):b,O=k({},x,{_persist:k({},h,{rehydrated:!0})});return s(O)}}if(!h)return t(l,f);var S=t(y,f);return S===y?l:(S._persist=h,s(S))}}var S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function j(e,t,n,r){r.debug;var o=E({},n);return e&&"object"===(void 0===e?"undefined":S(e))&&Object.keys(e).forEach((function(r){var i;"_persist"!==r&&(t[r]===n[r]&&(null===(i=n[r])||Array.isArray(i)||"object"!==(void 0===i?"undefined":S(i))?o[r]=e[r]:o[r]=E({},o[r],e[r])))})),o}var P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var T={registry:[],bootstrapped:!1},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T,t=arguments[1];switch(t.type){case h:return P({},e,{registry:[].concat(C(e.registry),[t.key])});case d:var n=e.registry.indexOf(t.key),r=[].concat(C(e.registry));return r.splice(n,1),P({},e,{registry:r,bootstrapped:0===r.length});default:return e}};var D=n(12),R=n(330),I=n(331),N=n.n(I),z=n(332),M=n.n(z),F=n(125);n.d(t,"createStore",(function(){return Q}));var L={storage:N.a,key:"cozy-bar",whitelist:M.a};Object(R.createLogger)({titleFormatter:function(e,t){var n=["[COZY-BAR]"];return n.push("".concat(String(e.type))),t&&n.push("@ ".concat(t)),n.join(" ")},logger:F.a});var U,B,q=(U=L,B=o()({},D.t),U.stateReconciler=void 0===U.stateReconciler?j:U.stateReconciler,O(U,Object(i.c)(B))),H=[f,p.default];var W,Q=function(){var e,t,n,r,o,a,u,c;return W=Object(i.e)(q,i.a.apply(null,H)),e=W,r=n||!1,o=Object(i.e)(A,T,t?t.enhancer:void 0),a=function(e){o.dispatch({type:h,key:e})},u=function(t,n,i){var a={type:d,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&c.getState().bootstrapped&&(r(),r=!1)},(c=P({},o,{purge:function(){var t=[];return e.dispatch({type:"persist/PURGE",result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:"persist/FLUSH",result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:"persist/PAUSE"})},persist:function(){e.dispatch({type:"persist/PERSIST",register:a,rehydrate:u})}})).persist(),W};t.default=function(){return W||(W=Q()),W}},function(e,t,n){"use strict";n.r(t);var r=n(5),o=n.n(r),i=n(9),a=n.n(i),u=n(23),c=n(21),s=n(12),l=n(3),f=n.n(l),p=n(7),d=n.n(p),h=n(8),y=n.n(h),v=n(10),g=n.n(v),m=n(6),b=n.n(m),w=n(0),x=n.n(w),_=["left","center","right","search"],k=function(e){return e[0].toUpperCase()+e.slice(1)},O=function(e){return"setBar".concat(k(e))},S=function(e){return"Bar".concat(k(e))};function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g()(this,n)}}var j=0,P=function(e){var t={};return _.forEach((function(n){t[O(n)]=function(t){return e.dispatch(Object(s.u)(n,"string"==typeof(r=t)?x.a.createElement("span",{dangerouslySetInnerHTML:{__html:r}}):r,"js"));var r},t[S(n)]=function(e,t){return function(n){y()(o,n);var r=E(o);function o(){return f()(this,o),r.apply(this,arguments)}return d()(o,[{key:"componentDidMount",value:function(){this.componentId=j++,this.setContent(this.props.children)}},{key:"setContent",value:function(n){try{n=x.a.Children.only(n)}catch(e){}e.dispatch(Object(s.u)(t,n,this.componentId))}},{key:"unsetContent",value:function(){e.dispatch(Object(s.A)(t,this.componentId))}},{key:"componentWillUnmount",value:function(){this.unsetContent()}},{key:"componentDidUpdate",value:function(e){this.props.children!==e.children&&this.setContent(this.props.children)}},{key:"render",value:function(){return null}}]),o}(w.Component)}(e,n)})),t.setLocale=function(){e.dispatch(s.w.apply(void 0,arguments))},t.setTheme=function(){e.dispatch(s.x.apply(void 0,arguments))},t.setWebviewContext=function(){e.dispatch(s.y.apply(void 0,arguments))},t},C=function(e){console.error("You tried to use the CozyBar API (".concat(e,") but the CozyBar is not initialised yet via cozy.bar.init(...)."))},T=function(e,t){return function(){if(e[t])return e[t].apply(e,arguments);C(t)}},A=function(){var e=document.querySelector("[role=application]");return e&&e.dataset?e.dataset:{}},D=function(){var e=document.querySelector('link[rel="icon"][sizes^="32"]');return null!==e?e.getAttribute("href"):"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},R=function(){return A().cozyAppNamePrefix||null},I=function(){return A().cozyAppSlug||null},N=function(){var e=document.querySelector("meta[name=user-action-required]"),t=e&&e.dataset;if(t){var n=t.title,r=t.code,o=t.detail,i=t.links;if(r)return{title:n,code:r,detail:o,links:i}}};n(418),n(419);n.d(t,"init",(function(){return U})),n.d(t,"version",(function(){return Z})),n.d(t,"setBarCenter",(function(){return H})),n.d(t,"setBarLeft",(function(){return W})),n.d(t,"setBarRight",(function(){return Q})),n.d(t,"setBarSearch",(function(){return $})),n.d(t,"BarLeft",(function(){return J})),n.d(t,"BarRight",(function(){return V})),n.d(t,"BarCenter",(function(){return G})),n.d(t,"BarSearch",(function(){return Y})),n.d(t,"setTheme",(function(){return K})),n.d(t,"setWebviewContext",(function(){return X})),n.d(t,"updateAccessToken",(function(){return B})),n.d(t,"setLocale",(function(){return s.w}));var z=function(e){if(null===document.getElementById("coz-bar")){var t=function(){var e=Object(u.isMobileApp)()?"mobile":"browser",t=document.createElement("div");return t.setAttribute("id","coz-bar"),t.setAttribute("role","banner"),t.classList.add("coz-target--".concat(e)),t}(),n=document.querySelector("[role=application]");return n?(document.body.insertBefore(t,n),e.onDrawer=function(e){t.dataset.drawerVisible=e},e.userActionRequired&&document.body.classList.add("has-banner"),t):(console.warn('Cozy-bar is looking for a "'.concat("[role=application]","\" tag that contains your application and can't find it :'(… The BAR is now disabled")),null)}},M=function(e,t){var r=n(0),o=n(112).render,i=n(37),a=i.connect,u=i.Provider,c=n(20).default,l=n(670).default,f=n(29).CozyProvider,p=t.cozyClient,d=a((function(e){return{lang:Object(s.g)(e)}}))(c),h=r.createElement(u,{store:t.reduxStore},r.createElement(d,{dictRequire:function(e){return n(667)("./".concat(e))}},p?r.createElement(f,{client:p},r.createElement(l,t)):r.createElement(l,t)));return o(h,e),h},F=function(e){var t=e.cozyURL,r=e.token,o=e.isPublic,i={uri:t||function(e){var t=A();if(!t.cozyDomain)return e||console.warn("Cozy-bar can't discover the cozy's URL, and will probably fail to initialize the connection with the stack."),"";var n=window.location.protocol;return"".concat(n,"//").concat(t.cozyDomain)}(o),token:r||function(e){var t=A();return t.cozyToken?t.cozyToken:(e||console.warn("Cozy-bar can't discover the app's token, and will probably fail to initialize the connection with the stack."),"")}(o)},a=n(29).default;return console.warn("Automatically made cozyClient. Options: ",i),new a(i)},L={},U=function(){var e=a()(o.a.mark((function e(){var t,r,i,a,u,l,f,p,d,h,y,v,g,m,b,w,x,_,k,O,S,E,j=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=j.length>0&&void 0!==j[0]?j[0]:{},r=t.appName,i=t.appNamePrefix,a=void 0===i?R():i,u=t.appSlug,l=void 0===u?I():u,f=t.lang,p=t.iconPath,d=void 0===p?D():p,h=t.cozyClient,y=t.cozyURL,v=t.token,g=t.replaceTitleOnMobile,m=void 0!==g&&g,b=t.isPublic,w=void 0!==b&&b,x=t.onLogOut,!w&&/^\/public/.test(window.location.pathname)&&(w=!0),h||(h=F({cozyURL:y,token:v,isPublic:w})),_=n(672).default,(k=_()).dispatch(Object(s.v)(r,a,l)),c.b.init({cozyClient:h,onCreate:function(e){return k.dispatch(Object(s.r)(e))},onDelete:function(e){return k.dispatch(Object(s.s)(e))}}),f&&k.dispatch(Object(s.w)(f)),O=P(k),Object.assign(L,O),S={appName:r,appNamePrefix:a,appSlug:l,cozyClient:h,iconPath:d,replaceTitleOnMobile:m,isPublic:w,onLogOut:x,userActionRequired:N(),reduxStore:k},E=z(S),M(E,S);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(e){c.b.updateAccessToken(e)},q=function(e){var t={};_.forEach((function(n){var r=O(n),o=S(n);t[r]=T(e,r),t[o]=function(t){if(e[o])return x.a.createElement(e[o],t);C(o)}}));for(var n=0,r=["setLocale","setTheme","setWebviewContext"];n<r.length;n++){var o=r[n];t[o]=T(e,o)}return t}(L),H=q.setBarCenter,W=q.setBarLeft,Q=q.setBarRight,$=q.setBarSearch,G=q.BarCenter,V=q.BarRight,J=q.BarLeft,Y=q.BarSearch,K=q.setTheme,X=q.setWebviewContext,Z="1.17.1"}])}));
57
+ //# sourceMappingURL=cozy-bar.min.js.map