diff --git a/app/notes.88176e6ba74aad55e331.js b/app/notes.a6b760dfc44a216b3804.js similarity index 99% rename from app/notes.88176e6ba74aad55e331.js rename to app/notes.a6b760dfc44a216b3804.js index 572e39a1..310de873 100644 --- a/app/notes.88176e6ba74aad55e331.js +++ b/app/notes.a6b760dfc44a216b3804.js @@ -1 +1 @@ -!function(e){function t(t){for(var r,o,s=t[0],c=t[1],l=t[2],d=0,f=[];d<s.length;d++)o=s[d],a[o]&&f.push(a[o][0]),a[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);f.length;)f.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var c=n[s];0!==a[c]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={2:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],n=a[e];if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+""+({1:"@atlaskit-internal_media-viewer-pdf-viewer"}[e]||e)+"/notes."+{1:"a1cd0033cb516495d012"}[e]+".js"}(e);var c=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=a[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",c.name="ChunkLoadError",c.type=r,c.request=i,n[1](c)}a[e]=void 0}};var l=setTimeout(function(){i({type:"timeout",target:s})},12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var s=window.webpackJsonp=window.webpackJsonp||[],c=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var u=c;i.push([1,0]),n()}({"/KVF":function(e,t,n){var r={"./en":"7dT6","./en.json":"7dT6","./fr":"9pOX","./fr.json":"9pOX"};function a(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]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id="/KVF"},0:function(e,t){},1:function(e,t,n){n("201c"),n("7NIr"),e.exports=n("LiWt")},2:function(e,t){},3:function(e,t){},"7dT6":function(e){e.exports=JSON.parse('{"Notes":{"Add":{"add_note":"Add a note"},"EditorView":{"main_placeholder":"Write anything…"},"Editor":{"title_placeholder":"Here is your title"},"List":{"my_notes":"My Notes","name":"Name","updated_at":"Updated at","location":"Location","sharings":"Sharings"},"Empty":{"welcome":"Welcome on Cozy Notes","after_created":"Once your Note is created, you can find it in your "}},"Error":{"unshared_title":"This share is no longer active","unshared_text":"The owner may have revoked this sharing. You can no longer edit a note at this address.","loading_error_title":"The note couldn\'t be loaded","loading_error_text_noReturnUrl":"The note may not exists anymore, or our servers may have a temporary glitch. Please try again later.","loading_error_text_returnUrl":"The note may not exists anymore, or our servers may have a temporary glitch. Please go <a href=\'%{url}\'>back</a> and try again later."},"manifest":{"short_description":"Cozy Notes is your personal and collaborative note-taking application.","long_description":"Notes is an online text editor that can already offer you to:\\n\\n* Create your own notes with the essential features (bold, underlined, links, tables...)\\n* Fill and find your notes with you other documents in files of your personal Drive\\n* Edit easily your notes from all your devices\\n* Access your notes offline\\n* For the fans, use shortcuts and input in markdown format ... and even write with contacts together on the same note (coming soon)!","screenshots":["screenshots/en/screenshot01.png","screenshots/en/screenshot02.png"]}}')},"9pOX":function(e){e.exports=JSON.parse('{"Notes":{"Add":{"add_note":"Ajouter une note"},"EditorView":{"main_placeholder":"Écrivez ce que vous souhaitez…"},"Editor":{"title_placeholder":"Ici votre titre"},"List":{"my_notes":"Mes Notes","name":"Nom","updated_at":"Mise à jour","location":"Emplacement","sharings":"Partage"},"Empty":{"welcome":"Bienvenue sur Cozy Notes","after_created":"Une fois votre note créée, il vous est possible de la retrouver dans "}},"Error":{"unshared_title":"Le partage n\'est plus actif","unshared_text":"Le propriétaire a peut-être révoqué ce partage. Vous ne pouvez plus éditer de note à cette adresse.","loading_error_title":"La note n\'a pas pu être chargée","loading_error_text_noReturnUrl":"Cette note n\'existe peut-être plus, ou nos serveurs ont peut-être un moment d\'égarrement. Merci de retenter plus tard.","loading_error_text_returnUrl":"Cette note n\'existe peut-être plus, ou nos serveurs ont peut-être un moment d\'égarrement. Merci revenir <a href=\'%{url}\'>en arrière</a> et de retenter plus tard."},"manifest":{"short_description":"Cozy Notes est votre application de prise de notes personnelles et collaboratives.","long_description":"Notes est un éditeur de texte en ligne destiné à :\\n\\n* Créer vos propres notes avec les fonctionnalités essentielles (gras, souligné, liens, tableaux...)\\n* Classer et retrouver vos notes avec vos autres documents, dans les répertoires de votre Drive personnel\\n* Éditer facilement vos notes depuis tous vos appareils\\n* Accéder à vos notes, même sans internet, stockées sur votre PC\\n* Pour les aficionados, utiliser les raccourcis et la saisie au format markdown\\n* ... et même écrire à plusieurs simultanément sur la même note (à venir) ! ","screenshots":["screenshots/fr/screenshot01.png","screenshots/fr/screenshot02.png"]}}')},G2JP:function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r).a.createContext(!1);t.a=a},LiWt:function(e,t,n){"use strict";n.r(t);n("llna"),n("/8/d"),n("3FT0"),n("VxdY");var r,a=n("q1tI"),i=n.n(a),o=n("JRPe"),s=n("SH7X"),c=n.n(s),l=n("i8i4"),u=n("buk/"),d=n("Le8U"),f=n("G2JP"),p=n("X3v2"),h=n("pZg0"),v={en:{react:n("PTt1"),atlaskit:n("eFxx").default},fr:{react:n("Z6Ro"),atlaskit:n("XCed").default}};Object(o.d)(v.en.react),Object(o.d)(v.fr.react);document.addEventListener("DOMContentLoaded",function(){var e=Object(p.b)(),t=Object(p.a)(e.cozyIconPath,n("ZAKO")),a=Object(p.a)(e.cozyAppNamePrefix||h.name_prefix,""),m=Object(p.a)(e.cozyAppName,h.name),b=Object(p.a)(e.cozyAppSlug,h.slug),y=Object(p.a)(e.cozyAppVersion,h.version);r=Object(p.a)(e.cozyLocale,"en");var g=window.location?window.location.protocol:"https:",_=Object(p.c)(),w=_||e.cozyToken,j=_||!w||""==w,x=new c.a({uri:"".concat(g,"//").concat(e.cozyDomain),token:w,appMetadata:{slug:b,version:y}});d.Document.cozyClient||d.Document.registerClient(x),j||cozy.bar.init({appName:m,appNamePrefix:a,iconPath:t,lang:r,replaceTitleOnMobile:!0,cozyClient:x,isPublic:j}),function(e,t){var a=n("pL5B").default;Object(l.render)(i.a.createElement(u.b,{lang:r,dictRequire:function(e){return n("/KVF")("./".concat(e))}},i.a.createElement(o.c,{locale:r,messages:v[r].atlaskit},i.a.createElement(s.CozyProvider,{client:e},i.a.createElement(f.a.Provider,{value:t},i.a.createElement(a,{isPublic:t}))))),document.querySelector("[role=application]"))}(x,j)})},Q2Eh:function(e,t,n){e.exports={"note-article":"note-article--2yQdC"}},RMII:function(e,t,n){e.exports={empty:"empty--FqnXy",appHeader:"appHeader--2ilS0",tableSpecialRow:"tableSpecialRow--4oekp",tableCellEmpty:"tableCellEmpty--21fZ1",tableCellName:"tableCellName--2Jak9",tableCell:"tableCell--3-jDP",tableRow:"tableRow--3SicR"}},VxdY:function(e,t,n){},X3v2:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a}),n.d(t,"c",function(){return i});n("dasq");var r=function(){return document.querySelector("[role=application]").dataset},a=function(e,t){return/^\{\{\.[a-zA-Z]*\}\}$/.test(e)?t:e},i=function(){return new URLSearchParams(window.location.search).get("sharecode")}},ZAKO:function(e,t){e.exports="/img/icon.f72378381a11b6129372a35089fea845.svg"},Zlyp:function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r),i=n("X+Uv"),o=n("ufaa"),s=n("SH7X"),c=n("kyGY"),l=n("buk/"),u=Object(o.a)()(Object(l.c)()(function(e){var t=e.t;return!e.breakpoints.isMobile&&a.a.createElement(c.b,null,t("Notes.List.my_notes"))})),d=n("7YkG"),f=n("V2U0"),p=n("GoJ1"),h=n("o0o1"),v=n.n(h),m=n("KXWi"),b=n("780l"),y=n("snnE");function g(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){g(i,r,a,o,s,"next",e)}function s(e){g(i,r,a,o,s,"throw",e)}o(void 0)})}}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var j=Object(s.withClient)(function(e){var t=e.client;return a.a.createElement(b.a,{onClick:_(v.a.mark(function e(){var n,r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(y.a)(t);case 2:n=e.sent,r=n.data,window.location.href=Object(y.b)(r);case 5:case"end":return e.stop()}},e,this)})),icon:"plus",className:"u-c-pointer"})}),x=Object(l.c)()(Object(s.withClient)(function(e){var t=e.t,n=e.className,i=e.client,o=w(Object(r.useState)(!1),2),s=o[0],c=o[1],l=Object(r.useCallback)(_(v.a.mark(function e(){var t,n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.next=3,Object(y.a)(i);case 3:t=e.sent,n=t.data,window.location.href=Object(y.b)(n);case 6:case"end":return e.stop()}},e,this)})),[]);return a.a.createElement(m.c,{onClick:l,type:"submit",busy:s,icon:"plus",label:t("Notes.Add.add_note"),extension:"narrow",className:n})})),k=n("4BeY"),O=n.n(k),E=n("IaFt"),C=n.n(E),S=new O.a({id:"icon_note_empty_77efa79dd615f19897a8ed6ec9097298",use:"icon_note_empty_77efa79dd615f19897a8ed6ec9097298-usage",viewBox:"0 0 171 168",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 171 168" id="icon_note_empty_77efa79dd615f19897a8ed6ec9097298">\n <defs>\n <path id="icon_note_empty_77efa79dd615f19897a8ed6ec9097298_a" d="M.02.12h36.532v20.674H.02z" />\n </defs>\n <g fill="none" fill-rule="evenodd">\n <path fill="#0DCBCF" d="M48.367 47.28c3.795-4.135 9.702 2.27 5.938 6.374-8.105 8.832-11.21 22.848-5.617 33.864 6.83 13.453 25.138 8.377 36.387 4.37 5.26-1.871 7.054 6.655 1.834 8.515-15.343 5.464-37.282 8.714-45.942-8.858-7.276-14.767-3.455-32.433 7.4-44.265" />\n <path fill="#D6FAFB" d="M59.57 16.922c.739-4.162 1.797-8.167 3.764-11.417C66.807-.21 73.009-.675 79.69.561c3.047.47 76.99 11.012 78.873 11.76 6.957 2.843 7.343 8.129 5.837 14.148-.141.971-20.067 84.443-21.43 88.854-1.852 5.978-4.906 11.375-10.609 11.973-5.714.623-75.27-18.403-78.5-19.534-3.954-1.39-5.72-3.632-6.159-6.323-.603-1.443-.376-3.088-.067-5.144.8-5.412 8.228-69.79 11.935-79.373" />\n <path fill="#FFF" d="M65.047 19.073S64.561 3.301 79.004 5.122c14.443 1.819 89.593 13.951 89.593 13.951v9.972l-15.17 7.281-88.38-17.253z" />\n <path fill="#ACF5F7" d="M53.622 31.458c.246-4.25.829-8.372 2.413-11.844 2.795-6.122 8.927-7.314 15.747-6.87 3.103.105 6.245.706 8.959 1.155 13.33 2.21 60.933 9.536 62.437 9.936.853.239 3.242 1.012 3.93 1.337 5.173 2.422 4.26 6.643 3.56 12.102-.023.988-10.066 86.694-10.903 91.263-1.155 6.187-3.561 11.933-9.185 13.21-5.636 1.297-77.342-9.496-80.695-10.235-4.111-.928-6.143-2.958-6.897-5.597-.781-1.368-.738-3.034-.675-5.12.157-5.506 8.735-79.333 11.309-89.337" />\n <path fill="#79ECEE" d="M134.818 99.416c4.069-24.17 8.504-48.43 11.948-72.677.037-.293.209-1.305.35-1.515-.04-.744 2.317.264 4.506.067.068 0 .925-.114.992-.114.716-.138 1.42-.29 2.149-.552 3.554-1.285 4.98-4.27 4.938-7.584-.046-2.971-2.376-4.28-2.285-5.071.047-.427 2.619.902 2.915 1 .405.133 3.131 1.892 4.372 4.065 1.249 2.19.856 5.296.785 8.049-.244 9.277-8.008 66.518-9.51 78.49.026.153-.358 3.1-.546 4.417-.38 2.901-.772 5.807-1.182 8.707-.319 2.271-1.653 15.153-1.929 15.747-3.391 7.361-12.892 9.872-20.513 9.34-.434.025-.851-.016-1.524-.102-.844-.108-2.024.034-3.35-.235.145-2.458 5.937-30.472 7.884-42.032" />\n <path fill="#FFF" d="M98.24 56.354c3.65-6.425 11.472-9.96 18.354-7.212a10.488 10.488 0 0 1 4.359 2.129c.117.074.22.173.33.253.099.086.2.171.29.253a10.141 10.141 0 0 1 3.012 3.703c.14.243.285.483.408.733.028.087.095.136.12.22.089.233.126.462.208.7.4 1.024.667 2.088.785 3.213.399 2.397.348 4.8-.468 7.371-1.431 4.512-6.871 6.769-11.066 7.466-3.062.503-6.549-.22-9.546-1.52-4.286-1.86-5.61-4.269-6.733-7.469-1.146-3.274-1.878-6.632-.054-9.84M57.875 49.863c1.7-3.323 4.417-5.416 7.697-6.62.072-.048.117-.104.197-.162 2.037-1.45 4.806-2 7.4-1.642 6.076.399 11.603 5.645 13.426 11.64.926 3.055.816 6.827-.747 9.66-2.345 4.249-6.24 6.338-10.86 7.305-7.715 1.625-16.183-3.686-18.103-11.22-.745-2.904-.38-6.293.99-8.961" />\n <path fill="#FFF" d="M97.573 60.005c.542 1.111 2.285 1.832 3.325 1.161 1.116-.715 1.315-2.42.479-3.462-.451-.557-1.063-.82-1.666-.79a.296.296 0 0 0-.235-.062c-1.392.108-2.635 1.68-1.903 3.153M82.511 58.042c.543 1.11 2.287 1.83 3.325 1.159 1.12-.72 1.318-2.42.479-3.46-.453-.558-1.059-.82-1.668-.791a.295.295 0 0 0-.227-.065c-1.4.11-2.637 1.679-1.909 3.157" />\n <path fill="#FFF" d="M83.12 55.648c.916-3.33 5.387-5.305 8.553-5.085 3.765.266 8.59 3.494 9.277 7.454.373 2.132-3.201 2.492-3.554.466-.782-4.47-8.893-6.614-10.702-2.003-.036.357-.226.713-.675 1.002-.022.023-.05.037-.07.05-1.412.921-3.292-.203-2.83-1.884" />\n <path fill="#79ECEE" d="M130.887 48.194c1.972 3.09 7.333 4.648 10.183 2.337 3.064-2.497 3.1-7.587.281-10.373-1.511-1.495-3.399-2.072-5.16-1.798a1.058 1.058 0 0 0-.718-.108c-4.064.775-7.221 5.81-4.586 9.942M127.85 77.94c1.733 2.724 6.45 4.093 8.956 2.058 2.697-2.199 2.723-6.673.244-9.122-1.327-1.316-2.985-1.825-4.536-1.582a.938.938 0 0 0-.63-.094c-3.578.679-6.353 5.109-4.034 8.74M123.467 106.767c1.607 2.793 6.26 4.374 8.854 2.454 2.796-2.074 3.021-6.54.654-9.102-1.267-1.375-2.901-1.949-4.46-1.781a.948.948 0 0 0-.627-.127c-3.603.52-6.573 4.823-4.42 8.556" />\n <path fill="#D6FAFB" d="M134.92 71.16l.384-.004c3.34-.056 4.832 2.564 4.435 4.87.819 3.035 6.732 4.083 9.188 4.55 3.327.638 6.204.138 7.935-1.695a5.354 5.354 0 0 0 .518-.67c.964-1.44 1.663-2.972 2.485-4.46.207-1.606.413-3.208.626-4.844 1.045.01 7.44.93 7.404 5.085-.061 7.397-4.113 11.963-9.873 13.901.007-.076.018-.156.03-.233a.106.106 0 0 0-.042.013l.012.22c-2.516.844-5.377 1.193-8.431 1.044-7.434-.364-19.518-4.398-19.253-13.56.07-2.467 2.191-4.176 4.582-4.217M155.979 103.575c.026.15-.358 3.097-.548 4.415-.379 2.903-.77 5.807-1.182 8.708-.04.298-.1.792-.173 1.41-.423.111-.846.232-1.267.325-9.933 2.216-23.748-2.264-26.83-12.978-1.387-4.823 5.737-6.845 8.28-3.535 3.25 3.006 6.375 4.279 10.726 4.987 2.315.378 9.589 1.174 10.133-1.001l.86-2.331z" />\n <path fill="#D6FAFB" d="M155.43 107.99c.19-1.318.575-4.264.549-4.415.141-1.139.343-2.691.587-4.57 1.43-.943 3.35-1.181 4.91-.156 4.028 2.644 5.269 6.247 3.534 10.833-1.791 4.722-6.312 7.18-10.936 8.425.075-.617.134-1.11.175-1.409.412-2.901.803-5.805 1.182-8.708" />\n <path fill="#0DCBCF" d="M97.295 86.818c.143-.42-.082-.821-.543-.907l-15.969-2.926c-.445-.086-.826.224-.826.667 0 0-.792 8.124 7.2 9.59 7.994 1.46 10.138-6.424 10.138-6.424M106.717 66.413a2.628 2.628 0 0 0 2.9-2.325c.148-1.137.803-3.051 3.438-2.757 2.873.313 2.836 2.714 2.758 3.44a2.632 2.632 0 0 0 2.32 2.906 2.635 2.635 0 0 0 2.902-2.328c.367-3.341-1.301-8.563-7.404-9.24-6.1-.67-8.868 4.061-9.233 7.399a2.623 2.623 0 0 0 2.319 2.905M65.97 60.55a2.618 2.618 0 0 0 2.898-2.323c.154-1.135.809-3.045 3.444-2.756 2.873.32 2.836 2.715 2.758 3.446a2.628 2.628 0 0 0 2.324 2.898 2.633 2.633 0 0 0 2.896-2.326c.369-3.336-1.295-8.561-7.399-9.232-6.107-.682-8.87 4.055-9.24 7.395a2.62 2.62 0 0 0 2.319 2.898M7.328 107.186s-4.037-2.086 6.805-8.374c10.108-5.864 7.278 10.253 7.278 10.253l-14.083-1.88z" />\n <path fill="#DFFCFC" d="M77.122 128.065c-3.962-7.31-6.318-14.535-8.397-21.528-3.496-11.78-4.837-23.725-10.418-35.926-.384-.842-1.51-1.893-2.359-2.092a1247.17 1247.17 0 0 1-45.203-11.481C5.086 55.485.713 55.304.083 59.109c-.007.039-.016.076-.022.12-.14.995-.046 2.243.353 3.81.19.754.696 1.372 1.281 1.841C4.793 75.29 6.898 85.406 10.32 95.907c3.831 11.75 8.712 23.72 12.591 35.483.415 1.26 1.806 2.668 3.07 2.721.323.013.648.028.971.04 3.006 1.149 30.837 7.319 41.229 8.583 4.412.538 18.182 5.133 17.55-.856-.335-3.168-7.048-10.931-8.61-13.813" />\n <path fill="#0DCBCF" d="M24.169 106.068c-4.748.862-9.072.078-13.23-2.376-3.782-2.232-6.633 3.978-2.878 6.194a24.375 24.375 0 0 0 16.752 2.983c4.29-.779 3.694-7.587-.644-6.801" />\n <path fill="#0DCBCF" d="M26.43 113.925c-4.822.208-9-1.152-12.787-4.147-3.445-2.725-7.11 3.043-3.69 5.747a24.362 24.362 0 0 0 16.193 5.225c4.356-.19 4.689-7.017.284-6.825" />\n <path fill="#0DCBCF" d="M27.7 121.497c-4.773-.725-8.608-2.867-11.746-6.535-2.856-3.338-7.566 1.615-4.73 4.929a24.372 24.372 0 0 0 14.88 8.249c4.313.653 5.952-5.982 1.595-6.643" />\n <path fill="#D6FAFB" d="M56.82 163.387c2.634 1.707 9.394 3.19 14.841 3.785 14.866 1.625 35.651.773 44.451-2.186 8.875-2.98 9.27-7.505-13.293-9.77-19.21-1.926-41.628.772-46.423 4.818-1.286 1.083-1.211 2.293.423 3.353" />\n <path fill="#FFF" d="M85.93 121.501l-8.872-2.495 5.144-7.99 53.966-19.197a4.453 4.453 0 0 1 5.686 2.7l.746 2.099a4.45 4.45 0 0 1-2.702 5.686L85.93 121.5z" />\n <path fill="#0DCBCF" d="M154.388 66.712c-4.389-3.498-9.232 3.746-4.877 7.216 9.374 7.469 14.612 20.835 10.794 32.583-4.663 14.35-23.538 12.171-35.273 9.956-5.483-1.035-5.935 7.667-.492 8.695 16.003 3.021 38.184 2.835 44.015-15.867 4.9-15.715-1.61-32.577-14.167-42.583" />\n <path fill="#0DCBCF" d="M117.57 120.966c-.858-.505-1.8-.82-2.724-.954.007-.692-.294-1.44-.896-2.045a5.36 5.36 0 0 0-1.042-.795c.604-.217 1.24-.4 1.767-.57 4.603-1.484-.888-7.006-5.49-5.523-4.248 1.372-8.193 3.504-7.248 7.418.244 1.01 1.247 2.234 2.773 2.788.09.031.177.056.268.09.235 1.784 2.018 3.698 4.6 4.72.32.126.656.225.99.326.556 1.45 2.692 2.89 4.895 2.99 5.026.234 8.746-1.607 9.6-4.766.4-1.491-1.568-3.332-3.883-3.906-1.418-.35-2.69-.218-3.61.227" />\n <path fill="#0DCBCF" d="M116.74 108.083c-2.338-.522-12.208 2.855-5.111 5.063 1.627.505 1.248.814 2.754 1.558-.564.2-1.05.473-1.4.824-2.277.728-2.681 3.583-1.654 5.93 1.48 3.38 2.415 7.939 7.426 7.805 5.597-.148 12.373-6.007 12.023-9.417-.211-2.065-1.65-5.025-4.013-6.767-1.204-.887-7.684-4.475-10.024-4.996" />\n <path fill="#0DCBCF" d="M118.038 108.505s-11.852-4.477-13.846-1.858c-1.799 2.363-5.817 10.49-3.131 10.95 2.683.463 10.129-2.62 10.129-2.62l6.848-6.472z" />\n <g transform="translate(134.244 38.595)">\n <mask id="icon_note_empty_77efa79dd615f19897a8ed6ec9097298_b" fill="#fff">\n <use xlink:href="#icon_note_empty_77efa79dd615f19897a8ed6ec9097298_a" />\n </mask>\n <path fill="#D6FAFB" d="M9.325 7.036c.397 5.93 8.7 6.329 13.777 4.795.42-.158.845-.317 1.23-.505a9.225 9.225 0 0 0 1.389-.872c.082-.06.995-.824 1.133-.954 1.086-1.008 2.065-2.238 2.415-3.433.248-2.072.485-4.087.695-5.947a8.54 8.54 0 0 1 2.63 1.137C34 2.191 34.869 3.2 35.499 4.768c.088.213.125.438.17.665.332.608.553 1.271.557 1.963 1.55 5.622-2.602 9.814-8.58 11.908.032-.244.058-.477.09-.717-.01.004-.02.011-.029.015-.018.233-.03.458-.061.702C17.12 22.994.906 20.164.03 7.036c-.365-5.393 8.932-5.393 9.294 0" mask="url(#icon_note_empty_77efa79dd615f19897a8ed6ec9097298_b)" />\n </g>\n <path fill="#ACF5F7" d="M67.018 83.907a4.967 4.967 0 1 1-9.935 0 4.966 4.966 0 0 1 4.967-4.967 4.967 4.967 0 0 1 4.968 4.967M73.57 105.824a4.967 4.967 0 1 1-9.935 0 4.966 4.966 0 0 1 4.966-4.966 4.967 4.967 0 0 1 4.969 4.966M80.564 124.544a4.967 4.967 0 0 1-4.968 4.966 4.966 4.966 0 0 1-4.967-4.966 4.967 4.967 0 1 1 9.935 0" />\n </g>\n</symbol>'}),M=(C.a.add(S),S),z=n("Le8U");function P(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var I={_type:"io.cozy.apps",_id:"io.cozy.apps/notes"},D=function(e){var t=N(Object(r.useState)(Object(y.d)(e)),2),n=t[0],a=t[1];return Object(r.useEffect)(function(){var t,n;(t=v.a.mark(function t(){var n,r;return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,z.CozyFolder.getReferencedFolders(I);case 3:n=t.sent,r=Object(y.d)(e,n[0]._id),a(r),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),a(Object(y.d)(e));case 11:case"end":return t.stop()}},t,this,[[0,8]])}),n=function(){var e=this,n=arguments;return new Promise(function(r,a){var i=t.apply(e,n);function o(e){P(i,r,a,o,s,"next",e)}function s(e){P(i,r,a,o,s,"throw",e)}o(void 0)})},function(){return n.apply(this,arguments)})()},[]),{notesFolder:n}},T=n("sCMN"),A=Object(l.c)()(Object(s.withClient)(function(e){var t=e.t,n=e.client,r=D(n).notesFolder;return a.a.createElement("div",{className:"empty"},a.a.createElement(p.a,{id:"empty",icon:M,title:t("Notes.Empty.welcome"),text:a.a.createElement(T.a,{href:r,slug:"drive"},function(e){var n=e.href,r=e.onClick;return a.a.createElement("span",{className:"u-mb-half"},t("Notes.Empty.after_created")," ",a.a.createElement("a",{href:n,onClick:r},"Cozy Drive"),".")})},a.a.createElement(x,{className:"u-mt-1"})))})),F=n("y6ex"),q=n("RMII"),U=n.n(q),B=new O.a({id:"icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d",use:"icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d">\n<style type="text/css">\n\t#icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#ACF5F7;}\n\t#icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#0DCBCF;}\n</style>\n<g transform="translate(2)">\n\t<path class="st0" d="M0,2c0-1.1,0.9-2,2-2h22c1.1,0,2,0.9,2,2v28c0,1.1-0.9,2-2,2H2c-1.1,0-2-0.9-2-2V2z" />\n\t<path class="st1" d="M6,8h14v2H6V8z M6,12h8v2H6V12z M6,16h14v2H6V16z M6,20h10v2H6V20z" />\n</g>\n<g transform="translate(0 4)">\n\t<path class="st1" d="M1.5,0h2C4.3,0,5,0.7,5,1.5l0,0C5,2.3,4.3,3,3.5,3h-2C0.7,3,0,2.3,0,1.5l0,0C0,0.7,0.7,0,1.5,0z" />\n\t<path class="st1" d="M1.5,7h2C4.3,7,5,7.7,5,8.5l0,0C5,9.3,4.3,10,3.5,10h-2C0.7,10,0,9.3,0,8.5l0,0C0,7.7,0.7,7,1.5,7z" />\n\t<path class="st1" d="M1.5,14h2C4.3,14,5,14.7,5,15.5l0,0C5,16.3,4.3,17,3.5,17h-2C0.7,17,0,16.3,0,15.5l0,0C0,14.7,0.7,14,1.5,14z" />\n\t<path class="st1" d="M1.5,21h2C4.3,21,5,21.7,5,22.5l0,0C5,23.3,4.3,24,3.5,24h-2C0.7,24,0,23.3,0,22.5l0,0C0,21.7,0.7,21,1.5,21z" />\n</g>\n<g>\n\t<path class="st1" d="M31.4,18.4l-2.8-2.8c0.8-0.8,2-0.8,2.8,0S32.2,17.6,31.4,18.4z" />\n\t<path class="st1" d="M30.7,19.1L20.8,29l-2.5,0.9c-0.5,0.2-1.1-0.1-1.3-0.6c-0.1-0.2-0.1-0.5,0-0.7l0.9-2.5l9.9-9.9L30.7,19.1z" />\n</g>\n</symbol>'}),L=(C.a.add(B),B),R=Object(o.a)()(Object(l.c)()(function(e){var t=e.note,n=e.f,r=e.breakpoints.isMobile,i=z.CozyFile.splitFilename(t),o=i.filename,s=i.extension;return a.a.createElement(d.f,{className:"u-c-pointer ".concat(U.a.tableRow),onClick:function(){return window.location.href=Object(y.b)(t)}},a.a.createElement(d.c,{className:"".concat(U.a.tableCellName," u-flex u-flex-items-center u-ellipsis u-fz-medium")},a.a.createElement(F.a,{icon:L,size:32,className:"u-mr-1 u-flex-shrink-0"}),a.a.createElement("span",{className:"u-charcoalGrey"},o),a.a.createElement("span",null,s)),!r&&a.a.createElement(a.a.Fragment,null,a.a.createElement(d.c,{className:U.a.tableCell},n(t.updated_at,"DD MMMM")),a.a.createElement(d.c,{className:U.a.tableCell},"—"),a.a.createElement(d.c,{className:U.a.tableCell},"—")))})),Q=function(){return a.a.createElement(d.f,{className:U.a.tableSpecialRow},a.a.createElement(d.c,{className:U.a.tableCellEmpty},a.a.createElement(A,null)))},V=function(){return a.a.createElement(d.f,{className:U.a.tableSpecialRow},a.a.createElement(d.c,{className:"".concat(U.a.tableCellEmpty," u-ta-center")},a.a.createElement(f.a,{size:"xxlarge"})))},J=Object(l.c)()(function(e){var t=e.t,n=e.notes,r=e.fetchStatus;return a.a.createElement(d.a,null,a.a.createElement(d.d,null,a.a.createElement(d.f,null,a.a.createElement(d.e,{className:U.a.tableCellName},t("Notes.List.name")),a.a.createElement(d.e,{className:U.a.tableCell},t("Notes.List.updated_at")),a.a.createElement(d.e,{className:U.a.tableCell},t("Notes.List.location")),a.a.createElement(d.e,{className:U.a.tableCell},t("Notes.List.sharings")))),a.a.createElement(d.b,null,"loading"===r?a.a.createElement(V,null):0===n.length?a.a.createElement(Q,null):n.map(function(e){return a.a.createElement(R,{note:e,key:e._id})})))}),H=n("BkRI"),Z=n.n(H),G=n("mwIZ"),X=n.n(G);function W(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function K(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Y=function(e){var t=K(Object(r.useState)([]),2),n=t[0],a=t[1],i=K(Object(r.useState)("loading"),2),o=i[0],s=i[1];return Object(r.useEffect)(function(){var t,n;(t=v.a.mark(function t(){var n,r,i,o,c;return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.query(e.all("io.cozy.files").where({cozyMetadata:{createdByApp:"notes"},trashed:!1,updated_at:{$gt:null}}).sortBy([{"cozyMetadata.createdByApp":"desc"},{updated_at:"desc"}]).indexFields(["cozyMetadata.createdByApp","updated_at"]));case 3:return n=t.sent,r=n.data,i=r.map(function(t){return e.getStackClient().fetchJSON("GET","/notes/".concat(t._id))}),t.next=8,Promise.all(i);case 8:o=t.sent,(c=Z()(r)).forEach(function(e,t){e.name=X()(o[t],"data.attributes.name",e.name)}),a(c),s("loaded"),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(0),s("errored"),console.log({error:t.t0});case 19:case"end":return t.stop()}},t,this,[[0,15]])}),n=function(){var e=this,n=arguments;return new Promise(function(r,a){var i=t.apply(e,n);function o(e){W(i,r,a,o,s,"next",e)}function s(e){W(i,r,a,o,s,"throw",e)}o(void 0)})},function(){return n.apply(this,arguments)})()},[]),{fetchStatus:o,data:{notes:n}}},$=function(e,t){return"loaded"===e&&t.length>0},ee=Object(o.a)()(Object(s.withClient)(function(e){var t=e.breakpoints.isMobile,n=e.client,r=cozy.bar.BarRight,o=Y(n),s=o.data.notes,c=o.fetchStatus;return a.a.createElement(a.a.Fragment,null,a.a.createElement(i.a,{className:"u-mt-1 u-mt-0-m"},a.a.createElement("div",{className:"".concat(U.a.appHeader," u-flex u-flex-justify-between u-flex-items-center")},a.a.createElement(u,null),!t&&$(c,s)&&a.a.createElement(x,null)),a.a.createElement(J,{notes:s,fetchStatus:c})),t&&$(c,s)&&a.a.createElement(r,null,a.a.createElement(j,null)))})),te=n("k4o+"),ne=n("9jEr"),re=n("jWvl"),ae=n("KXVJ"),ie={allowTables:!0,allowRule:!0,allowLists:!0,allowTextColor:!0,allowPanel:!0},oe=function(e){return a.a.createElement("header",{className:"page-header-menu "+(e.className||"")},a.a.createElement("div",{className:"page-header-menu--left"},e.left),e.children,a.a.createElement("div",{className:"page-header-menu--right"},e.right))},se=n("Q2Eh"),ce=n.n(se);function le(){return(le=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)}function ue(e){e.style.height="".concat(e.scrollHeight,"px")}var de=Object(l.c)()(function(e){var t=e.defaultValue,n=e.onTitleChange,i=e.onTitleBlur,o=e.onContentChange,s=e.defaultTitle,l=e.title,u=e.collabProvider,d=e.leftComponent,f=e.rightComponent,p=e.t,h=Object(r.useRef)(null),v=Object(r.useCallback)(function(e){ue(e.target),n&&n(e)},[n]);return Object(r.useEffect)(function(){return ue(h.current)},[]),Object(ae.a)(h.current,"blur",i),a.a.createElement("article",{className:ce.a["note-article"]},a.a.createElement("style",null,"#coz-bar ","{ display: none }"),a.a.createElement(oe,{left:d,className:"note-header-menu--editing",right:f}),a.a.createElement("section",{className:"note-editor-container"},a.a.createElement(te.a,le({collabEdit:u,onChange:o,defaultValue:t},ie,{appearance:"full-page",placeholder:p("Notes.EditorView.main_placeholder"),shouldFocus:!0,contentComponents:a.a.createElement(ne.a,{render:function(){return a.a.createElement(c.b,{tag:"h1",className:"note-title"},a.a.createElement(re.a,{ref:h,rows:"1",fullwidth:!0,value:l,onChange:v,placeholder:s,className:"note-title-input"}))}})}))))});var fe=function(){return a.a.createElement("div",null,a.a.createElement(f.a,{size:"xxlarge",middle:!0}))};var pe=Object(l.c)()(function(e){var t=e.t,n=e.returnUrl;return a.a.createElement(p.a,{icon:"cross-small",title:t("Error.loading_error_title"),text:a.a.createElement("p",{className:"u-mb-half",dangerouslySetInnerHTML:{__html:n?t("Error.loading_error_text_returnUrl",{url:n}):t("Error.loading_error_text_noReturnUrl")}})})}),he=n("UmWK"),ve=n("AQIY");function me(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=Object(ve.a)(he.c);function _e(e,t,n){var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ye(e,t,n[t])})}return e}({id:e},t),a=s.models.file.normalize(r);return n&&n.path?s.models.file.ensureFilePath(a,n):a}var we=Object(s.withClient)(function(e){var t=e.client,n=be(Object(r.useState)(void 0),2),i=n[0],o=n[1],s=e.file.id||e.file._id,c=Object(r.useMemo)(function(){return _e(s,e.file,i)},[s,i]);Object(r.useEffect)(function(){function e(){var n;return n=v.a.mark(function e(n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.query(t.get("io.cozy.files",n.attributes.dir_id));case 3:r=e.sent,o(r.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.warn("Request failed when try to fetch the parent ".concat(n.attributes.dir_id," of io.cozy.files ").concat(n.id||n._id));case 10:case"end":return e.stop()}},e,this,[[0,7]])}),(e=function(){var e=this,t=arguments;return new Promise(function(r,a){var i=n.apply(e,t);function o(e){me(i,r,a,o,s,"next",e)}function s(e){me(i,r,a,o,s,"throw",e)}o(void 0)})}).apply(this,arguments)}!function(t){e.apply(this,arguments)}(c)},[c.attributes.dir_id]);var l=be(Object(r.useState)(!1),2),u=l[0],d=l[1],f=Object(r.useCallback)(function(){return d(!u)},[]),p=Object(r.useCallback)(function(){return d(!1)},[]),h=c.id;return i&&a.a.createElement(ge,{doctype:c.type,documentType:"Notes"},a.a.createElement(he.a,{theme:"primary",docId:h,onClick:f,label:"",extension:"narrow",iconOnly:!0}),u&&a.a.createElement(he.b,{document:c,onClose:p}))||null}),je=n("55Ip"),xe=n("G2JP");function ke(e){var t=e.returnUrl,n=e.file,i=Object(r.useContext)(xe.a);if(t){var o=Object(y.e)(Object(y.f)(n));return a.a.createElement(T.a,{slug:"drive",href:t,nativePath:o},function(e){var t=e.onClick,n=e.href;return a.a.createElement(m.b,{icon:"previous",onClick:t,href:n,className:"sto-app-back",subtle:!0})})}return i?null:a.a.createElement(m.a,{icon:"previous",tag:je.b,to:"/",className:"sto-app-back",subtle:!0})}var Oe=n("cjKa"),Ee=n("O1Kf"),Ce=n("bfWj");function Se(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function Me(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){Se(i,r,a,o,s,"next",e)}function s(e){Se(i,r,a,o,s,"throw",e)}o(void 0)})}}function ze(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)}}var Pe=function(){var e,t=new Promise(function(t){e=t});return t.resolved=!1,t.resolve=function(){return e(),t.resolved=!0,t},t},Ne=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.service=n,this.eventEmitter=new Oe.EventEmitter2,this.resetBackoff(),this.initializeStepsQueue(),this.isSending=!1,this.emptyQueuePromise=Pe().resolve()}var t,n,r,a,i,o,s,c,l;return t=e,(n=[{key:"resetBackoff",value:function(){this.backoff=0,this.failures=0}},{key:"increaseBackoff",value:function(){this.failures=this.failures+1,this.failures%4==0&&this.emit("needcatchup",{failures:this.failures}),this.backoff=Math.max(Math.min(2*this.backoff,3e5),128)}},{key:"afterBackoff",value:function(){var e=this;return new Promise(function(t){e.backoff<128?t():window.setTimeout(t,e.backoff)})}},{key:"initializeStepsQueue",value:function(){this.queuedStep=void 0}},{key:"ensureEmptyQueue",value:(l=Me(v.a.mark(function e(){return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.emptyQueuePromise);case 1:case"end":return e.stop()}},e,this)})),function(){return l.apply(this,arguments)})},{key:"enqueueSteps",value:function(e){var t=e.getState,n=e.state,r=e.localSteps;this.emptyQueuePromise.resolved&&(this.emptyQueuePromise=Pe()),this.queuedStep={getState:t,state:n,localSteps:r}}},{key:"dequeueSteps",value:function(){var e=this.queuedStep,t=e.getState,n=e.state||t(),r=e.localSteps||Object(Ee.sendableSteps)(n)||{steps:[]};return this.queuedStep=void 0,{getState:t,state:n,localSteps:r}}},{key:"hasQueuedSteps",value:function(){return!!this.queuedStep}},{key:"rebaseStepsInQueue",value:function(){this.queuedStep&&(this.queuedStep={getState:this.queuedStep.getState})}},{key:"sendSteps",value:(c=Me(v.a.mark(function e(t,n,r){return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.enqueueSteps({getState:t,state:n,localSteps:r}),e.next=3,this.processQueue();case 3:case"end":return e.stop()}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"processQueue",value:(s=Me(v.a.mark(function e(){var t,n,r,a,i,o,s;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isSending){e.next=2;break}return e.abrupt("return");case 2:if(this.hasQueuedSteps()){e.next=5;break}return this.emptyQueuePromise.resolve(),e.abrupt("return");case 5:return this.isSending=!0,e.next=8,this.afterBackoff();case 8:if(t=this.dequeueSteps(),n=t.getState,r=t.state,a=t.localSteps.steps,void 0!==(i=Object(Ee.getVersion)(r))){e.next=12;break}return e.abrupt("return");case 12:if(0!==a.length){e.next=14;break}return e.abrupt("return");case 14:return e.prev=14,o=this.config.docId,e.next=18,this.service.pushSteps(o,i,a);case 18:s=e.sent,this.rebaseStepsInQueue(),this.resetBackoff(),this.isSending=!1,s&&s.steps&&s.steps.length>0&&this.emit("data",s),e.next=30;break;case 25:e.prev=25,e.t0=e.catch(14),this.hasQueuedSteps()?this.rebaseStepsInQueue():this.enqueueSteps({getState:n}),this.increaseBackoff(),this.isSending=!1;case 30:return e.next=32,this.processQueue();case 32:case"end":return e.stop()}},e,this,[[14,25]])})),function(){return s.apply(this,arguments)})},{key:"connect",value:(o=Me(v.a.mark(function e(t,n){var r,a=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=this.config.docId,this.service.join(r),this.service.onStepsCreated(r,function(e){a.emit("data",{version:e.version,steps:[e]})}),this.service.onTelepointerUpdated(r,function(e){a.emit("telepointer",e)}),this.emit("connected",{doc:n,version:t});case 5:case"end":return e.stop()}},e,this)})),function(e,t){return o.apply(this,arguments)})},{key:"getSteps",value:(i=Me(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.config.docId,e.next=3,this.service.getSteps(n,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"sendTelepointer",value:(a=Me(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.config.docId,e.next=3,this.service.pushTelepointer(n,t);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:"on",value:function(e,t){return this.eventEmitter.on(e,t),this}},{key:"off",value:function(e,t){return this.eventEmitter.off(e,t),this}},{key:"emit",value:function(e,t){return this.eventEmitter.emit(e,t),this}}])&&ze(t.prototype,n),r&&ze(t,r),e}();function Ie(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function De(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Fe(e,t,n[t])})}return e}function Ae(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)}}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qe=new Ce.a,Ue=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Fe(this,"processRemoteData",function(e){var t=e.version,n=e.steps;if(n&&n.length){var a=n.map(function(e){return e.sessionId||r.serviceClient.getUserId(e.sessionId)});r.emit("data",{json:n,version:t,userIds:a})}else console.warn("Collab.Provider: processRemoteData no steps ? ",n,e)}),Fe(this,"onReceiveData",function(e){r.queueData(e),r.processQueue()}),Fe(this,"onReceiveTelepointer",function(e){var t=e.sessionId,n=r.serviceClient.getUserId(t);if(n!==r.config.userId){var a=r.participants.get(n);a&&a.lastActive>e.timestamp||(r.updateParticipant(t,e.timestamp),r.emit("telepointer",e))}}),this.config=Te({},t),this.config.sessionId=n.getSessionId(),this.config.userId=n.getUserId(),this.serviceClient=n,this.channel=t.channel||new Ne(this.config,n),this.eventEmitter=new Oe.EventEmitter2,this.queue=[],this.getState=function(){},this.participants=new Map,this.pauseQueue=!1,this.initialVersion=t.version,this.pauseQueue=!1}var t,n,r,a,i;return t=e,(n=[{key:"initialize",value:function(e){var t=this;this.getState=e,this.channel.on("connected",function(e){var n=e.doc,r=e.version,a=t.config.sessionId;t.emit("init",{sid:a,doc:n,version:r}),t.emit("connected",{sid:a})}),this.channel.on("data",this.onReceiveData),this.channel.on("telepointer",this.onReceiveTelepointer),this.channel.on("needcatchup",function(){return t.catchup()});var n=e(),r=qe.encode(n.doc),a=void 0!==this.initialVersion?this.initialVersion:r.version,i=Te({},r,{version:a});return this.channel.connect(a,i),this}},{key:"send",value:function(e,t,n){e.steps&&e.steps.length&&this.channel.sendSteps(this.getState,n)}},{key:"sendMessage",value:function(e){if(e)switch(e.type){case"telepointer":this.channel.sendTelepointer(Te({},e,{timestamp:(new Date).getTime()}))}}},{key:"queueData",value:function(e){var t=[].concat(De(this.queue),[e]).sort(function(e,t){var n=e.version-e.steps.length,r=t.version-t.steps.length;return n>r?1:n<r?-1:e.version>t.version?-1:e.version<t.version?1:0});this.queue=t}},{key:"catchup",value:(a=v.a.mark(function e(){var t,n,r,a,i,o,s,c,l;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.pauseQueue=!0,t=Object(Ee.getVersion)(this.getState()),e.prev=2,e.next=5,this.channel.getSteps(t);case 5:n=e.sent,r=n.doc,a=n.version,i=n.steps,r?(o=this.config.sessionId,s=Object(Ee.sendableSteps)(this.getState())||{},c=s.steps,l=void 0===c?[]:c,this.emit("init",{sid:o,doc:r,version:a}),l.length&&this.emit("local-steps",{steps:l})):i.length>0&&this.onReceiveData({steps:i,version:a},!0),this.queueTimeout=void 0,this.pauseQueue=!1,this.processQueue(),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),this.pauseQueue=!1,this.programCatchup();case 19:case"end":return e.stop()}},e,this,[[2,15]])}),i=function(){var e=this,t=arguments;return new Promise(function(n,r){var i=a.apply(e,t);function o(e){Ie(i,n,r,o,s,"next",e)}function s(e){Ie(i,n,r,o,s,"throw",e)}o(void 0)})},function(){return i.apply(this,arguments)})},{key:"programCatchup",value:function(){var e=this;this.queueTimeout||(this.queueTimeout=window.setTimeout(function(){e.catchup()},1e3))}},{key:"cancelCatchup",value:function(){this.queueTimeout&&(window.clearTimeout(this.queueTimeout),this.queueTimeout=void 0)}},{key:"processQueue",value:function(){if(this.queue.length>0&&!this.pauseQueue)for(var e=Object(Ee.getVersion)(this.getState());this.queue.length>0;){var t=this.queue[0],n=t.version,r=t.steps.length+e;if(n==r)this.cancelCatchup(),this.queue.shift(),this.processRemoteData(t),e=n;else if(n<=r&&this.queue.shift(),n>r){this.programCatchup();break}}}},{key:"updateParticipant",value:function(e,t){var n=this,r=this.serviceClient.getUserId(e),a=function(e){var t=e.userId,n=e.sessionId;return{userId:n,sessionId:n||t,name:t,avatar:"https://api.adorable.io/avatars/80/".concat(t.replace(/[^a-zA-Z0-9]/g,""),".png"),email:"".concat(t.replace(/\s+/g,".").replace(/[^a-zA-Z0-9.]/g,""),".toLocaleLowerCase()}@mycozy.cloud")}}({userId:r,sessionId:e});this.participants.set(r,Te({name:"",email:"",avatar:"",sessionId:e,userId:r},a,{lastActive:t}));var i=[this.participants.get(r)],o=(new Date).getTime(),s=Array.from(this.participants.values()).filter(function(e){return(o-e.lastActive)/1e3>300});s.forEach(function(e){return n.participants.delete(e.userId)}),this.emit("presence",{joined:i,left:s})}},{key:"emit",value:function(e,t){return this.eventEmitter.emit(e,t),this}},{key:"on",value:function(e,t){return this.eventEmitter.on(e,t),this}},{key:"off",value:function(e,t){return this.eventEmitter.off(e,t),this}},{key:"unsubscribeAll",value:function(e){this.eventEmitter.removeAllListeners(e)}}])&&Ae(t.prototype,n),r&&Ae(t,r),e}(),Be=n("oBqo"),Le=n.n(Be),Re=n("hmtS");function Qe(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function Ve(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){Qe(i,r,a,o,s,"next",e)}function s(e){Qe(i,r,a,o,s,"throw",e)}o(void 0)})}}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){He(e,t,n[t])})}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(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)}}var Ge=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.userId,r=t.cozyClient,a=t.schema,i=t.realtime,o=new Date,s=o.getTime()+"."+o.getMilliseconds()+"."+Math.random();this.sessionId=n+":"+s,this.userId=this.getUserId(n),this.cozyClient=r,this.stackClient=r.getStackClient(),this.schema=a,this.onRealtimeEvent=this.onRealtimeEvent.bind(this),this.realtime=i||new Le.a({client:r}),this.resetCallbacks()}var t,n,r,a,i,o,s,c,l,u,d,f,p,h;return t=e,(n=[{key:"resetCallbacks",value:function(){this.callbacks={}}},{key:"setCallback",value:function(e,t,n){this.callbacks[e]=this.callbacks[e]||{},this.callbacks[e][t]=n}},{key:"getUserId",value:function(e){return e?e.match(/[^:]+/)[0]:this.userId}},{key:"getSessionId",value:function(){return this.sessionId}},{key:"close",value:function(){this.realtime.unsubscribeAll(),this.resetCallbacks()}},{key:"defaultTitle",value:function(){return(new Date).toISOString()}},{key:"path",value:function(e,t){return e?t?"/notes/".concat(e,"/").concat(t):"/notes/".concat(e):"/notes"}},{key:"client2server",value:function(e){return Je({sessionID:e.sessionId||this.sessionId},e)}},{key:"server2client",value:function(e){return Je({sessionId:e.sessionID,userId:this.getUserId(e.sessionID)},e)}},{key:"create",value:(h=Ve(v.a.mark(function e(t,n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={data:{type:"io.cozy.notes.documents",attributes:{title:t||this.defaultTitle(),schema:n||this.schema||Re.a}}},e.abrupt("return",this.stackClient.fetchJSON("POST",this.path(),r));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return h.apply(this,arguments)})},{key:"sync",value:(p=Ve(v.a.mark(function e(t){return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("POST",this.path(t,"sync"));case 2:case"end":return e.stop()}},e,this)})),function(e){return p.apply(this,arguments)})},{key:"setTitle",value:(f=Ve(v.a.mark(function e(t,n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={data:{type:"io.cozy.notes.documents",id:t,attributes:this.client2server({title:n})}},e.next=3,this.stackClient.fetchJSON("PUT",this.path(t,"title"),r);case 3:case"end":return e.stop()}},e,this)})),function(e,t){return f.apply(this,arguments)})},{key:"onRealtimeEvent",value:function(e){var t=e.id||e._id,n=e.doctype;if(this.callbacks[n]&&this.callbacks[n][t])return this.callbacks[n][t](e);console.warn("Event not managed",n,t,this.callbacks)}},{key:"join",value:(d=Ve(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return e.id==t?this.onRealtimeEvent(e):void 0},e.next=3,Promise.all([this.realtime.subscribe("created","io.cozy.notes.events",n),this.realtime.subscribe("updated","io.cozy.notes.events",t,this.onRealtimeEvent),this.realtime.subscribe("deleted","io.cozy.notes.events",t,this.onRealtimeEvent)]);case 3:case"end":return e.stop()}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"onStepsCreated",value:(u=Ve(v.a.mark(function e(t,n){var r=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setCallback("io.cozy.notes.steps",t,function(e){return n(r.server2client(e))});case 1:case"end":return e.stop()}},e,this)})),function(e,t){return u.apply(this,arguments)})},{key:"onTelepointerUpdated",value:(l=Ve(v.a.mark(function e(t,n){var r=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setCallback("io.cozy.notes.telepointers",t,function(e){return n(r.server2client(e))});case 1:case"end":return e.stop()}},e,this)})),function(e,t){return l.apply(this,arguments)})},{key:"onTitleUpdated",value:(c=Ve(v.a.mark(function e(t,n){var r=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setCallback("io.cozy.notes.documents",t,function(e){return e.sessionID&&e.sessionID==r.sessionId?null:n(e.title)});case 1:case"end":return e.stop()}},e,this)})),function(e,t){return c.apply(this,arguments)})},{key:"getDoc",value:(s=Ve(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",this.path(t));case 2:return n=e.sent,e.abrupt("return",{doc:n.data.attributes.metadata.content,version:n.data.attributes.metadata.version,title:n.data.attributes.metadata.title,file:n.data});case 4:case"end":return e.stop()}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"pushSteps",value:(o=Ve(v.a.mark(function e(t,n,r){var a,i,o=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={headers:{"if-match":n}},i={data:r.map(function(e){return{type:"io.cozy.notes.steps",attributes:o.client2server(e.toJSON())}})},e.next=4,this.stackClient.fetchJSON("PATCH",this.path(t),i,a);case 4:return e.abrupt("return",null);case 5:case"end":return e.stop()}},e,this)})),function(e,t,n){return o.apply(this,arguments)})},{key:"getSteps",value:(i=Ve(v.a.mark(function e(t,n){var r,a,i,o,s,c,l,u,d,f,p=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.stackClient.fetchJSON("GET","".concat(this.path(t,"steps"),"?Version=").concat(n));case 3:if(0!=(r=e.sent).data.length){e.next=8;break}return e.abrupt("return",{steps:[],version:n});case 8:return a=r.data.map(function(e){return p.server2client(e.attributes)}),i=r.data[r.data.length-1].attributes.version,e.abrupt("return",{version:i,steps:a});case 11:e.next=28;break;case 13:if(e.prev=13,e.t0=e.catch(0),o=e.t0.response,s=e.t0.reason&&e.t0.reason.data,c=s&&s.attributes&&s.attributes.metadata,l=c&&c.content,u=c&&c.version,412!=o.status||!l||!u){e.next=27;break}return f={_id:t,_type:"io.cozy.notes.events",doctype:d="io.cozy.notes.documents",title:c.title},this.callbacks[d]&&this.callbacks[d][t]&&this.callbacks[d][t](f),e.abrupt("return",{doc:l,version:u});case 27:throw e.t0;case 28:case"end":return e.stop()}},e,this,[[0,13]])})),function(e,t){return i.apply(this,arguments)})},{key:"pushTelepointer",value:(a=Ve(v.a.mark(function e(t,n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={data:{type:"io.cozy.notes.telepointers",id:t,attributes:this.client2server(n)}},e.abrupt("return",this.stackClient.fetchJSON("PUT",this.path(t,"telepointer"),r));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return a.apply(this,arguments)})}])&&Ze(t.prototype,n),r&&Ze(t,r),e}();function Xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){We(e,t,n[t])})}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ye(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function $e(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){Ye(i,r,a,o,s,"next",e)}function s(e){Ye(i,r,a,o,s,"throw",e)}o(void 0)})}}function et(){return(et=$e(v.a.mark(function e(t,n,r,a,i,o){var s;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r||a(!0),e.next=4,t.getDoc(n);case 4:s=e.sent,o(s.title||""),i(s),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),o(!1),i(!1);case 13:a(!1);case 14:case"end":return e.stop()}},e,this,[[0,9]])}))).apply(this,arguments)}var tt=Object(l.c)()(Object(s.withClient)(function(e){var t=e.client,n=e.noteId,i=e.t,o=Object(r.useMemo)(function(){return e.userName||Object(y.j)(t)},[e.userName]),s=Object(r.useMemo)(y.c),c=Object(r.useContext)(xe.a),l=n,u=o,d=t,f=Ke(Object(r.useState)(!0),2),p=f[0],h=f[1],m=Ke(Object(r.useState)(void 0),2),b=m[0],g=m[1],_=Ke(Object(r.useState)(void 0),2),w=_[0],j=_[1],x=Object(r.useMemo)(function(){return new Ge({userId:u,userName:o,cozyClient:d})},[n]),k=b&&b.version,O=Object(r.useMemo)(function(){if(void 0!==k){var e=new Ue({version:b.version,docId:l},x);return{useNativePlugin:!0,provider:Promise.resolve(e),inviteToEditHandler:function(){},isInviteToEditButtonSelected:!1,userId:x.getSessionId()}}return null},[n,k,o,x]);Object(r.useEffect)(function(){!function(e,t,n,r,a,i){et.apply(this,arguments)}(x,n,p,h,g,j)},[n]);var E=Object(r.useCallback)(function(){return null},[n]),C=Object(r.useCallback)(function(e,t,n,r){return function(a){var i=a.target.value;n!=i&&(r(i),e.setTitle(t,i))}}(x,n,w,j),[n,j,x]),S=Object(r.useCallback)(function(e){w!=e&&j(e)},[n,j]);Object(r.useMemo)(function(){x.onTitleUpdated(n,S)},[S,x]),Object(r.useEffect)(function(){!function(e,t){document.title=t&&""!=t?"".concat(e," - ").concat(t):e}(s,w)},[w]);var M=Object(r.useMemo)(function(){return void 0!==e.returnUrl?e.returnUrl:b?Object(y.g)(t,b.file):c?void 0:"/"},[e.returnUrl,b]);function z(){return P.apply(this,arguments)}function P(){return(P=$e(v.a.mark(function e(){var t;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=8;break}return e.next=3,O.provider;case 3:return t=e.sent,e.next=6,t.channel.ensureEmptyQueue();case 6:return e.next=8,x.sync(l);case 8:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}Object(r.useEffect)(function(){p||b||console.warn("Could not load note ".concat(n))},[p,b]),Object(r.useEffect)(function(){return z},[l,b]);var N=Object(r.useCallback)(function(){b&&l&&x.sync(l)},[b,l]);return Object(ae.a)(window,"unload",N),p?a.a.createElement(fe,null):b?a.a.createElement(de,{onTitleChange:C,onTitleBlur:N,onContentChange:E,collabProvider:O,defaultTitle:i("Notes.Editor.title_placeholder"),defaultValue:Xe({},b.doc,{version:b.version}),title:w&&w.length>0?w:void 0,leftComponent:a.a.createElement(ke,{returnUrl:M,file:b.file}),rightComponent:!c&&a.a.createElement(we,{file:b.file})}):a.a.createElement(pe,{returnUrl:M})})),nt=Object(l.c)()(function(e){var t=e.t;return a.a.createElement(p.a,{icon:"unlink",title:t("Error.unshared_title"),text:t("Error.unshared_text")})});n.d(t,"b",function(){return ee}),n.d(t,"a",function(){return tt}),n.d(t,"c",function(){return nt})},hmtS:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n("byeC"),a=[["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"}]}]],i=[["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:""}}}]];function o(e){return e.reduce(function(e,t){return e[t[0]]=t[1],e},{})}var s={nodes:a,marks:i},c={nodes:o(a),marks:o(i)};new r.Schema(c)},nw0P:function(e,t,n){var r={"./_lib/build_formatting_tokens_reg_exp/index.js":"kOWh","./ar/build_distance_in_words_locale/index.js":"XxX6","./ar/build_format_locale/index.js":"alis","./ar/index.js":"EDRf","./be/build_distance_in_words_locale/index.js":"LQ09","./be/build_format_locale/index.js":"kj7F","./be/index.js":"YEhR","./bg/build_distance_in_words_locale/index.js":"7K3h","./bg/build_format_locale/index.js":"RrdL","./bg/index.js":"isx8","./ca/build_distance_in_words_locale/index.js":"wqqj","./ca/build_format_locale/index.js":"qcV0","./ca/index.js":"Vwa+","./cs/build_distance_in_words_locale/index.js":"ZKDM","./cs/build_format_locale/index.js":"ipyF","./cs/index.js":"dvhP","./da/build_distance_in_words_locale/index.js":"2Mgc","./da/build_format_locale/index.js":"Gned","./da/index.js":"7ur/","./de/build_distance_in_words_locale/index.js":"5IWf","./de/build_format_locale/index.js":"THCn","./de/index.js":"bgw5","./el/build_distance_in_words_locale/index.js":"o/GB","./el/build_format_locale/index.js":"8T9h","./el/index.js":"dH0v","./en/build_distance_in_words_locale/index.js":"LZbM","./en/build_format_locale/index.js":"6DAA","./en/index.js":"Us+F","./eo/build_distance_in_words_locale/index.js":"qrnn","./eo/build_format_locale/index.js":"Bl15","./eo/index.js":"UB7v","./es/build_distance_in_words_locale/index.js":"GEfZ","./es/build_format_locale/index.js":"O+zC","./es/index.js":"/S0t","./fi/build_distance_in_words_locale/index.js":"VHtQ","./fi/build_format_locale/index.js":"Oydx","./fi/index.js":"ndVD","./fil/build_distance_in_words_locale/index.js":"uq4p","./fil/build_format_locale/index.js":"d7hw","./fil/index.js":"pNfm","./fr/build_distance_in_words_locale/index.js":"IzMR","./fr/build_format_locale/index.js":"I3Zg","./fr/index.js":"LKA2","./hr/build_distance_in_words_locale/index.js":"DPvn","./hr/build_format_locale/index.js":"puw3","./hr/index.js":"L9Jq","./hu/build_distance_in_words_locale/index.js":"w2RQ","./hu/build_format_locale/index.js":"/0iD","./hu/index.js":"Nm+E","./id/build_distance_in_words_locale/index.js":"JbvB","./id/build_format_locale/index.js":"0wlw","./id/index.js":"A6C3","./is/build_distance_in_words_locale/index.js":"qzMC","./is/build_format_locale/index.js":"S3yD","./is/index.js":"N4bE","./it/build_distance_in_words_locale/index.js":"MDEp","./it/build_format_locale/index.js":"aUJd","./it/index.js":"hmb4","./ja/build_distance_in_words_locale/index.js":"nNvt","./ja/build_format_locale/index.js":"buui","./ja/index.js":"uAXs","./ko/build_distance_in_words_locale/index.js":"oEw+","./ko/build_format_locale/index.js":"9SQf","./ko/index.js":"iW8+","./mk/build_distance_in_words_locale/index.js":"nmwZ","./mk/build_format_locale/index.js":"htxJ","./mk/index.js":"GzBU","./nb/build_distance_in_words_locale/index.js":"SL1f","./nb/build_format_locale/index.js":"CJ5F","./nb/index.js":"73vv","./nl/build_distance_in_words_locale/index.js":"Uyu0","./nl/build_format_locale/index.js":"doCD","./nl/index.js":"hCQt","./pl/build_distance_in_words_locale/index.js":"FUBD","./pl/build_format_locale/index.js":"nOYf","./pl/index.js":"B6yL","./pt/build_distance_in_words_locale/index.js":"aTPA","./pt/build_format_locale/index.js":"TTT0","./pt/index.js":"gdks","./ro/build_distance_in_words_locale/index.js":"gI+A","./ro/build_format_locale/index.js":"njjO","./ro/index.js":"r2yp","./ru/build_distance_in_words_locale/index.js":"KmPx","./ru/build_format_locale/index.js":"UUBw","./ru/index.js":"nz/o","./sk/build_distance_in_words_locale/index.js":"q2Bs","./sk/build_format_locale/index.js":"9sxn","./sk/index.js":"Wqan","./sl/build_distance_in_words_locale/index.js":"mlv2","./sl/build_format_locale/index.js":"vHkZ","./sl/index.js":"KYSo","./sr/build_distance_in_words_locale/index.js":"LlkS","./sr/build_format_locale/index.js":"RhjJ","./sr/index.js":"7mU3","./sv/build_distance_in_words_locale/index.js":"UNBN","./sv/build_format_locale/index.js":"zTNB","./sv/index.js":"hxgj","./th/build_distance_in_words_locale/index.js":"XAGa","./th/build_format_locale/index.js":"We2s","./th/index.js":"Pk+z","./tr/build_distance_in_words_locale/index.js":"aFZF","./tr/build_format_locale/index.js":"jh7A","./tr/index.js":"3ZWG","./zh_cn/build_distance_in_words_locale/index.js":"KdB7","./zh_cn/build_format_locale/index.js":"l4EP","./zh_cn/index.js":"8tMq","./zh_tw/build_distance_in_words_locale/index.js":"vyyr","./zh_tw/build_format_locale/index.js":"uYH7","./zh_tw/index.js":"QPlQ"};function a(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]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id="nw0P"},pL5B:function(e,t,n){"use strict";n.r(t),function(e){var r=n("o0o1"),a=n.n(r),i=n("q1tI"),o=n.n(i),s=n("0cfB"),c=n("Ty5D"),l=n("55Ip"),u=n("SH7X"),d=n("67rm"),f=n("ufaa"),p=n("jDpt"),h=n("le8I"),v=n("V2U0"),m=n("vYzF"),b=n("Zlyp"),y=n("snnE"),g=n("X3v2");function _(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var j=n("pZg0"),x=Object(c.f)(function(e){var t=Object(y.h)();return o.a.createElement(b.a,{noteId:e.match.params.id,returnUrl:t})}),k=function(){return o.a.createElement(c.c,null,o.a.createElement(c.a,{path:"/n/:id",component:x}),o.a.createElement(c.a,{path:"/",component:b.b}))},O=Object(u.withClient)(function(e){var t=e.client,n=w(Object(i.useState)(null),2),r=n[0],s=n[1],c=Object(i.useMemo)(function(){return Object(y.h)()},[]);return Object(i.useEffect)(function(){(function(){var e,n=(e=a.a.mark(function e(){var n;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(y.i)(t);case 3:n=e.sent,s(n),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),s(!1);case 10:case"end":return e.stop()}},e,this,[[0,7]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){_(i,r,a,o,s,"next",e)}function s(e){_(i,r,a,o,s,"throw",e)}o(void 0)})});return function(){return n.apply(this,arguments)}})()()},[]),r?o.a.createElement(b.a,{noteId:r,returnUrl:c||!1}):null!==r?o.a.createElement(b.c,null):o.a.createElement(v.a,{size:"xxlarge",middle:!0})});t.default=Object(s.hot)(e)(Object(f.a)()(Object(u.withClient)(function(e){var t=e.isPublic,n=e.breakpoints.isMobile,r=e.client,a="";if(n){var i=r.getInstanceOptions();a=Object(g.a)(i.cozyAppName,j.name)}var s=cozy.bar.BarCenter;return o.a.createElement(l.a,null,o.a.createElement(p.b,{monoColumn:!0},!t&&n&&o.a.createElement(s,null,o.a.createElement(m.a,null,a)),o.a.createElement(p.c,null,o.a.createElement(p.a,null,t?o.a.createElement(O,null):o.a.createElement(k,null))),o.a.createElement(h.a,null),o.a.createElement(d.a,null)))})))}.call(this,n("3UD+")(e))},pZg0:function(e,t){e.exports={name:"Notes",name_prefix:"Cozy",slug:"notes",icon:"icon.svg",categories:["cozy"],version:"1.5.1",licence:"AGPL-3.0",editor:"Cozy",source:"https://github.com/cozy/cozy-notes.git@build",developer:{name:"Cozy Cloud",url:"https://cozy.io"},screenshots:["screenshots/fr/screenshot01.png","screenshots/fr/screenshot02.png"],langs:["en","fr"],routes:{"/":{folder:"/",index:"index.html",public:!1},"/public":{folder:"/",index:"index.html",public:!0}},permissions:{apps:{description:"Required by the cozy-bar to display the icons of the apps",type:"io.cozy.apps",verbs:["GET"]},files:{description:"Notes as files",type:"io.cozy.files"},settings:{description:"Required by the cozy-bar to display Claudy and know which applications are coming soon",type:"io.cozy.settings",verbs:["GET"]}}}},snnE:function(e,t,n){"use strict";n.d(t,"j",function(){return h}),n.d(t,"h",function(){return m}),n.d(t,"b",function(){return b}),n.d(t,"i",function(){return y}),n.d(t,"f",function(){return _}),n.d(t,"e",function(){return w}),n.d(t,"d",function(){return j}),n.d(t,"g",function(){return x}),n.d(t,"c",function(){return k}),n.d(t,"a",function(){return O});var r=n("o0o1"),a=n.n(r),i=n("mwIZ"),o=n.n(i),s=n("AHTZ"),c=n("X3v2"),l=n("hmtS"),u=n("pZg0"),d=n.n(u);function f(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e){return new URL(e.getStackClient().uri).hostname+Math.floor(100*Math.random())}var v="returnUrl";function m(){var e=new URLSearchParams(window.location.search),t=!0,n=!1,r=void 0;try{for(var a,i=e[Symbol.iterator]();!(t=(a=i.next()).done);t=!0){var o=p(a.value,2),s=o[0],c=o[1];if(s===v)return c}}catch(l){n=!0,r=l}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}var b=function(e){var t=new URL(window.location);return t.searchParams.set(v,"#/"),t.hash="#/n/".concat(e.id),t};function y(e){return g.apply(this,arguments)}function g(){var e;return e=a.a.mark(function e(t){var n,r,i,s;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.collection("io.cozy.permissions").getOwnPermissions();case 2:return n=e.sent,r=n.data,i=r.attributes.permissions,s=o()(Object.values(i),"0.values.0"),e.abrupt("return",s);case 7:case"end":return e.stop()}},e,this)}),(g=function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){f(i,r,a,o,s,"next",e)}function s(e){f(i,r,a,o,s,"throw",e)}o(void 0)})}).apply(this,arguments)}function _(e){return e.relationships.parent.data.id}function w(e){return"/folder/".concat(e.replace(/-/g,""))}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=new URL(e.getStackClient().uri),r=e.getInstanceOptions().cozySubdomainType,a=null!==t?w(t):"";return Object(s.b)({cozyUrl:n.origin,slug:"drive",subDomainType:r,nativePath:a})}function x(e,t){return j(e,_(t))}function k(){var e=Object(c.b)(),t=Object(c.a)(e.cozyAppNamePrefix||d.a.name_prefix,""),n=Object(c.a)(e.cozyAppName,d.a.name);return""!=t?"".concat(t," ").concat(n):n}function O(e){return e.getStackClient().fetchJSON("POST","/notes",{data:{type:"io.cozy.notes.documents",attributes:{title:"",schema:l.a}}})}}}); \ No newline at end of file +!function(e){function t(t){for(var r,o,s=t[0],c=t[1],l=t[2],d=0,f=[];d<s.length;d++)o=s[d],a[o]&&f.push(a[o][0]),a[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);f.length;)f.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var c=n[s];0!==a[c]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={2:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],n=a[e];if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+""+({1:"@atlaskit-internal_media-viewer-pdf-viewer"}[e]||e)+"/notes."+{1:"a1cd0033cb516495d012"}[e]+".js"}(e);var c=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=a[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",c.name="ChunkLoadError",c.type=r,c.request=i,n[1](c)}a[e]=void 0}};var l=setTimeout(function(){i({type:"timeout",target:s})},12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var s=window.webpackJsonp=window.webpackJsonp||[],c=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var u=c;i.push([1,0]),n()}({"/KVF":function(e,t,n){var r={"./en":"7dT6","./en.json":"7dT6","./fr":"9pOX","./fr.json":"9pOX"};function a(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]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id="/KVF"},0:function(e,t){},1:function(e,t,n){n("201c"),n("7NIr"),e.exports=n("LiWt")},2:function(e,t){},3:function(e,t){},"7dT6":function(e){e.exports=JSON.parse('{"Notes":{"Add":{"add_note":"Add a note"},"EditorView":{"main_placeholder":"Write anything…"},"Editor":{"title_placeholder":"Here is your title"},"List":{"my_notes":"My Notes","name":"Name","updated_at":"Updated at","location":"Location","sharings":"Sharings"},"Empty":{"welcome":"Welcome on Cozy Notes","after_created":"Once your Note is created, you can find it in your "}},"Error":{"unshared_title":"This share is no longer active","unshared_text":"The owner may have revoked this sharing. You can no longer edit a note at this address.","loading_error_title":"The note couldn\'t be loaded","loading_error_text_noReturnUrl":"The note may not exists anymore, or our servers may have a temporary glitch. Please try again later.","loading_error_text_returnUrl":"The note may not exists anymore, or our servers may have a temporary glitch. Please go <a href=\'%{url}\'>back</a> and try again later."},"manifest":{"short_description":"Cozy Notes is your personal and collaborative note-taking application.","long_description":"Notes is an online text editor that can already offer you to:\\n\\n* Create your own notes with the essential features (bold, underlined, links, tables...)\\n* Fill and find your notes with you other documents in files of your personal Drive\\n* Edit easily your notes from all your devices\\n* Access your notes offline\\n* For the fans, use shortcuts and input in markdown format ... and even write with contacts together on the same note (coming soon)!","screenshots":["screenshots/en/screenshot01.png","screenshots/en/screenshot02.png"]}}')},"9pOX":function(e){e.exports=JSON.parse('{"Notes":{"Add":{"add_note":"Ajouter une note"},"EditorView":{"main_placeholder":"Écrivez ce que vous souhaitez…"},"Editor":{"title_placeholder":"Ici votre titre"},"List":{"my_notes":"Mes Notes","name":"Nom","updated_at":"Mise à jour","location":"Emplacement","sharings":"Partage"},"Empty":{"welcome":"Bienvenue sur Cozy Notes","after_created":"Une fois votre note créée, il vous est possible de la retrouver dans "}},"Error":{"unshared_title":"Le partage n\'est plus actif","unshared_text":"Le propriétaire a peut-être révoqué ce partage. Vous ne pouvez plus éditer de note à cette adresse.","loading_error_title":"La note n\'a pas pu être chargée","loading_error_text_noReturnUrl":"Cette note n\'existe peut-être plus, ou nos serveurs ont peut-être un moment d\'égarrement. Merci de retenter plus tard.","loading_error_text_returnUrl":"Cette note n\'existe peut-être plus, ou nos serveurs ont peut-être un moment d\'égarrement. Merci revenir <a href=\'%{url}\'>en arrière</a> et de retenter plus tard."},"manifest":{"short_description":"Cozy Notes est votre application de prise de notes personnelles et collaboratives.","long_description":"Notes est un éditeur de texte en ligne destiné à :\\n\\n* Créer vos propres notes avec les fonctionnalités essentielles (gras, souligné, liens, tableaux...)\\n* Classer et retrouver vos notes avec vos autres documents, dans les répertoires de votre Drive personnel\\n* Éditer facilement vos notes depuis tous vos appareils\\n* Accéder à vos notes, même sans internet, stockées sur votre PC\\n* Pour les aficionados, utiliser les raccourcis et la saisie au format markdown\\n* ... et même écrire à plusieurs simultanément sur la même note (à venir) ! ","screenshots":["screenshots/fr/screenshot01.png","screenshots/fr/screenshot02.png"]}}')},G2JP:function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r).a.createContext(!1);t.a=a},LiWt:function(e,t,n){"use strict";n.r(t);n("llna"),n("/8/d"),n("3FT0"),n("VxdY");var r,a=n("q1tI"),i=n.n(a),o=n("JRPe"),s=n("SH7X"),c=n.n(s),l=n("i8i4"),u=n("buk/"),d=n("Le8U"),f=n("G2JP"),p=n("X3v2"),h=n("pZg0"),v={en:{react:n("PTt1"),atlaskit:n("eFxx").default},fr:{react:n("Z6Ro"),atlaskit:n("XCed").default}};Object(o.d)(v.en.react),Object(o.d)(v.fr.react);document.addEventListener("DOMContentLoaded",function(){var e=Object(p.b)(),t=Object(p.a)(e.cozyIconPath,n("ZAKO")),a=Object(p.a)(e.cozyAppNamePrefix||h.name_prefix,""),m=Object(p.a)(e.cozyAppName,h.name),b=Object(p.a)(e.cozyAppSlug,h.slug),y=Object(p.a)(e.cozyAppVersion,h.version);r=Object(p.a)(e.cozyLocale,"en");var g=window.location?window.location.protocol:"https:",_=Object(p.c)(),w=_||e.cozyToken,j=_||!w||""==w,x=new c.a({uri:"".concat(g,"//").concat(e.cozyDomain),token:w,appMetadata:{slug:b,version:y}});d.Document.cozyClient||d.Document.registerClient(x),j||cozy.bar.init({appName:m,appNamePrefix:a,iconPath:t,lang:r,replaceTitleOnMobile:!0,cozyClient:x,isPublic:j}),function(e,t){var a=n("pL5B").default;Object(l.render)(i.a.createElement(u.b,{lang:r,dictRequire:function(e){return n("/KVF")("./".concat(e))}},i.a.createElement(o.c,{locale:r,messages:v[r].atlaskit},i.a.createElement(s.CozyProvider,{client:e},i.a.createElement(f.a.Provider,{value:t},i.a.createElement(a,{isPublic:t}))))),document.querySelector("[role=application]"))}(x,j)})},Q2Eh:function(e,t,n){e.exports={"note-article":"note-article--2yQdC"}},RMII:function(e,t,n){e.exports={empty:"empty--FqnXy",appHeader:"appHeader--2ilS0",tableSpecialRow:"tableSpecialRow--4oekp",tableCellEmpty:"tableCellEmpty--21fZ1",tableCellName:"tableCellName--2Jak9",tableCell:"tableCell--3-jDP",tableRow:"tableRow--3SicR"}},VxdY:function(e,t,n){},X3v2:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a}),n.d(t,"c",function(){return i});n("dasq");var r=function(){return document.querySelector("[role=application]").dataset},a=function(e,t){return/^\{\{\.[a-zA-Z]*\}\}$/.test(e)?t:e},i=function(){return new URLSearchParams(window.location.search).get("sharecode")}},ZAKO:function(e,t){e.exports="/img/icon.f72378381a11b6129372a35089fea845.svg"},Zlyp:function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r),i=n("X+Uv"),o=n("ufaa"),s=n("SH7X"),c=n("kyGY"),l=n("buk/"),u=Object(o.a)()(Object(l.c)()(function(e){var t=e.t;return!e.breakpoints.isMobile&&a.a.createElement(c.b,null,t("Notes.List.my_notes"))})),d=n("7YkG"),f=n("V2U0"),p=n("GoJ1"),h=n("o0o1"),v=n.n(h),m=n("KXWi"),b=n("780l"),y=n("snnE");function g(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){g(i,r,a,o,s,"next",e)}function s(e){g(i,r,a,o,s,"throw",e)}o(void 0)})}}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var j=Object(s.withClient)(function(e){var t=e.client;return a.a.createElement(b.a,{onClick:_(v.a.mark(function e(){var n,r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(y.a)(t);case 2:n=e.sent,r=n.data,window.location.href=Object(y.b)(r);case 5:case"end":return e.stop()}},e,this)})),icon:"plus",className:"u-c-pointer"})}),x=Object(l.c)()(Object(s.withClient)(function(e){var t=e.t,n=e.className,i=e.client,o=w(Object(r.useState)(!1),2),s=o[0],c=o[1],l=Object(r.useCallback)(_(v.a.mark(function e(){var t,n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.next=3,Object(y.a)(i);case 3:t=e.sent,n=t.data,window.location.href=Object(y.b)(n);case 6:case"end":return e.stop()}},e,this)})),[]);return a.a.createElement(m.c,{onClick:l,type:"submit",busy:s,icon:"plus",label:t("Notes.Add.add_note"),extension:"narrow",className:n})})),k=n("4BeY"),O=n.n(k),E=n("IaFt"),C=n.n(E),S=new O.a({id:"icon_note_empty_77efa79dd615f19897a8ed6ec9097298",use:"icon_note_empty_77efa79dd615f19897a8ed6ec9097298-usage",viewBox:"0 0 171 168",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 171 168" id="icon_note_empty_77efa79dd615f19897a8ed6ec9097298">\n <defs>\n <path id="icon_note_empty_77efa79dd615f19897a8ed6ec9097298_a" d="M.02.12h36.532v20.674H.02z" />\n </defs>\n <g fill="none" fill-rule="evenodd">\n <path fill="#0DCBCF" d="M48.367 47.28c3.795-4.135 9.702 2.27 5.938 6.374-8.105 8.832-11.21 22.848-5.617 33.864 6.83 13.453 25.138 8.377 36.387 4.37 5.26-1.871 7.054 6.655 1.834 8.515-15.343 5.464-37.282 8.714-45.942-8.858-7.276-14.767-3.455-32.433 7.4-44.265" />\n <path fill="#D6FAFB" d="M59.57 16.922c.739-4.162 1.797-8.167 3.764-11.417C66.807-.21 73.009-.675 79.69.561c3.047.47 76.99 11.012 78.873 11.76 6.957 2.843 7.343 8.129 5.837 14.148-.141.971-20.067 84.443-21.43 88.854-1.852 5.978-4.906 11.375-10.609 11.973-5.714.623-75.27-18.403-78.5-19.534-3.954-1.39-5.72-3.632-6.159-6.323-.603-1.443-.376-3.088-.067-5.144.8-5.412 8.228-69.79 11.935-79.373" />\n <path fill="#FFF" d="M65.047 19.073S64.561 3.301 79.004 5.122c14.443 1.819 89.593 13.951 89.593 13.951v9.972l-15.17 7.281-88.38-17.253z" />\n <path fill="#ACF5F7" d="M53.622 31.458c.246-4.25.829-8.372 2.413-11.844 2.795-6.122 8.927-7.314 15.747-6.87 3.103.105 6.245.706 8.959 1.155 13.33 2.21 60.933 9.536 62.437 9.936.853.239 3.242 1.012 3.93 1.337 5.173 2.422 4.26 6.643 3.56 12.102-.023.988-10.066 86.694-10.903 91.263-1.155 6.187-3.561 11.933-9.185 13.21-5.636 1.297-77.342-9.496-80.695-10.235-4.111-.928-6.143-2.958-6.897-5.597-.781-1.368-.738-3.034-.675-5.12.157-5.506 8.735-79.333 11.309-89.337" />\n <path fill="#79ECEE" d="M134.818 99.416c4.069-24.17 8.504-48.43 11.948-72.677.037-.293.209-1.305.35-1.515-.04-.744 2.317.264 4.506.067.068 0 .925-.114.992-.114.716-.138 1.42-.29 2.149-.552 3.554-1.285 4.98-4.27 4.938-7.584-.046-2.971-2.376-4.28-2.285-5.071.047-.427 2.619.902 2.915 1 .405.133 3.131 1.892 4.372 4.065 1.249 2.19.856 5.296.785 8.049-.244 9.277-8.008 66.518-9.51 78.49.026.153-.358 3.1-.546 4.417-.38 2.901-.772 5.807-1.182 8.707-.319 2.271-1.653 15.153-1.929 15.747-3.391 7.361-12.892 9.872-20.513 9.34-.434.025-.851-.016-1.524-.102-.844-.108-2.024.034-3.35-.235.145-2.458 5.937-30.472 7.884-42.032" />\n <path fill="#FFF" d="M98.24 56.354c3.65-6.425 11.472-9.96 18.354-7.212a10.488 10.488 0 0 1 4.359 2.129c.117.074.22.173.33.253.099.086.2.171.29.253a10.141 10.141 0 0 1 3.012 3.703c.14.243.285.483.408.733.028.087.095.136.12.22.089.233.126.462.208.7.4 1.024.667 2.088.785 3.213.399 2.397.348 4.8-.468 7.371-1.431 4.512-6.871 6.769-11.066 7.466-3.062.503-6.549-.22-9.546-1.52-4.286-1.86-5.61-4.269-6.733-7.469-1.146-3.274-1.878-6.632-.054-9.84M57.875 49.863c1.7-3.323 4.417-5.416 7.697-6.62.072-.048.117-.104.197-.162 2.037-1.45 4.806-2 7.4-1.642 6.076.399 11.603 5.645 13.426 11.64.926 3.055.816 6.827-.747 9.66-2.345 4.249-6.24 6.338-10.86 7.305-7.715 1.625-16.183-3.686-18.103-11.22-.745-2.904-.38-6.293.99-8.961" />\n <path fill="#FFF" d="M97.573 60.005c.542 1.111 2.285 1.832 3.325 1.161 1.116-.715 1.315-2.42.479-3.462-.451-.557-1.063-.82-1.666-.79a.296.296 0 0 0-.235-.062c-1.392.108-2.635 1.68-1.903 3.153M82.511 58.042c.543 1.11 2.287 1.83 3.325 1.159 1.12-.72 1.318-2.42.479-3.46-.453-.558-1.059-.82-1.668-.791a.295.295 0 0 0-.227-.065c-1.4.11-2.637 1.679-1.909 3.157" />\n <path fill="#FFF" d="M83.12 55.648c.916-3.33 5.387-5.305 8.553-5.085 3.765.266 8.59 3.494 9.277 7.454.373 2.132-3.201 2.492-3.554.466-.782-4.47-8.893-6.614-10.702-2.003-.036.357-.226.713-.675 1.002-.022.023-.05.037-.07.05-1.412.921-3.292-.203-2.83-1.884" />\n <path fill="#79ECEE" d="M130.887 48.194c1.972 3.09 7.333 4.648 10.183 2.337 3.064-2.497 3.1-7.587.281-10.373-1.511-1.495-3.399-2.072-5.16-1.798a1.058 1.058 0 0 0-.718-.108c-4.064.775-7.221 5.81-4.586 9.942M127.85 77.94c1.733 2.724 6.45 4.093 8.956 2.058 2.697-2.199 2.723-6.673.244-9.122-1.327-1.316-2.985-1.825-4.536-1.582a.938.938 0 0 0-.63-.094c-3.578.679-6.353 5.109-4.034 8.74M123.467 106.767c1.607 2.793 6.26 4.374 8.854 2.454 2.796-2.074 3.021-6.54.654-9.102-1.267-1.375-2.901-1.949-4.46-1.781a.948.948 0 0 0-.627-.127c-3.603.52-6.573 4.823-4.42 8.556" />\n <path fill="#D6FAFB" d="M134.92 71.16l.384-.004c3.34-.056 4.832 2.564 4.435 4.87.819 3.035 6.732 4.083 9.188 4.55 3.327.638 6.204.138 7.935-1.695a5.354 5.354 0 0 0 .518-.67c.964-1.44 1.663-2.972 2.485-4.46.207-1.606.413-3.208.626-4.844 1.045.01 7.44.93 7.404 5.085-.061 7.397-4.113 11.963-9.873 13.901.007-.076.018-.156.03-.233a.106.106 0 0 0-.042.013l.012.22c-2.516.844-5.377 1.193-8.431 1.044-7.434-.364-19.518-4.398-19.253-13.56.07-2.467 2.191-4.176 4.582-4.217M155.979 103.575c.026.15-.358 3.097-.548 4.415-.379 2.903-.77 5.807-1.182 8.708-.04.298-.1.792-.173 1.41-.423.111-.846.232-1.267.325-9.933 2.216-23.748-2.264-26.83-12.978-1.387-4.823 5.737-6.845 8.28-3.535 3.25 3.006 6.375 4.279 10.726 4.987 2.315.378 9.589 1.174 10.133-1.001l.86-2.331z" />\n <path fill="#D6FAFB" d="M155.43 107.99c.19-1.318.575-4.264.549-4.415.141-1.139.343-2.691.587-4.57 1.43-.943 3.35-1.181 4.91-.156 4.028 2.644 5.269 6.247 3.534 10.833-1.791 4.722-6.312 7.18-10.936 8.425.075-.617.134-1.11.175-1.409.412-2.901.803-5.805 1.182-8.708" />\n <path fill="#0DCBCF" d="M97.295 86.818c.143-.42-.082-.821-.543-.907l-15.969-2.926c-.445-.086-.826.224-.826.667 0 0-.792 8.124 7.2 9.59 7.994 1.46 10.138-6.424 10.138-6.424M106.717 66.413a2.628 2.628 0 0 0 2.9-2.325c.148-1.137.803-3.051 3.438-2.757 2.873.313 2.836 2.714 2.758 3.44a2.632 2.632 0 0 0 2.32 2.906 2.635 2.635 0 0 0 2.902-2.328c.367-3.341-1.301-8.563-7.404-9.24-6.1-.67-8.868 4.061-9.233 7.399a2.623 2.623 0 0 0 2.319 2.905M65.97 60.55a2.618 2.618 0 0 0 2.898-2.323c.154-1.135.809-3.045 3.444-2.756 2.873.32 2.836 2.715 2.758 3.446a2.628 2.628 0 0 0 2.324 2.898 2.633 2.633 0 0 0 2.896-2.326c.369-3.336-1.295-8.561-7.399-9.232-6.107-.682-8.87 4.055-9.24 7.395a2.62 2.62 0 0 0 2.319 2.898M7.328 107.186s-4.037-2.086 6.805-8.374c10.108-5.864 7.278 10.253 7.278 10.253l-14.083-1.88z" />\n <path fill="#DFFCFC" d="M77.122 128.065c-3.962-7.31-6.318-14.535-8.397-21.528-3.496-11.78-4.837-23.725-10.418-35.926-.384-.842-1.51-1.893-2.359-2.092a1247.17 1247.17 0 0 1-45.203-11.481C5.086 55.485.713 55.304.083 59.109c-.007.039-.016.076-.022.12-.14.995-.046 2.243.353 3.81.19.754.696 1.372 1.281 1.841C4.793 75.29 6.898 85.406 10.32 95.907c3.831 11.75 8.712 23.72 12.591 35.483.415 1.26 1.806 2.668 3.07 2.721.323.013.648.028.971.04 3.006 1.149 30.837 7.319 41.229 8.583 4.412.538 18.182 5.133 17.55-.856-.335-3.168-7.048-10.931-8.61-13.813" />\n <path fill="#0DCBCF" d="M24.169 106.068c-4.748.862-9.072.078-13.23-2.376-3.782-2.232-6.633 3.978-2.878 6.194a24.375 24.375 0 0 0 16.752 2.983c4.29-.779 3.694-7.587-.644-6.801" />\n <path fill="#0DCBCF" d="M26.43 113.925c-4.822.208-9-1.152-12.787-4.147-3.445-2.725-7.11 3.043-3.69 5.747a24.362 24.362 0 0 0 16.193 5.225c4.356-.19 4.689-7.017.284-6.825" />\n <path fill="#0DCBCF" d="M27.7 121.497c-4.773-.725-8.608-2.867-11.746-6.535-2.856-3.338-7.566 1.615-4.73 4.929a24.372 24.372 0 0 0 14.88 8.249c4.313.653 5.952-5.982 1.595-6.643" />\n <path fill="#D6FAFB" d="M56.82 163.387c2.634 1.707 9.394 3.19 14.841 3.785 14.866 1.625 35.651.773 44.451-2.186 8.875-2.98 9.27-7.505-13.293-9.77-19.21-1.926-41.628.772-46.423 4.818-1.286 1.083-1.211 2.293.423 3.353" />\n <path fill="#FFF" d="M85.93 121.501l-8.872-2.495 5.144-7.99 53.966-19.197a4.453 4.453 0 0 1 5.686 2.7l.746 2.099a4.45 4.45 0 0 1-2.702 5.686L85.93 121.5z" />\n <path fill="#0DCBCF" d="M154.388 66.712c-4.389-3.498-9.232 3.746-4.877 7.216 9.374 7.469 14.612 20.835 10.794 32.583-4.663 14.35-23.538 12.171-35.273 9.956-5.483-1.035-5.935 7.667-.492 8.695 16.003 3.021 38.184 2.835 44.015-15.867 4.9-15.715-1.61-32.577-14.167-42.583" />\n <path fill="#0DCBCF" d="M117.57 120.966c-.858-.505-1.8-.82-2.724-.954.007-.692-.294-1.44-.896-2.045a5.36 5.36 0 0 0-1.042-.795c.604-.217 1.24-.4 1.767-.57 4.603-1.484-.888-7.006-5.49-5.523-4.248 1.372-8.193 3.504-7.248 7.418.244 1.01 1.247 2.234 2.773 2.788.09.031.177.056.268.09.235 1.784 2.018 3.698 4.6 4.72.32.126.656.225.99.326.556 1.45 2.692 2.89 4.895 2.99 5.026.234 8.746-1.607 9.6-4.766.4-1.491-1.568-3.332-3.883-3.906-1.418-.35-2.69-.218-3.61.227" />\n <path fill="#0DCBCF" d="M116.74 108.083c-2.338-.522-12.208 2.855-5.111 5.063 1.627.505 1.248.814 2.754 1.558-.564.2-1.05.473-1.4.824-2.277.728-2.681 3.583-1.654 5.93 1.48 3.38 2.415 7.939 7.426 7.805 5.597-.148 12.373-6.007 12.023-9.417-.211-2.065-1.65-5.025-4.013-6.767-1.204-.887-7.684-4.475-10.024-4.996" />\n <path fill="#0DCBCF" d="M118.038 108.505s-11.852-4.477-13.846-1.858c-1.799 2.363-5.817 10.49-3.131 10.95 2.683.463 10.129-2.62 10.129-2.62l6.848-6.472z" />\n <g transform="translate(134.244 38.595)">\n <mask id="icon_note_empty_77efa79dd615f19897a8ed6ec9097298_b" fill="#fff">\n <use xlink:href="#icon_note_empty_77efa79dd615f19897a8ed6ec9097298_a" />\n </mask>\n <path fill="#D6FAFB" d="M9.325 7.036c.397 5.93 8.7 6.329 13.777 4.795.42-.158.845-.317 1.23-.505a9.225 9.225 0 0 0 1.389-.872c.082-.06.995-.824 1.133-.954 1.086-1.008 2.065-2.238 2.415-3.433.248-2.072.485-4.087.695-5.947a8.54 8.54 0 0 1 2.63 1.137C34 2.191 34.869 3.2 35.499 4.768c.088.213.125.438.17.665.332.608.553 1.271.557 1.963 1.55 5.622-2.602 9.814-8.58 11.908.032-.244.058-.477.09-.717-.01.004-.02.011-.029.015-.018.233-.03.458-.061.702C17.12 22.994.906 20.164.03 7.036c-.365-5.393 8.932-5.393 9.294 0" mask="url(#icon_note_empty_77efa79dd615f19897a8ed6ec9097298_b)" />\n </g>\n <path fill="#ACF5F7" d="M67.018 83.907a4.967 4.967 0 1 1-9.935 0 4.966 4.966 0 0 1 4.967-4.967 4.967 4.967 0 0 1 4.968 4.967M73.57 105.824a4.967 4.967 0 1 1-9.935 0 4.966 4.966 0 0 1 4.966-4.966 4.967 4.967 0 0 1 4.969 4.966M80.564 124.544a4.967 4.967 0 0 1-4.968 4.966 4.966 4.966 0 0 1-4.967-4.966 4.967 4.967 0 1 1 9.935 0" />\n </g>\n</symbol>'}),M=(C.a.add(S),S),z=n("Le8U");function P(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var I={_type:"io.cozy.apps",_id:"io.cozy.apps/notes"},D=function(e){var t=N(Object(r.useState)(Object(y.d)(e)),2),n=t[0],a=t[1];return Object(r.useEffect)(function(){var t,n;(t=v.a.mark(function t(){var n,r;return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,z.CozyFolder.getReferencedFolders(I);case 3:n=t.sent,r=Object(y.d)(e,n[0]._id),a(r),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),a(Object(y.d)(e));case 11:case"end":return t.stop()}},t,this,[[0,8]])}),n=function(){var e=this,n=arguments;return new Promise(function(r,a){var i=t.apply(e,n);function o(e){P(i,r,a,o,s,"next",e)}function s(e){P(i,r,a,o,s,"throw",e)}o(void 0)})},function(){return n.apply(this,arguments)})()},[]),{notesFolder:n}},T=n("sCMN"),A=Object(l.c)()(Object(s.withClient)(function(e){var t=e.t,n=e.client,r=D(n).notesFolder;return a.a.createElement("div",{className:"empty"},a.a.createElement(p.a,{id:"empty",icon:M,title:t("Notes.Empty.welcome"),text:a.a.createElement(T.a,{href:r,slug:"drive"},function(e){var n=e.href,r=e.onClick;return a.a.createElement("span",{className:"u-mb-half"},t("Notes.Empty.after_created")," ",a.a.createElement("a",{href:n,onClick:r},"Cozy Drive"),".")})},a.a.createElement(x,{className:"u-mt-1"})))})),F=n("y6ex"),q=n("RMII"),U=n.n(q),B=new O.a({id:"icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d",use:"icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d">\n<style type="text/css">\n\t#icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#ACF5F7;}\n\t#icon-note-32_0b87f187ce7a65cb93dbf28b37a73b8d .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#0DCBCF;}\n</style>\n<g transform="translate(2)">\n\t<path class="st0" d="M0,2c0-1.1,0.9-2,2-2h22c1.1,0,2,0.9,2,2v28c0,1.1-0.9,2-2,2H2c-1.1,0-2-0.9-2-2V2z" />\n\t<path class="st1" d="M6,8h14v2H6V8z M6,12h8v2H6V12z M6,16h14v2H6V16z M6,20h10v2H6V20z" />\n</g>\n<g transform="translate(0 4)">\n\t<path class="st1" d="M1.5,0h2C4.3,0,5,0.7,5,1.5l0,0C5,2.3,4.3,3,3.5,3h-2C0.7,3,0,2.3,0,1.5l0,0C0,0.7,0.7,0,1.5,0z" />\n\t<path class="st1" d="M1.5,7h2C4.3,7,5,7.7,5,8.5l0,0C5,9.3,4.3,10,3.5,10h-2C0.7,10,0,9.3,0,8.5l0,0C0,7.7,0.7,7,1.5,7z" />\n\t<path class="st1" d="M1.5,14h2C4.3,14,5,14.7,5,15.5l0,0C5,16.3,4.3,17,3.5,17h-2C0.7,17,0,16.3,0,15.5l0,0C0,14.7,0.7,14,1.5,14z" />\n\t<path class="st1" d="M1.5,21h2C4.3,21,5,21.7,5,22.5l0,0C5,23.3,4.3,24,3.5,24h-2C0.7,24,0,23.3,0,22.5l0,0C0,21.7,0.7,21,1.5,21z" />\n</g>\n<g>\n\t<path class="st1" d="M31.4,18.4l-2.8-2.8c0.8-0.8,2-0.8,2.8,0S32.2,17.6,31.4,18.4z" />\n\t<path class="st1" d="M30.7,19.1L20.8,29l-2.5,0.9c-0.5,0.2-1.1-0.1-1.3-0.6c-0.1-0.2-0.1-0.5,0-0.7l0.9-2.5l9.9-9.9L30.7,19.1z" />\n</g>\n</symbol>'}),L=(C.a.add(B),B),R=Object(o.a)()(Object(l.c)()(function(e){var t=e.note,n=e.f,r=e.breakpoints.isMobile,i=z.CozyFile.splitFilename(t),o=i.filename,s=i.extension;return a.a.createElement(d.f,{className:"u-c-pointer ".concat(U.a.tableRow),onClick:function(){return window.location.href=Object(y.b)(t)}},a.a.createElement(d.c,{className:"".concat(U.a.tableCellName," u-flex u-flex-items-center u-ellipsis u-fz-medium")},a.a.createElement(F.a,{icon:L,size:32,className:"u-mr-1 u-flex-shrink-0"}),a.a.createElement("span",{className:"u-charcoalGrey"},o),a.a.createElement("span",null,s)),!r&&a.a.createElement(a.a.Fragment,null,a.a.createElement(d.c,{className:U.a.tableCell},n(t.updated_at,"DD MMMM")),a.a.createElement(d.c,{className:U.a.tableCell},"—"),a.a.createElement(d.c,{className:U.a.tableCell},"—")))})),Q=function(){return a.a.createElement(d.f,{className:U.a.tableSpecialRow},a.a.createElement(d.c,{className:U.a.tableCellEmpty},a.a.createElement(A,null)))},V=function(){return a.a.createElement(d.f,{className:U.a.tableSpecialRow},a.a.createElement(d.c,{className:"".concat(U.a.tableCellEmpty," u-ta-center")},a.a.createElement(f.a,{size:"xxlarge"})))},J=Object(l.c)()(function(e){var t=e.t,n=e.notes,r=e.fetchStatus;return a.a.createElement(d.a,null,a.a.createElement(d.d,null,a.a.createElement(d.f,null,a.a.createElement(d.e,{className:U.a.tableCellName},t("Notes.List.name")),a.a.createElement(d.e,{className:U.a.tableCell},t("Notes.List.updated_at")),a.a.createElement(d.e,{className:U.a.tableCell},t("Notes.List.location")),a.a.createElement(d.e,{className:U.a.tableCell},t("Notes.List.sharings")))),a.a.createElement(d.b,null,"loading"===r?a.a.createElement(V,null):0===n.length?a.a.createElement(Q,null):n.map(function(e){return a.a.createElement(R,{note:e,key:e._id})})))}),H=n("BkRI"),Z=n.n(H),G=n("mwIZ"),X=n.n(G);function W(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function K(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Y=function(e){var t=K(Object(r.useState)([]),2),n=t[0],a=t[1],i=K(Object(r.useState)("loading"),2),o=i[0],s=i[1];return Object(r.useEffect)(function(){var t,n;(t=v.a.mark(function t(){var n,r,i,o,c;return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.query(e.all("io.cozy.files").where({cozyMetadata:{createdByApp:"notes"},trashed:!1,updated_at:{$gt:null}}).sortBy([{"cozyMetadata.createdByApp":"desc"},{updated_at:"desc"}]).indexFields(["cozyMetadata.createdByApp","updated_at"]));case 3:return n=t.sent,r=n.data,i=r.map(function(t){return e.getStackClient().fetchJSON("GET","/notes/".concat(t._id))}),t.next=8,Promise.all(i);case 8:o=t.sent,(c=Z()(r)).forEach(function(e,t){e.name=X()(o[t],"data.attributes.name",e.name)}),a(c),s("loaded"),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(0),s("errored"),console.log({error:t.t0});case 19:case"end":return t.stop()}},t,this,[[0,15]])}),n=function(){var e=this,n=arguments;return new Promise(function(r,a){var i=t.apply(e,n);function o(e){W(i,r,a,o,s,"next",e)}function s(e){W(i,r,a,o,s,"throw",e)}o(void 0)})},function(){return n.apply(this,arguments)})()},[]),{fetchStatus:o,data:{notes:n}}},$=function(e,t){return"loaded"===e&&t.length>0},ee=Object(o.a)()(Object(s.withClient)(function(e){var t=e.breakpoints.isMobile,n=e.client,r=cozy.bar.BarRight,o=Y(n),s=o.data.notes,c=o.fetchStatus;return a.a.createElement(a.a.Fragment,null,a.a.createElement(i.a,{className:"u-mt-1 u-mt-0-m"},a.a.createElement("div",{className:"".concat(U.a.appHeader," u-flex u-flex-justify-between u-flex-items-center")},a.a.createElement(u,null),!t&&$(c,s)&&a.a.createElement(x,null)),a.a.createElement(J,{notes:s,fetchStatus:c})),t&&$(c,s)&&a.a.createElement(r,null,a.a.createElement(j,null)))})),te=n("k4o+"),ne=n("9jEr"),re=n("jWvl"),ae=n("KXVJ"),ie={allowTables:!0,allowRule:!0,allowLists:!0,allowTextColor:!0,allowPanel:!0},oe=function(e){return a.a.createElement("header",{className:"page-header-menu "+(e.className||"")},a.a.createElement("div",{className:"page-header-menu--left"},e.left),e.children,a.a.createElement("div",{className:"page-header-menu--right"},e.right))},se=n("Q2Eh"),ce=n.n(se);function le(){return(le=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)}function ue(e){e.style.height="".concat(e.scrollHeight,"px")}var de=Object(l.c)()(function(e){var t=e.defaultValue,n=e.onTitleChange,i=e.onTitleBlur,o=e.onContentChange,s=e.defaultTitle,l=e.title,u=e.collabProvider,d=e.leftComponent,f=e.rightComponent,p=e.t,h=Object(r.useRef)(null),v=Object(r.useCallback)(function(e){ue(e.target),n&&n(e)},[n]);return Object(r.useEffect)(function(){return ue(h.current)},[]),Object(ae.a)(h.current,"blur",i),a.a.createElement("article",{className:ce.a["note-article"]},a.a.createElement("style",null,"#coz-bar ","{ display: none }"),a.a.createElement(oe,{left:d,className:"note-header-menu--editing",right:f}),a.a.createElement("section",{className:"note-editor-container"},a.a.createElement(te.a,le({collabEdit:u,onChange:o,defaultValue:t},ie,{appearance:"full-page",placeholder:p("Notes.EditorView.main_placeholder"),shouldFocus:!0,contentComponents:a.a.createElement(ne.a,{render:function(){return a.a.createElement(c.b,{tag:"h1",className:"note-title"},a.a.createElement(re.a,{ref:h,rows:"1",fullwidth:!0,value:l,onChange:v,placeholder:s,className:"note-title-input"}))}})}))))});var fe=function(){return a.a.createElement("div",null,a.a.createElement(f.a,{size:"xxlarge",middle:!0}))};var pe=Object(l.c)()(function(e){var t=e.t,n=e.returnUrl;return a.a.createElement(p.a,{icon:"cross-small",title:t("Error.loading_error_title"),text:a.a.createElement("p",{className:"u-mb-half",dangerouslySetInnerHTML:{__html:n?t("Error.loading_error_text_returnUrl",{url:n}):t("Error.loading_error_text_noReturnUrl")}})})}),he=n("UmWK"),ve=n("AQIY");function me(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=Object(ve.a)(he.c);function _e(e,t,n){var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ye(e,t,n[t])})}return e}({id:e},t),a=s.models.file.normalize(r);return n&&n.path?s.models.file.ensureFilePath(a,n):a}var we=Object(s.withClient)(function(e){var t=e.client,n=be(Object(r.useState)(void 0),2),i=n[0],o=n[1],s=e.file.id||e.file._id,c=Object(r.useMemo)(function(){return _e(s,e.file,i)},[s,i]);Object(r.useEffect)(function(){function e(){var n;return n=v.a.mark(function e(n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.query(t.get("io.cozy.files",n.attributes.dir_id));case 3:r=e.sent,o(r.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.warn("Request failed when try to fetch the parent ".concat(n.attributes.dir_id," of io.cozy.files ").concat(n.id||n._id));case 10:case"end":return e.stop()}},e,this,[[0,7]])}),(e=function(){var e=this,t=arguments;return new Promise(function(r,a){var i=n.apply(e,t);function o(e){me(i,r,a,o,s,"next",e)}function s(e){me(i,r,a,o,s,"throw",e)}o(void 0)})}).apply(this,arguments)}!function(t){e.apply(this,arguments)}(c)},[c.attributes.dir_id]);var l=be(Object(r.useState)(!1),2),u=l[0],d=l[1],f=Object(r.useCallback)(function(){return d(!u)},[]),p=Object(r.useCallback)(function(){return d(!1)},[]),h=c.id;return i&&a.a.createElement(ge,{doctype:c.type,documentType:"Notes"},a.a.createElement(he.a,{theme:"primary",docId:h,onClick:f,label:"",extension:"narrow",iconOnly:!0}),u&&a.a.createElement(he.b,{document:c,onClose:p}))||null}),je=n("55Ip"),xe=n("G2JP");function ke(e){var t=e.returnUrl,n=e.file,i=Object(r.useContext)(xe.a);if(t){var o=Object(y.e)(Object(y.f)(n));return a.a.createElement(T.a,{slug:"drive",href:t,nativePath:o},function(e){var t=e.onClick,n=e.href;return a.a.createElement(m.b,{icon:"previous",onClick:t,href:n,className:"sto-app-back",subtle:!0})})}return i?null:a.a.createElement(m.a,{icon:"previous",tag:je.b,to:"/",className:"sto-app-back",subtle:!0})}var Oe=n("cjKa"),Ee=n("O1Kf"),Ce=n("bfWj");function Se(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function Me(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){Se(i,r,a,o,s,"next",e)}function s(e){Se(i,r,a,o,s,"throw",e)}o(void 0)})}}function ze(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)}}var Pe=function(){var e,t=new Promise(function(t){e=t});return t.resolved=!1,t.resolve=function(){return e(),t.resolved=!0,t},t},Ne=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.service=n,this.eventEmitter=new Oe.EventEmitter2,this.resetBackoff(),this.initializeStepsQueue(),this.isSending=!1,this.emptyQueuePromise=Pe().resolve()}var t,n,r,a,i,o,s,c,l;return t=e,(n=[{key:"resetBackoff",value:function(){this.backoff=0,this.failures=0}},{key:"increaseBackoff",value:function(){this.failures=this.failures+1,this.failures%4==0&&this.emit("needcatchup",{failures:this.failures}),this.backoff=Math.max(Math.min(2*this.backoff,3e5),128)}},{key:"afterBackoff",value:function(){var e=this;return new Promise(function(t){e.backoff<128?t():window.setTimeout(t,e.backoff)})}},{key:"initializeStepsQueue",value:function(){this.queuedStep=void 0}},{key:"ensureEmptyQueue",value:(l=Me(v.a.mark(function e(){return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.emptyQueuePromise);case 1:case"end":return e.stop()}},e,this)})),function(){return l.apply(this,arguments)})},{key:"enqueueSteps",value:function(e){var t=e.getState,n=e.state,r=e.localSteps;this.emptyQueuePromise.resolved&&(this.emptyQueuePromise=Pe()),this.queuedStep={getState:t,state:n,localSteps:r}}},{key:"dequeueSteps",value:function(){var e=this.queuedStep,t=e.getState,n=e.state||t(),r=e.localSteps||Object(Ee.sendableSteps)(n)||{steps:[]};return this.queuedStep=void 0,{getState:t,state:n,localSteps:r}}},{key:"hasQueuedSteps",value:function(){return!!this.queuedStep}},{key:"rebaseStepsInQueue",value:function(){this.queuedStep&&(this.queuedStep={getState:this.queuedStep.getState})}},{key:"sendSteps",value:(c=Me(v.a.mark(function e(t,n,r){return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.enqueueSteps({getState:t,state:n,localSteps:r}),e.next=3,this.processQueue();case 3:case"end":return e.stop()}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"processQueue",value:(s=Me(v.a.mark(function e(){var t,n,r,a,i,o,s;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isSending){e.next=2;break}return e.abrupt("return");case 2:if(this.hasQueuedSteps()){e.next=5;break}return this.emptyQueuePromise.resolve(),e.abrupt("return");case 5:return this.isSending=!0,e.next=8,this.afterBackoff();case 8:if(t=this.dequeueSteps(),n=t.getState,r=t.state,a=t.localSteps.steps,void 0!==(i=Object(Ee.getVersion)(r))){e.next=12;break}return e.abrupt("return");case 12:if(0!==a.length){e.next=14;break}return e.abrupt("return");case 14:return e.prev=14,o=this.config.docId,e.next=18,this.service.pushSteps(o,i,a);case 18:s=e.sent,this.rebaseStepsInQueue(),this.resetBackoff(),this.isSending=!1,s&&s.steps&&s.steps.length>0&&this.emit("data",s),e.next=30;break;case 25:e.prev=25,e.t0=e.catch(14),this.hasQueuedSteps()?this.rebaseStepsInQueue():this.enqueueSteps({getState:n}),this.increaseBackoff(),this.isSending=!1;case 30:return e.next=32,this.processQueue();case 32:case"end":return e.stop()}},e,this,[[14,25]])})),function(){return s.apply(this,arguments)})},{key:"connect",value:(o=Me(v.a.mark(function e(t,n){var r,a=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=this.config.docId,this.service.join(r),this.service.onStepsCreated(r,function(e){a.emit("data",{version:e.version,steps:[e]})}),this.service.onTelepointerUpdated(r,function(e){a.emit("telepointer",e)}),this.emit("connected",{doc:n,version:t});case 5:case"end":return e.stop()}},e,this)})),function(e,t){return o.apply(this,arguments)})},{key:"getSteps",value:(i=Me(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.config.docId,e.next=3,this.service.getSteps(n,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"sendTelepointer",value:(a=Me(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.config.docId,e.next=3,this.service.pushTelepointer(n,t);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:"on",value:function(e,t){return this.eventEmitter.on(e,t),this}},{key:"off",value:function(e,t){return this.eventEmitter.off(e,t),this}},{key:"emit",value:function(e,t){return this.eventEmitter.emit(e,t),this}}])&&ze(t.prototype,n),r&&ze(t,r),e}();function Ie(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function De(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Fe(e,t,n[t])})}return e}function Ae(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)}}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qe=new Ce.a,Ue=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Fe(this,"processRemoteData",function(e){var t=e.version,n=e.steps;if(n&&n.length){var a=n.map(function(e){return e.sessionId||r.serviceClient.getUserId(e.sessionId)});r.emit("data",{json:n,version:t,userIds:a})}else console.warn("Collab.Provider: processRemoteData no steps ? ",n,e)}),Fe(this,"onReceiveData",function(e){r.queueData(e),r.processQueue()}),Fe(this,"onReceiveTelepointer",function(e){var t=e.sessionId,n=r.serviceClient.getUserId(t);if(n!==r.config.userId){var a=r.participants.get(n);a&&a.lastActive>e.timestamp||(r.updateParticipant(t,e.timestamp),r.emit("telepointer",e))}}),this.config=Te({},t),this.config.sessionId=n.getSessionId(),this.config.userId=n.getUserId(),this.serviceClient=n,this.channel=t.channel||new Ne(this.config,n),this.eventEmitter=new Oe.EventEmitter2,this.queue=[],this.getState=function(){},this.participants=new Map,this.pauseQueue=!1,this.initialVersion=t.version,this.pauseQueue=!1}var t,n,r,a,i;return t=e,(n=[{key:"initialize",value:function(e){var t=this;this.getState=e,this.channel.on("connected",function(e){var n=e.doc,r=e.version,a=t.config.sessionId;t.emit("init",{sid:a,doc:n,version:r}),t.emit("connected",{sid:a})}),this.channel.on("data",this.onReceiveData),this.channel.on("telepointer",this.onReceiveTelepointer),this.channel.on("needcatchup",function(){return t.catchup()});var n=e(),r=qe.encode(n.doc),a=void 0!==this.initialVersion?this.initialVersion:r.version,i=Te({},r,{version:a});return this.channel.connect(a,i),this}},{key:"send",value:function(e,t,n){e.steps&&e.steps.length&&this.channel.sendSteps(this.getState,n)}},{key:"sendMessage",value:function(e){if(e)switch(e.type){case"telepointer":this.channel.sendTelepointer(Te({},e,{timestamp:(new Date).getTime()}))}}},{key:"queueData",value:function(e){var t=[].concat(De(this.queue),[e]).sort(function(e,t){var n=e.version-e.steps.length,r=t.version-t.steps.length;return n>r?1:n<r?-1:e.version>t.version?-1:e.version<t.version?1:0});this.queue=t}},{key:"catchup",value:(a=v.a.mark(function e(){var t,n,r,a,i,o,s,c,l;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.pauseQueue=!0,t=Object(Ee.getVersion)(this.getState()),e.prev=2,e.next=5,this.channel.getSteps(t);case 5:n=e.sent,r=n.doc,a=n.version,i=n.steps,r?(o=this.config.sessionId,s=Object(Ee.sendableSteps)(this.getState())||{},c=s.steps,l=void 0===c?[]:c,this.emit("init",{sid:o,doc:r,version:a}),l.length&&this.emit("local-steps",{steps:l})):i.length>0&&this.onReceiveData({steps:i,version:a},!0),this.queueTimeout=void 0,this.pauseQueue=!1,this.processQueue(),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),this.pauseQueue=!1,this.programCatchup();case 19:case"end":return e.stop()}},e,this,[[2,15]])}),i=function(){var e=this,t=arguments;return new Promise(function(n,r){var i=a.apply(e,t);function o(e){Ie(i,n,r,o,s,"next",e)}function s(e){Ie(i,n,r,o,s,"throw",e)}o(void 0)})},function(){return i.apply(this,arguments)})},{key:"programCatchup",value:function(){var e=this;this.queueTimeout||(this.queueTimeout=window.setTimeout(function(){e.catchup()},1e3))}},{key:"cancelCatchup",value:function(){this.queueTimeout&&(window.clearTimeout(this.queueTimeout),this.queueTimeout=void 0)}},{key:"processQueue",value:function(){if(this.queue.length>0&&!this.pauseQueue)for(var e=Object(Ee.getVersion)(this.getState());this.queue.length>0;){var t=this.queue[0],n=t.version,r=t.steps.length+e;if(n==r)this.cancelCatchup(),this.queue.shift(),this.processRemoteData(t),e=n;else if(n<=r&&this.queue.shift(),n>r){this.programCatchup();break}}}},{key:"updateParticipant",value:function(e,t){var n=this,r=this.serviceClient.getUserId(e),a=function(e){var t=e.userId,n=e.sessionId;return{userId:n,sessionId:n||t,name:t,avatar:"https://api.adorable.io/avatars/80/".concat(t.replace(/[^a-zA-Z0-9]/g,""),".png"),email:"".concat(t.replace(/\s+/g,".").replace(/[^a-zA-Z0-9.]/g,""),".toLocaleLowerCase()}@mycozy.cloud")}}({userId:r,sessionId:e});this.participants.set(r,Te({name:"",email:"",avatar:"",sessionId:e,userId:r},a,{lastActive:t}));var i=[this.participants.get(r)],o=(new Date).getTime(),s=Array.from(this.participants.values()).filter(function(e){return(o-e.lastActive)/1e3>300});s.forEach(function(e){return n.participants.delete(e.userId)}),this.emit("presence",{joined:i,left:s})}},{key:"emit",value:function(e,t){return this.eventEmitter.emit(e,t),this}},{key:"on",value:function(e,t){return this.eventEmitter.on(e,t),this}},{key:"off",value:function(e,t){return this.eventEmitter.off(e,t),this}},{key:"unsubscribeAll",value:function(e){this.eventEmitter.removeAllListeners(e)}}])&&Ae(t.prototype,n),r&&Ae(t,r),e}(),Be=n("oBqo"),Le=n.n(Be),Re=n("hmtS");function Qe(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function Ve(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){Qe(i,r,a,o,s,"next",e)}function s(e){Qe(i,r,a,o,s,"throw",e)}o(void 0)})}}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){He(e,t,n[t])})}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(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)}}var Ge=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.userId,r=t.cozyClient,a=t.schema,i=t.realtime,o=new Date,s=o.getTime()+"."+o.getMilliseconds()+"."+Math.random();this.sessionId=n+":"+s,this.userId=this.getUserId(n),this.cozyClient=r,this.stackClient=r.getStackClient(),this.schema=a,this.onRealtimeEvent=this.onRealtimeEvent.bind(this),this.realtime=i||new Le.a({client:r}),this.resetCallbacks()}var t,n,r,a,i,o,s,c,l,u,d,f,p,h;return t=e,(n=[{key:"resetCallbacks",value:function(){this.callbacks={}}},{key:"setCallback",value:function(e,t,n){this.callbacks[e]=this.callbacks[e]||{},this.callbacks[e][t]=n}},{key:"getUserId",value:function(e){return e?e.match(/[^:]+/)[0]:this.userId}},{key:"getSessionId",value:function(){return this.sessionId}},{key:"close",value:function(){this.realtime.unsubscribeAll(),this.resetCallbacks()}},{key:"defaultTitle",value:function(){return(new Date).toISOString()}},{key:"path",value:function(e,t){return e?t?"/notes/".concat(e,"/").concat(t):"/notes/".concat(e):"/notes"}},{key:"client2server",value:function(e){return Je({sessionID:e.sessionId||this.sessionId},e)}},{key:"server2client",value:function(e){return Je({sessionId:e.sessionID,userId:this.getUserId(e.sessionID)},e)}},{key:"create",value:(h=Ve(v.a.mark(function e(t,n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={data:{type:"io.cozy.notes.documents",attributes:{title:t||this.defaultTitle(),schema:n||this.schema||Re.a}}},e.abrupt("return",this.stackClient.fetchJSON("POST",this.path(),r));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return h.apply(this,arguments)})},{key:"sync",value:(p=Ve(v.a.mark(function e(t){return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("POST",this.path(t,"sync"));case 2:case"end":return e.stop()}},e,this)})),function(e){return p.apply(this,arguments)})},{key:"setTitle",value:(f=Ve(v.a.mark(function e(t,n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={data:{type:"io.cozy.notes.documents",id:t,attributes:this.client2server({title:n})}},e.next=3,this.stackClient.fetchJSON("PUT",this.path(t,"title"),r);case 3:case"end":return e.stop()}},e,this)})),function(e,t){return f.apply(this,arguments)})},{key:"onRealtimeEvent",value:function(e){var t=e.id||e._id,n=e.doctype;if(this.callbacks[n]&&this.callbacks[n][t])return this.callbacks[n][t](e);console.warn("Event not managed",n,t,this.callbacks)}},{key:"join",value:(d=Ve(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return e.id==t?this.onRealtimeEvent(e):void 0},e.next=3,Promise.all([this.realtime.subscribe("created","io.cozy.notes.events",n),this.realtime.subscribe("updated","io.cozy.notes.events",t,this.onRealtimeEvent),this.realtime.subscribe("deleted","io.cozy.notes.events",t,this.onRealtimeEvent)]);case 3:case"end":return e.stop()}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"onStepsCreated",value:(u=Ve(v.a.mark(function e(t,n){var r=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setCallback("io.cozy.notes.steps",t,function(e){return n(r.server2client(e))});case 1:case"end":return e.stop()}},e,this)})),function(e,t){return u.apply(this,arguments)})},{key:"onTelepointerUpdated",value:(l=Ve(v.a.mark(function e(t,n){var r=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setCallback("io.cozy.notes.telepointers",t,function(e){return n(r.server2client(e))});case 1:case"end":return e.stop()}},e,this)})),function(e,t){return l.apply(this,arguments)})},{key:"onTitleUpdated",value:(c=Ve(v.a.mark(function e(t,n){var r=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setCallback("io.cozy.notes.documents",t,function(e){return e.sessionID&&e.sessionID==r.sessionId?null:n(e.title)});case 1:case"end":return e.stop()}},e,this)})),function(e,t){return c.apply(this,arguments)})},{key:"getDoc",value:(s=Ve(v.a.mark(function e(t){var n;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stackClient.fetchJSON("GET",this.path(t));case 2:return n=e.sent,e.abrupt("return",{doc:n.data.attributes.metadata.content,version:n.data.attributes.metadata.version,title:n.data.attributes.metadata.title,file:n.data});case 4:case"end":return e.stop()}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"pushSteps",value:(o=Ve(v.a.mark(function e(t,n,r){var a,i,o=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={headers:{"if-match":n}},i={data:r.map(function(e){return{type:"io.cozy.notes.steps",attributes:o.client2server(e.toJSON())}})},e.next=4,this.stackClient.fetchJSON("PATCH",this.path(t),i,a);case 4:return e.abrupt("return",null);case 5:case"end":return e.stop()}},e,this)})),function(e,t,n){return o.apply(this,arguments)})},{key:"getSteps",value:(i=Ve(v.a.mark(function e(t,n){var r,a,i,o,s,c,l,u,d,f,p=this;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.stackClient.fetchJSON("GET","".concat(this.path(t,"steps"),"?Version=").concat(n));case 3:if(0!=(r=e.sent).data.length){e.next=8;break}return e.abrupt("return",{steps:[],version:n});case 8:return a=r.data.map(function(e){return p.server2client(e.attributes)}),i=r.data[r.data.length-1].attributes.version,e.abrupt("return",{version:i,steps:a});case 11:e.next=28;break;case 13:if(e.prev=13,e.t0=e.catch(0),o=e.t0.response,s=e.t0.reason&&e.t0.reason.data,c=s&&s.attributes&&s.attributes.metadata,l=c&&c.content,u=c&&c.version,412!=o.status||!l||!u){e.next=27;break}return f={_id:t,_type:"io.cozy.notes.events",doctype:d="io.cozy.notes.documents",title:c.title},this.callbacks[d]&&this.callbacks[d][t]&&this.callbacks[d][t](f),e.abrupt("return",{doc:l,version:u});case 27:throw e.t0;case 28:case"end":return e.stop()}},e,this,[[0,13]])})),function(e,t){return i.apply(this,arguments)})},{key:"pushTelepointer",value:(a=Ve(v.a.mark(function e(t,n){var r;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={data:{type:"io.cozy.notes.telepointers",id:t,attributes:this.client2server(n)}},e.abrupt("return",this.stackClient.fetchJSON("PUT",this.path(t,"telepointer"),r));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return a.apply(this,arguments)})}])&&Ze(t.prototype,n),r&&Ze(t,r),e}();function Xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){We(e,t,n[t])})}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ye(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function $e(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){Ye(i,r,a,o,s,"next",e)}function s(e){Ye(i,r,a,o,s,"throw",e)}o(void 0)})}}function et(){return(et=$e(v.a.mark(function e(t,n,r,a,i,o){var s;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r||a(!0),e.next=4,t.getDoc(n);case 4:s=e.sent,o(s.title||""),i(s),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),o(!1),i(!1);case 13:a(!1);case 14:case"end":return e.stop()}},e,this,[[0,9]])}))).apply(this,arguments)}var tt=Object(l.c)()(Object(s.withClient)(function(e){var t=e.client,n=e.noteId,i=e.t,o=Object(r.useMemo)(function(){return e.userName||Object(y.j)(t)},[e.userName]),s=Object(r.useMemo)(y.c),c=Object(r.useContext)(xe.a),l=n,u=o,d=t,f=Ke(Object(r.useState)(!0),2),p=f[0],h=f[1],m=Ke(Object(r.useState)(void 0),2),b=m[0],g=m[1],_=Ke(Object(r.useState)(void 0),2),w=_[0],j=_[1],x=Object(r.useMemo)(function(){return new Ge({userId:u,userName:o,cozyClient:d})},[n]),k=b&&b.version,O=Object(r.useMemo)(function(){if(void 0!==k){var e=new Ue({version:b.version,docId:l},x);return{useNativePlugin:!0,provider:Promise.resolve(e),inviteToEditHandler:function(){},isInviteToEditButtonSelected:!1,userId:x.getSessionId()}}return null},[n,k,o,x]);Object(r.useEffect)(function(){!function(e,t,n,r,a,i){et.apply(this,arguments)}(x,n,p,h,g,j)},[n]);var E=Object(r.useCallback)(function(){return null},[n]),C=Object(r.useCallback)(function(e,t,n,r){return function(a){var i=a.target.value;n!=i&&(r(i),e.setTitle(t,i))}}(x,n,w,j),[n,j,x]),S=Object(r.useCallback)(function(e){w!=e&&j(e)},[n,j]);Object(r.useMemo)(function(){x.onTitleUpdated(n,S)},[S,x]),Object(r.useEffect)(function(){!function(e,t){document.title=t&&""!=t?"".concat(e," - ").concat(t):e}(s,w)},[w]);var M=Object(r.useMemo)(function(){return void 0!==e.returnUrl?e.returnUrl:b?Object(y.g)(t,b.file):c?void 0:"/"},[e.returnUrl,b]);function z(){return P.apply(this,arguments)}function P(){return(P=$e(v.a.mark(function e(){var t;return v.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=8;break}return e.next=3,O.provider;case 3:return t=e.sent,e.next=6,t.channel.ensureEmptyQueue();case 6:return e.next=8,x.sync(l);case 8:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}Object(r.useEffect)(function(){p||b||console.warn("Could not load note ".concat(n))},[p,b]),Object(r.useEffect)(function(){return z},[l,b]);var N=Object(r.useCallback)(function(){b&&l&&x.sync(l)},[b,l]);return Object(ae.a)(window,"unload",N),p?a.a.createElement(fe,null):b?a.a.createElement(de,{onTitleChange:C,onTitleBlur:N,onContentChange:E,collabProvider:O,defaultTitle:i("Notes.Editor.title_placeholder"),defaultValue:Xe({},b.doc,{version:b.version}),title:w&&w.length>0?w:void 0,leftComponent:a.a.createElement(ke,{returnUrl:M,file:b.file}),rightComponent:!c&&a.a.createElement(we,{file:b.file})}):a.a.createElement(pe,{returnUrl:M})})),nt=Object(l.c)()(function(e){var t=e.t;return a.a.createElement(p.a,{icon:"unlink",title:t("Error.unshared_title"),text:t("Error.unshared_text")})});n.d(t,"b",function(){return ee}),n.d(t,"a",function(){return tt}),n.d(t,"c",function(){return nt})},hmtS:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n("byeC"),a=[["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"}]}]],i=[["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:""}}}]];function o(e){return e.reduce(function(e,t){return e[t[0]]=t[1],e},{})}var s={nodes:a,marks:i},c={nodes:o(a),marks:o(i)};new r.Schema(c)},nw0P:function(e,t,n){var r={"./_lib/build_formatting_tokens_reg_exp/index.js":"kOWh","./ar/build_distance_in_words_locale/index.js":"XxX6","./ar/build_format_locale/index.js":"alis","./ar/index.js":"EDRf","./be/build_distance_in_words_locale/index.js":"LQ09","./be/build_format_locale/index.js":"kj7F","./be/index.js":"YEhR","./bg/build_distance_in_words_locale/index.js":"7K3h","./bg/build_format_locale/index.js":"RrdL","./bg/index.js":"isx8","./ca/build_distance_in_words_locale/index.js":"wqqj","./ca/build_format_locale/index.js":"qcV0","./ca/index.js":"Vwa+","./cs/build_distance_in_words_locale/index.js":"ZKDM","./cs/build_format_locale/index.js":"ipyF","./cs/index.js":"dvhP","./da/build_distance_in_words_locale/index.js":"2Mgc","./da/build_format_locale/index.js":"Gned","./da/index.js":"7ur/","./de/build_distance_in_words_locale/index.js":"5IWf","./de/build_format_locale/index.js":"THCn","./de/index.js":"bgw5","./el/build_distance_in_words_locale/index.js":"o/GB","./el/build_format_locale/index.js":"8T9h","./el/index.js":"dH0v","./en/build_distance_in_words_locale/index.js":"LZbM","./en/build_format_locale/index.js":"6DAA","./en/index.js":"Us+F","./eo/build_distance_in_words_locale/index.js":"qrnn","./eo/build_format_locale/index.js":"Bl15","./eo/index.js":"UB7v","./es/build_distance_in_words_locale/index.js":"GEfZ","./es/build_format_locale/index.js":"O+zC","./es/index.js":"/S0t","./fi/build_distance_in_words_locale/index.js":"VHtQ","./fi/build_format_locale/index.js":"Oydx","./fi/index.js":"ndVD","./fil/build_distance_in_words_locale/index.js":"uq4p","./fil/build_format_locale/index.js":"d7hw","./fil/index.js":"pNfm","./fr/build_distance_in_words_locale/index.js":"IzMR","./fr/build_format_locale/index.js":"I3Zg","./fr/index.js":"LKA2","./hr/build_distance_in_words_locale/index.js":"DPvn","./hr/build_format_locale/index.js":"puw3","./hr/index.js":"L9Jq","./hu/build_distance_in_words_locale/index.js":"w2RQ","./hu/build_format_locale/index.js":"/0iD","./hu/index.js":"Nm+E","./id/build_distance_in_words_locale/index.js":"JbvB","./id/build_format_locale/index.js":"0wlw","./id/index.js":"A6C3","./is/build_distance_in_words_locale/index.js":"qzMC","./is/build_format_locale/index.js":"S3yD","./is/index.js":"N4bE","./it/build_distance_in_words_locale/index.js":"MDEp","./it/build_format_locale/index.js":"aUJd","./it/index.js":"hmb4","./ja/build_distance_in_words_locale/index.js":"nNvt","./ja/build_format_locale/index.js":"buui","./ja/index.js":"uAXs","./ko/build_distance_in_words_locale/index.js":"oEw+","./ko/build_format_locale/index.js":"9SQf","./ko/index.js":"iW8+","./mk/build_distance_in_words_locale/index.js":"nmwZ","./mk/build_format_locale/index.js":"htxJ","./mk/index.js":"GzBU","./nb/build_distance_in_words_locale/index.js":"SL1f","./nb/build_format_locale/index.js":"CJ5F","./nb/index.js":"73vv","./nl/build_distance_in_words_locale/index.js":"Uyu0","./nl/build_format_locale/index.js":"doCD","./nl/index.js":"hCQt","./pl/build_distance_in_words_locale/index.js":"FUBD","./pl/build_format_locale/index.js":"nOYf","./pl/index.js":"B6yL","./pt/build_distance_in_words_locale/index.js":"aTPA","./pt/build_format_locale/index.js":"TTT0","./pt/index.js":"gdks","./ro/build_distance_in_words_locale/index.js":"gI+A","./ro/build_format_locale/index.js":"njjO","./ro/index.js":"r2yp","./ru/build_distance_in_words_locale/index.js":"KmPx","./ru/build_format_locale/index.js":"UUBw","./ru/index.js":"nz/o","./sk/build_distance_in_words_locale/index.js":"q2Bs","./sk/build_format_locale/index.js":"9sxn","./sk/index.js":"Wqan","./sl/build_distance_in_words_locale/index.js":"mlv2","./sl/build_format_locale/index.js":"vHkZ","./sl/index.js":"KYSo","./sr/build_distance_in_words_locale/index.js":"LlkS","./sr/build_format_locale/index.js":"RhjJ","./sr/index.js":"7mU3","./sv/build_distance_in_words_locale/index.js":"UNBN","./sv/build_format_locale/index.js":"zTNB","./sv/index.js":"hxgj","./th/build_distance_in_words_locale/index.js":"XAGa","./th/build_format_locale/index.js":"We2s","./th/index.js":"Pk+z","./tr/build_distance_in_words_locale/index.js":"aFZF","./tr/build_format_locale/index.js":"jh7A","./tr/index.js":"3ZWG","./zh_cn/build_distance_in_words_locale/index.js":"KdB7","./zh_cn/build_format_locale/index.js":"l4EP","./zh_cn/index.js":"8tMq","./zh_tw/build_distance_in_words_locale/index.js":"vyyr","./zh_tw/build_format_locale/index.js":"uYH7","./zh_tw/index.js":"QPlQ"};function a(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]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id="nw0P"},pL5B:function(e,t,n){"use strict";n.r(t),function(e){var r=n("o0o1"),a=n.n(r),i=n("q1tI"),o=n.n(i),s=n("0cfB"),c=n("Ty5D"),l=n("55Ip"),u=n("SH7X"),d=n("67rm"),f=n("ufaa"),p=n("jDpt"),h=n("le8I"),v=n("V2U0"),m=n("vYzF"),b=n("Zlyp"),y=n("snnE"),g=n("X3v2");function _(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var j=n("pZg0"),x=Object(c.f)(function(e){var t=Object(y.h)();return o.a.createElement(b.a,{noteId:e.match.params.id,returnUrl:t})}),k=function(){return o.a.createElement(c.c,null,o.a.createElement(c.a,{path:"/n/:id",component:x}),o.a.createElement(c.a,{path:"/",component:b.b}))},O=Object(u.withClient)(function(e){var t=e.client,n=w(Object(i.useState)(null),2),r=n[0],s=n[1],c=Object(i.useMemo)(function(){return Object(y.h)()},[]);return Object(i.useEffect)(function(){(function(){var e,n=(e=a.a.mark(function e(){var n;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(y.i)(t);case 3:n=e.sent,s(n),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),s(!1);case 10:case"end":return e.stop()}},e,this,[[0,7]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){_(i,r,a,o,s,"next",e)}function s(e){_(i,r,a,o,s,"throw",e)}o(void 0)})});return function(){return n.apply(this,arguments)}})()()},[]),r?o.a.createElement(b.a,{noteId:r,returnUrl:c||!1}):null!==r?o.a.createElement(b.c,null):o.a.createElement(v.a,{size:"xxlarge",middle:!0})});t.default=Object(s.hot)(e)(Object(f.a)()(Object(u.withClient)(function(e){var t=e.isPublic,n=e.breakpoints.isMobile,r=e.client,a="";if(n){var i=r.getInstanceOptions();a=Object(g.a)(i.cozyAppName,j.name)}var s=cozy.bar.BarCenter;return o.a.createElement(l.a,null,o.a.createElement(p.b,{monoColumn:!0},!t&&n&&o.a.createElement(s,null,o.a.createElement(m.a,null,a)),o.a.createElement(p.c,null,o.a.createElement(p.a,null,t?o.a.createElement(O,null):o.a.createElement(k,null))),o.a.createElement(h.a,null),o.a.createElement(d.a,null)))})))}.call(this,n("3UD+")(e))},pZg0:function(e,t){e.exports={name:"Notes",name_prefix:"Cozy",slug:"notes",icon:"icon.svg",categories:["cozy"],version:"1.6.0",licence:"AGPL-3.0",editor:"Cozy",source:"https://github.com/cozy/cozy-notes.git@build",developer:{name:"Cozy Cloud",url:"https://cozy.io"},screenshots:["screenshots/fr/screenshot01.png","screenshots/fr/screenshot02.png"],langs:["en","fr"],routes:{"/":{folder:"/",index:"index.html",public:!1},"/public":{folder:"/",index:"index.html",public:!0}},permissions:{apps:{description:"Required by the cozy-bar to display the icons of the apps",type:"io.cozy.apps",verbs:["GET"]},files:{description:"Notes as files",type:"io.cozy.files"},settings:{description:"Required by the cozy-bar to display Claudy and know which applications are coming soon",type:"io.cozy.settings",verbs:["GET"]}}}},snnE:function(e,t,n){"use strict";n.d(t,"j",function(){return h}),n.d(t,"h",function(){return m}),n.d(t,"b",function(){return b}),n.d(t,"i",function(){return y}),n.d(t,"f",function(){return _}),n.d(t,"e",function(){return w}),n.d(t,"d",function(){return j}),n.d(t,"g",function(){return x}),n.d(t,"c",function(){return k}),n.d(t,"a",function(){return O});var r=n("o0o1"),a=n.n(r),i=n("mwIZ"),o=n.n(i),s=n("AHTZ"),c=n("X3v2"),l=n("hmtS"),u=n("pZg0"),d=n.n(u);function f(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,a)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e){return new URL(e.getStackClient().uri).hostname+Math.floor(100*Math.random())}var v="returnUrl";function m(){var e=new URLSearchParams(window.location.search),t=!0,n=!1,r=void 0;try{for(var a,i=e[Symbol.iterator]();!(t=(a=i.next()).done);t=!0){var o=p(a.value,2),s=o[0],c=o[1];if(s===v)return c}}catch(l){n=!0,r=l}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}var b=function(e){var t=new URL(window.location);return t.searchParams.set(v,"#/"),t.hash="#/n/".concat(e.id),t};function y(e){return g.apply(this,arguments)}function g(){var e;return e=a.a.mark(function e(t){var n,r,i,s;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.collection("io.cozy.permissions").getOwnPermissions();case 2:return n=e.sent,r=n.data,i=r.attributes.permissions,s=o()(Object.values(i),"0.values.0"),e.abrupt("return",s);case 7:case"end":return e.stop()}},e,this)}),(g=function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(e){f(i,r,a,o,s,"next",e)}function s(e){f(i,r,a,o,s,"throw",e)}o(void 0)})}).apply(this,arguments)}function _(e){return e.relationships.parent.data.id}function w(e){return"/folder/".concat(e.replace(/-/g,""))}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=new URL(e.getStackClient().uri),r=e.getInstanceOptions().cozySubdomainType,a=null!==t?w(t):"";return Object(s.b)({cozyUrl:n.origin,slug:"drive",subDomainType:r,nativePath:a})}function x(e,t){return j(e,_(t))}function k(){var e=Object(c.b)(),t=Object(c.a)(e.cozyAppNamePrefix||d.a.name_prefix,""),n=Object(c.a)(e.cozyAppName,d.a.name);return""!=t?"".concat(t," ").concat(n):n}function O(e){return e.getStackClient().fetchJSON("POST","/notes",{data:{type:"io.cozy.notes.documents",attributes:{title:"",schema:l.a}}})}}}); \ No newline at end of file diff --git a/index.html b/index.html index 3a58095d..ef060298 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Cozy Notes</title><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16"><link rel="manifest" href="/site.webmanifest" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><link rel="stylesheet" type="text/css" href="//{{.Domain}}/assets/fonts/fonts.css"><meta name="theme-color" content="#ffffff"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><link rel="stylesheet" href="vendors/notes.69279fcfa71b30e973e7.0.min.css"><link rel="stylesheet" href="app/notes.088d11afd6749f056bdf.min.css"><script src="vendors/notes.fdc0acad752e170ff9e6.js" defer="defer"></script><script src="app/notes.88176e6ba74aad55e331.js" defer="defer"></script>{{.CozyBar}}</head><div role="application" data-cozy-token="{{.Token}}" data-cozy-domain="{{.Domain}}" data-cozy-subdomain-type="{{.SubDomain}}" data-cozy-locale="{{.Locale}}" data-cozy-app-name="{{.AppName}}" data-cozy-app-slug="{{.AppSlug}}" data-cozy-app-name-prefix="{{.AppNamePrefix}}" data-cozy-app-editor="{{.AppEditor}}" data-cozy-icon-path="{{.IconPath}}"></div></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Cozy Notes</title><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16"><link rel="manifest" href="/site.webmanifest" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><link rel="stylesheet" type="text/css" href="//{{.Domain}}/assets/fonts/fonts.css"><meta name="theme-color" content="#ffffff"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><link rel="stylesheet" href="vendors/notes.69279fcfa71b30e973e7.0.min.css"><link rel="stylesheet" href="app/notes.088d11afd6749f056bdf.min.css"><script src="vendors/notes.fdc0acad752e170ff9e6.js" defer="defer"></script><script src="app/notes.a6b760dfc44a216b3804.js" defer="defer"></script>{{.CozyBar}}</head><div role="application" data-cozy-token="{{.Token}}" data-cozy-domain="{{.Domain}}" data-cozy-subdomain-type="{{.SubDomain}}" data-cozy-locale="{{.Locale}}" data-cozy-app-name="{{.AppName}}" data-cozy-app-slug="{{.AppSlug}}" data-cozy-app-name-prefix="{{.AppNamePrefix}}" data-cozy-app-editor="{{.AppEditor}}" data-cozy-icon-path="{{.IconPath}}"></div></html> \ No newline at end of file diff --git a/manifest.webapp b/manifest.webapp index b75d3f5d..a891c798 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -6,7 +6,7 @@ "categories": [ "cozy" ], - "version": "1.5.1", + "version": "1.6.0", "licence": "AGPL-3.0", "editor": "Cozy", "source": "https://github.com/cozy/cozy-notes.git@build",