tiro-notes 0.30.95-12 → 0.30.95-13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- (this["webpackJsonptiro-notes-client"]=this["webpackJsonptiro-notes-client"]||[]).push([[10],{243:function(t,n){},264:function(t,n){},266:function(t,n){},277:function(t,n){},279:function(t,n){},304:function(t,n){},306:function(t,n){},307:function(t,n){},312:function(t,n){},314:function(t,n){},320:function(t,n){},322:function(t,n){},341:function(t,n){},353:function(t,n){},356:function(t,n){},372:function(t,n,e){"use strict";e.r(n);var o=e(0),i=e.n(o),c=e(9),r=e(1),a=function(t){return s()===t};function l(){return!!/iPad/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}var s=function(){var t=window.innerWidth,n="desktop";return p()||t<1e3&&(n="tablet"),t<500&&(n="mobile"),n},p=function(){return!u()},u=function(){var t,n=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(n=!0),n},d=e(16),f=e(18),g=e(8),b=e.n(g),h=e(199),m=96,v={staticResources:"static",defaultDataFolder:"markdown-notes",configFolder:".tiro",backendStateFolder:".states",cacheFolder:"cache",historyFolder:".history",archiveFolder:".history_archive",uploadFolder:".resources",relativeUploadFolderName:".resources"},w={headerStart:"=== HEADER ===",headerEnd:"=== END HEADER ==="},x={log:{verbose:!1,socket:!1,upload:!1,iframe:!1,eventManager:!1},version:"0.30.95",params:{previewArea:{scrollSpeed:1.3}}};function O(t,n){var e=Object(o.useState)((function(){try{var e=window.localStorage.getItem(t);return e?JSON.parse(e):n}catch(o){return console.log(o),n}})),i=Object(c.a)(e,2),r=i[0],a=i[1];return[r,function(n){try{var e=n instanceof Function?n(r):n;a(e),window.localStorage.setItem(t,JSON.stringify(e))}catch(o){console.log(o)}}]}var j={folders:"Folders",files:"files",images:"images",trashNote:"Are you sure to trash that note?",clickHereDisconnected:"(click here if persist)",searchingLabel:"searching...",lastNotes:"Last Notes",newNote:"New Note",dateModified:"Modified :",dateCreated:"Created :",searchPlaceholder:"Search Note",hoursAgo:" hours ago",daysAgo:" days ago",minsAgo:" mins ago",months:["January","February","March","April","May","June","July","August","September","October","November","December"],createFolder:"Create folder",createFolderPrompt:"New Folder name to create in",renameFolder:"Rename folder",renameFolderPrompt:"Rename folder to :",deleteFolder:"Delete folder",deleteFolderPrompt:"Are you sure you want to delete the folder and all its notes (no recovery possible) : ",deleteTabPrompt:"Are you sure you want to delete that tab? : ",moveToTrash:"Move to trash",moveToTrashPrompt:"Are you sure you want move folder in .tiro/.trash : ",loadingFolder:"loading...",moveFolderPrompt:"move folder",setupForm:{title:"Login to Tiro",introText:"Welcome to Tiro, please fill these informations to get started",user:"user",password:"password",dataFolder:"folder path",userExplanation:"should have > 3 chars",passwordExplanation:"should have > 3 chars",folderExplanation:"relative from Tiro folder installation (../data for example)",successReload:"Configuration file successfully written, reloading application...",submit:"login",noFolder1:"folder path",noFolder2:"doesn't exists, please create it or choose another folder (no data will be deleted)."},appviews:{image:"Switch to Gallery View",text:"Switch to Files View"},loginForm:{wrongUserPassword:"Wrong login/password",wrongToken:"Authentication expired, please log again"},passwordForm:{explanation:"please enter your password",submit:"submit"},editorBar:{tts:"Text to speech",explanation:{history:"File history"},lightbox:"Show Images"},ttsPopup:{title:"Text to speech",voice:"Voice"},settingsPopup:{title:"Tiro Settings",backend:{title:"Server settings",explanation:"Only fill if server is on another port/protocol than the client (usually in development)",protocol:"Https",protocolExpl:"https or http",port:"Port",portExpl:"Port used by backend (ex: 3023)"}},historyPopup:{title:"Versions for ",thead:{date:"date",name:"version"}},rgNotWorking:"ERROR: Tiro requires Ripgrep to be working, it seems that ripgrep (rg command) is either not installed or not functionning correctly on you computer. To install it, follow these instructions : https://github.com/BurntSushi/ripgrep#installation",promptPopup:{defaultTitle:"User Prompt",confirmTitle:"Confirm",accept:"Ok",refuse:"Cancel"},tabs:{newTab:"New Tab"}},k=e(5),y=e(6),C=e(12),T=e(13),E=(e(246),e(247),e(248),e(249),e.p+"static/media/deco-bg-map.7ca9103b.png"),S=e.p+"static/media/file-solid.6415173e.svg",I=e.p+"static/media/compact-disc-solid.55b6e50c.svg",N=e.p+"static/media/file-pdf-solid.0a9d75fe.svg",F=e.p+"static/media/file-word-solid.9228e1ff.svg",L=e.p+"static/media/file-code-solid.62b467ac.svg",R=e.p+"static/media/book-solid.87f5b737.svg",A=e.p+"static/media/file-excel-solid.217d73db.svg",D=e.p+"static/media/file-video-solid.312288cf.svg",P=e.p+"static/media/file-audio-solid.a76f99f0.svg",z=e.p+"static/media/file-zipper-solid.7db57917.svg",M=e.p+"static/media/file-powerpoint-solid.4d969453.svg",B=e.p+"static/media/link-solid.7b689dbd.svg",_=e.p+"static/media/globe-africa-solid.0ad34146.svg",H=e.p+"static/media/search-solid.cc51b702.svg",U={main:"#E86666",bgPopup:"#FFF",bgPopup2:"#f9f9f9",bgPopup3:"#f5efef",bgTabs:"#D8D8D8",bgTab:"#D0D0D0",fontTab:"#797979",bgTabActive:"#EFEFEF",bgInterface:"#efefef",fontInterface:"#323232",bgInterface2:"#e1e1e1",fontInterface2:"#585757",bgEditor:"#FFFFFF",bgPreview:"#F7F7F7",fontEditor:"#323232",dev:["#C3668B","#A766A7","#CE66E8","#E4E866"],compl:["#11abf8","#3fd7a4"],pal1:["#5c1a70","#ffa67c","#ffda77"],grey1:"#797979",grey2:"red",green:"green",l1:{bg:"#e1e1e1",font:"#615f5f"},l2:{bg:"#eeecec",title:"#797979",text:"#615f5f",date:"#b3b2b2"},editor:{bg:"#ffffff",font:"#525252",interfaceGrey:"#d4d1d1",mobileToolbar:{bg:"#e1e1e1",font:"#747474"}},bg:{l1:"#e1e1e1",dark:"rgb(39, 39, 39)",grey:"rgb(221, 221, 221)",light:"#FFFFFF",black:"#000000"},font:{light:"#FFFFFF",black:"#000000"}},W={els:function(){return{button:"\n\t\tbackground: none;\n border: none;\n ",images:"\n\t\tborder-radius: 7px;\n box-shadow: 0px 0px 10px rgb(0 0 0 / 10%);\n max-width: 100%;\n ",imageInfos:"\n ",redButton:"\n\t\t\tborder: none;\n\t\t\tbackground: ".concat(U.main,";\n &:hover {\n\t\t\topacity: 0.9;\n\n }\n color: white;\n border-radius: 5px;\n cursor: pointer;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 1px;\n ")}},colors:U,font:{main:"'Open sans', sans-serif",editor:"Consolas, monaco, monospace"},sizes:{desktop:{l:37,l1:37,l2:63,r:63},search:{h:94,padding:10},gallery:{topH:100},block:15,scrollbar:17,l2:{fileLi:{height:77,padding:5,margin:5,img:67}},editor:{padding:45},mobile:{bottomBarHeight:50,editorBar:40,editorTopWrapper:100}},assets:{decoBgMap:E,linkIcon:B,worldIcon:_,fileIcon:S,diskIcon:I,pdfIcon:N,presIcon:M,audioIcon:P,videoIcon:D,excelIcon:A,wordIcon:F,codeIcon:L,bookIcon:R,archiveIcon:z,searchIcon:H},anim:{time:"100ms"}},q=function(t){Object(C.a)(e,t);var n=Object(T.a)(e);function e(){var t;Object(k.a)(this,e);for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];return(t=n.call.apply(n,[this].concat(i))).canBgClose=!t.props.canBgClose||t.props.canBgClose,t}return Object(y.a)(e,[{key:"render",value:function(){var t=this;return Object(r.c)("div",{className:"popup-wrapper-component"},Object(r.c)("div",{className:"overlay-click-popup",onClick:function(n){t.canBgClose&&t.props.onClose()}}),Object(r.c)("div",{className:"popup-wrapper ".concat(l()?"ipad":"")},Object(r.c)("div",{className:"popupTitle"}," ",this.props.title),Object(r.c)("div",{className:"popupContent"},this.props.children)))}}]),e}(i.a.Component),V=function(t){var n,e=Object(o.useRef)(),i=function(){t.shouldFocus&&e.current.focus()};Object(o.useEffect)((function(){i()}),[t.shouldFocus]),Object(o.useEffect)((function(){i()}),[]);var c="checkbox"===t.type&&(!0===t.value||"true"===t.value),a=t.value;return Object(g.isBoolean)(a)&&(a=""),Object(r.c)("div",{className:"input-component ".concat(t.id?t.id:""," ").concat(t.type)},t.label&&Object(r.c)("span",null,t.label," :"),Object(r.c)("div",{className:"input-wrapper"},"select"!==t.type&&Object(r.c)("input",{ref:e,type:t.type?t.type:"text",value:a,checked:c,readOnly:t.readonly,onFocus:function(){t.onFocus&&t.onFocus()},onClick:function(){!t.shouldNotSelectOnClick&&e.current.select()},onKeyPress:function(n){"Enter"==(n.code||n.key)&&t.onEnterPressed&&t.onEnterPressed()},onChange:function(n){t.onCheckedChange&&t.onCheckedChange(n.target.checked),t.onChange&&t.onChange(n.target.value)}}),"select"===t.type&&Object(r.c)("select",{value:a,onChange:function(n){t.onSelectChange&&t.onSelectChange(n.target.value)}},null===(n=t.list)||void 0===n?void 0:n.map((function(t,n){return Object(r.c)("option",{value:t.key,selected:a===t.key},t.label," ")}))),t.explanation&&Object(r.c)("div",{className:"explanation"}," ",t.explanation," ")))},G=function(){var t=(new Date).getTime(),n="undefined"!==typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var o=16*Math.random();return t>0?(o=(t+o)%16|0,t=Math.floor(t/16)):(o=(n+o)%16|0,n=Math.floor(n/16)),("x"===e?o:3&o|8).toString(16)}))},J=function(t){var n=t.split("?")[1]||"",e=t.split("?")[0],o=e.replace(/[^\w\s]/gi,"_"),i=n.replace(/[^\w\s]/gi,"_"),c=e.split(".").pop()||"";return((c="."+c.replace(/[^\w\s]/gi,"_")).length>6||c.length<=1)&&(c=""),"".concat(o,"_").concat(i).concat(c)},Y=function(t){return t=(t=(t=t.split("//").join("/")).split("\\").join("/")).split("//").join("/")},K=function(t,n){return Y(t+"/")===Y(n+"/")},$=["Az","Crea","Modif"],X=["alphabetical","created","modified"],Z=function(t,n){var e;switch(X[n]){case"alphabetical":default:e=Object(g.sortBy)(t,[function(t){return t.realname.toLocaleLowerCase()}]);break;case"created":e=Object(g.sortBy)(t,["created"]).reverse();break;case"modified":e=Object(g.sortBy)(t,["modified"]).reverse()}return e},Q=function(){var t=function(t){var n,e="; ".concat(document.cookie).split("; ".concat(t,"="));return 2===e.length?null===(n=e.pop())||void 0===n?void 0:n.split(";").shift():void 0}("tiro-login-token");return t||""},tt=function(){return"?token=".concat(Q())},nt=function(t){!function(t,n,e){var o=new Date;o.setTime(o.getTime()+60*e*60*1e3);var i="expires="+o.toUTCString();document.cookie=t+"="+n+";"+i+";path=/"}("tiro-login-token",t,m)};function et(t,n){var e=Object(o.useState)(n),i=Object(c.a)(e,2),r=i[0],a=i[1],l="/".concat(v.configFolder,"/").concat(v.backendStateFolder,"/").concat(t,".md");'[BACKEND STATE] "'.concat(t,'" clientApi not loaded! Persistance system will not work correctly');Object(o.useEffect)((function(){s()}),[]);var s=function(){ei().then((function(t){t.file.getContent(l,(function(t){var n=JSON.parse(t);a(n)}))}))};return[r,function(t){a(t),ei().then((function(n){n.file.saveContent(l,JSON.stringify(t))}))},s]}var ot={title:"",key:"",path:""},it=function t(n,e){for(var o,i=0;i<e.length;i++)if(K(e[i].path,n)){o=Object(g.cloneDeep)(e[i]);var c=e[i].children;if(Object(g.isArray)(c))for(var r=0;r<c.length;r++){var a=t(c[r].path,e);a&&(o.children[r]=a)}}return o},ct=function(t,n){for(var e="add",o=0;o<n.length;o++)K(t.path,n[o].path)&&(n[o]=t,e="update");return"add"===e&&n.push(t),n},rt={title:".trash",key:"/.tiro/.trash",path:"/.tiro/.trash"},at=e(19),lt=e.n(at),st={img:lt()().find(".").then("jpg").or("jpeg").or("png").or("gif").or("webm").or("svg").or("webp"),imgMdConfig:lt()().anythingBut("[]|").maybe("|").beginCapture().anythingBut("[]|").endCapture().maybe("|").beginCapture().anythingBut("[]|").endCapture(),customTag:/\[\[[a-zA-Z0-9-\ _\/]*\]\]/},pt={metas:lt()().find(w.headerStart).beginCapture().anythingBut("").endCapture().then(w.headerEnd),titleHtml:/<(title)[^>]*>([^<]*)<\/\1>/gi,metasHtml:/<meta[^>]*(name|property)="([^"]*)"[^>]*content="([^"]*)"[^>]*>/gi,externalLink2:/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/gm,externalLink3:/https?:\/\/((www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256})\b(\/[-a-zA-Z0-9()@:%_\+.~#?&=]*\/)?([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\/(\n| |$)/gim,matchingHtmlTags:/<([^>]*)>([^<]*)<\/\1>/,baliseHtml:lt()().find("<").anythingBut("<>").then(">"),ressource:lt()().find("![").beginCapture().anythingBut("[]").endCapture().then("](").beginCapture().anythingBut("()").endCapture().then(")"),ref:lt()().find("[").anythingBut("[]").then("](").anythingBut("()").then(")"),extimage:lt()().find("![").anythingBut("[]").then("](").beginCapture().then("http").anythingBut("()").then(st.img).anythingBut("()").endCapture().then(")"),image:lt()().find("![").anythingBut("[]").then("](").beginCapture().anythingBut("()").then(st.img).anythingBut("()").endCapture().then(")"),fullImageMd:lt()().beginCapture().find("![").anythingBut("[]").then("](").anythingBut("()").then(st.img).anythingBut("()").endCapture().then(")"),imageAndTitleCapture:lt()().find("![").beginCapture().anythingBut("[]").endCapture().then("](").beginCapture().anythingBut("()").then(st.img).anythingBut("()").endCapture().then(")"),imageAndTitleCapture2:/\!\[([^\[\]]+)\]\(([^\(\)]+\.(jpg|jpeg|png|gif|webm|svg|webp))\)/gi,imageAndConfig:lt()().find("![").then(st.imgMdConfig).then("](").beginCapture().anythingBut("()").then(st.img).anythingBut("()").endCapture().then(")"),searchlink:lt()().find("[search|").beginCapture().anythingBut("[]").endCapture().then("]"),linklink:lt()().find("[link|").beginCapture().anythingBut("[]").endCapture().then(" ").beginCapture().then("/").anythingBut("[]").endCapture().then("]"),latexTag:lt()().find("[[latex]]").beginCapture().anythingBut("").endCapture().then("[[latex]]"),scriptTag:lt()().find("[[script]]").beginCapture().anythingBut("").endCapture().then("[[script]]"),userCustomTagFull:lt()().find(st.customTag).beginCapture().anythingBut("").endCapture().then(st.customTag),userCustomTagFull2:lt()().beginCapture().beginCapture().find(st.customTag).endCapture().anythingBut("").beginCapture().then(st.customTag).endCapture().endCapture(),userCustomTagFull3:lt()().beginCapture().find(st.customTag).endCapture(),userCustomTag3:lt()().beginCapture().then(st.customTag).endCapture(),userCustomTagManual:st.customTag,externalLink:lt()().find("http").maybe("s").then("://").beginCapture().anythingBut("/ ").endCapture().beginCapture().anythingBut(" ").then("/").beginCapture().anythingBut("? ").endCapture().anythingBut(" \n").then("\\n").endCapture(),url2transform:lt()().find("!").beginCapture().find("http").maybe("s").then("://").beginCapture().anything().endCapture().endCapture(),searchFolder:lt()().find(" /").anything().endOfLine(),searchFolderNoSpace:lt()().find("/").anything().endOfLine(),firstPartImg:lt()().find("![").anythingBut("[]").then("]("),hashtag3:lt()().find(/[-| |\n]{1}\#([A-z\xc0-\xfa1-9_\-]+)/gi),titleMd:lt()().startOfLine().find("#").oneOrMore().then(" ").beginCapture().anythingBut("").endCapture(),scriptHtml:lt()().find("<script>").beginCapture().anythingBut("").endCapture().then("<\/script>")},ut=!1,dt=function(t){if(!t)return null;if(t.startsWith(w.headerStart)&&(ut=!0),t.startsWith(w.headerEnd)&&(ut=!1),""===t)return null;if(!ut)return null;var n=t.split(": ");if(2!==n.length)return null;var e=n.shift();if(!e)return null;var o,i=n.join(":").trim();if("created"===e||"modified"===e){o=i,i=parseInt(o).toString()===o?function(t){var n="".concat(t).substr(0,10);return parseInt(n)}(i):i;var c=new Date(i).getTime();isNaN(c)||(i=c)}return{name:e,value:i}},ft=function(t,n){for(var e=0;e<n.length;e++){var o=n[e];t=t.split(o[0]).join(o[1])}return t},gt=function(t){return{file:function(n,e,cb){var o=ri("move-file-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFILE] ".concat(n," -> ").concat(e)),Ze.emit("moveFile",{initPath:n,endPath:e,idReq:o,token:Q()})},folder:function(n,e,cb){var o=ri("move-folder-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFOLDER] ".concat(n," -> ").concat(e)),Ze.emit("moveFolder",{initPath:n,endPath:e,idReq:o,token:Q()})}}},bt=function(t){var n="[FILE API] 005363 ";Object(o.useEffect)((function(){Ze.on("getFileContent",(function(n){if(n.error)t.eventBus.notify(n.idReq,{error:n.error});else{var e=function(t){var n=t.match(pt.metas),e={};if(n&&n[0])for(var o=n[0].split("\n"),i=0;i<o.length;i++){var c=dt(o[i]);c&&(e[c.name]=c.value)}return{metas:e,content:ft(t,[[pt.metas,""]])}}(n.fileContent);t.eventBus.notify(n.idReq,{content:e.content})}}))}),[]);var e=Object(o.useRef)("");return{getContent:function(n,cb,e){var o=ht(n),i=ri("get-file-content");t.eventBus.subscribe(i,(function(t){t.error&&e&&e.onError?e.onError(t.error):!t.error||e&&e.onError?t.error||cb(t.content):cb(t.error)})),Ze.emit("askForFileContent",{filePath:o,token:Q(),idReq:i})},saveContent:function(n,o,i){var c=!(!i||!i.history)&&i.history,r=(!i||!i.withMetas||i.withMetas,ht(n));Ze.emit("saveFileContent",{filePath:r,newFileContent:o,token:Q()}),c&&(n!==e.current&&ei().then((function(t){var e=t.ui.browser.folders.current.get;if(e===function(t){var n=t.match(/(.*)[\/\\]/),e=n?n[1]+"/":"";return Y(e)}(n)){var o,i="",c=t.ui.windows.active.get();if(c)i=(null===(o=c.content.file)||void 0===o?void 0:o.name)||"";t.ui.browser.goTo(e,i)}})),t.historyApi.intervalSave(n,o),e.current=n)},delete:function(e,cb){var o=ri("delete-file");console.log("".concat(n," delete file ").concat(e.path)),t.eventBus.subscribe(o,cb),Ze.emit("onFileDelete",{filepath:e.path,idReq:o,token:Q()})},move:gt({eventBus:t.eventBus}).file,create:function(e,cb){var o=ri("create-file");console.log("".concat(n," create file in ").concat(e)),t.eventBus.subscribe(o,cb),Ze.emit("createNote",{folderPath:e,idReq:o,token:Q()})}}},ht=function(t){return t.replace(pt.linklink,"$2/$1")},mt=e(59),vt=e(84),wt=function(){var t=Object(vt.a)(Object(mt.a)().mark((function t(n){return Object(mt.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,e){var o={},i=[];ei().then((function(e){e.search.word("#",n,(function(n){var e=[],c={};console.log(n),Object(g.each)(n,(function(t,n){var i={file:t.file,titleName:""};Object(g.each)(t.results,(function(t,n){var r=[],a=t.match(pt.titleMd);if(a&&a[0]){var l=a[0].split("#").join("").trim();i.titleName=l}var s=t.match(pt.hashtag3);Object(g.each)(s,(function(t){t=t.substring(1),o[t]||(o[t]={id:Object.keys(o).length+1,name:t,lines:[],noteParts:[]}),o[t].noteParts.push(Object(g.cloneDeep)(i)),o[t].lines.push(n),o[t].lines=Object(g.uniq)(o[t].lines);var e=i.file.name+"-"+i.titleName;c[e]||(c[e]=[]),c[e].push(o[t].id),r.push(o[t])})),Object(g.each)(r,(function(t,n){Object(g.each)(r,(function(o,i){if(n!==i){var c=t.id,r=o.id,a="".concat(c,"-").concat(r),l="".concat(r,"-").concat(c);-1===e.indexOf(a)&&-1===e.indexOf(l)&&e.push(a)}}))}))}))})),Object(g.each)(o,(function(t){i.push(t)}));var r={nodesObj:o,nodesArr:i,edges:e};console.log(22232,r),t(r)}))}))})));case 1:case"end":return t.stop()}}),t)})));return function(n){return t.apply(this,arguments)}}(),xt=function(t){var n="[SEARCH API] 00563 ",e=Object(o.useState)(""),i=Object(c.a)(e,2),r=i[0],a=i[1];Object(o.useEffect)((function(){Ze.on("getWordSearch",(function(n){t.eventBus.notify(n.idReq,n.result)}))}),[]);var l=function(e,cb){!function(e,cb,o){var i=ri("search-".concat(o,"-"));console.log("".concat(n," searching ").concat(e," with type ").concat(o)),t.statusApi.searching.set(!0),t.eventBus.subscribe(i,(function(n){t.statusApi.searching.set(!1),cb(n)})),Ze.emit("searchFor",{term:e,token:Q(),type:o,idReq:i})}(e,cb,"text")};return{files:{search:l},word:function(e,o,cb){var i=ri("search-word-");console.log("".concat(n," searching WORD ").concat(e)),t.eventBus.subscribe(i,(function(t){cb(t)})),Ze.emit("searchWord",{word:e,folder:o,token:Q(),idReq:i})},hashtags:function(t,cb){wt(t).then((function(t){cb(t)}))},ui:{search:function(t){ei().then((function(n){n.ui.browser.files.set([]),a(t),l(t,(function(t){n.ui.browser.files.set(t)}))}))},term:{set:a,get:r}}}},Ot=e(252),jt=function(t){var n=Object(d.a)({},t).eventBus;Object(o.useEffect)((function(){Ze.on("getUploadedFile",(function(t){n.notify(t.idReq,t)}))}),[]);var e={uploadFile:function(t){var e=ri("upload-file");n.subscribe(e,(function(n){delete n.idReq,t.onSuccess(n)})),function(t){var n=Object(d.a)({},t),e=n.file,o=n.path,i=n.idReq,c=n.onProgress,r=new Ot(Xe);r.addEventListener("start",(function(t){t.file.meta.idReq=i,t.file.meta.path=o,t.file.meta.token=Q()})),r.addEventListener("progress",(function(t){var n=Math.round(t.bytesLoaded/t.file.size*100);c(n)})),r.submitFiles([e])}({file:t.file,path:t.folderPath,idReq:e,onProgress:function(n){t.onProgress&&t.onProgress(n)}})}};return e},kt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,yt=/([^\s,]+)/g,Ct=e(10),Tt=function(t){Object(C.a)(e,t);var n=Object(T.a)(e);function e(t,o){var i;return Object(k.a)(this,e),(i=n.call(this)).match=t,i.replacement=o,i}return Object(y.a)(e,[{key:"toDOM",value:function(){return this.replacement(this.match)}}]),e}(Ct.g),Et=function(t,n){return new Ct.e({regexp:t,decoration:function(t){return Ct.a.widget({widget:new Tt(t,n)})}})},St=function(t){return Ct.f.fromClass(function(){function n(e){Object(k.a)(this,n),this.decorations=void 0,this.decorations=Et(t.pattern,t.replacement).createDeco(e)}return Object(y.a)(n,[{key:"update",value:function(n){try{this.decorations=Et(t.pattern,t.replacement).updateDeco(n,this.decorations)}catch(e){console.warn("[ERROR VIEWPLUGIN CM]",e,n)}}}]),n}(),{decorations:function(t){return t.decorations},provide:function(n){return Ct.c.atomicRanges.of((function(e){var o,i,c=(null===(o=e.plugin(n))||void 0===o?void 0:o.decorations)||Ct.a.none;return null!==(i=t.options)&&void 0!==i&&i.isAtomic||(c=Ct.a.none),c}))}})},It=function(t,n,e){return'<a class="title-search-link preview-link" data-file="'.concat(t,'" data-folder="').concat(n,'" data-windowid="').concat(e,'">').concat(t,"</a>")},Nt=function(t){return t||(t=""),"\n\t\t\t.preview-link {\t\t\t\t\t\t\t\n\t\t\t\tfont-weight: 800;\n\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\tbackground-position: 4px 2px;\n\t\t\t\tpadding-left: 20px;\n\t\t\t\tbackground-size: 10px;\n\t\t}\n\n\t\t".concat(t,".external-link {\n\t\t\t\tbackground-image: url(").concat(W.assets.worldIcon,");\n\t\t}\n\t\t").concat(t,".search-link {\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\tbackground-image: url(").concat(W.assets.searchIcon,");\n\t\t}\n\t\t").concat(t,".title-search-link {\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\tbackground-image: url(").concat(W.assets.linkIcon,");\n\t\t\t\tcursor: pointer;\n\t\t}\n\t\t").concat(t,".resource-link {\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t} ")},Ft=function(t){var n=t.dataset.file,e=t.dataset.folder,o=t.dataset.windowid;n&&e&&ei().then((function(t){t.ui.browser.goTo(e,n,{openIn:o})}))},Lt=null,Rt=null,At=!1,Dt="[LATEX]",Pt=x.log.verbose,zt=function(t,n){var e=document.createElement("script");e.src=t,e.crossorigin="anonymous",document.body.appendChild(e),e.onload=function(){n()}};At||(zt("https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js",(function(){zt("https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/contrib/auto-render.min.js",(function(){At=!0,Lt=window.katex,Rt=window.renderMathInElement}))})),function(t){var n=document.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=t,document.body.appendChild(n)}("https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.css"));var Mt=Object(g.debounce)((function(){Pt&&console.log(Dt,"REFRESH"),Bt(".render-latex")}),100),Bt=function(t){if(Rt){var n=document.querySelectorAll(t);if(!n)return console.warn(Dt,"no el found :",t);Pt&&console.log(Dt,n),Object(g.each)(n,(function(t){Rt(t,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!0},{left:"[[l]]",right:"[[l]]",display:!0},{left:"\\[",right:"\\]",display:!0}],throwOnError:!1})}))}},_t=e(253);_t.setOptions({gfm:!0,breaks:!0,headerPrefix:"t-"});var Ht=function(t){var n=t;return n=_t.parse(n)},Ut=function(t,n,e){var o=t,i=o.match(n)||"";return Object(g.each)(i,(function(t){o=o.replace(t,e(t))})),o},Wt=function(t,n,e){var o=t,i=n.replace("[[","").replace("]]",""),c="(?:\\[\\[".concat(i,"\\]\\])((?:[^]*))(?:\\[\\[").concat(i,"\\]\\])"),r=new RegExp(c,"gm"),a=o.match(r)||"";if(a[0]){for(var l=a[0].split(n),s=[],p=0;p<l.length;p++){var u=l[p];""!==u&&s.push(u)}for(var d=0;d<s.length;d++){s[d];if(d%2===0)try{s[d]=e(s[d])}catch(g){console.warn("[REPLACE CUSTOM MD TAGS] error: ".concat(g),s[d])}}var f=s.join("");o=o.replace(r,f)}return o},qt=function t(n,e){var o=!1;if(Object(g.each)(n,(function(t){t.id===e&&(o=!0)})),o){var i=!1,c=[e[e.length-2],e[e.length-1]],r=e.slice(0,-2),a=parseInt(c[1]);return"-"!==c[0]||isNaN(a)||(i=!0),i?e="".concat(r,"-").concat(a+1):e+="-1",t(n,e)}return e},Vt=e(200),Gt=e(34),Jt=function(t,n){var e="render-react-wrapper-".concat(G()),o=function(){var n=Yt(t),o=setInterval((function(){var t=document.getElementById(e);t&&(t.innerHTML="",t.appendChild(n),clearInterval(o))}),10)};return n&&n.delay?setTimeout(o,n.delay):o(),e},Yt=function(t,n){return n||(n=document.createElement("div")),Object(Vt.createRoot)(n).render(t),n},Kt=(Gt.renderToString,e(85)),$t=e(201),Xt=e(202),Zt=function(t){Object(C.a)(e,t);var n=Object(T.a)(e);function e(){var t;Object(k.a)(this,e);for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];return(t=n.call.apply(n,[this].concat(i))).size=t.props.size?t.props.size:1,t.isLocal=!t.props.name.startsWith("fa"),t}return Object(y.a)(e,[{key:"render",value:function(){return Object(r.c)("span",{style:{transform:"scale(".concat(this.size,")"),display:"inline-block"}},!this.isLocal&&Object(r.c)($t.a,{icon:Xt[this.props.name],color:this.props.color||"black",size:"1x"}),this.isLocal&&Object(r.c)("span",{style:{transform:"scale(".concat(this.size,")"),display:"inline-block",width:"20px",height:"20px",background:"url('".concat(this.props.name,"')"),backgroundSize:"contain",backgroundRepeat:"no-repeat"}}))}}]),e}(i.a.Component),Qt=i.a.memo(Zt,(function(t,n){return JSON.stringify(t)===JSON.stringify(n)})),tn=function(t){var n=Object(d.a)({},t),e=n.design,i=n.colors,c=n.size;e||(e="horizontal");var a=!("popup"in t)||t.popup,l=Object(Kt.a)("button.toolbar-button{position:relative;&.active{svg{color:",i?i[1]:W.colors.main,";}}svg{transform:scale(",c||1.3,");color:",i?i[0]:W.colors.editor.interfaceGrey,";&:hover{color:",i?i[1]:W.colors.main,";}}}","");return Object(o.useMemo)((function(){return Object(r.c)("div",{className:l},Object(r.c)("ul",{className:"buttons-toolbar-component ".concat(t.class," ").concat(e," ").concat(a?"with-popup":"no-popup")},t.buttons.map((function(t,n){var e;return t.action&&Object(r.c)("li",{className:"".concat(t.class," btn-").concat(null===(e=t.title)||void 0===e?void 0:e.toLowerCase()),title:t.title,key:n},Object(r.c)(en,t))}))))}),[t.buttons])},nn=i.a.memo(tn,(function(t,n){return!1})),en=function(t){var n=Object(r.c)(i.a.Fragment,null);t.title&&(n=Object(r.c)(i.a.Fragment,null,t.title)),t.icon&&(n=Object(r.c)(Qt,{name:t.icon})),t.customHtml&&(n=t.customHtml);var e="toolbar-button ".concat(t.class&&t.class," ").concat(t.active&&"active");return Object(r.c)("button",{className:e,onClick:function(n){t.action&&t.action(n)}},Object(r.c)("div",{className:"inside-html-wrapper"},n),Object(r.c)("div",{className:"button-hover-popup "},t.title))},on=e(28),cn=function(t){var n=t.headerLog,e={},o=function(t){e[t]&&delete e[t]};return{notify:function(t){for(var i in e){var c=e[i],r=!1;if(i.endsWith("-once")&&(i=i.replace("-once",""),r=!0),i===t.subId)try{c(t.data),r&&o("".concat(i,"-once"))}catch(a){n&&console.log("".concat(n," error with function"),a)}}},subscribe:function(t,cb){e[t]=cb},subscribeOnce:function(t,cb){var n="".concat(t,"-once");e[n]=cb},unsubscribe:o}},rn="[IFRAME PARENT] 00563",an=x.log.iframe,ln=cn({headerLog:rn}),sn=ln.notify,pn=ln.subscribe,un=ln.unsubscribe;window.addEventListener("message",(function(t){t.data.subId&&(an&&console.log(rn,"parent <== iframe",t.data.data),sn(t.data))}));var dn={subscribe:pn,unsubscribe:un,send:function(t,n){t&&t.contentWindow&&(an&&console.log(rn,"parent ==> iframe",n),t.contentWindow.postMessage(n,"*"))}},fn=function(t){return'\n<html>\n\t\t<div id="content-wrapper">\n\t\t\t\t'.concat(t,'\n\t\t</div>\n\t\t<div id="external-ressources-wrapper"></div>\n\t\t<script>\n\t\t\t\tconst IMPORTED_backend_url = "').concat(di(),'"\n\t\t\t\tconst IMPORTED_login_token = "').concat(Q(),'"\n\t\t\t\tconst IMPORTED_replaceCustomMdTags = ').concat(Wt.toString(),"\n\t\t\t\tconst IMPORTED_unescapeHtml = ").concat(Wo.toString(),"\n\t\t\t\tconst IMPORTED_createEventBus = ").concat(cn.toString(),"\n\t\t\t\tconst IMPORTED_generateUUID = ").concat(G.toString(),"\n\t\t\t\tconst IMPORTED_getRessourceIdFromUrl = ").concat(J.toString(),"\n\t\t\t\tconst IMPORTED_bindToElClass = ").concat(Vo.toString(),"\n\t\t\t\tconst main = ").concat(gn.toString(),";\n\t\t\t\tmain({\n\t\t\t\t\tbackendUrl: IMPORTED_backend_url,\n\t\t\t\t\tloginToken: IMPORTED_login_token,\n\t\t\t\t\treplaceCustomMdTags: IMPORTED_replaceCustomMdTags,\n\t\t\t\t\tunescapeHtml: IMPORTED_unescapeHtml,\n\t\t\t\t\tcreateEventBus: IMPORTED_createEventBus,\n\t\t\t\t\tgenerateUUID: IMPORTED_generateUUID,\n\t\t\t\t\tgetRessourceIdFromUrl: IMPORTED_getRessourceIdFromUrl,\n\t\t\t\t\tbindToElClass: IMPORTED_bindToElClass\n\t\t\t\t})\n\t\t<\/script>\n</html>\n")},gn=function(t){var n,e="[IFRAME child] 00564",o={file:null,frameId:"",reloadCounter:0,windowId:"",innerTag:"",tagName:"",tagContent:"",loginToken:t.loginToken,backendUrl:t.backendUrl},i=function(t){if(""===o.frameId)return console.warn(e,"NO FRAME ID, CANNOT SEND TO PARENT");var n={subId:o.frameId,data:t};window.parent.postMessage(n,"*")},c=function(t){var n={error:"CUSTOM TAG/SCRIPT ERROR: ".concat(t)};i({action:"iframeError",data:n})},r=function(t){var n=document.getElementById("content-wrapper");if(!t){if(!n||0===n.clientHeight)return;t=n.clientHeight+20}i({action:"resize",data:{height:t}})},a=t.createEventBus({headerLog:"[FRAME API] 00567"}),l=a.subscribeOnce,s=a.notify,p=function(t,n){var o;t.includes(".js")?(o=document.createElement("script")).src=t:t.includes(".css")&&((o=document.createElement("link")).href=t,o.rel="stylesheet",o.type="text/css"),o.onload=function(){n()};var i=document.getElementById("external-ressources-wrapper");if(!i)return console.error(e,"could not load ".concat(t," because ressource wrapper was not detected"));i.appendChild(o)},u=function(n){var e="?token=".concat(t.loginToken);return"".concat(t.backendUrl,"/static").concat("/.tiro/cache/ctag-ressources/").concat(t.getRessourceIdFromUrl(n)).concat(e)},d=function(t,cb){for(var n=0,o=function(){if(++n===t.length)try{cb&&cb()}catch(o){console.error(e,"ERROR LoadScript Callback : ".concat(o))}},i=function(n){var i=t[n],c=u(i),r=!0===window.disableCache,a=function(){f("ressource.download",[i,"/.tiro/cache/ctag-ressources/"],(function(){p(c,(function(){o()}))}))};r?(console.warn(e,"CACHE DISABLED, DOWNLOADING RESSOURCES EVERYTIME!"),a()):function(t,n,e){try{var o=new XMLHttpRequest;o.open("HEAD",t,!1),o.send(),404!==o.status?n():e()}catch(i){e(i)}}(c,(function(){p(c,(function(){o()}))}),(function(){a()}))},c=0;c<t.length;c++)i(c)},f=function(n,e,cb){if(!e||!n||e.constructor!==Array||"string"!==typeof n)return c("Call Api : ".concat(n," => wrong arguments type / number(").concat(JSON.stringify({apiName:n,apiArguments:e,cb:cb}),")"));var o="iframe-api-call-".concat(t.generateUUID()," ");l(o,(function(t){cb&&cb(t)})),i({action:"apiCall",data:{reqId:o,apiName:n,apiArguments:e}})},g={version:1.1,call:f,utils:{getInfos:function(){return o},loadCachedRessources:d,getCachedRessourceUrl:u,loadScripts:function(t,cb){d(t,cb)},loadRessources:function(t,cb){d(t,cb)},loadScriptsNoCache:function(t,cb){for(var n=0,o=0;o<t.length;o++){var i=t[o],c=document.createElement("script");c.src=i,c.onload=function(){if(++n===t.length)try{cb&&cb()}catch(o){console.error(e,"ERROR LoadScript Callback : ".concat(o))}};var r=document.getElementById("external-ressources-wrapper");r&&r.appendChild(c)}},resizeIframe:r,canScrollIframe:function(t){i({action:"canScrollIframe",data:{status:t}})},loadCustomTag:function(t,n,e){var o=g.utils.createDiv(),i=o.div,c=o.updateContent;e||(e={}),e.base_url=t.split("/").slice(0,-1).join("/");var r=!0;return!1===e.padding&&(r=e.padding),g.utils.loadScripts([t],(function(){var t=window.initCustomTag("".concat(n),e);r&&(t='<div class="with-padding" style="padding: 0px 15px;">'.concat(t,"</div>")),c(t)})),i},uuid:t.generateUUID,createDiv:function(){var n="ctag-content-wrapper-".concat(t.generateUUID()," ");return{div:'<div id="'.concat(n,'"></div>'),updateContent:function t(e){var o=document.getElementById(n);o?o.innerHTML=e:setTimeout((function(){t(e)}),100)}}}}};return window.api=g,n={init:function(n){o.frameId=n.frameId,o.innerTag=n.innerTag,o.tagContent=n.tagContent,o.tagName=n.tagName,o.file=n.file,o.reloadCounter=n.reloadCounter,o.windowId=n.windowId;var i,a=document.getElementById("content-wrapper");if(a){var l=t.unescapeHtml(a.innerHTML),s=(i=l,t.replaceCustomMdTags(i,"[[script]]",(function(t){var n="".concat(t);try{return new Function(n)()}catch(o){console.warn(e,"[SCRIPT] error: ".concat(o),n),c("".concat(o,' in Code "').concat(n,'"'))}})));a.innerHTML=s,setTimeout((function(){r()}),100),t.bindToElClass("title-search-link",(function(t){var n=t.dataset.file,e=t.dataset.folder,o=t.dataset.windowid;g.call("ui.browser.goTo",[e,n,{openIn:o}])}))}},apiAnswer:function(t){var n={subId:t.reqId,data:t.data};s(n)}},window.onmessage=function(t){var e=t.data;if(e)for(var o in n)n&&n[o]&&o===e.action&&n[o](t.data.data)},g};function bn(cb,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e={leading:!1,trailing:!0};n&&(e.leading=n);var i=Object(o.useRef)(cb),c=hn();return Object(o.useEffect)((function(){i.current={cb:cb,delay:t}})),Object(o.useCallback)(b.a.debounce((function(){var n;i.current.delay===t&&c()&&(n=i.current).cb.apply(n,arguments)}),t,e),[t,b.a.debounce])}function hn(){var t=Object(o.useRef)(!0);return Object(o.useEffect)((function(){return function(){t.current=!1}}),[]),function(){return t.current}}var mn=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),i=e[0],a=e[1],l=Object(o.useState)(!1),p=Object(c.a)(l,2),u=p[0],d=p[1];Object(o.useEffect)((function(){a(t.title)}),[t.title]);var f=bn((function(n){0!==n.length&&"mobile"===s()&&(d(!1),t.onEdited(t.title,i))}),1e3);return Object(r.c)("div",{className:"title-input-wrapper"},Object(r.c)("input",{className:"big-title",type:"text",value:i,onChange:function(t){var n=function(t){return t.replace(/[^\w\s\_\-]/gi,"")}(t.target.value);a(n),d(!0),f(n)},onKeyDown:function(n){if("Enter"===n.key){if(i.length<3)return;t.onEdited(t.title,i),d(!1)}}}),u&&Object(r.c)("div",{className:"press-to-save"},Object(r.c)(Qt,{name:"faCircle",color:W.colors.main,size:.7})))},vn=i.a.memo(mn,(function(t,n){var e=!1;return t.title!==n.title&&(e=!1),e})),wn=e(203),xn=e(4),On=e(3),jn=e(7),kn=function(t,n){for(var e=document.querySelectorAll(t),o=function(t){var o=e[t];null===o||void 0===o||o.addEventListener("click",(function(t){n(o)}))},i=0;i<e.length;i++)o(i)},yn=St({pattern:pt.externalLink3,replacement:function(t){console.log(t);var n=document.createElement("span"),e=t[0].slice(0,-1),o=t[1].replace("www.",""),i=t[3],c=t[4];n.classList.add("link-mdpreview-wrapper"),n.classList.add("link-wrapper");o.length>20&&(o=o.substring(o.length-20));var a=i;""!==a&&a||(a=c),a.length>20&&(a=a.substring(0,20)+""),a=0!==a.length?"".concat(a):"";var l="".concat(o).concat(a),s="".concat(Object(Gt.renderToString)(Object(r.c)(Qt,{name:"faLink",color:W.colors.main}))),p='<span class="link-openwindow" data-link="'.concat(e,'">').concat(Object(Gt.renderToString)(Object(r.c)(Qt,{name:"faExternalLinkAlt"})),"</span>"),u='<a href="'.concat(e,'" class="link-mdpreview" title="').concat(e,'" target="_blank" rel="noreferrer">').concat(s," ").concat(l,"</a> ").concat(p);return n.innerHTML="".concat(u),Cn(),n}}),Cn=function(){setTimeout((function(){kn(".link-openwindow",(function(t){if(t){var n=t.dataset.link;window.open(n,"popup-preview-link","width=800,height=1000")}}))}),100)},Tn=function(){setTimeout((function(){kn(".cm-mdpreview-image .enlarge",(function(t){var n;if(t){var e=null===(n=t.parentNode.querySelector("img"))||void 0===n?void 0:n.src;Object(g.isString)(e)&&e.startsWith("http")&&(e=e.replace(tt(),""),oi((function(t){t.ui.lightbox.open(0,[e])})))}}))}),1e3)},En={LatexMdEl:xn.a.define()},Sn={resolve:"LatexMdEl"},In={defineNodes:["LatexMdEl"],parseInline:[{name:"MdCustomTagsParser",parse:function(t,n,e){return 36===n?t.addDelimiter(Sn,e,e+1,!0,!0):-1},after:"Emphasis"}],props:[Object(xn.c)({LatexMdEl:En.LatexMdEl})]},Nn=function(t){Object(C.a)(e,t);var n=Object(T.a)(e);function e(t){var o;return Object(k.a)(this,e),(o=n.call(this)).str=t,o}return Object(y.a)(e,[{key:"ignoreEvent",value:function(){return!1}},{key:"toDOM",value:function(){var t=document.createElement("div");t.classList.add("cm-mdpreview-wrapper"),t.classList.add("latex-wrapper");var n=function(t){var n=t=t.replaceAll("$","");if(!Lt)return n;try{window.ka=Lt,n=Lt.renderToString(t)}catch(e){Pt&&console.log("LATEX ERR:",e)}return n}(this.str);return t.innerHTML=' <div class="latex-height" >'.concat(n,"</div> "),t}}]),e}(Ct.g);function Fn(t,n){var e,o=[],i=Object(On.a)(t.visibleRanges);try{for(i.s();!(e=i.n()).done;){var c=e.value,r=c.from,a=c.to;Object(jn.B)(t.state).iterate({from:r,to:a,enter:function(n){if("LatexMdEl"===n.name){var e=t.state.doc.sliceString(n.from,n.to),i=Ct.a.widget({widget:new Nn(e),side:1});o.push(i.range(n.from))}}})}}catch(l){i.e(l)}finally{i.f()}return Ct.a.set(o)}var Ln=function(t){return Ct.f.fromClass(function(){function n(e){Object(k.a)(this,n),this.decorations=void 0,this.decorations=Fn(e,t.file)}return Object(y.a)(n,[{key:"update",value:function(n){(n.docChanged||n.viewportChanged)&&(this.decorations=Fn(n.view,t.file))}}]),n}(),{decorations:function(t){return t.decorations},eventHandlers:{mousedown:function(n,e){var o=n.target;if(function(t){t.classList.contains("title-search-link")&&Ft(t)}(o),o.classList.contains("actionable-title")){var i=o.innerHTML.replace(/^#{1,6} /,"");t.onTitleClick(i)}}}})},Rn=function(){return"\n.latex-height {\n\t\theight: 20px;\n\t\toverflow: scroll;\n\t\tline-height: initial;\n\t\tbackground: rgb(247,247,247);\n\t\tpadding: 10px;\n\t\tborder-radius: 5px;\n\t\tcolor: rgba(0,0,0,0);\n\t\ttransition: all 0.2s;\n\t\t.katex, .katex span {\n\t\t\t\tcolor: black;\n\t\t}\n}\n\n.mdpreview-source {\n\t\tfont-weight: bold;\n\t\tcolor: #b4b4b4;\n\t\tfont-size: 9px;\n\t\tdisplay: block;\n}\n\n.cm-mdpreview-wrapper {\n\t\tline-height: 0px;\n\n\t\t&.latex-wrapper {\n\t\t\t\tposition: relative;\n\t\t\t\tleft: -10px;\n\t\t\t\tdisplay: inline-block;\n\t\t}\n\t\t&.image-wrapper {\n\t\t\t\t/* max-height: 160px; */\n\t\t}\n\n\t\t.cm-mdpreview-image {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\timg {\n\t\t\t\t\t\tmargin: 5px 0px;\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\tmax-width: calc(100% - 20px);\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tmax-height: 220px;\n\t\t\t\t}\n\t\t\t\t.enlarge {\n\t\t\t\t\t\twidth: 10px;\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\ttransition: 0.2s all;\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\tright: 23px;\n\t\t\t\t\t\tz-index: 2;\n\t\t\t\t\t\tpadding: 6px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tbackground: rgba(0,0,0,0.6);\n\t\t\t\t\t\tborder-radius: 19px;\n\t\t\t\t}\n\t\t\t\tsvg, span {\n\t\t\t\t\t\tpointer-events: none;\n\t\t\t\t}\n\t\t\t\tsvg {\n\t\t\t\t\t\tbox-shadow: 0 0 0 rgba(0,0,0,0.4);\n\t\t\t\t}\n\n\t\t}\n\t\t&:hover .enlarge {\n\t\t\t\topacity: 0.3;\n\t\t\t\t/* pointer-events: all; */\n\t\t}\n}\n}\n\n ".concat("\n.link-mdpreview-wrapper {\n\t\tposition: relative;\n\t\t&:hover {\n\t\t\t\t.link-openwindow,\n\t\t\t\t.links-infos {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\tpointer-events: all;\n\t\t\t\t}\n\t\t\t\t.link-openwindow {\n\t\t\t\t\t\topacity: 0.1\n\t\t\t\t}\n\t\t}\n\n\t\t.link-openwindow {\n\t\t\t\tcursor: pointer;\n\t\t\t\tposition: absolute;\n\t\t\t\tright: 0px;\n\t\t\t\ttop: 0px;\n\t\t\t\topacity: 0;\n\t\t\t\ttransition: 0.2s all;\n\t\t\t\tpointer-events: none;\n\t\t\t\tsvg, span, div {\n\t\t\t\t\t\tpointer-events:none;\n\t\t\t\t}\n\t\t}\n\n\t\t.links-infos {\n\t\t\t\ttransition: 0.2s all;\n\t\t\t\ttransition-delay: 1s;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: -50px;\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t\tbackground: white;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\tpadding: 8px;\n\t\t\t\tbox-shadow: 0 0 5px rgba(0,0,0,0.4);\n\t\t\t\t".concat("\n\n","\n\t\t\t\tfont-size: 8px;\n\n\n\t\t}\n\n\t\t.link-mdpreview {\n\t\t\t\topacity: 0.6;\n\t\t\t\ttransition: 0.2s all;\n\t\t\t\t&:hover {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\t\t\t\tline-height: 20px;\n\t\t\t\ttext-decoration: none;\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\t// border: solid 2px ").concat(W.colors.main,";\n\t\t\t\tpadding: 0px 6px;\n\t\t\t\tcursor: pointer;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\tsvg {\n\t\t\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\t}\n\t\t}\n}\n"),"\n ").concat("\n.cm-mdpreview-wrapper.image-wrapper {\n\t\t.mdpreview-source {\n\t\t\t\tline-height: initial;\n\t\t}\n}\n\n","\n ")},An=function(){return Object(wn.a)({theme:"light",settings:{background:"#ffffff",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",selectionMatch:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C",gutterBorder:"#ddd",lineHighlight:"#fff"},styles:[{tag:xn.e.comment,color:"#787b80"},{tag:xn.e.definition(xn.e.typeName),color:"#194a7b"},{tag:xn.e.typeName,color:"#194a7b"},{tag:xn.e.tagName,color:"#008a02"},{tag:xn.e.variableName,color:"#1a00db"},{tag:xn.e.heading,color:W.colors.main},{tag:Pn.Image,color:"red",class:"tiro-image"},{tag:En.LatexMdEl,class:"cm-mdpreview-latex-code mdpreview-source"},{tag:xn.e.heading1,class:"actionable-title h1"},{tag:xn.e.heading2,class:"actionable-title h2"},{tag:xn.e.heading3,class:"actionable-title h3"},{tag:xn.e.heading4,class:"actionable-title h4"},{tag:xn.e.heading5,class:"actionable-title h5"},{tag:xn.e.heading6,class:"actionable-title h6"},{tag:xn.e.content,fontSize:"10px"}]})},Dn={ImageTwo:xn.a.define()},Pn=(Object(xn.c)({ImageTwo:Dn.ImageTwo,"Strikethrough/...":Dn.ImageTwo}),{ListItem:xn.a.define(),headingMark:xn.a.define(),LinkReference:xn.a.define(),Image:xn.a.define(),LinkTitle:xn.a.define(),LinkLabel:xn.a.define(),Link:xn.a.define(),LinkMark:xn.a.define(),BulletList:xn.a.define()}),zn=(Object(xn.c)({LinkReference:Pn.LinkReference,ListItem:Pn.ListItem,Link:Pn.Link,Image:Pn.Image,LinkTitle:Pn.LinkTitle,LinkLabel:Pn.LinkLabel,LinkMark:Pn.LinkMark,BulletList:Pn.BulletList}),"[Code Mirror]"),Mn=x.log.verbose,Bn=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Mn&&console.log(zn," update cursor",n,t);try{e&&t.view.dispatch({selection:{anchor:n,head:n},scrollIntoView:!0})}catch(o){console.warn(zn,"update Cursor error",o)}},_n=0,Hn=function(t){if(console.log("GET SCROLLING LINE -> NOT USED, SHOULD BE UPDATED"),!t.view)return-1;for(var n=t.view.state.doc.toString(),e=t.view.elementAtHeight(t.view.scrollDOM.scrollTop).from,o=n.split("\n"),i=0,c=0,r=0;r<o.length&&(i+=o[r].length)<e;r++)c=r;_n=c},Un={getEditorInfos:function(t){var n=t,e=Math.round(n.viewState.pixelViewport.top),o=n.lineBlockAtHeight(e),i=n.state.doc.lineAt(o.from).number,c=n.contentHeight,r=n.viewState.editorHeight,a=(c-r)/100;return{viewportHeight:r,contentHeight:c,visibleFirstLine:i,percentPx:a,currentPercentScrolled:n.viewState.pixelViewport.top/a}},getCurrentLineInfos:function(t){var n=t.view.state.doc.lineAt(t.view.state.selection.main.head).number-1,e=function(t){return t.view.state.selection.ranges[0].from}(t),o=t.view.state.doc.toString().split("\n");return{lines:o,currentPosition:e,activeLine:o[n]||"",lineIndex:n}},getScrolledLine:function(t){return Hn(t),_n},updateCursor:Bn,updateText:function(t,n,e){var o=t.view.state.doc.toString().length,i=t.view.state.selection.ranges[0].from;t.view.dispatch(t.view.state.update({changes:{from:0,to:o,insert:n}})),Bn(t,i,!0)},scrollTo:function(t,n){if(!t.view)return-1;Bn(t,n,!0)},scrollToLine:function(t,n){var e=t.view.state.doc.line(n);Bn(t,e.from,!0)},getCustomTheme:An},Wn=function(t){for(var n=!0,e=0;e<t.length;e++)32!==t[e].charCodeAt(0)&&45!==t[e].charCodeAt(0)&&91!==t[e].charCodeAt(0)&&93!==t[e].charCodeAt(0)&&(n=!1);return n},qn="[TEXT MANIP ACTION]",Vn=function(t){var n=Object(o.useRef)(0),e=t.editorRef,i=t.editorRef,c=t.editorRef,r=function(){var o;if("codemirror"===t.editorType){var r=Un.getCurrentLineInfos(e.current);o=r,n.current=r.currentPosition}else if("monaco-textarea"===t.editorType){var a;if("desktop"===t.deviceType)o=null===(a=i.current)||void 0===a?void 0:a.getCurrentLineInfos(),n.current=o&&o.monacoPosition?o.monacoPosition:0;else o=c.current?function(t){for(var n=t.value.split("\n"),e=t.selectionStart,o=0,i=0;o<e+1;)o+=n[i].length+1,i++;return{currentPosition:e,lines:n,activeLine:n[--i],lineIndex:i}}(c.current):null,n.current=o&&o.currentPosition?o.currentPosition:0}return o},l=function(o){var r=n.current+o;if("codemirror"===t.editorType)Un.updateCursor(e.current,r,!0);else if(a("desktop")){var l;null===(l=i.current)||void 0===l||l.editor.setPosition(r)}else{var s=c.current;if(!s)return;s.focus(),setTimeout((function(){s&&(s.selectionStart=r,s.selectionEnd=r)}))}};return{getLineTextInfos:r,resetCursorPosition:l,applyTextModifAction:function(t,n){var e=r();if(!e)return null;console.log(qn,"applying =>",t,n);var o=function(t,n,cb,e){var o=n.lines;if("^"===t){var i=o[n.lineIndex-1],c=o[n.lineIndex];o[n.lineIndex]=i,o[n.lineIndex-1]=c,cb(-i.length-1)}if("v"===t){var r=o[n.lineIndex+1],a=o[n.lineIndex];o[n.lineIndex]=r,o[n.lineIndex+1]=a,cb(+r.length+1)}if("X"===t){o[n.lineIndex].length;var l=Object(f.a)(o).splice(0,n.lineIndex).join("\n").length+1-n.currentPosition;o[n.lineIndex]="",cb(l)}if("C"===t){var s=o[n.lineIndex].length,p=o[n.lineIndex];o.splice(n.lineIndex,0,p),cb(s+1)}"->"===t&&(o[n.lineIndex]=" "+o[n.lineIndex],cb(2)),"<-"===t&&(n.activeLine.startsWith(" ")?(o[n.lineIndex]=o[n.lineIndex].substr(2,o[n.lineIndex].length),cb(-2)):cb(0));var u=n.activeLine.trim();if("[x]"===t&&(u.startsWith("- [ ]")||u.startsWith("- [x]")?u.startsWith("- [ ]")?(o[n.lineIndex]=o[n.lineIndex].replace("[ ]","[x]"),cb(0)):u.startsWith("- [x]")?(o[n.lineIndex]=o[n.lineIndex].replace("[x]","[ ]"),cb(0)):cb(0):(o[n.lineIndex]=o[n.lineIndex].replace(u,"- [ ] "+u.replace("-","")),cb(6))),"insertAt"===t&&e&&e.textToInsert&&(Object(g.isNumber)(e.insertPosition)||Object(g.isString)(e.insertPosition))){var d="currentPos"===e.insertPosition?n.currentPosition+1:e.insertPosition,b=o.join("\n");o=[b.slice(0,d),e.textToInsert,b.slice(d)].join("").split("\n")}return o.join("\n")}(t,e,(function(t){console.log(qn,"applying a decal of cursor of :",t),l(t)}),n);return o}}},Gn=function(t,n){var e=Vn({editorType:"monaco-textarea",deviceType:"mobile",editorRef:n.mobileTextarea}),i=e.getLineTextInfos,r=e.resetCursorPosition,a=function(t){var n=Object(o.useState)(0),e=Object(c.a)(n,2),i=e[0],r=e[1];return{saveYTextarea:function(n){var e=t.current?t.current.scrollTop:0;r(n||e)},resetYTextarea:function(){t.current&&(console.log("resetYTextarea",i),t.current.scrollTop=i)}}}(n.mobileTextarea),l=a.saveYTextarea,s=a.resetYTextarea,p=Object(o.useState)(!1),u=Object(c.a)(p,2),d=u[0],f=u[1];Object(g.debounce)((function(){f(!1)}),500);return{onTextareaChange:function(e){console.log("onTextareaChange");var o=e.target.value,c=o[e.target.selectionStart-1]&&o[e.target.selectionStart-1].charCodeAt(0);if(o.length>t.length){var a=i();if(!a)return;o=function(t,n,cb){if(10===n){console.log("updateTextFromLetterInput => ENTER PRESSED");var e=t.lines[t.lineIndex-1],o=e.indexOf("- ["),i=e.indexOf("-"),c="";-1!==o&&"- [ ] "!==e?(c=e.substr(0,o+3)+" ] ",Wn(c)&&(t.lines[t.lineIndex]=c+t.activeLine,cb(c.length))):-1!==i&&"- "!==e&&"- [ ] "!==e&&(c=e.substr(0,i+1)+" ",Wn(c)&&(t.lines[t.lineIndex]=c+t.activeLine,cb(c.length)))}return t.lines.join("\n")}(a,c,(function(t){setTimeout((function(){r(t),s()}))}))}n.onMobileNoteEdition(o)},onTextareaScroll:function(t){if(!d){var n=t.target.scrollTop;l(n),console.log("onTextareaScroll")}}}},Jn="",Yn=e(42),Kn=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),i=e[0],a=e[1],l=function(){t.onSubmit(i)};return Object(r.c)($n,null,Object(r.c)(q,{title:j.passwordForm.explanation,onClose:function(){t.onClose()}},Object(r.c)("div",null,Object(r.c)(V,{value:i,label:j.setupForm.password,type:"password",shouldFocus:!0,onChange:function(t){a(t)},onEnterPressed:function(){l()}}),Object(r.c)("button",{className:"submit-button",onClick:function(t){l()}},j.passwordForm.submit))))},$n=Object(Yn.a)("div",{target:"eozyeru0"})(".submit-button{margin-top:10px;",W.els().redButton,";padding:10px 20px;}"),Xn=e(60),Zn=e.n(Xn),Qn=function(t,n){var e=Zn.a.generateRSAKey(n,1024),o=Zn.a.publicKeyString(e);return Zn.a.encrypt(t,o)},te=function(t,n){var e=n.replace(t,"").length,o=n.length;return Math.round(e/o*100)/100},ne=function(t){return t>0&&t<=.9},ee=function(t){var n=!1,e={nb:te(/[^0-9]/g,t),up:te(/[^A-Z]/g,t),low:te(/[^a-z]/g,t),spe:te(/[^\/\=\?\+]/g,t)},o=ne(e.nb)&&ne(e.up)&&ne(e.low)&&e.spe>0,i=(t.trim().endsWith("==")||t.trim().endsWith("="),/^[a-zA-Z0-9\/\=\?\+]+$/.test(t)),c=t.length>100;return i&&o&&c&&(n=!0),n},oe=function(t){var n=Object(o.useState)(null),e=Object(c.a)(n,2),i=e[0],a=e[1],l=Object(o.useState)(!1),s=Object(c.a)(l,2),p=s[0],u=s[1],d=Object(o.useState)(!1),f=Object(c.a)(d,2),g=f[0],b=f[1],h=Object(o.useState)(null),m=Object(c.a)(h,2),v=m[0],w=m[1],x=function(n){var e=t.fileContent,o=Qn(e,n);if("failure"===o.status)w(null);else{console.log("encryption done",o),u(!1);var i=o.cipher;t.onTextEncrypted(i)}},O=function(n){var e=function(t,n){var e=Zn.a.generateRSAKey(n,1024);return Zn.a.decrypt(t,e)}(t.fileContent,n);if("failure"===e.status)w(null),alert("wrong password");else{b(!0),u(!0),console.log("decryption done",e);var o=e.plaintext;t.onTextDecrypted(o)}};return{APasswordPopup:Object(r.c)(Kn,{onClose:function(){a(null)},onSubmit:function(t){var n=i;a(null),w(t),"toEncrypt"===n&&x(t),"toDecrypt"===n&&O(t)}}),askForPassword:i,decryptButtonConfig:{title:"decrypt text",icon:"faUnlock",action:function(){v?O(v):a("toDecrypt")}},encryptButtonConfig:{title:"encrypt text",icon:"faLock",action:function(){v?x(v):a("toEncrypt")}},ifEncryptOnLeave:function(cb){if(p&&v){console.log("[EVENTS EDITOR] shouldEncryptOnLeave");var n=Qn(t.fileContent,v);n.cipher&&cb(n.cipher)}w(null),b(!1)},noHistoryBackupWhenDecrypted:g}},ie=function(t){var n=((new Date).getTime()-t.getTime())/1e3,e=604800,o="";if(n<=3600)o="".concat(Math.ceil(n/60)," ").concat(j.minsAgo);else if(n>3600&&n<=86400)o="".concat(Math.ceil(n/3600)," ").concat(j.hoursAgo);else if(n>86400&&n<=e)o="".concat(Math.ceil(n/86400)," ").concat(j.daysAgo);else if(n>e){var i=("0"+t.getDate()).slice(-2),c=j.months[t.getMonth()],r=t.getFullYear().toString();o="".concat(i," ").concat(c," ").concat(r)}return o},ce=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),i=e[0],a=e[1];Object(o.useEffect)((function(){Ze.emit("askFileHistory",{filepath:t.file.path,token:Q()});var n=Ze.on("getFileHistory",(function(t){var n=Object(g.orderBy)(t.files,["created"],["desc"]);a(n)}));return function(){Ze.off(n)}}),[]);var l=Object(o.useContext)(ii),s=Object(o.useState)(""),p=Object(c.a)(s,2),u=p[0],d=p[1],f=Object(o.useState)(null),b=Object(c.a)(f,2),h=b[0],m=b[1];return Object(r.c)(re,null,Object(r.c)("div",{className:"history-popup-wrapper"},Object(r.c)(q,{title:"".concat(j.historyPopup.title,'"').concat(t.file.realname,'"'),onClose:function(){t.onClose()}},Object(r.c)("div",{className:"table-wrapper"},Object(r.c)("table",null,Object(r.c)("thead",null,Object(r.c)("tr",null,Object(r.c)("th",null,j.historyPopup.thead.name),Object(r.c)("th",null,j.historyPopup.thead.date))),Object(r.c)("tbody",null,i.map((function(t){return Object(r.c)("tr",{className:"".concat((null===h||void 0===h?void 0:h.path)===t.path?"active":""),onClick:function(){!function(t){l&&l.file.getContent(t.path,(function(n){d(n),m(t)}))}(t)}},Object(r.c)("td",null," ",t.realname," "),Object(r.c)("td",null," ",ie(new Date(t.created||0))," "))}))))),u&&Object(r.c)("div",{className:"note-preview"},Object(r.c)("textarea",{className:"note-preview-textarea",value:u})))))},re=Object(Yn.a)("div",{target:"ew7e5uv0"})(".history-popup-wrapper .popup-wrapper-component .popup-wrapper{}.popup-wrapper .popupContent{max-height:70vh;padding:0px;}.table-wrapper{max-height:30vh;overflow-y:auto;padding:0px 0px 20px 0px;table{border-spacing:0px;thead{tr{th{padding:8px;}}}tbody{text-align:left;tr{cursor:pointer;background:#f1f0f0;&:nth-child(2n){background:none;}&.active{font-weight:bold;}&:hover{background:r",W.colors.main,";}td{padding:8px;}}}}}.note-preview{.note-preview-textarea{padding:6px;margin:10px 0px 0px 0px;width:calc(100% - 10px);height:34vh;border:none;background:gainsboro;}}"),ae=function(t,n){var e=Object(o.useRef)();Object(o.useEffect)((function(){e.current=t}),[t]),Object(o.useEffect)((function(){if(null!==n){var t=setInterval((function(){e.current()}),n);return function(){return clearInterval(t)}}}),[n])},le=function(){var t=[];return window.speechSynthesis.getVoices().forEach((function(n,e){var o=n.lang?" (".concat(n.lang,")"):"",i="".concat(n.name).concat(o);t.push({key:e,label:i,obj:n})})),t},se=Object(y.a)((function t(n){var e=this;Object(k.a)(this,t),this.rawText=void 0,this.voice=void 0,this.text2read=void 0,this.chunkedText=void 0,this.chunkLength=1e3,this.currChunkId=0,this.currSpeechObj=void 0,this.speed=1,this.isLoaded=!1,this.shouldStop=!1,this.chunkText=function(t){for(var n=(t=t.replace(/(\r\n\r\n|\n\n|\r\r|\n)/gm,".")).split(/[.!?]+/),o=[],i=0;i<n.length;i++){var c=n[i];if(c.length>e.chunkLength)for(var r=c.split(" "),a="",l=0;l<r.length;l++)((a+=r[l]+" ").length>e.chunkLength||l===r.length-1)&&(o.push(a),a="");else o.push(c)}return console.log(o),o},this.loadVoice=function(t){console.log("[TTS] LOAD VOICE",t),e.voice=t},this.updateSpeed=function(t){e.speed=t},this.play=function(){if(e.isLoaded)console.log("[TTS] RESUME play chunk ".concat(e.currChunkId)),window.speechSynthesis.resume();else{if(e.currChunkId>e.chunkedText.length-1)return console.log("[TTS] finished played");e.isLoaded=!0,console.log("[TTS] START play chunk ".concat(e.currChunkId),{txt:e.chunkedText[e.currChunkId]}),e.currSpeechObj=new SpeechSynthesisUtterance,e.currSpeechObj.text=e.chunkedText[e.currChunkId],e.currSpeechObj.rate=e.speed,e.voice&&(e.currSpeechObj.voice=e.voice),console.log(e.currSpeechObj),setTimeout((function(){window.speechSynthesis.speak(e.currSpeechObj)}),0),e.currSpeechObj.addEventListener("end",(function(){e.isLoaded=!1,console.log("[TTS] END play chunk ".concat(e.currChunkId)),e.shouldStop?e.shouldStop=!1:(e.currChunkId+=1,e.play())}))}},this.isPlaying=function(){var t=window.speechSynthesis.speaking;return t&&(t=!window.speechSynthesis.paused),t},this.pause=function(){console.log("[TTS] pause"),e.stop()},this.stop=function(){console.log("[TTS] stop"),e.shouldStop=!0,e.isLoaded=!1,window.speechSynthesis.cancel()},this.goToChunk=function(t){console.log("[TTS] goToChunk",t),t<=0||t>e.chunkedText.length-1||(e.currChunkId=t,e.isPlaying()&&e.debounceRestart())},this.debounceRestart=Object(g.debounce)((function(){console.log("DEBOUNCE RESTART"),e.stop(),e.play()}),500),this.goBack=function(){console.log("[TTS] goBack",e.currChunkId),e.goToChunk(e.currChunkId-1)},this.goForward=function(){console.log("[TTS] goForward",e.currChunkId),e.goToChunk(e.currChunkId+1)},this.rawText=n.text,this.text2read=function(t){var n=t;return n=(n=n.replace(pt.ressource,"")).replace(pt.ref,""),n=Ht(n),console.log("222",n),n=n.replace(pt.baliseHtml,""),console.log("cleanText2Speech",n),n}(n.text),this.chunkedText=this.chunkText(this.text2read),console.log("[TTS] init new manager ",{p:n,text:this.chunkedText,length:this.chunkedText.length})})),pe="[SCREEN WAKE LOCK]",ue=null,de=function(){var t=Object(vt.a)(Object(mt.a)().mark((function t(){return Object(mt.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.wakeLock.request("screen");case 3:ue=t.sent,console.log(pe,"ACTIVE"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(pe,"Error : ".concat(t.t0.name,", ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();var fe=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],a=e[1],l=O("tts-selected-voice",0),p=Object(c.a)(l,2),u=p[0],d=p[1],f=Object(o.useState)(!1),g=Object(c.a)(f,2),b=g[0],h=g[1],m=function(t){!0===t?de():ue&&ue.release().then((function(){ue=null,console.log(pe,"DISABLED")})),h(t)},v=O("tts-pos-".concat(t.file.name),0),w=Object(c.a)(v,2),x=w[0],k=w[1],y=O("tts-rate",1),C=Object(c.a)(y,2),T=C[0],E=C[1],S=Object(o.useState)(0),I=Object(c.a)(S,2),N=I[0],F=I[1],L=Object(o.useRef)();return Object(o.useEffect)((function(){setTimeout((function(){le()[u]&&(console.log("2voice loaded",u),L.current.loadVoice(le()[u].obj))})),L.current=new se({text:t.fileContent}),L.current.goToChunk(x)}),[]),Object(o.useEffect)((function(){le()[u]&&(console.log("voice loaded",u),L.current.loadVoice(le()[u].obj))}),[u]),Object(o.useEffect)((function(){L.current.updateSpeed(T)}),[T]),ae((function(){a(L.current.isPlaying()),0!==L.current.currChunkId&&k(L.current.currChunkId),F(L.current.chunkedText.length)}),500),Object(r.c)(ge,null,Object(r.c)(q,{title:"".concat(j.ttsPopup.title),onClose:function(){L.current.stop(),t.onClose()}},Object(r.c)(V,{value:u,type:"select",list:le(),label:j.ttsPopup.voice,onSelectChange:function(t){d(parseInt(t))}}),Object(r.c)("span",null," SPEED : "),Object(r.c)("input",{type:"range",value:T,min:"0",max:"3",step:"0.1",onChange:function(t){var n=t.target.value;console.log(n),E(n)}}),Object(r.c)("br",null),Object(r.c)("br",null),Object(r.c)("input",{type:"range",value:x,min:"0",max:N,onChange:function(t){console.log(t.target.value),L.current.goToChunk(parseInt(t.target.value))}}),Object(r.c)("input",{type:"number",value:x,min:"0",max:N,onChange:function(t){console.log(t.target.value),L.current.goToChunk(parseInt(t.target.value))}})," / ",N,Object(r.c)("div",{className:"buttons"},Object(r.c)("button",{onClick:function(t){L.current.goBack()}},Object(r.c)(Qt,{name:"faFastBackward",color:"black"})),Object(r.c)("button",{onClick:function(t){i?L.current.pause():L.current.play()}},Object(r.c)(Qt,{name:i?"faPause":"faPlay",color:"black"})),Object(r.c)("button",{onClick:function(t){L.current.goForward()}},Object(r.c)(Qt,{name:"faFastForward",color:"black"})),"desktop"!==s()&&Object(r.c)("button",{onClick:function(t){m(!0)}},Object(r.c)(Qt,{name:"faLock",color:"black"})))),b&&Object(r.c)("div",{className:"bg-lock"},Object(r.c)("button",{onContextMenu:function(t){m(!1)}},Object(r.c)(Qt,{name:"faUnlock",color:"black"}))))},ge=Object(Yn.a)("div",{target:"e1kwupat0"})({name:"11mbgq1",styles:".bg-lock{position:fixed;top:0px;left:0px;width:100vw;height:100vh;z-index:1005;background:rgba(0,0,0,0.3);display:flex;justify-content:center;align-items:center;button{}}.popup-wrapper .popupContent{padding:20px;.input-component span,span{display:inline-block;width:30%;font-size:12px;font-weight:bold;}}"}),be=function(t){return Object(r.c)("div",null,Object(r.c)(nn,{class:"mobile-text-manip-toolbar",colors:[W.colors.editor.mobileToolbar.font,W.colors.editor.mobileToolbar.font],buttons:[{icon:"faAngleLeft",action:function(){return t.onButtonClicked("<-")}},{icon:"faAngleRight",action:function(){return t.onButtonClicked("->")}},{icon:"faCheckSquare",action:function(){return t.onButtonClicked("[x]")}},{icon:"faAngleUp",action:function(){return t.onButtonClicked("^")}},{icon:"faAngleDown",action:function(){return t.onButtonClicked("v")}},{icon:"faEraser",action:function(){return t.onButtonClicked("X")}},{icon:"faClone",action:function(){return t.onButtonClicked("C")}}]}))},he=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=(e[0],e[1],t.dir?t.dir:"left"),a=t.maxHeight?t.maxHeight:50;return Object(r.c)("div",{className:"dropdown-wrapper ".concat(i," ").concat(t.hover?"hover-active":"")},Object(r.c)("span",{onMouseEnter:function(){},onClick:function(){},className:"context-menu-wrapper"},Object(r.c)("div",{className:"dropdown-icon"},Object(r.c)(Qt,{name:"faEllipsisH",color:W.colors.l1.font})),Object(r.c)("div",{className:"context-menu",style:{maxHeight:a}},t.children)))},me=function(t){var n="faPaperclip";"image"===t.type&&(n="faImage"),"camera"===t.type&&(n="faCamera"),"microphone"===t.type&&(n="faMicrophone");var e="*";"image"===t.type&&(e="image/*"),"camera"===t.type&&(e="image/*"),"microphone"===t.type&&(e="audio/*");var o=Object(g.uniqueId)();return Object(r.c)("div",{className:"upload-button-component"},Object(r.c)("input",{className:"input-file-hidden",id:"file-".concat(o),multiple:!0,name:"file-".concat(o),type:"file",capture:"camera"===t.type||"microphone"===t.type,accept:e,onChange:function(n){var e=n.target.files;0!==e.length&&Object(g.each)(e,(function(n){oi((function(e){e.upload.uploadFile({file:n,folderPath:t.file.folder,onProgress:t.onProgress,onSuccess:t.onSuccess})}))}))}}),Object(r.c)("label",{htmlFor:"file-".concat(o)},Object(r.c)(Qt,{name:n}),Object(r.c)("span",{className:"label-text"},t.label)))},ve=function(){return"\n.upload-button-wrapper {\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t\t.inside-html-wrapper {\n\t\t\t\twidth: 100%;\n\t\t}\n\t\t&:hover {\n\t\t\t\t.label-text { color :".concat(W.colors.main,"; }\n\t\t}\n\t\t.upload-button-component {\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\t.input-file-hidden {\n\t\t\t\t\t\twidth: 0.1px;\n\t\t\t\t\t\theight: 0.1px;\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tz-index: -1;\n\t\t\t\t}\n\t\t\t\t.label-text {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tmargin-left: 18px;\n\t\t\t\t\t\tfont-size: 11px;\n\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t}\n\t\t}\n}\n")},we=function(t){var n=t.progress,e=n>=0&&n<100;return Object(r.c)(i.a.Fragment,null,e&&Object(r.c)("div",{className:"upload-progress-bar-wrapper"},Object(r.c)("div",{className:"bg-fill",style:{width:"".concat(n,"%")}}),Object(r.c)("div",{className:"label"},n,"% uploaded... ")))},xe=e(204),Oe=function(t){return t||(t=0),Object(xe.isNumber)(t)?t+1:0},je=e(205),ke=e.n(je),ye=(e(369),e(370),"notes-view-type"),Ce={};window.dbscroll=Ce;x.log.verbose;var Te=function(t){var n=document.querySelector(".window-id-".concat(t," .preview-area")),e=document.querySelector(".window-id-".concat(t," .cm-scroller")),o=document.querySelector(".window-id-".concat(t," .scrolling-bar-wrapper"));return Ce[t]||(Ce[t]={els:{preview:n,editor:e,scroller:o},dims:{editor:{viewport:0,full:0},preview:{viewport:0,full:0},scroller:{viewport:0,full:0}},posPercent:0,previewOffsetY:0}),Ce[t].els.preview=n,Ce[t].els.editor=e,Ce[t].els.scroller=o,Ce[t]},Ee=function(t,n){var e=Te(t);if(e.els.editor){n||(n=e.posPercent);var o=e.els.scroller.dataset;o.scrollRefresh||(o.scrollRefresh=1),o.scrollRefresh=parseInt(o.scrollRefresh)+1}},Se=function(t,n){var e=Te(t);if(e.els.editor){var o=e.dims.editor;n||(n=e.posPercent);var i=(o.full-o.viewport)/100;e.els.editor.scrollTop=i*n}},Ie=function(t,n){var e=Te(t);if(e.els.editor){var o=e.dims.preview;n||(n=e.posPercent);var i=o.full/100,c=Math.round(i*n);e.els.preview.scrollTop=c+e.previewOffsetY}},Ne=function(t,n){var e=Te(t);if(e.els.editor){var o=e.dims.preview.full/100,i=n-Math.round(o*e.posPercent);e.previewOffsetY=i}},Fe={getScrollObj:Te,updateEditorDims:function(t,n){var e=Te(t);e.els.editor&&(e.dims.editor=n)},updatePreviewDims:function(t){var n=Te(t);if(n.els.editor){var e=n.els.preview.querySelector(".simple-css-wrapper").clientHeight,o=n.els.preview.clientHeight;n.dims.preview={viewport:o,full:e}}},updateScrollerDims:function(t){var n=Te(t);if(n.els.editor){var e=n.dims.editor.viewport/n.dims.editor.full||1e7,o=n.dims.preview.viewport/n.dims.preview.full||1e7,i=e<o?e:o,c=n.els.scroller.clientHeight,r=i*c,a={viewport:r=r>c?c:r,full:c};n.dims.scroller=a;var l=n.els.scroller.dataset;l.scrollRefresh||(l.scrollRefresh=1),l.scrollRefresh=parseInt(l.scrollRefresh)+1}},updatePreviewOffset:Ne,onEditorScroll:function(t,n){var e=Te(t);e.els.editor&&(e.posPercent=n,Ee(t,n),Ie(t,n))},onScrollerScroll:function(t,n){var e=Te(t);e.els.editor&&(e.posPercent=n,Se(t,n),Ie(t,n))},onPreviewScroll:function(t){var n=Te(t);if(n.els.editor){var e=n.els.preview.scrollTop;Ne(t,e)}},onWindowLoad:function(t){if(Ce[t]){var n=Te(t);if(!n.els.editor)return;var e=n.posPercent;Ee(t,e),Se(t,e),Ie(t,e)}},scrollEditor:Se,scrollPreview:Ie,scrollScroller:Ee},Le=e(66),Re=e.n(Le),Ae=function(t){var n=Object(o.useState)(0),e=Object(c.a)(n,2),i=e[0],a=e[1],l=Object(o.useRef)(null),s=Object(o.useRef)(null),p=function(){var t={maxY:0,y:0,percent:0},n=s.current?s.current:null,e=l.current?l.current:null;if(!e||!n)return t;var o=e.getBoundingClientRect().height,i=n.getBoundingClientRect().y;return t.maxY=n.getBoundingClientRect().height-o,t.y=e.getBoundingClientRect().y-i,t.percent=t.y/t.maxY*100,t};Object(o.useEffect)((function(){var n=s.current?s.current:null;if(n){var e=new MutationObserver((function(n,e){var o,i=Object(On.a)(n);try{for(i.s();!(o=i.n()).done;){if("data-scroll-refresh"===o.value.attributeName){var c=Fe.getScrollObj(t.windowId),r=c.dims.scroller.viewport;r<20&&(r=20),g(r);var l=(c.dims.scroller.full-c.dims.scroller.viewport)/100,s=c.posPercent*l;a(s)}}}catch(p){i.e(p)}finally{i.f()}}));return e.observe(n,{attributes:!0}),function(){e.disconnect()}}}),[]);var u=Object(o.useState)(0),d=Object(c.a)(u,2),f=d[0],g=d[1];return Object(r.c)("div",{className:"scrolling-bar-wrapper",ref:s},Object(r.c)(Re.a,{onDrag:function(n){Fe.onScrollerScroll(t.windowId,p().percent)},onStop:function(){a(p().y)},position:{x:0,y:i},axis:"y",bounds:"parent"},Object(r.c)("div",{ref:l,style:{height:"".concat(f,"px")},className:"scrolling-bar"})))},De=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),i=e[0],a=e[1],l=Object(o.useState)(0),p=Object(c.a)(l,2),u=(p[0],p[1]),d=Object(o.useRef)(0),h=function(t){t>d.current&&(d.current=t),u(d.current)};Object(o.useEffect)((function(){u(0)}),[t.fileContent]),Object(o.useEffect)((function(){a(t.fileContent)}),[t.fileContent,t.file.path]),Object(o.useEffect)((function(){setTimeout((function(){Fe.onWindowLoad(t.windowId)}),500)}),[t.file.path]);var m=Object(o.useState)(-1),v=Object(c.a)(m,2),w=v[0],x=v[1];Object(o.useEffect)((function(){t.lineJumpEvent&&("active"!==t.lineJumpEvent.windowId||t.isActive)&&("active"!==t.lineJumpEvent.windowId&&t.lineJumpEvent.windowId!==t.windowId||(x(t.lineJumpEvent.line),setTimeout((function(){x(-1)}),100)))}),[t.lineJumpEvent]);var O={id:"",line:0,title:""},j=function(n){var e=function(t){for(var n=[],e=t.split("\n"),o=[],i=0;i<e.length;i++){var c=e[i],r=Object(f.a)(c.matchAll(/([#]{1,9})\ (.+)/gi));if(r.length>0){var a=r[0],l=a[2].toLowerCase(),s=i,p=l.trim().split(" ").join("-").replace(/[^a-zA-Z0-9-_\xc0-\xfa]/gi,"");p=qt(o,p),o.push({raw:c,matches:a,id:p,line:s,title:l,ranking:a[1].length}),n.push({id:p,title:l,line:s})}}return n}(i),o=O;if(Object(g.each)(e,(function(t){n>=t.line&&(o=t)})),""!==o.id){var c=".window-id-".concat(t.windowId," #t-").concat(o.id);try{var r,a=null===(r=document.querySelector(c))||void 0===r?void 0:r.offsetTop;Object(g.isNumber)(a)&&(Fe.updatePreviewOffset(t.windowId,a),Fe.scrollPreview(t.windowId))}catch(l){console.error(l)}}},k=function(cb,t){var n=Object(o.useRef)(cb);return Object(o.useEffect)((function(){n.current=cb})),Object(o.useCallback)(b.a.throttle((function(){return n.current.apply(n,arguments)}),t,{leading:!0,trailing:!1}),[t])}(j,200),y=bn(j,500);return Object(r.c)("div",{className:"dual-view-wrapper view-".concat(t.viewType," device-").concat(s()," window-id-").concat(t.windowId)},Object(r.c)(To,{windowId:t.windowId,editorType:"codemirror",file:t.file,canEdit:t.canEdit,fileContent:t.fileContent,isActive:t.isActive,jumpToLine:w,posY:0,onTitleClick:function(t){!function(t){k(t),y(t)}(t)},onScroll:function(t){},onUpdateY:function(t){},onMaxYUpdate:h,onFileEdited:function(n,e){t.onFileEdited(n,e),a(e)},onScrollModeChange:function(t){},onViewToggle:function(n){t.onViewChange&&t.onViewChange(n)}}),Object(r.c)(Eo,{windowId:t.windowId,file:t.file,posY:0,fileContent:i,onMaxYUpdate:h,yCnt:0,onIframeMouseWheel:function(t){}}),Object(r.c)(Ae,{windowId:t.windowId}))},Pe=function(t){var n=Object(o.useContext)(ii),e=null===n||void 0===n?void 0:n.ui.note.lineJump.get;return Object(r.c)(De,Object(on.a)({},t,{lineJumpEvent:e}))},ze=function(t){var n=Object(d.a)({},t.content),e=n.file,a=n.view,l=n.active,p=n.i,u=Object(o.useState)(""),f=Object(c.a)(u,2),b=f[0],h=f[1],m=Object(o.useState)(),v=Object(c.a)(m,2),w=v[0],x=v[1];Object(o.useEffect)((function(){var t;x(a),(t=null===e||void 0===e?void 0:e.path,new Promise((function(n,e){oi((function(e){e.cache.get(ye,(function(e){if(e){var o=e[t];n(o||!1)}}))}))}))).then((function(t){t&&x(t)}))}),[a,null===e||void 0===e?void 0:e.path]);var O=Object(o.useRef)((null===e||void 0===e?void 0:e.path)||"");Object(o.useEffect)((function(){O.current=(null===e||void 0===e?void 0:e.path)||"",C(!1),e&&oi((function(t){t.file.getContent(e.path,(function(t){h(t),C(!0)})),t.watch.file(e.path,(function(t){O.current===t.filePath&&(!0===I.current?"desktop"===s()&&(T.current=t.fileContent):h(t.fileContent))}))}))}),[null===e||void 0===e?void 0:e.path,b]);var j=Object(o.useState)(!1),k=Object(c.a)(j,2),y=k[0],C=k[1],T=Object(o.useRef)(!1),E=Object(o.useRef)(!1),S=bn((function(){E.current=!1}),2e3),I=Object(o.useRef)(!1),N=bn((function(){T.current=!1,Object(g.isBoolean)(T.current)||(h(T.current),E.current=!0,S())}),2e3);return Object(o.useEffect)((function(){e&&l&&oi((function(t){t.ui.browser.goTo(e.folder,e.name)}))}),[l]),Object(r.c)(i.a.Fragment,null,e&&Object(r.c)("div",{className:"window-editor-wrapper"},Object(r.c)(Pe,{windowId:p,file:e,fileContent:b,isActive:l,canEdit:y,viewType:w,onViewChange:t.onViewChange,onFileEdited:function(t,n){!function(t,n){oi((function(e){e.file.saveContent(t,n,{history:!0})})),I.current=!0,N()}(t,n)}})))},Me=i.a.memo(ze,(function(t,n){return!1})),Be={rows:2,cols:4},_e={m:10,rows:Be.rows,cols:Be.cols,decalBottom:10},He=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),a=e[0],l=e[1],p=Object(o.useState)([]),u=Object(c.a)(p,2),d=u[0],f=u[1],b=Object(o.useRef)();Object(o.useEffect)((function(){t.grid&&t.grid.layout&&(f(t.grid.layout),l(t.grid.content))}),[t.refresh]),Object(o.useEffect)((function(){S(),j()}),[d]);var h=function(n,e){t.onGridUpdate({layout:n,content:e})},m=function(){var t=a[0].file;if(t){var n=function(t){for(var n=[],e=Be,o=function(o){for(var i=[],c=function(n){var e=0;Object(g.each)(t,(function(t){for(var i=0;i<t.w;i++)for(var c=0;c<t.h;c++){var r=t.x+i,a=t.y+c;r===n&&a===o&&(e=1)}})),i.push(e)},r=0;r<e.cols;r++)c(r);n.push(i)},i=0;i<e.rows;i++)o(i);for(var c=[-1,-1],r=[-1,-1],a=0;a<e.rows;a++)for(var l=0;l<e.cols;l++)0===n[a][l]&&-1===c[0]&&-1===c[1]&&(c[0]=l,c[1]=a),0===n[a][l]&&(r[0]=l,r[1]=a);var s=r[0]-c[0]+1,p=r[1]-c[1]+1;return{x:c[0],y:c[1],w:s,h:p}}(d),e=Ue({file:t,w:n.w,h:n.h,x:n.x,y:n.y}),o=Object(g.cloneDeep)(d);o.push(e.layout),L(o)&&(f(o),setTimeout((function(){var t=Object(g.cloneDeep)(a);t.push(e.content);var n=I(e.content.i,t);l(n),h(o,n)})),h(o,a))}},v=Object(o.useState)(!1),w=Object(c.a)(v,2),x=w[0],O=w[1],j=function(){O(d.length>1)},k=function(t){var n=Object(g.filter)(Object(g.cloneDeep)(d),(function(n){return n.i!==t})),e=function(t){var n=Be;return 1===t.length&&(t[0].x=0,t[0].y=0,t[0].h=n.rows,t[0].w=n.cols),t}(n);f(e),setTimeout((function(){var e=Object(g.filter)(Object(g.cloneDeep)(a),(function(n){return n.i!==t}));l(e),h(n,e)})),h(n,a)},y=Object(o.useState)(!1),C=Object(c.a)(y,2),T=C[0],E=C[1],S=function(){var t=0,n=_e.cols*_e.rows;Object(g.each)(d,(function(n){t+=n.w*n.h})),E(t!==n)},I=function(t,n){var e=Object(g.cloneDeep)(n);return Object(g.each)(e,(function(n){n.active=n.i===t})),e},N=function(t,n){var e=I(t,a);l(e),h(d,e),n&&(null===P||void 0===P||P.ui.browser.goTo(n.folder,n.name))},F=function(t){b.current=Object(g.cloneDeep)(t)},L=function(t){for(var n=!0,e=0;e<t.length;e++){var o=t[e];o.y>1&&(n=!1),o.h>1&&o.y>0&&(n=!1)}return n};!function(){var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[1],r=Object(o.useRef)(0);Object(o.useEffect)((function(){var t=Object(g.debounce)((function(){r.current=r.current+1,i(!0),setTimeout((function(){i(!1)}),200)}),200);return window.addEventListener("resize",(function(){t()})),function(){window.removeEventListener("resize",(function(){t()}))}}),[])}(),Object(o.useEffect)((function(){var t=R.current;if(t)return t.addEventListener("resize",(function(){})),function(){t.removeEventListener("resize",(function(){}))}}),[]);var R=Object(o.useRef)(null),A={width:300,height:300};R.current&&(A.width=R.current.clientWidth,A.height=R.current.clientHeight-_e.decalBottom);var D=function(t,n){var e=Object(g.cloneDeep)(a);e[n].view=t,l(e),h(d,e)},P=Object(o.useContext)(ii),z=Object(o.useState)(null),M=Object(c.a)(z,2),B=M[0],_=M[1];Object(o.useEffect)((function(){if("mobile"===s()){var t=null===P||void 0===P?void 0:P.ui.windows.active.get();if(t)_(t);else{var n={layout:d[0],content:a[0]};n.layout&&n.content&&n.layout.i===n.content.i&&(_(n),N(n.content.i))}}}),[t.refresh]);return Object(r.c)("div",{className:"draggable-grid-wrapper"},Object(r.c)("div",{className:"draggable-grid-wrapper-in",ref:R},"mobile"!==s()&&Object(r.c)(ke.a,{className:"draggable-grid",autoSize:!1,layout:d,onLayoutChange:function(t){var n=Object(g.cloneDeep)(t);if(L(n)){var e=function(t){var n=t,e=Be;return n.length,2===n.length&&(n[0].w===e.cols/2-1&&n[1].w===e.cols/2||n[1].w===e.cols/2-1&&n[0].w===e.cols/2)&&(n[0].w=e.cols/2,n[1].w=e.cols/2),n}(n);F(e),f(e),h(e,a)}else{if(!b.current)return;var o=function(t){var n=t,e=Be,o=null;console.log("0035",n),(2===n.length&&(n[0].w===e.cols-1&&n[0].h===e.rows&&n[1].w===e.cols/2&&n[1].h===e.rows||n[1].w===e.cols-1&&n[1].h===e.rows&&n[0].w===e.cols/2&&n[0].h===e.rows)||2===n.length&&(n[0].w===e.cols-1&&n[0].h===e.rows&&n[1].w===e.cols/2&&n[1].h===e.rows||n[1].w===e.cols-1&&n[1].h===e.rows&&n[0].w===e.cols/2&&n[0].h===e.rows))&&(console.log("[ALT LAYOUT] 0035 found i|iii to ii|ii"),o=Object(g.cloneDeep)(t),Object(g.each)(o,(function(t,n){t.w=e.cols/2,t.y=0,1===n&&(t.x=e.cols/2)})));return o}(t);o&&F(o);var i=o||b.current,c=Object(g.cloneDeep)(i);Object(g.each)(c,(function(t){t.refresh=Oe(t.refresh)})),f(c),h(c,a)}},cols:_e.cols,compactType:"horizontal",useCSSTransforms:!1,rowHeight:A.height/_e.rows-_e.m*(_e.rows+1),draggableHandle:".drag-handle",width:A.width,margin:[_e.m,_e.m]},d.map((function(n,e){return Object(r.c)("div",{key:n.i,className:"\n\t\t\t\t\t\t\t\t\t\t".concat(a[e]&&a[e].active?"active":"","\n\t\t\t\t\t\t\t\t\t\twindow-wrapper\n\t\t\t\t\t\t\t\t"),onClick:function(){a[e]&&!a[e].active&&N(a[e].i,a[e].file)}},function(t,n){return Object(r.c)(i.a.Fragment,null,Object(r.c)("div",{className:"note-active-ribbon"}),Object(r.c)("div",{className:"window-buttons-bar ".concat(T?"can-add":""," ").concat(x?"can-remove":"")},Object(r.c)(nn,{design:"horizontal",popup:!1,buttons:[{icon:"faGripVertical",title:"Move Window",class:"drag-handle",action:function(){}},{icon:"faPlus",title:"Add Window",class:"add-button",action:function(){m()}},{icon:"faPlus",title:"Delete Window",class:"delete-button",action:function(){k(t.i)}}],colors:["#d4d1d1","#615f5f"],size:.8})))}(n),Object(r.c)("div",{className:"note-wrapper"},Object(r.c)(Me,{content:t.grid.content[e]&&t.grid.content[e],onViewChange:function(t){D(t,e)}})))}))),"mobile"===s()&&Object(r.c)("div",{className:"mobile-grid-view"},Object(r.c)("div",{className:" window-wrapper"},Object(r.c)("div",{className:"note-wrapper"},B&&Object(r.c)(Me,{content:B.content,onViewChange:function(t){D(t,0)}}))))))},Ue=function(t){var n=Object(d.a)({},t),e=n.w,o=n.h,i=n.x,c=n.y,r=n.file;o||(o=Be.rows),e||(e=Be.cols),i||(i=0),c||(c=0);var a=G();return{layout:{i:a,x:i,y:c,w:e,h:o,minH:1,maxH:2,forceRender:0},content:{i:a,active:!1,file:r,view:"both"}}},We=function(t){var n=Object(g.cloneDeep)(t);return Object(g.each)(n,(function(t){t.refresh=Oe(t.refresh)})),n},qe=function(t){return t.length>15?"".concat(t.substring(0,13),".."):t},Ve=function(t){var n=void 0;return Object(g.each)(t,(function(t,e){t.active&&(n=e)})),n},Ge=function(t,n){var e=Object(g.cloneDeep)(n);return Object(g.each)(e,(function(n){n.refresh=Object(g.isNumber)(n.refresh)?n.refresh++:1,n.id===t?n.active=!0:n.active=!1})),e},Je=function(t){if(t.copiedTab){var n=Object(g.cloneDeep)(t.copiedTab);return n.id=G(),n.name=Ye(t.copiedTab.name),n}if(t.fullWindowFile){var e=Ue({file:t.fullWindowFile});return{id:G(),name:qe(t.fullWindowFile.name),active:!0,grid:{layout:[e.layout],content:[e.content]}}}},Ye=function(t){var n=t,e=n[n.length-1];return isNaN(parseInt(e))?n+=" 1":(n=n.slice(0,-1),n+="".concat(parseInt(e)+1)),n},Ke=function(t,n){0==t.clipboardData&&"function"==typeof n&&n(void 0);var e=t.clipboardData.items;void 0==e&&"function"==typeof n&&n(void 0);for(var o=0;o<e.length;o++)if(-1!=e[o].type.indexOf("image")){console.log("[PASTE] informations on files pasted : ",t,e,e.length);var i=e[o].getAsFile();"function"==typeof n&&n(i)}},$e=Object(d.a)(Object(d.a)({},x),{},{global:{protocol:"".concat(window.location.protocol,"//"),url:"".concat(window.location.hostname),port:"80"===window.location.port?"":":".concat(window.location.port)}});var Xe,Ze,Qe={upload:{uploadCounter:0,reinit:function(){}},file:{onTitleUpdate:function(t,n){},onFileDelete:function(t){}}},to=i.a.createContext(Qe),no=function(t){var n=Object(d.a)({},t).tab,e=Object(o.useContext)(ii),i=Object(o.useState)(Qe),a=Object(c.a)(i,2),l=a[0],s=a[1],p=function(){var t=Object(o.useContext)(ii),n=Object(o.useState)({name:"",data:{}}),e=Object(c.a)(n,2),i=e[0],r=e[1],a=Object(o.useRef)({});return Object(o.useEffect)((function(){if(t){var cb=a.current[i.name];cb&&cb(t,i.data)}}),[i]),{onNextStateTrigger:function(t){r(t)},addNextStateAction:function(t,cb){a.current[t]=cb}}}(),u=p.onNextStateTrigger,f=p.addNextStateAction;f("refreshFolderList",(function(t,n){var e=t.ui.browser.folders.current.get;e===n.folder&&(t.ui.browser.goTo(e,n.name,{openIn:"activeWindow"}),u({name:"checkIfNoWindows"}))})),f("checkIfNoWindows",(function(t){0===n.grid.content.length&&t.tabs.close(n.id)}));var b=Object(g.cloneDeep)(l);return b.file.onFileDelete=function(t){e&&e.popup.confirm("".concat(j.trashNote),(function(){e.file.delete(t,(function(n){e.ui.windows.getIdsFromFile(t.path),n[n.length-1];var o=n[0];Object(g.each)(n,(function(t){t.modified&&o.modified&&t.modified>o.modified&&(o=t)})),u({name:"refreshFolderList",data:o})}))}))},b.file.onTitleUpdate=function(t,n){e&&e.file.move(t,n,(function(o){var i=null;if(Object(g.each)(o,(function(t){t.path===n&&(i=t)})),i){var c=e.ui.windows.getIdsFromFile(t);e.ui.windows.updateWindows(c,i),u({name:"refreshFolderList",data:i})}}))},b.upload.reinit=function(){var t=Object(g.cloneDeep)(l);delete t.upload.file,s(t)},Object(o.useEffect)((function(){var t=function(t){var o,i=null===(o=function(t){var n=void 0;return Object(g.each)(t.grid.content,(function(t){t.active&&(n=t)})),n||(n=t.grid.content[0]),n}(n))||void 0===o?void 0:o.file;i&&(console.log("003441 dragdrop OR clipboard",t,i.name),e&&e.upload.uploadFile({file:t,folderPath:i.folder,onSuccess:function(t){var n=Object(g.cloneDeep)(l);n.upload.uploadCounter=n.upload.uploadCounter+1,n.upload.file=t,delete n.upload.progress,s(n)},onProgress:function(t){var n=Object(g.cloneDeep)(l);delete n.upload.file,n.upload.progress=t,s(n)}}))},o=function(t){var n=function(n){if(n.preventDefault(),n.dataTransfer&&n.dataTransfer.items){var e=n.dataTransfer.items;if(!e[0])return;for(var o=0;o<e.length;o++)t.onDropped(e[o].getAsFile())}},e=function(t){t.preventDefault(),o()},o=Object(g.debounce)((function(){t.onDragEnd()}),100);return $e.log.upload&&console.log("[UPLOAD] reinit drag/drop events"),window.addEventListener("drop",n),window.addEventListener("dragover",e),function(){window.removeEventListener("drop",n),window.removeEventListener("dragover",e)}}({onDropped:t,onDragEnd:function(){console.log("003442 onDragEnd")}}),i=function(t){var n=function(n){Ke(n,(function(n){n&&t.onImagePasted(n)}))};return window.addEventListener("paste",n,!1),function(){window.removeEventListener("paste",n,!1)}}({onImagePasted:t});return function(){i(),o()}}),[t.tab]),Object(r.c)(eo,null,Object(r.c)("div",{className:"window-grid-wrapper"},Object(r.c)(to.Provider,{value:b},Object(r.c)(He,{refresh:n.refresh||0,grid:n.grid,onGridUpdate:t.onGridUpdate}))))},eo=Object(Yn.a)("div",{target:"ejnwhwz0"})({name:"zk0z9r",styles:"height:100%;.window-grid-wrapper{height:100%;}"}),oo=e(86),io=e(208),co=e(21),ro=e(210),ao=function(t){return t.path.substr(0,t.path.length-(t.title.length+1))},lo=function(t){var n=t.split("/");return n=n.filter((function(t){return""!==t})),console.log(n),n.pop(),"/"+n.join("/")+"/"},so=(x.log.verbose,function(t,n,e,o,i){return{label:t,apply:n||t,info:e,detail:i,type:"tag",boost:o||0}}),po=function(t){var n=fo(t);return[go,n,uo]},uo=function(t){var n=t.matchBefore(/\-\-/);if(!t.explicit&&!n)return null;var e="".concat(v.configFolder,"/snippets.md");return new Promise((function(o,i){oi((function(i){i.file.getContent(e,(function(e){var i=[],c=e.split("\n");Object(g.each)(c,(function(t){var n,e=(t=t.split("\\n").join("\n")).split("|"),o=null===(n=e.shift())||void 0===n?void 0:n.trim(),c=e.join("|").trim();if(c&&o){if(o="--"+o,c.includes("${")){var r=c;try{c=new Function("return `"+r+"`")()}catch(l){console.warn("[Code Mirror]","snippets error: ",l,r)}}var a=c.length>20?"".concat(c.substring(0,20),"..."):c;i.push(so(o,c,void 0,void 0,a))}}));var r={from:n?n.from:t.pos,options:i,validFor:/.*/};o(r)}))}))}))},fo=function(t){return function(n){var e=n.matchBefore(/\#/);return n.explicit||e?new Promise((function(o,i){oi((function(i){var c=lo(lo(t.folder));i.search.hashtags(c,(function(t){console.log(c,t);var i=[];Object(g.each)(t.nodesArr,(function(t){i.push(so(t.name,t.name))}));var r={from:e?e.from:n.pos,options:i,validFor:/.*/};console.log(r),o(r)}))}))})):null}},go=function(t){var n=t.matchBefore(/\[\[/);return t.explicit||n?new Promise((function(e,o){oi((function(o){o.files.get("/.tiro/tags",(function(t){var n=[],e=0;Object(g.each)(t,(function(c){var r=c.name.replace(".md",""),a="[[".concat(r,"]]"),l="".concat(a," ").concat(a),s="Insert installed custom tag ".concat(a),p=0;o.file.getContent(c.path,(function(o){var c=o.split("\n"),r="// --insert:",u="// --comment:",d="// --boost:";Object(g.each)(c,(function(t){(t=t.split("\\n").join("\n")).startsWith(r)&&(l=t.replace(r,"")),t.startsWith(u)&&(s=t.replace(u,"")),t.startsWith(d)&&(p=parseInt(t.replace(d,"")))})),n.push(so(a,l,s,p)),++e===t.length&&i(n)}))}))}));var i=function(o){var i={from:n?n.from:t.pos,options:o,validFor:/.*/};e(i)}}))})):null},bo={ui_sidebar:!0,ui_filesList_sortMode:2,ui_layout_colors_main:"#E86666",ui_editor_markdown_preview:!0,ui_editor_links_as_button:!0},ho="[USER SETTINGS] :",mo=x.log.verbose,vo=function(){var t=et("user-settings",{}),n=Object(c.a)(t,3),e=n[0],i=n[1],r=n[2],a=Object(o.useState)(0),l=Object(c.a)(a,2),s=l[0],p=l[1],u=Object(o.useRef)([]);Object(o.useEffect)((function(){d()}),[e]);var d=bn((function(){mo&&console.log(ho,"UPDATE!",e,s),function(t,n,o){u.current[t]||(u.current[t]=n[o]);var i=e[t];Object(g.isNull)(i)||Object(g.isUndefined)(i)||(""===i&&u.current[t]&&(i=u.current[t]),n[o]=i)}("ui_layout_colors_main",W.colors,"main"),p(s+1)}),1e3),f=function(t,n){Ze.emit("updateSetupJson",{paramName:t,paramValue:n,token:Q(),idReq:"updateSetupJson-".concat(G())})};return{userSettings:e,userSettingsApi:{updateSetupJson:f,set:function(t,n,o){o||(o={}),o.writeInSetupJson||(o.writeInSetupJson=!1),o.writeInSetupJson&&f(t,"".concat(n)),mo&&console.log(ho,"updateUserSettings ".concat(t," to ").concat(n));var c=Object(g.cloneDeep)(e);c[t]=n,i(c)},get:function(t){var n=bo[t],o=n;return t in e&&(o=e[t]),""===o&&(o=n),o},list:function(){var t=[];return Object(g.each)(e,(function(n,e){var o=e;t.push({key:o,val:n})})),t},refresh:{css:{get:s}}},refreshUserSettingsFromBackend:r}},wo="[Code Mirror]",xo=x.log.verbose,Oo=Object(o.forwardRef)((function(t,n){var e=function(){var t=n.current;return t&&t.state?t:null},i=Object(o.useRef)(null);Object(o.useEffect)((function(){!function(){var n=e();if(window.cmobj=n,!n)return!1;if(t.value===i.current)return!1;if("loading..."===t.value)return!1;if(n.view.state.doc.toString()===t.value)return!1;var o=Un.getCurrentLineInfos(n).currentPosition;Un.updateText(n,t.value,o),i.current=t.value}()}),[t.value,t.forceRender]);Object(o.useEffect)((function(){if(xo&&console.log(wo,"JUMP to line :",t.jumpToLine),-1!==t.jumpToLine){var n=e();n&&(t.posY<=-10||Un.scrollToLine(n,t.jumpToLine))}}),[t.jumpToLine]);Object(o.useEffect)((function(){u()}),[t.value]),Object(o.useEffect)((function(){u()}),[]);var a=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],r=e[1];return Object(o.useEffect)((function(){var n=Object(g.debounce)((function(){r(!0),setTimeout((function(){r(!1)}),200)}),200),e=document.querySelector(t);if(e){var o=new ResizeObserver((function(t){n()}));return o.observe(e),function(){o.disconnect()}}}),[]),{resizeState:i}}(".window-id-".concat(t.windowId)),l=a.resizeState;Object(o.useEffect)((function(){u()}),[l]);var s,p,u=function(){var n=e();if(n){var o=Un.getEditorInfos(n.view);Fe.updateEditorDims(t.windowId,{viewport:o.viewportHeight,full:o.contentHeight}),Fe.updateScrollerDims(t.windowId)}},d=Ln({file:t.file,onTitleClick:function(n){!function(n){var o=e();if(o){var i=Un.getCurrentLineInfos(o);xo&&console.log(wo,"CLICK ON TITLE DETECTED",n,i),t.onTitleClick(i.lineIndex)}}(n)}}),f=[Object(co.a)({override:po(t.file)}),Ct.c.domEventHandlers({scroll:function(t,n){},wheel:function(n,e){var o=Un.getEditorInfos(e);Fe.onEditorScroll(t.windowId,o.currentPercentScrolled),t.onScroll()}})],b={base:oo.markdownLanguage,codeLanguages:io.a,extensions:[]},h=vo().userSettingsApi;return h.get("ui_editor_links_as_button")&&(f.push(yn),f.push((s=t.windowId,St({pattern:pt.linklink,replacement:function(t){var n=document.createElement("span");n.classList.add("note-link-mdpreview-wrapper"),n.classList.add("note-link-wrapper");var e=t[1],o=t[2],i=It(e,o,s);return n.innerHTML="".concat(i),n}})))),h.get("ui_editor_markdown_preview")&&(f.push(d),b.extensions.push(In),f.push((p=t.file,St({pattern:pt.image,replacement:function(t){var n=document.createElement("div"),e=t[0],o='<div class="mdpreview-source">'.concat(e,"</div>"),i="".concat(Ho(p.folder),"/").concat(t[1]);n.classList.add("cm-mdpreview-wrapper"),n.classList.add("image-wrapper");var c=Object(Gt.renderToString)(Object(r.c)(Qt,{name:"faExpand",color:"white"}));return n.innerHTML='<div class="cm-mdpreview-image"><div class="enlarge" data-src='.concat(i,"> ").concat(c,'</div><img onerror="this.style.display=\'none\'" src="').concat(i+tt(),'" /></div>').concat(o),Tn(),n}}))),f.push(function(t){return St({pattern:pt.ressource,replacement:function(n){var e=n[0],o='<div class="mdpreview-source">'.concat(e,"</div>"),i=document.createElement("span"),c=Object(Gt.renderToString)(Object(r.c)(Po,{markdownTag:e,file:t}));return i.innerHTML="".concat(c," ").concat(o),i}})}(t.file))),f.push(Object(oo.markdown)(b)),Object(r.c)("div",{className:"codemirror-editor-wrapper"},Object(r.c)(ro.a,{value:"",ref:n,theme:An(),onChange:function(n,e){n!==t.value&&(i.current=n,t.onChange(n),u())},basicSetup:{foldGutter:!1,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1,closeBrackets:!1,bracketMatching:!1,lineNumbers:!1},extensions:f}))})),jo=i.a.memo(Oo,(function(t,n){var e=!0;return t.forceRender!==n.forceRender&&(e=!1),t.jumpToLine!==n.jumpToLine&&(e=!1),e})),ko=function(){return"\n@page {\nmargin: 0;\n}\n@media print {\n.hide-print {\ndisplay: none;\n\n}\n}\n\n* {\n\t-webkit-print-color-adjust: exact; \n\tprint-color-adjust: exact; \n}\n\n.file-path-wrapper {\n\tdisplay: none;\n}\n.file-infos-wrapper {\n\tbackground: #eeeeee;\n\tpadding: 10px;\n\tmargin: 10px;\n}\n\t\t.simple-css-print-wrapper {\n\t\t\tmargin: 20px;\n\t\t\twidth: 70%;\n\n\t\t}\n\t\timg {\n\t\t\t\tmax-width: 300px!important;\n\t\t\t\tmax-height: 500px!important;\n\t\t}\n\t\t.block-tag {\n\t\t\t\tdisplay: none;\n\t\t}\n\t\t"},yo=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),a=e[0],l=e[1],p=Object(o.useRef)(null),u=!0;!1===t.canEdit&&(u=!1),!1===t.isConnected&&(u=!1),Object(o.useEffect)((function(){l("")}),[t.file.path]);var b=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],r=e[1],a=Object(o.useRef)(!1);Object(o.useEffect)((function(){a.current=t.canEdit}),[t.canEdit]),Object(o.useEffect)((function(){return r(!1),t.onEditorDidMount&&t.onEditorDidMount(),function(){t.onEditorWillUnmount&&(l(),t.onEditorWillUnmount())}}),[t.file.path]),Object(o.useEffect)((function(){l()}),[t.file.path]),Object(o.useEffect)((function(){t.onNoteContentDidLoad&&t.onNoteContentDidLoad()}),[t.fileContent,t.file.path]);var l=function(){""!==Jn&&t.onNoteLeaving&&t.onNoteLeaving(i,Jn),Jn=t.file.path};return{triggerNoteEdition:function(n){if(!a.current)return console.warn("[EVENTS EDITOR] => onEdition CANNOT EDIT AS OFFLINE");i?t.onNoteEdition&&t.onNoteEdition(n,!1):t.onNoteEdition&&t.onNoteEdition(n,!0),r(!0)}}}({file:t.file,fileContent:t.fileContent,canEdit:u,onEditorDidMount:function(){},onEditorWillUnmount:function(){},onNoteContentDidLoad:function(){Xe&&l(t.fileContent)},onNoteEdition:function(n,e){l(n),t.onFileEdited(t.file.path,n),e&&oi((function(n){n.history.save(t.file.path,t.fileContent,"enter")}))},onNoteLeaving:function(n,e){S((function(n){t.onFileEdited(e,n)}))}}),h=b.triggerNoteEdition,m=Object(o.useRef)(null),v=Gn(a,{mobileTextarea:m,onMobileNoteEdition:h}),w=(v.onTextareaChange,v.onTextareaScroll,Object(o.useRef)(null)),x="desktop"!==s()?m:p;"codemirror"===t.editorType&&(x=w);var O=Vn({editorType:t.editorType,deviceType:s(),editorRef:x}).applyTextModifAction,k=oe({fileContent:a,onTextEncrypted:h,onTextDecrypted:h}),y=k.APasswordPopup,C=k.askForPassword,T=k.decryptButtonConfig,E=k.encryptButtonConfig,S=k.ifEncryptOnLeave,I=(k.noHistoryBackupWhenDecrypted,Object(o.useContext)(to)),N=Object(o.useState)(-1),F=Object(c.a)(N,2),L=F[0],R=F[1];Object(o.useEffect)((function(){if(I.upload.progress&&t.isActive&&R(I.upload.progress),I.upload.file&&t.isActive){var n=Object(d.a)({},I.upload.file),e=n.name,o=n.path;I.upload.reinit(),A(e,o)}}),[I.upload]);var A=function(t,n){D.current+="![".concat(t,"](").concat(n,")\n"),P()},D=Object(o.useRef)(""),P=bn((function(){var t=w.current,n=Un.getCurrentLineInfos(t).currentPosition;!function(t,n){var e=O("insertAt",{textToInsert:t,insertPosition:n});e&&(h(e),et())}(D.current,"currentPos"),D.current="",Un.updateCursor(t,n,!0)}),500),z="[link|".concat(t.file.realname," ").concat(t.file.folder,"]\n"),M=function(n,e){return{title:"",class:"upload-button-wrapper",action:function(){},customHtml:Object(r.c)(me,{file:t.file,type:n,label:e,onProgress:function(t){return R(t)},onSuccess:function(t){A(t.name,t.path)}})}},B=[].concat(Object(f.a)(function(){var t=[M("all","Upload files")];return"desktop"!==s()&&(t.push(M("image","Upload Gallery")),t.push(M("camera","Capture")),t.push(M("microphone","Record"))),t}()),[ee(a)?T:E,{title:"Export/Print",icon:"faFileDownload",action:function(){!function(t,n){var e=".window-id-".concat(t," .preview-area-wrapper"),o=document.querySelector(e),i="print-wrapper";if(o){!function(){var t=document.querySelectorAll(".".concat(i));Object(g.each)(t,(function(t){t.classList.remove(i)}))}();var c=ie(new Date(n.modified||0)),r=ie(new Date(n.modified||0)),a="\n<head>\n\t<title>".concat(n.name,' </title>\n\n\n</head>\n<html>\n\t<body>\n\t\t\t\t<div class="simple-css-print-wrapper">\n<div class="hide-print">\n\t<bm> Export options </bm>\n\t<button onclick="window.print()">print</button>\n\t<button onclick="window.print()">export to pdf</button>\n<button onclick="window.alert(\'CTRL+ S then select *complete webpage* if available\')">export to html</button>\n</div>\n\t\t\t\t\t<div class="file-infos-wrapper">\n\t\t\t\t\tNote Name : ').concat(n.name,"<br>\n\t\t\t\t\tNote Path : ").concat(n.path,"<br>\n\t\t\t\t\tCreated : ").concat(c,"<br>\n\t\t\t\t\tEdited : ").concat(r,"<br>\n\t\t\t\t\t</div>\n\t\t\t\t").concat(o.innerHTML,"\n\t\t\t\t</div>\n\n\t\t\t\t<style>").concat(So({w:".simple-css-print-wrapper",pl:".preview-link",r:".resource-link-icon"}),"</style>\n\t\t\t\t<style>").concat(ko(),"</style>\n\n<script>\n<\/script>\n\n\n\n\t</body>\n</html>\n\t\t\t\t"),l=window.open("","print-popup","width=800,height=1000");null===l||void 0===l||l.document.write(a)}}(t.windowId,t.file)}},{title:j.editorBar.explanation.history,icon:"faHistory",action:function(){W(!U)}},{title:j.editorBar.tts,icon:"faCommentDots",action:function(){J(!G)}},{title:"Delete note",class:"delete",icon:"faTrash",action:function(){I.file.onFileDelete(t.file)}}]),_=Object(o.useState)(!1),H=Object(c.a)(_,2),U=H[0],W=H[1],q=Object(o.useState)(!1),V=Object(c.a)(q,2),G=V[0],J=V[1],Y=Object(o.useRef)(null),K=Y.current,$=700;K&&($=K.clientHeight/1.3),"mobile"===s()&&($=window.innerHeight);var X=Object(o.useRef)(null);Object(o.useEffect)((function(){et()}),[t.fileContent,t.file.path]);var Z=Object(o.useState)(0),Q=Object(c.a)(Z,2),tt=Q[0],nt=Q[1],et=function(){nt(tt+1)},ot=a.length>3e4&&"desktop"!==s(),it=function(n){var e,o;e=t.file.path,o=n,oi((function(t){t.cache.get(ye,(function(n){n||(n={}),n[e]=o,t.cache.set(ye,n,1e17)}))})),t.onViewToggle(n)};return Object(r.c)("div",{className:"editor-area",ref:Y},Object(r.c)("div",{className:"infos-editor-wrapper"},Object(r.c)("div",{className:"file-path-wrapper"},t.file.path.replace("/".concat(t.file.name),"")),Object(r.c)(vn,{title:t.file.name.replace(".md",""),onEdited:function(n,e){var o="".concat(t.file.folder).concat(n,".md"),i="".concat(t.file.folder).concat(e,".md");I.file.onTitleUpdate(o,i),et()}}),Object(r.c)("div",{className:"toolbar-and-dates-wrapper"},Object(r.c)("div",{className:"editor-toolbar-dropdown"},Object(r.c)(he,{hover:!0,dir:"right",maxHeight:$},Object(r.c)(i.a.Fragment,null,Object(r.c)("div",{className:"view-toggler-wrapper"},"mobile"!==s()&&Object(r.c)(nn,{class:"editor-view-toolbar",size:.8,buttons:[{title:"Editor",icon:"custom_icons/view-3.svg",action:function(){it("editor")}},{title:"Editor with minimap",icon:"custom_icons/view-4.svg",action:function(){it("editor-with-map")}},{title:"Dual view",icon:"custom_icons/view-1.svg",action:function(){it("both")}},{title:"Render view",icon:"custom_icons/view-2.svg",action:function(){it("preview")}}]})),Object(r.c)("div",{className:"toolbar-wrapper"},Object(r.c)(nn,{class:"editor-main-toolbar",design:"vertical",size:.8,buttons:B})),Object(r.c)("div",{className:"separation-bar"}),Object(r.c)("div",{className:"dates-wrapper"},Object(r.c)("div",{className:"date modified"},Object(r.c)("h4",null,"Modified"),ie(new Date(t.file.modified||0))),Object(r.c)("div",{className:"date created"},Object(r.c)("h4",null,"Created"),ie(new Date(t.file.created||0)))),Object(r.c)("div",{className:"path-wrapper"},Object(r.c)("div",{className:"path"},Object(r.c)("h4",null,"Path"),Object(r.c)("span",{className:"path-link",onClick:function(){oi((function(n){n.ui.browser.goTo(t.file.folder,t.file.name)}))}}," ",t.file.folder," "))),Object(r.c)("div",{className:"note-id-wrapper"},Object(r.c)("h4",null,"Node Id"),Object(r.c)("div",{className:"note-id-form"},Object(r.c)("input",{type:"text",ref:X,onClick:function(t){var n=t.target;n.setSelectionRange(0,n.value.length)},value:z,readOnly:!0}),Object(r.c)(nn,{class:"note-id-toolbar",size:1,buttons:[{title:"Copy note ID",icon:"faClipboard",action:function(){var t=X.current;t&&function(t){var n=t.value;navigator&&navigator.clipboard&&navigator.clipboard.writeText(n).then((function(){console.log("Text copied to clipboard...")})).catch((function(t){console.log("Something went wrong",t)}))}(t)}}]})))))))),Object(r.c)(we,{progress:L}),Object(r.c)("div",{className:"main-editor-wrapper"},!ot&&"codemirror"===t.editorType&&Object(r.c)(jo,{windowId:t.windowId,ref:w,value:a,onChange:h,posY:t.posY,jumpToLine:t.jumpToLine||0,forceRender:tt,onScroll:t.onScroll,onTitleClick:t.onTitleClick,file:t.file}),ot&&Object(r.c)("div",{className:"codemirror-mobile-fallback"},Object(r.c)("p",null," note is too long for mobile, we disabled the advanced edition system "),Object(r.c)("textarea",{defaultValue:a,onChange:function(t){h(t.target.value)}}))),"desktop"!==s()&&Object(r.c)(be,{onButtonClicked:function(t){var n=O(t);n&&(h(n),et())}}),C&&y,U&&Object(r.c)(ce,{file:t.file,onClose:function(){W(!1)}}),G&&Object(r.c)(fe,{file:t.file,fileContent:a,onClose:function(){J(!1)}}))},Co=function(){return"\n.mobile-text-manip-toolbar {\n\t\t.toolbar-button {\n\t\t\t\tpadding: 13px 20px;\n\t\t}\n}\n\n.file-path-wrapper {\n\t\tpadding-top: ".concat(a("desktop")?W.sizes.block:W.sizes.block/2,"px;\n\t\tfont-size: 13px;\n\t\tfont-weight: 700;\n\t\tcolor: #b6b5b5;\n\t\tcursor: pointer;\n\t\ttext-transform: capitalize;\n}\n.big-title {\n\t\tcolor: ").concat(W.colors.main,";\n\t\tfont-size: 30px;\n\t\tfont-weight: 800;\n\t\twidth: 100%;\n\t\ttext-transform: uppercase;\n}\n\n.separation-bar {\n\t\twidth: 86%;\n height: 1px;\n background: #e6e6e6;\n margin: 10px 6%;\n}\n\n.dates-wrapper {\n\t\tposition: relative;\n\t\tmargin: 0px 0px 5px 0px;\n\t\tdisplay: block!important;\n .modified {\n\t\t\t\tcolor: grey;\n\t\t\t\ttext-align: left;\n }\n\t\t.created {\n\t\t\t\ttext-align: right;\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0px;\n\t\t\t\tright: 0px;\n\t\t\t\tcolor: ").concat(W.colors.editor.interfaceGrey,";\n\t\t}\n}\n\n.path-wrapper {\n\t\tcolor: grey;\n text-align: left;\n\t\tpadding: 0px 0px 5px 0px;\n .path-link {\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\tfont-weight: bold;\n\t\t\t\tcursor: pointer;\n }\n}\n\n.note-id-wrapper {\n\t\tcolor: grey;\n text-align: left;\n\t\t.note-id-form {\n\t\t\t\tdisplay:flex;\n\t\t\t\tinput {\n\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\tbackground: #ebebeb;\n\t\t\t\t\t\tborder-radius: 3px;\n\t\t\t\t\t\tfont-size: 9px;\n\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t}\n\t\t}\n}\n.toolbar-and-dates-wrapper {\n\t\th4 {\n\t\t\t\tmargin: 0px;\n\n\t\t}\n}\n\n\n")},To=function(t){var n=Object(o.useContext)(ii),e=(null===n||void 0===n?void 0:n.status.isConnected)||!1;return Object(o.useMemo)((function(){return Object(r.c)(yo,Object(on.a)({},t,{isConnected:e}))}),[e,t.canEdit,t.editorType,t.file.path,t.file,t.fileContent,t.isActive,t.jumpToLine])},Eo=function(t){var n={wrapper:Object(o.useRef)(null),main:Object(o.useRef)(null)},e=t.file.path.split("/");e.pop();e.join("/");Object(o.useEffect)((function(){setTimeout((function(){t.onMaxYUpdate(i())}),1e3)}),[t.fileContent]);var i=function(){var t=n.main.current;return 2*((null===t||void 0===t?void 0:t.clientHeight)||3e3)},a=Object(o.useState)([]),l=Object(c.a)(a,2),p=l[0],u=l[1];Object(o.useEffect)((function(){var n=Yo.chunks.chunk(t.fileContent);u(n),setTimeout((function(){Yo.injectLogic({fileContent:t.fileContent,file:t.file})}),100),setTimeout((function(){Fe.updatePreviewDims(t.windowId),Fe.updateScrollerDims(t.windowId)}),100)}),[t.fileContent]);var d=function(){var n=0,e=document.querySelector(".window-id-".concat(t.windowId));return e&&(n=e.clientHeight),"mobile"===s()&&0===n&&(n=document.body.clientHeight-120),n};return Object(r.c)("div",{className:"preview-area-wrapper render-latex",onWheelCapture:function(n){Fe.onPreviewScroll(t.windowId)}},Object(r.c)("div",{className:"preview-area",ref:n.wrapper,style:{bottom:function(){var n=i(),e=t.posY+0;return Object(g.clamp)(e,0,n)}()}},Object(r.c)("div",{className:"preview-area-transitions"},Object(r.c)("div",{className:"infos-preview-wrapper"},Object(r.c)("div",{className:"file-path-wrapper"},t.file.path.replace("/".concat(t.file.name),"")),Object(r.c)("h1",{className:"title big-title"},t.file.name.replace(".md",""))),Object(r.c)("div",{className:"content-blocks-wrapper"},Object(r.c)("div",{className:"simple-css-wrapper"},p.map((function(n,e){return Object(r.c)(Lo,{key:e,block:n,windowId:t.windowId,file:t.file,windowHeight:d(),yCnt:t.yCnt,onIframeMouseWheel:t.onIframeMouseWheel})})))))))},So=function(t){return t||(t={w:".simple-css-wrapper",pl:".preview-link",r:".resource-link-icon"}),"\n\n\t\thtml, body {\n\t\t\t\tmargin: 0px;\n\t\t\t\tpadding: 0px;\n\t\t}\n\n\t\t".concat(t.w," {\n\t\t\t\tcolor: ").concat(W.colors.editor.font,";\n\t\t\t\tline-height: 19px;\n\t\t\t\tfont-size: 11px;\n\t\t\t\tfont-family:").concat(W.font.main,";\n\t\t}\n\n\t\tbutton,\n\t\tinput {\n\t\t\t\tfont-family:").concat(W.font.main,";\n\t\t\t\tfont-weight: 700;\n\t\t\t\tcolor: ").concat(W.colors.l2.title,";\n\t\t}\n\n\t\t/**********************************************************\n\n\t\t// COUNTER TITLES\n\n*********************************************************/\n\n\t\t").concat(t.w,' {\n\t\t\t\toverflow-wrap: break-word;\n\t\t\t\tcounter-reset: sh1 ;\n\t\t}\n\n\n\t\th1:before {\n\t\t\t\tcontent: ""counter(sh1)" \u2219 ";\n\t\t\t\tcounter-increment: sh1;\n\t\t}\n\t\th1 {\n\t\t\t\tcounter-reset: sh2;\n\t\t}\n\n\t\th2:before {\n\t\t\t\tcontent: ""counter(sh1)"." counter(sh2)" \u2219 ";\n\t\t\t\tcounter-increment: sh2;\n\t\t}\n\t\th2 {\n\t\t\t\tcounter-reset: sh3;\n\t\t}\n\n\t\th3:before {\n\t\t\t\tcontent: ""counter(sh1)"." counter(sh2)"."counter(sh3)" \u2219 ";\n\t\t\t\tcounter-increment: sh3;\n\t\t}\n\t\th3 {\n\t\t}\n\n\n\n\t\t/**********************************************************\n\n\t\t// BASIC STYLE\n\n**********************************************************/\n\n\t\ta {\n\t\t\t\tcolor: ').concat(W.colors.main,";\n\t\t}\n\n\t\t.main-color, .main-color:before, .main-color:after {\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t}\n\t\t.title {\n\t\t\t\tmargin: 0px 0px;\n\t\t}\n\n\t\th1:before, h2:before, h3:before, h4:before, h5:before, h6:before {\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t}\n\t\th1, h2, h3, h4, h5, h6 {\n\t\t\t\tposition:relative;\n\t\t\t\tcolor: ").concat(W.colors.main,';\n\t\t\t\tmargin-top: 0px;\n\t\t\t\tline-height: normal;\n\t\t\t\tmargin-right: 10px;\n\t\t}\n\t\th1:after,\n\t\th2:after {\n\t\t\t\tcontent: "-";\n\t\t\t\tbackground: ').concat(W.colors.main,";\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 2px;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0px;\n\t\t\t\tleft: 0px;\n\t\t\t\tfont-size: 0px;\n\t\t\t\t/* opacity: 0.4; */\n\t\t}\n\t\th2:after {\n\t\t\t\t/* width: 70%; */\n\t\t\t\theight: 1px;\n\t\t}\n\t\th1 {\n\t\t\t\tpadding: 5px;\n\t\t\t\t/* border-bottom: 2px solid; */\n\t\t\t\tmargin-top: 30px;\n\t\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\th2 {\n\t\t\t\tpadding: 5px;\n\t\t\t\t/* border-bottom: 1px solid; */\n\t\t}\n\t\th2, h3, h4, h5, h6 {\n\t\t\t\tmargin-bottom: 10px;\n\t\t\t\tmargin-top: 25px;\n\t\t}\n\n img,\n .content-image {\n\t\t\t\tcursor: pointer;\n }\n\t\t\t.content-image-img {\n\t\t\t\t\t").concat(W.els().images,"\n\t\t\t\t\tcursor: pointer;\n\t\t\t}\n\n p {\n\t\t\t\tdisplay: inline;\n }\n\n\n\t\t/**********************************************************\n\n\t\t// LIST\n\n**********************************************************/\n\t\t.no-css ul li {\n\t\t\t\tbackground: none!important;\n\t\t\t\tpadding: 0px;\n\t\t}\n\n\t\tul {\n\t\t\t\tpadding: 0px;\n\t\t\t\tlist-style-image: \"./custom_icons/view-1.svg\"; \n\t\t\t\tlist-style: none; \n\t\t}\n\n\t\tul li {\n\t\t\t\tpadding-left: 12px;\n\t\t}\n\t\tul li:before {\n\t\t\t\tcontent: '-';\n\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\twidth: 10px;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tfont-size: 15px;\n\n\t\t\t\t/* background-image: url(./custom_icons/line.svg); */\n\t\t\t\t/* background-repeat: no-repeat; */\n\t\t\t\t/* background-position: -3px 4px; */\n\t\t\t\t/* background-size: 11px; */\n\n\t\t\t\t/* background-image: url(./custom_icons/line.svg); */\n\t\t\t\t/* background-repeat: no-repeat; */\n\t\t\t\t/* background-color: ").concat(W.colors.main,'; */\n\t\t\t\t/* -webkit-mask-position: -3px 4px; */\n\t\t\t\t/* -webkit-mask-size: 11px; */\n\t\t\t\t/* -webkit-mask-image: url(./custom_icons/line.svg); */\n\t\t\t\t/* -webkit-mask-repeat: no-repeat; */\n\t\t}\n\t\tul li p {\n\t\t\t\tmargin: 0px;\n\t\t}\n\n\t\tul input[type=checkbox] {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 0px;\n\t\t\t\theight: 10px;\n\t\t\t\tmargin-right: 9px\n\t\t}\n\t\tul input[type=checkbox]:before {\n\t\t\t\tcontent: "";\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: 15px;\n\t\t\t\theight: 15px;\n\t\t\t\ttop: 0px;\n\t\t\t\tleft: -4px;\n\n\t\t\t\tbackground-color: ').concat(W.colors.main,";\n\t\t\t\t/* background-image: url(./custom_icons/check.svg); */\n\t\t\t\t/* background-repeat: no-repeat; */\n\t\t\t\t/* background-size: contain; */\n\t\t\t\tmask-position: -2px -1px;\n\t\t\t\tmask-image: url(./custom_icons/check.svg);\n\t\t\t\tmask-size: contain;\n\t\t\t\tmask-repeat: no-repeat;\n\n\t\t\t\t-webkit-mask-position: -2px -1px;\n\t\t\t\t-webkit-mask-image: url(./custom_icons/check.svg);\n\t\t\t\t-webkit-mask-size: contain;\n\t\t\t\t-webkit-mask-repeat: no-repeat;\n\t\t}\n\t\tul input[type=checkbox]:checked:before {\n\t\t\t\t/* background-color: red; */\n\t\t\t\t/* -webkit-mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\t/* mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\t/* background-image: url(./custom_icons/uncheck.svg); */\n\n\t\t\t\t/* background-color: red; */\n\t\t\t\t/* -webkit-mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\t/* mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\tmask-image: url(./custom_icons/uncheck.svg);\n\t\t\t\t-webkit-mask-image: url(./custom_icons/uncheck.svg);\n\n\t\t}\n\n\t\t/**********************************************************\n\n\t\t PREVIEW LINK\n\n**********************************************************/\n\n\n\t\t").concat(Nt(t.pl),"\n\n\t\t/**********************************************************\n\n\t\t// TABLE\n\n**********************************************************/\n\n\t\ttable {\n\t\t\t\tmargin: 10px 0px;\n\t\t\t\tpadding 15px;\n\t\t\t\tborder-spacing: 0;\n\t\t\t\tborder-collapse: collapse;\n\t\t}\n\n\n\t\tth {\n\t\t\t\ttext-align: left;\n\t\t\t\tpadding: 10px 10px;\n\t\t}\n\t\ttd {\n\t\t\t\tpadding: 5px 10px;\n\t\t}\n\t\tthead tr {\n\t\t\t\tbackground: #e4e3e3;\n\t\t}\n\t\tth, td {\n\t\t\t\tborder: 1px solid #ccc;\n\t\t}\n\t\ttbody {\n\t\t}\n\t\t// tbody tr:nth-child(even) {background: #CCC}\n\t\t// tbody tr:nth-child(odd) {background: #EEE}\n\n\t\t/**********************************************************\n\n\t\t// RESSOURCE LINK\n\n**********************************************************/\n\t\t").concat(Mo(),"\n\n\t\tpre {\n\t\t}\n\n\t\tpre code {\n\t\t\t\tdisplay: block;\n\t\t\t\tborder-radius: 8px;\n\t\t\t\tbackground: #d2d2d2;\n\t\t\t\tpadding: 11px 23px;\n\t\t}\n\t\t")},Io=x.log.verbose,No=["latex","l"],Fo=function(t){var n="tag"===t.block.type&&!No.includes(t.block.tagName||""),e=Object(o.useState)(null),i=Object(c.a)(e,2),a=i[0],l=i[1],s=Object(o.useState)(null),p=Object(c.a)(s,2),u=p[0],d=p[1],f=Object(o.useState)("null"),g=Object(c.a)(f,2),b=g[0],h=g[1];Object(o.useEffect)((function(){n&&(h("loading"),"script"===t.block.tagName?(l("\n[[script]]".concat(t.block.content,"[[script]]")),setTimeout((function(){h("loaded")}),100),t.block.content=""):ei().then((function(n){n.file.getContent("/.tiro/tags/".concat(t.block.tagName,".md"),(function(t){l(t),setTimeout((function(){h("loaded")}),100)}),{onError:function(){l(null)}})})))}),[t.windowId,t.block.content]);var m="l"===t.block.tagName||"latex"===t.block.tagName;return Object(o.useEffect)((function(){if(!n){var e=Yo.render({raw:t.block.content,file:t.file,windowId:t.windowId});m&&(e="[[l]]".concat(t.block.content,"[[l]]")),d(e)}}),[t.windowId,t.file,t.block]),Object(r.c)("span",{className:"content-block ".concat(n?"block-tag":"block-text"," ")},"loaded"===b&&n&&a&&Object(r.c)(Ro,Object(on.a)({},t,{noteTagContent:a})),!n&&u&&Object(r.c)("span",{className:"content-block-text",dangerouslySetInnerHTML:{__html:u}}))},Lo=i.a.memo(Fo,(function(t,n){var e=!0;return JSON.stringify(t.block)!==JSON.stringify(n.block)&&(e=!1),t.block.content!==n.block.content&&(e=!1),t.file.path!==n.file.path&&(e=!1),e})),Ro=function(t){var n=Object(d.a)({},t).noteTagContent,e=Object(o.useState)(""),i=Object(c.a)(e,2),a=i[0],l=i[1],s=Object(o.useRef)(null),p=Object(o.useState)(""),u=Object(c.a)(p,2),f=u[0],b=u[1],h=Object(o.useState)(!1),m=Object(c.a)(h,2),v=m[0],w=m[1],x=Object(o.useState)(0),O=Object(c.a)(x,2),j=O[0],k=O[1],y=Object(o.useState)(null),C=Object(c.a)(y,2),T=C[0],E=C[1],S=Object(o.useState)(!1),I=Object(c.a)(S,2),N=I[0],F=I[1],L=function(){var n,e,o=function(n){N&&t.onIframeMouseWheel(n)};return null===(n=s.current)||void 0===n||null===(e=n.contentDocument)||void 0===e||e.addEventListener("mousewheel",o),function(){var t,n;return null===(t=s.current)||void 0===t||null===(n=t.contentDocument)||void 0===n?void 0:n.removeEventListener("mousewheel",o)}};Object(o.useEffect)(L,[t.yCnt,N]);var R=bn((function(e){L(),b(e),E(null),dn.subscribe(e,(function(n){if("resize"===n.action){var e=n.data.height;if(Object(g.isString)(e)&&e.endsWith("%")){var o=parseInt(e.replace("%",""))/100;e=(t.windowHeight||200)*o}Io&&console.log("[IFRAME COMPONENT]","resizing to",e),k(e),w(!0)}if("canScrollIframe"===n.action){var i=n.data;F(i.status)}if("apiCall"===n.action){var c=n.data;ai(c,(function(t,e){if("nok"===t)return E(e.error);var o={reqId:n.data.reqId,data:e};dn.send(s.current,{action:"apiAnswer",data:o})}))}if("iframeError"===n.action){var r=n.data.error;E(r)}})),setTimeout((function(){var o={file:t.file,innerTag:t.block.content,windowId:t.windowId,frameId:e,reloadCounter:P,tagContent:n,tagName:t.block.tagName||"",loginToken:Q(),backendUrl:di()};dn.send(s.current,{action:"init",data:o})}),100)}),500),A=Object(o.useState)(0),D=Object(c.a)(A,2),P=D[0],z=D[1],M=Object(o.useState)(!1),B=Object(c.a)(M,2),_=B[0],H=B[1];return Object(o.useEffect)((function(){w(!1),function(){var e=Yo.render({raw:n,windowId:t.windowId,file:t.file}),o=fn(e),i='\n\t\t\t\t<div class="simple-css-wrapper">\n\t\t\t\t'.concat(o,"\n\t\t\t\t</div>\n\t\t\t\t<style>\n\t\t\t\t").concat(So(),"\n\t\t\t\t</style>\n\t\t\t\t");i=ft(i,[["{{innerTag}}",t.block.content.trim()]]),l(i)}();var e="iframe-".concat(G());return R(e),function(){dn.unsubscribe(e)}}),[t.windowId,t.block.content,t.block.tagName,t.noteTagContent,P]),Object(r.c)("div",{className:"iframe-view-wrapper ".concat(v?"can-show":"hide"," iframe-tag-").concat(t.block.tagName)},Object(r.c)("div",{className:"ctag-reload",onClick:function(){z(P+1),H(!0),setTimeout((function(){H(!1)}),100)}},Object(r.c)(Qt,{name:"faRetweet",color:"#b2b2b2"})),!_&&Object(r.c)("iframe",{ref:s,id:f,"data-testid":"iframe",title:f,srcDoc:a,className:"tag-iframe",style:{height:j},sandbox:"allow-scripts allow-same-origin allow-popups"}),T&&Object(r.c)("div",{className:"iframe-error"},Object(r.c)("code",null,Object(r.c)("pre",null,T))))},Ao=400,Do=200,Po=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],a=e[1],l=t.markdownTag.split("](")[1].slice(0,-1),p=t.markdownTag.split("](")[0].replace("![",""),u=l.split("."),d=u[u.length-1];"7z"===d&&(d="d7z");var f="".concat(Ho(t.file.folder),"/").concat(l).concat(tt()),g="".concat(p,".").concat(d),b=[{title:"Download",icon:"faDownload",action:function(){console.log(f,g),Bo(g,f)}}],h=!1;["pdf","mp4","mp3","ogg","wav","aac","webm","flac","txt","json","css","js","html","epub"].includes(d.toLowerCase())&&(h=!0);var m=window.location.origin,v=["ppt","pptx","doc","docx","xls","xlsx"].includes(d.toLowerCase()),w=v||"pdf"===d.toLowerCase(),x=_o(m,["localhost","192.168"]),O=f;!x&&v&&(O="https://docs.google.com/gview?url=".concat(f,"&embedded=true"));var j=x&&v?"[REQUIRES NON LOCAL TIRO URL] ":"";(h||v)&&(b.unshift({title:j+"Open in detached window",icon:"faExternalLinkAlt",action:function(){x&&v||window.open(O,"popup-".concat(O),"width=800,height=1000")}}),b.unshift({title:i?"Close Preview":j+"Preview",icon:i?"faEyeSlash":"faEye",action:function(){x&&v||a(!i)}}));var k="id-".concat(G()),y=function(t,n){var e=document.querySelector(t);null===e||void 0===e||e.addEventListener("click",(function(t){n(t)}))},C=function(){var t=document.querySelector(".".concat(k," .iframe-wrapper")),n=null===t||void 0===t?void 0:t.querySelector("iframe"),e=w?Ao:Do,o="<iframe\n\t\t\t\tsrc='".concat(O,"'\n\t\t\t\ttitle='").concat(O,'\'\n\t\t\t\tallowFullScreen\n\t\t\t\tclass="resource-link-iframe"\n\t\t\t\tstyle="height:').concat(e,'px"\n\t\t\t\t/>');t&&(t.innerHTML=n?"":o,I(n?"closed":"open"))},T=function(){console.log("CLICK PREV"),x&&v||("epub"===d.toLocaleLowerCase()?oi((function(n){n.file.getContent("/.tiro/tags/epub.md",(function(n){!function(){var n=document.querySelector(".".concat(k," .iframe-wrapper"));if(n){var e=n.querySelector("iframe"),o=Jt(Object(r.c)(Lo,{file:t.file,block:{type:"tag",tagName:"epub",content:O,start:0,end:0},windowHeight:Ao+75,windowId:"null",yCnt:0,onIframeMouseWheel:function(){}}),{delay:100}),i='<div id="'.concat(o,'" class="resource-link-ctag"><div class="loading-string">loading...</div></div>');n.innerHTML=e?"":i,I(e?"closed":"open")}}()}),{onError:function(t){}})})):"pdf"===d.toLocaleLowerCase()?oi((function(n){n.file.getContent("/.tiro/tags/pdf.md",(function(n){!function(){var n=document.querySelector(".".concat(k," .iframe-wrapper"));if(console.log("WTFFFFFFFF"),n){var e=n.querySelector("iframe"),o=Jt(Object(r.c)(Lo,{file:t.file,block:{type:"tag",tagName:"pdf",content:O,start:0,end:0},windowHeight:Ao+75,windowId:"null",yCnt:0,onIframeMouseWheel:function(){}}),{delay:100}),i='<div id="'.concat(o,'" class="resource-link-ctag"><div class="loading-string">loading...</div></div>');n.innerHTML=e?"":i,I(e?"closed":"open")}}()}),{onError:function(t){C()}})})):C())},E="ressource-preview-status",S="".concat(t.file.path,"-").concat(l),I=function(t){console.log("SET STATUS",t,S),oi((function(n){n.cache.get(E,(function(e){e||(e={}),e[S]=t,n.cache.set(E,e,1e17)}))}))};return setTimeout((function(){var cb;cb=function(t){"open"===t&&T()},oi((function(t){t.cache.get(E,(function(t){if(t){var n=t[S]?t[S]:"closed";cb(n)}}))}));var t=".".concat(k," ul.buttons-toolbar-component");y("".concat(t," .btn-preview"),T),y("".concat(t," .btn-open"),(function(){x&&v||window.open(O,"popup-".concat(O),"width=800,height=1000")})),y("".concat(t," .btn-download"),(function(){Bo(g,f)}))}),100),Object(r.c)("div",{className:"".concat(k," resource-link-iframe-wrapper")},Object(r.c)("div",{className:" resource-link-wrapper device-".concat(s())},Object(r.c)("div",{className:"resource-link-icon ".concat(d)}),Object(r.c)("div",{className:"resource-link-content-wrapper"},Object(r.c)("a",{className:"resource-link preview-link",href:f,download:!0},p," (",d,")"),Object(r.c)(nn,{buttons:b,size:1}))),Object(r.c)("div",{className:"iframe-wrapper"}))},zo=".resource-link-icon",Mo=function(){return"\n.loading-string {\n text-align: center;\n padding: 50px;\n}\n.resource-link-ctag {\n\t\theight: ".concat(Ao,"px;\n\t\toverflow:hidden;\n\t\twidth: 100%;\n\t\tborder:none;\n}\n.resource-link-iframe {\n\t\tborder: none;\n\t\twidth: 100%;\n}\n\n.resource-link-wrapper,\n.resource-link-wrapper a {\n\t\tcolor: ").concat(W.colors.main,";\n}\n.resource-link-iframe-wrapper {\n\t\tbackground: #f7f6f6;\n\t\t border-radius: 5px;\noverflow:hidden;\n}\n\n.resource-link-wrapper {\n\t\tpadding: 20px;\n\t\tborder-radius: 10px;\n\t\tposition: relative;\n\t\tmargin: 5px 0px;\n\t\t// height: 20px;\n\n}\n\n.resource-link-icon {\n\t\ttop: 14px;\n\t\tleft: 19px;\n\t\twidth: 21px;\n\t\theight: 27px;\n\t\tdisplay: inline-block;\n\t\tbackground-image: url(/static/media/file-solid.6415173e.svg);\n\t\topacity: 0.08;\n\t\tposition: absolute;\n\t\tbackground-repeat: no-repeat;\n\t\ttransform: scale(1.5);\n\t\tbackground-image: url(").concat(W.assets.fileIcon,");\n}\n\n").concat(zo,".epub, ").concat(zo,".cbr, ").concat(zo,".cbz,").concat(zo,".mobi, ").concat(zo,".azw, ").concat(zo,".azw3, ").concat(zo,".iba {background - image: url(").concat(W.assets.bookIcon,"); }\n").concat(zo,".pdf\n{background - image: url(").concat(W.assets.pdfIcon,"); }\n\n").concat(zo,".xls, ").concat(zo,".xlsm, ").concat(zo,".xlsx, ").concat(zo,".ods\n{background - image: url(").concat(W.assets.excelIcon,"); }\n\n").concat(zo,".avi, ").concat(zo,".flv, ").concat(zo,".h264, ").concat(zo,".m4v, ").concat(zo,".mov, ").concat(zo,".mp4, ").concat(zo,".mpg, ").concat(zo,".mpeg, ").concat(zo,".rm, ").concat(zo,".swf, ").concat(zo,".vob, ").concat(zo,".wmv, ").concat(zo,".mkv\n{background - image: url(").concat(W.assets.videoIcon,"); }\n\n").concat(zo,".d7z, ").concat(zo,".arj, ").concat(zo,".deb, ").concat(zo,".rar, ").concat(zo,".gz, ").concat(zo,".zip, ").concat(zo,".rpm, ").concat(zo,".pkg\n{background - image: url(").concat(W.assets.archiveIcon,");}\n\n").concat(zo,".aif, ").concat(zo,".mp3, ").concat(zo,".cda, ").concat(zo,".mid, ").concat(zo,".mpa, ").concat(zo,".ogg, ").concat(zo,".wav, ").concat(zo,".wpl, ").concat(zo,".wma, ").concat(zo,".midi\n{background - image: url(").concat(W.assets.audioIcon,"); }\n\n").concat(zo,".doc, ").concat(zo,".docx, ").concat(zo,".odt, ").concat(zo,".txt\n{background - image: url(").concat(W.assets.wordIcon,"); }\n\n").concat(zo,".html, ").concat(zo,".css, ").concat(zo,".js, ").concat(zo,".json, ").concat(zo,".ts, ").concat(zo,".jsx, ").concat(zo,".tsx\n{background - image: url(").concat(W.assets.codeIcon,"); }\n\n").concat(zo,".bin, ").concat(zo,".dmg, ").concat(zo,".iso, ").concat(zo,".toast, ").concat(zo,".vcd\n{\n\t\ttop: 19px;\n\t\ttransform: scale(1.8);\n\t\tbackground-image: url(").concat(W.assets.diskIcon,");\n}\n\n").concat(zo,".ppt, ").concat(zo,".pptx, ").concat(zo,".odp, ").concat(zo,".key, ").concat(zo,".pps\n{background - image: url(").concat(W.assets.presIcon,"); }\n\n\n.resource-link-content-wrapper {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n}\n\n.resource-link-content-wrapper {\n}\n\n.resource-link-content-wrapper ul {\n\t\tpadding - left: 7px;\n}\n.resource-link-content-wrapper ul li {\n\t\tpadding - left: 0px;\n}\n.resource-link-content-wrapper ul li:before {\n\t\tdisplay: none;\n}\n\n\n// HIDING IT ON DESKTOP \n.device-desktop .resource-link-wrapper:hover .resource-link-content-wrapper ul {\n\t\topacity:1;\n\t\tpointer-events: all;\n}\n.device-desktop .resource-link-content-wrapper ul {\n\t\topacity: 0;\n\t\ttransition: 0.2s all;\n\t\tpointer-events: none;\n}\n\n\n")},Bo=function(t,n){var e=document.createElement("a");e.style.display="none",document.body.appendChild(e),e.href=n,e.target="_blank",e.setAttribute("download",t),e.click(),window.URL.revokeObjectURL(e.href),document.body.removeChild(e)},_o=function(t,n){var e=!1;return Object(g.each)(n,(function(n){n.includes(t)&&(e=!0),t.includes(n)&&(e=!0)})),e},Ho=function(t){var n=t.replace("".concat(di(),"/").concat(v.staticResources,"/"),""),e="".concat(di(),"/").concat(v.staticResources,"/").concat(n);return t.startsWith("http")?t:e},Uo=function(t,n){var e=0,o=function(t,n){var e=t.match(pt.image),o=[];return Object(g.each)(e,(function(t){var e=t.match(pt.firstPartImg),i=e&&e[0]?e[0].replace("![","").replace("]","").replace("(",""):"",c=t.replace(pt.firstPartImg,"").replace(")",""),r={url:Ho(n.folder)+"/"+c,title:i,file:n};o.push(r)})),o}(n,t);if(0===o.length)return n;var i=encodeURIComponent(JSON.stringify(o));return Ut(n,pt.image,(function(n){var o=n.split("](")[1].slice(0,-1),c=n.match(/w_([0-9]+)/),r=n.match(/r_([0-9]+)/),a=c?"width: ".concat(c[1],"px;"):"",l=r?"transform:rotate(".concat(r[1],"deg);"):"",s="max-width: 100%; ".concat(a," ").concat(l," "),p='<div class="content-image" data-images='.concat(i,' data-index="').concat(e,'"><img class="content-image-img" style="').concat(s,'" src="').concat(Ho(t.folder),"/").concat(o).concat(tt(),'" /></div>');return e++,p}))},Wo=function(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},qo=function(t){var n=Object(d.a)({},t),e=n.raw,o=n.file,i=n.windowId,c=Ht(function(t,n){var e=0;return Ut(n,pt.ressource,(function(n){e++,"".concat(n,"-").concat(e);var o=Object(Gt.renderToString)(Object(r.c)(Po,{markdownTag:n,file:t}));return"".concat(o," ")}))}(o,Uo(o,function(t){var n=t.replace(pt.searchlink,'<a class="search-link preview-link" href="javascript:window.tiroCli.triggerSearch.func(\'$1$2\');">$1</a>');return ft(n,[[">[__id_",">["],[">[__tags_",">["],[">[__tag_",">["],[" ]</a>","]</a>"]])}(function(t,n){var e=It("$1","$2",t);return n.replace(pt.linklink,e)}(i,function(t){var n='<a class="external-link preview-link" href="#/" '.concat("onclick=\"window.open('$1','$1','width=600,height=600');\"",">$2</a>");return t.replace(pt.url2transform,n)}(e))))));return Mt(),c},Vo=function(t,cb){for(var n=document.getElementsByClassName(t),e=function(t){var e=n[t];e.onclick=function(){cb(e)}},o=0;o<n.length;o++)e(o)},Go=function(t){var n=t.split(pt.userCustomTagManual),e=[],o=[],i=pt.userCustomTag3,c=t.match(i)||"",r=[];Object(g.each)(c,(function(t){r.push(t)}));var a=null,l=-1,s=[],p=[],u={};if(Object(g.each)(r,(function(t){u[t]?u[t]=u[t]+1:u[t]=1})),Object(g.each)(u,(function(t,n){t>=2&&p.push(n)})),Object(g.each)(r,(function(t,e){if(p.includes(t))if(a){if(a===t){var i=[l+1,e+1];s.push.apply(s,i);for(var c=n.slice(i[0],i[1]),u=r.slice(l+1,e+1),d="",f=0;f<c.length;f++){var g=f===c.length-1?"":u[f];d+="".concat(c[f]).concat(g)}o.push({type:"tag",tagName:a.replace("[[","").replace("]]",""),content:d,start:l,end:e}),l=-1,a=null}}else a=t,l=e})),0===s.length)e.push({type:"text",content:t,start:0,end:1});else{s.unshift(0);for(var d=0;d<s.length;d+=2){var f=s[d];n[f]&&e.push({type:"text",content:n[f],start:f,end:f+1})}}for(var b=0===t.indexOf(r[0]),h=[],m=o.length>e.length?o.length:e.length,v=0;v<m;v++)b?(o[v]&&h.push(o[v]),e[v]&&h.push(e[v])):(e[v]&&h.push(e[v]),o[v]&&h.push(o[v]));return h},Jo=function(t){var n="";return Object(g.each)(t,(function(t){"text"===t.type?n+=t.content:"tag"===t.type&&(n+="[[".concat(t.tagName,"]]").concat(t.content,"[[").concat(t.tagName,"]]"))})),n},Yo={render:function(t){var n=Object(d.a)({},t),e=n.raw,o=n.file,i=n.windowId,c=Go(e);return Object(g.each)(c,(function(t){"text"===t.type&&(t.content=qo({raw:t.content,file:o,windowId:i})),"tag"===t.type&&(t.content=t.content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"))})),Jo(c)},injectLogic:function(t){Vo("title-search-link",Ft),Vo("content-image",(function(t){ei().then((function(n){var e=parseInt(t.dataset.index);try{var o=JSON.parse(decodeURIComponent(t.dataset.images));Object(g.isNumber)(e)||(e=0),n.ui.lightbox.open(e,o)}catch(i){console.error(i)}}))}))},chunks:{chunk:Go,merge:Jo}},Ko="[RESSOURCE API] ",$o="/".concat(v.configFolder,"/").concat(v.cacheFolder,"/cache-api"),Xo="[CACHE API]",Zo=x.log.verbose,Qo=function(){return(new Date).getTime()},ti=function(t){var n=t-Qo()<0;return Zo&&console.log(Xo,"isExpired? : ",n,(t-Qo())/6e4,"mins"),n},ni=null,ei=function(){return new Promise((function(t,n){if(ni)return t(ni);var e=setInterval((function(){if(ni)return clearInterval(e),t(ni)}),200)}))},oi=function(cb){ei().then((function(t){cb(t)}))},ii=i.a.createContext(null),ci=function(t){var n=Object(o.useRef)({}),e=function(t){delete n.current[t]},i={subscribe:function(t,cb,e){e||(e={}),n.current[t]||(n.current[t]=[]),n.current[t].push({cb:cb,options:e})},unsubscribe:e,notify:function(t,o){Object(g.each)(n.current,(function(n,i){i===t&&Object(g.each)(n,(function(n){try{n.cb(o)}catch(i){console.log("[CLIENT API] error with function",i)}n.options.persistent||e(t)}))}))}};Object(o.useEffect)((function(){x.log.verbose&&console.log("[CLIENT API ]INIT ")}),[]);var r=function(t){var n="watch-api-unique-id-request";return Object(o.useEffect)((function(){Ze.on("onNoteWatchUpdate",(function(e){t.eventBus.notify(n,e)}))}),[]),{file:function(e,cb){t.eventBus.subscribe(n,(function(t){e===t.filePath&&cb(t)}),{persistent:!0})}}}({eventBus:i}),a=xt({eventBus:i,statusApi:t.statusApi}),l=bt({eventBus:i,historyApi:t.historyApi}),s=function(t){return Object(o.useEffect)((function(){Ze.on("getFiles",(function(n){t.eventBus.notify(n.idReq,n.files)})),Ze.on("getFilesPreview",(function(n){t.eventBus.notify(n.idReq,n.filesPreview)}))}),[]),{get:function(n,cb){x.log.socket&&console.log("[CLIENT API] get files ".concat(n));var e=ri("get-files-");t.statusApi.searching.set(!0),t.eventBus.subscribe(e,(function(n){t.statusApi.searching.set(!1),cb(n)})),Ze.emit("askForFiles",{folderPath:n,token:Q(),idReq:e})},getPreviews:function(n,cb){var e=ri("get-files-");t.eventBus.subscribe(e,cb),Ze.emit("askFilesPreview",{filesPath:n,idReq:e,token:Q()})},search:t.searchApi.files.search}}({eventBus:i,searchApi:a,statusApi:t.statusApi}),p=jt({eventBus:i}),u=function(t){var n=Object(d.a)({},t).eventBus;return Object(o.useEffect)((function(){Ze.on("getRessourceApiAnswer",(function(t){n.notify(t.idReq,t)}))}),[]),{delete:function(n,cb){var e=ri("delete-ressource");console.log("".concat(Ko," delete ressource ").concat(n)),t.eventBus.subscribe(e,cb),Ze.emit("askRessourceDelete",{path:n,idReq:e,token:Q()})},download:function(n,e,cb){var o=ri("download-ressource");console.log("".concat(Ko," downloading ressource url ").concat(n," to folder ").concat(e)),t.eventBus.subscribe(o,cb),Ze.emit("askRessourceDownload",{url:n,folder:e,idReq:o,token:Q()})}}}({eventBus:i}),b=function(t){return Object(o.useEffect)((function(){Ze.on("getFoldersScan",(function(n){t.eventBus.notify(n.idReq,{folders:n.folders,pathBase:n.pathBase})}))}),[]),{get:function(n,cb){x.log.socket&&console.log("[FOLDERS API] get folders ");var e=ri("get-folders-");t.eventBus.subscribe(e,cb),Ze.emit("askFoldersScan",{foldersPaths:n,token:Q(),idReq:e})},move:gt({eventBus:t.eventBus}).folder}}({eventBus:i}),h=function(t){var n=function(t){return"".concat($o,"/cache-api-storage-").concat(t.replace(/[^\w\s]/gi,""),".md")},e=Object(o.useRef)({}),i=function(t,n,o){var i;e.current[t]={content:n,until:(i=o,Qo()+60*i*1e3)}};return{get:function(t,cb){if(t in e.current){var o=e.current[t],c=ti(o.until);c&&(o.content=void 0),Zo&&console.log(Xo,"FROM RAM",t," expired:",c),cb(o.content)}else oi((function(o){o.file.getContent(n(t),(function(n){var o=JSON.parse(n);e.current[t]=o;var i=e.current[t],c=ti(i.until);c&&(i.content=void 0),Zo&&console.log(Xo,"FROM FILE",t," expired:",c),cb(i.content)}),{onError:function(n){"NO_FILE"===n&&(Zo&&console.log(Xo,"FROM FILE: NO_FILE",t),i(t,void 0,60),cb(e.current[t].content))}})}))},set:function(t,o,c){c||(c=60),i(t,o,c);var r=e.current[t];Zo&&console.log(Xo,"SETTING",t," with cachedTime in min",c),ei().then((function(e){e.file.saveContent(n(t),JSON.stringify(r))}))}}}(),m=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),i=e[0],r=e[1],a=Object(o.useState)(-1),l=Object(c.a)(a,2),s=l[0],p=l[1],u=O("selected-folder",""),d=Object(c.a)(u,2),b=d[0],h=d[1],m=Object(o.useState)(ot),v=Object(c.a)(m,2),w=v[0],j=v[1],k=et("foldersFlat",[]),y=Object(c.a)(k,3),C=y[0],T=y[1],E=y[2],S=Object(o.useState)(""),I=Object(c.a)(S,2),N=I[0],F=I[1],L=et("folders-open",["/"]),R=Object(c.a)(L,3),A=R[0],D=R[1],P=R[2];Object(o.useEffect)((function(){z(A)}),[A]);var z=function(t,n){n||(n={}),Object(g.isBoolean)(n.cache)||(n.cache=!0);var e=!!Object(g.isBoolean)(n.background)&&n.background,o=t.join("-"),i=o.length;o=o.substring(0,30)+"-"+i;var c="folder-scan-".concat(o);oi((function(o){var i=function(){o.folders.get(t,(function(t){!e&&M(t.pathBase,t.folders),o.cache.set(c,t,999999)}))};n&&n.cache?o.cache.get(c,(function(t){t?!e&&M(t.pathBase,t.folders):i()})):i()}))},M=function(t,n){var e=Object(g.cloneDeep)(C),o={current:e};Object(g.each)(n,(function(t){t&&(o.current=o.current.filter((function(n){return t.path!==n.path})))})),Object(g.each)(n,(function(t){t&&(o.current=ct(t,o.current))})),e=o.current,T(e);var i=it("/",e);i&&j(i),F(t)};return{goTo:function(n,e,o){""!==n&&(n=Y("".concat(n,"/")),x.log.verbose&&console.log("".concat("[BROWSER GO TO] "," ").concat(n," ").concat(e," ").concat(JSON.stringify(o))),t.searchUiApi.term.set(""),t.statusApi.searching.set(!0),h(n),t.filesApi.get(n,(function(n){t.statusApi.searching.set(!1);var i=t.userSettingsApi.get("ui_filesList_sortMode"),c=Z(n,i),a=-1;if(e&&Object(g.each)(c,(function(t,n){t.name===e&&(a=n)})),p(a),r(c),o&&o.openIn){var l=c[a];"active"===o.openIn||"activeWindow"===o.openIn?t.tabsApi.active.get()?t.windowApi.active.setContent(l):t.tabsApi.openInNewTab(l):t.windowApi.updateWindows([o.openIn],l)}})))},files:{active:{get:i[s],getIndex:s,set:p},set:r,get:i},folders:{refreshFromBackend:function(){E(),P()},base:N,get:w,clean:function(){j(ot)},scan:z,open:{get:A,add:function(t){D([].concat(Object(f.a)(A),[t]))},remove:function(t){var n=Object(g.cloneDeep)(A),e=n.indexOf(t);e>-1&&n.splice(e,1),D(n)}},current:{get:b,set:h}}}}({searchUiApi:a.ui,statusApi:t.statusApi,filesApi:s,foldersApi:b,windowApi:t.windowsApi,tabsApi:t.tabsApi,userSettingsApi:t.userSettingsApi}),v=function(t){var n=Object(o.useState)(),e=Object(c.a)(n,2),i=e[0],r=e[1];return Object(d.a)(Object(d.a)({},Yo),{},{ui:{lineJump:{jump:r,get:i}}})}(),w={cache:h,file:l,files:s,popup:t.popupApi,upload:p,ressource:u,tabs:t.tabsApi,folders:b,userSettings:t.userSettingsApi,history:t.historyApi,status:t.statusApi,note:v,search:a,watch:r,ui:{browser:m,windows:t.windowsApi,lightbox:t.lightboxApi,search:a.ui,note:v.ui}};return ni=w,w},ri=function(t){return"client-api-".concat(t,"-req-").concat(G())},ai=function(t,cb){ei().then((function(n){var e=t.apiName.split("."),o=n;if(Object(g.each)(e,(function(t){o=o[t]?o[t]:null})),null===o)return cb("nok",{error:'"'.concat(t.apiName,'" does not exists in current api \n\nAvailable Api properties :\n\n').concat(si("",n))});try{var i=li(o);if(!i){var c=o.apply(void 0,Object(f.a)(t.apiArguments));return cb("ok",c)}var r=Object(g.cloneDeep)(t.apiArguments);r.splice(i,0,(function(t){cb("ok",t)})),o.apply(void 0,Object(f.a)(r))}catch(a){return cb("nok",{error:'error "'.concat(JSON.stringify(a),'" when executing "').concat(t.apiName,'" with props ').concat(t.apiArguments)})}}))},li=function(t){var n=function(t){var n=t.toString().replace(kt,""),e=n.slice(n.indexOf("(")+1,n.indexOf(")")).match(yt);return null===e&&(e=[]),e}(t),e=n.indexOf("cb");return e&&-1!==e?e:null},si=function t(n,e){var o="";for(var i in e)if("object"===typeof e[i]&&e[i].constructor!==Array){if(i.length>1&&"get"!==i){var c=""!==n?"".concat(n,"."):"";o+=t("".concat(c).concat(i),e[i])}}else o="".concat(o).concat(n,".").concat(i,"\n");var r=o.split("\n"),a=[];return ei().then((function(t){Object(g.each)(r,(function(n){var e=n.split("."),o=t;Object(g.each)(e,(function(t,n){o[t]&&(o=o[t])}));var i="var",c="";Object(g.isFunction)(o)&&(i="Function",c=o.toString()),a.push({name:n,type:i,description:c})}))})),o},pi=function(t){var n=localStorage.getItem("settings-".concat(t))||"";return ft(n,[['"',""]])},ui=function(t){var n=O("settings-backend-port",-1),e=Object(c.a)(n,2),i=e[0],a=e[1],l=O("settings-backend-protocol","same"),s=Object(c.a)(l,2),p=(s[0],s[1],Object(o.useContext)(ii)),u=j.settingsPopup,d=[];if(p){var f=p.userSettings,b="".concat(window.location.protocol,"//"),h="".concat(b).concat(p.status.ipsServer.getLocal()).concat($e.global.port),m="https://api.qrserver.com/v1/create-qr-code/?size=400x400&margin=50&data=".concat(h);d=[{title:"Devices",fields:[{type:"text",var:h,customHtml:'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="qrcode-wrapper">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img src="'.concat(m,'"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>'),title:"Tiro Url",readOnly:!0,expl:"Access Tiro on another device on the <b>same wifi/local network</b> either by :\n\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t - Entering that url in a browser\n\t\t\t\t\t\t\t\t\t\t\t\t <br>\n\t\t\t\t\t\t\t\t\t\t\t\t - Scanning that qrcode (on desktop, go to a website like <a href='https://webqr.com/'>webqr.com </a>)",modifier:function(){},onCustomHtmlClick:function(){p.ui.lightbox.open(0,[m])}},{type:"none",var:"",customHtml:"<button> Open Tiro Window </button>",title:"Open Tiro Window",readOnly:!0,expl:"Open Tiro in a separate window (Desktop only)",modifier:function(){},onCustomHtmlClick:function(){window.open(window.location.href,"popup-tiro","width=800,height=1000"),window.open("","_self").close()}}]},{title:"layout",fields:[{type:"text",title:"Main color",expl:"A color string like 'orange' or 'blue' or an Hex string like '#E86666' (tiro red) or '#729fc4'",var:f.get("ui_layout_colors_main"),modifier:function(t){f.set("ui_layout_colors_main",t)}}]},{title:"editor",fields:[{type:"checkbox",title:"Markdown Preview",expl:"Preview Images and Latex in the editor",var:f.get("ui_editor_markdown_preview"),modifier:function(t){E(!0),f.set("ui_editor_markdown_preview",t)}},{type:"checkbox",title:"Links button",expl:"Replace http links into buttons in the editor",var:f.get("ui_editor_links_as_button"),modifier:function(t){E(!0),f.set("ui_editor_links_as_button",t)}}]},{title:"Users and Rights",fields:[{type:"checkbox",title:"Enable read-only viewer",expl:'Create a "viewer" user that can read but not edit the content',var:f.get("users_viewer_user_enable"),modifier:function(t){f.set("users_viewer_user_enable",t,{writeInSetupJson:!0})}},{type:"text",title:"Viewer user password",expl:'Define the "viewer" user password',var:f.get("users_viewer_user_password"),modifier:function(t){f.set("users_viewer_user_password",t,{writeInSetupJson:!0})}},{type:"checkbox",title:"Demo Mode",expl:"Autofill the 'viewer' user and password on login popup for easier access during a demo mode",var:f.get("demo_mode_enable"),modifier:function(t){f.set("demo_mode_enable",t,{writeInSetupJson:!0})}},{type:"none",var:"",customHtml:"<button> Logout </button>",title:"Logout current User",readOnly:!0,expl:"Logout Current User",modifier:function(){},onCustomHtmlClick:function(){nt(""),t.onClose(),oi((function(t){t.folders.get(["/"],(function(){}))}))}}]},{title:"Advanced",fields:[{type:"text",var:i,title:u.backend.port,expl:u.backend.portExpl,modifier:a}]}]}var v=et("config-panels-opened",[]),w=Object(c.a)(v,3),x=w[0],k=w[1],y=(w[2],Object(o.useState)(!1)),C=Object(c.a)(y,2),T=C[0],E=C[1];return Object(r.c)("div",{className:"settings-popup-wrapper"},Object(r.c)(q,{title:"".concat(u.title),onClose:function(){t.onClose()}},d.map((function(t,n){return Object(r.c)("div",{className:"settings-panel"},Object(r.c)("h3",{onClick:function(){!function(t){var n=Object(g.cloneDeep)(x);n[t]=!n[t],k(n)}(n)}},Object(r.c)("div",{className:"arrow"},x[n]?"\u25bc":"\u25ba"),t.title),Object(r.c)("div",{className:"fields-wrapper ".concat(x[n]?"active":"")},t.fields.map((function(t){return Object(r.c)("div",{className:"field-wrapper"},Object(r.c)("div",{className:"input-and-html-wrapper"},"none"===t.type&&Object(r.c)("span",null,t.title),"none"!==t.type&&Object(r.c)(V,{value:t.var,label:t.title,type:t.type,readonly:t.readOnly,onChange:function(n){"checkbox"!==t.type&&t.modifier(n)},onCheckedChange:function(n){"checkbox"===t.type&&t.modifier(n)}}),t.customHtml&&Object(r.c)("div",{className:"custom-html-wrapper",onClick:function(n){t.onCustomHtmlClick&&t.onCustomHtmlClick()},dangerouslySetInnerHTML:{__html:t.customHtml}})),Object(r.c)("div",{className:"explanation",dangerouslySetInnerHTML:{__html:t.expl||""}}))}))))})),T&&Object(r.c)("button",{onClick:function(t){window.location.reload()}},"Reload App")))},di=function(){var t=$e.global.protocol,n=pi("backend-port")?":".concat(pi("backend-port")):"".concat($e.global.port);return"".concat(t).concat($e.global.url).concat(n)},fi=function(t,n){return["%c [CLIENT SOCKET 2] ".concat(t),"background: #ccc; color: red",n||null]},gi=function(t){var n={};return{on:function(e,o){var i=function(t,n){return function(e){var o;x.log.socket&&(o=console).log.apply(o,Object(f.a)(fi("<== ON ".concat(t," "),Object(d.a)({},e)))),n(e)}}(e,o),c=Object(g.random)(1,1e8);return n[c]={endpoint:e,apiFn:i},t.on(e,i),c},off:function(e){n[e]&&(t.off(n[e].endpoint,n[e].apiFn),delete n[e])},emit:function(n,e){var o;x.log.socket&&(o=console).log.apply(o,Object(f.a)(fi("==> EMIT ".concat(n," "),Object(d.a)({},e)))),t.emit(n,e)}}},bi={};window.tiroCli=bi;var hi=function(t,n){var e,a,l=O("showRenderId",!1),s=Object(c.a)(l,2),p=s[0],u=s[1];e="toggleRenderId",(a={description:"toggle display of renderId for each block",func:function(){console.log("[toggleRenderId]"),u(!p),setTimeout((function(){window.location.reload()}),1e3)}}).f=a.func,bi[e]=a;var d=Object(g.random)(0,1e3);return Object(o.useMemo)((function(){var n=(new Date).getTime(),e=(new Error).stack,o=(null===e||void 0===e||e.split("\n")[6].replace("at ","").replace(/\(.*\)/gi,"").trim(),Object(r.c)(i.a.Fragment,null,p&&Object(r.c)("p",{style:{position:"absolute",fontSize:"10px",color:"rgba(255,0,0,0.8)"}},d),t));(new Date).getTime();return o}),n)},mi=function(){return"Tiro (".concat($e.version,")")},vi=function(t){return Object(r.c)("button",{className:"new-file-button",onClick:function(n){t.onNewFile()}},Object(r.c)(Qt,{name:"faPlusCircle",color:"white"}),Object(r.c)("span",null,j.newNote))},wi=i.a.memo(vi,(function(t,n){return!0})),xi=e(211),Oi=e(209),ji={ctrl:!1,shift:!1,alt:!1,opt:!1},ki={38:"up",40:"down",17:"ctrl",16:"shift",18:"alt",93:"opt",13:"enter"},yi=function(t){return t=t||window.event,ki[t.keyCode]?ki[t.keyCode]:t.key},Ci={},Ti=function(t){Object(C.a)(e,t);var n=Object(T.a)(e);function e(t){var o;return Object(k.a)(this,e),(o=n.call(this,t)).oldFiles=[],o.liRefs=[],o.scrollerWrapperRef=i.a.createRef(),o.scrollerListRef=i.a.createRef(),o.canAutoScroll=!1,o.getVisibleItemsDebounced=Object(g.debounce)((function(){var t=o.scrollerWrapperRef.current;if(t){for(var n=t.getBoundingClientRect().height,e=-1,i=[],c=0;c<o.liRefs.length;c++){var r=o.liRefs[c].current;if(r){var a,l=r.getBoundingClientRect().top;if(l>-50&&l<n+100)-1===e&&(e=c),o.props.files[c]&&i.push(null===(a=o.props.files[c])||void 0===a?void 0:a.path)}}o.props.onVisibleItemsChange(i)}}),500),o.onListScroll=function(){o.canAutoScroll=!1,o.getVisibleItemsDebounced()},o.isMultiSelected=function(t){var n=!1;return o.state.selectionEdges[0]<=t&&o.state.selectionEdges[1]>=t&&(n=!0),n},o.itemToScroll=0,o.autoScrollToItem=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o.itemToScroll=n?t:o.itemToScroll+t,o.itemToScroll<0&&(o.itemToScroll=0),o.itemToScroll>o.props.files.length&&(o.itemToScroll=o.props.files.length),o.scrollerListRef.current.scrollToItem(o.itemToScroll)},o.getUrlLoginToken=function(){return"?token=".concat(Q())},o.state={hoverMode:!1,selectionEdges:[-1,-1]},o}return Object(y.a)(e,[{key:"shouldComponentUpdate",value:function(t,n){if(JSON.stringify(t.files)!==JSON.stringify(this.oldFiles)){this.oldFiles=Object(g.cloneDeep)(t.files),this.liRefs=[];for(var e=0;e<t.files.length;e++)this.liRefs.push(i.a.createRef());this.getVisibleItemsDebounced(),this.setState({selectionEdges:[-1,-1]}),this.canAutoScroll=!0}return this.props.activeFileIndex>0&&this.canAutoScroll&&(this.canAutoScroll=!1,this.autoScrollToItem(this.props.activeFileIndex)),!0}},{key:"render",value:function(){var t=this,n=X[this.props.sortMode],e=W.sizes.l2.fileLi.height+2*W.sizes.l2.fileLi.padding+W.sizes.l2.fileLi.margin,o=window.innerHeight-(W.sizes.search.h+W.sizes.search.padding),c=a("desktop")?o:o-W.sizes.mobile.bottomBarHeight;return Object(r.c)(i.a.Fragment,null,Object(r.c)("div",{className:"list-wrapper-scroller",style:{height:c},onScroll:this.onListScroll,ref:this.scrollerWrapperRef},Object(r.c)(Oi.a,null,(function(o){o.height;var a=o.width;return Object(r.c)(xi.a,{itemData:t.props.files,className:"List",ref:t.scrollerListRef,height:c,itemCount:t.props.files.length,itemSize:e,width:a,onScroll:t.onListScroll},(function(e){var o=e.index,c=e.style,l=t.props.files[o],s=t.props.filesPreview[l.path];return Object(r.c)("div",{style:c},Object(r.c)("li",{ref:t.liRefs[o],style:{width:a-2*Ni.l2.fileLi.padding-2*Ni.l2.fileLi.margin-35},className:["file-element-list","element-".concat(o),"".concat(t.isMultiSelected(o)?"active":""),"".concat(o===t.props.activeFileIndex?"active":""),"".concat(s&&s.picture?"with-image":"")].join(" "),key:o,draggable:!0,onDragStart:function(){var n=[],e=t.state.selectionEdges;n=-1!==e[0]||-1!==e[1]?t.props.files.slice(e[0],e[1]+1):[l],t.props.onFileDragStart(n)},onDragEnd:function(){t.props.onFileDragEnd()},onClick:function(n){if(ji["shift"]){var e=[t.props.activeFileIndex,o];e.sort(),t.setState({selectionEdges:e})}else t.props.onFileClicked(o),t.setState({selectionEdges:[-1,-1]});t.props.onFileClicked(o)}},Object(r.c)("div",{className:"background-item"}),Object(r.c)("div",{className:"background-item-border"}),Object(r.c)("div",{className:"left"},Object(r.c)("h3",{className:"label ".concat(l.name.length<=35?"oneliner":"more"),onMouseEnter:function(n){t.props.hoverMode&&t.props.onFileClicked(o)}},l.name),Object(r.c)("div",{className:"content"},s&&s.content&&Object(r.c)(i.a.Fragment,null,s.content)),Object(r.c)("div",{className:"date ".concat(n)},ie(new Date(("modified"===n?l.modified:l.created)||0)))),Object(r.c)("div",{className:"right"},s&&s.picture&&Object(r.c)("div",{className:"picture",style:{backgroundColor:"white",backgroundImage:"url('".concat(s.picture.startsWith("http")?s.picture+t.getUrlLoginToken():"".concat(Ho(t.props.files[0].folder),"/").concat(s.picture).concat(t.getUrlLoginToken()),"')")}}))))}))}))))}}]),e}(i.a.Component),Ei=i.a.memo(Ti,(function(t,n){return!1})),Si=Object(d.a)({},W),Ii=(Si.els,Si.colors),Ni=(Si.font,Si.sizes),Fi=function(t){return Object(r.c)("div",{className:"folder-tree-view-component"},Object(r.c)("h3",{className:"subtitle"},j.folders),Object(r.c)(Li,{openFolders:t.openFolders,folder:t.folder,current:t.current,onFolderClicked:t.onFolderClicked,onFolderMenuAction:t.onFolderMenuAction,onFolderOpen:function(n){oi((function(e){e.ui.browser.folders.open.add(n),t.onFolderOpen(n)}))},onFolderClose:function(n){oi((function(e){e.ui.browser.folders.open.remove(n),t.onFolderClose(n)}))},onFolderDragStart:t.onFolderDragStart,onFolderDragEnd:t.onFolderDragEnd,onFolderDrop:t.onFolderDrop}))},Li=function t(n){var e=n.openFolders.includes(n.folder.path)&&n.folder.hasFolderChildren,i=Object(o.useState)(!1),a=Object(c.a)(i,2),l=a[0],s=a[1],p=Object(o.useState)(""),u=Object(c.a)(p,2),d=u[0],f=u[1],g=K(n.current,n.folder.key);return Object(r.c)("li",{className:"folder-wrapper ".concat(g?"current":""," "),draggable:!0,onDrop:function(t){n.folder.key&&(n.onFolderDrop(n.folder),t.stopPropagation())},onDragStart:function(t){n.folder.key&&(n.onFolderDragStart(n.folder),t.stopPropagation())},onDragEnd:function(){n.folder.key&&n.onFolderDragEnd()},onMouseLeave:function(){l&&s(!1)}},Object(r.c)("div",{className:"folder-title ".concat(d),onDragEnter:function(t){f("drag")},onDrop:function(t){f("")},onDragLeave:function(t){f("")}},Object(r.c)("span",{className:"icon",onClick:function(t){e?n.onFolderClose(n.folder.key):n.onFolderOpen(n.folder.key)}},n.folder.hasFolderChildren&&Object(r.c)(Qt,{name:e?"faCaretDown":"faCaretRight",color:W.colors.main})),Object(r.c)("span",{className:"title",onClick:function(t){n.onFolderClicked(n.folder.key)}},Object(r.c)("div",{className:"title-drag-bg"}),Object(r.c)("div",{className:"title-label"}," ",n.folder.title)),Object(r.c)("span",{onClick:function(){s(!l)},className:"context-menu-wrapper"},Object(r.c)(Qt,{name:"faEllipsisH",color:W.colors.l1.font}),l&&Object(r.c)("div",{className:"context-menu context-menu-folders"},Object(r.c)("ul",null,Object(r.c)("li",{onClick:function(){if(""===n.folder.path)return s(!1);var t=prompt("".concat(j.renameFolderPrompt," "),n.folder.title);t&&""!==t&&t!==n.folder.title&&n.onFolderMenuAction("rename",n.folder,t),s(!1)}},j.renameFolder),Object(r.c)("li",{onClick:function(){if(""===n.folder.path)return s(!1);ei().then((function(t){t.popup.prompt({text:"".concat(j.createFolderPrompt,' "').concat(n.folder.path,'"?'),userInput:!0,onAccept:function(t){t&&""!==t&&n.onFolderMenuAction("create",n.folder,t)},onRefuse:function(){}})})),s(!1)}},j.createFolder),-1===n.folder.path.indexOf(".tiro/.trash")&&Object(r.c)("li",{onClick:function(){if(""===n.folder.path)return s(!1);s(!1),n.onFolderMenuAction("moveToTrash",n.folder)}},j.moveToTrash),-1!==n.folder.path.indexOf(".tiro/.trash")&&Object(r.c)("li",{onClick:function(){if(""===n.folder.path)return s(!1);s(!1),ei().then((function(t){t.popup.confirm("".concat(j.deleteFolderPrompt,' "').concat(n.folder.path,'"?'),(function(){n.onFolderMenuAction("delete",n.folder)}))}))}},j.deleteFolder))))),e&&Object(r.c)("ul",{className:"folder-children"},n.folder.children&&n.folder.children.map((function(e,o){return Object(r.c)(t,{openFolders:n.openFolders,key:o,folder:e,current:n.current,onFolderOpen:n.onFolderOpen,onFolderMenuAction:n.onFolderMenuAction,onFolderClose:n.onFolderClose,onFolderClicked:n.onFolderClicked,onFolderDragStart:n.onFolderDragStart,onFolderDragEnd:n.onFolderDragEnd,onFolderDrop:n.onFolderDrop})}))))},Ri=i.a.memo(Fi,(function(t,n){var e=!0;return t.openFolders===n.openFolders&&t.folder===n.folder&&t.current===n.current||(e=!1),e})),Ai=function(t){var n=Object(d.a)({},t).files;return Object(r.c)(i.a.Fragment,null,n.length>0&&Object(r.c)("div",{className:"last-notes-component"},Object(r.c)("h3",{className:"subtitle"},j.lastNotes),Object(r.c)("ul",null,n.map((function(n,e){var o=n.name.replace(".md","");return o=o.length>20?"".concat(o.substr(0,20)):o,Object(r.c)("li",{key:e,title:o,onClick:function(e){t.onClick(n)},className:"note"},Object(r.c)(Qt,{name:"faFile"}),o)})))))},Di=i.a.memo(Ai,(function(t,n){return t.files===n.files})),Pi=function(t){var n=Object(o.useContext)(ii),e=!!n&&n.status.searching.get;return Object(r.c)(i.a.Fragment,null,Object(r.c)("div",{className:"search-bar-component"},Object(r.c)("input",{type:"text",placeholder:j.searchPlaceholder,value:t.term,onKeyDown:function(e){if("Enter"===e.key){if(t.term.length<3)return;n&&n.ui.search.search(t.term)}},onChange:function(e){!function(e,o){if(n){var i=n.ui.browser.folders.current.get;""===t.term&&""!==i&&(e=e+" "+i,o&&setTimeout((function(){var t=(o.selectionStart||0)-i.length-1;o.selectionStart=t,o.selectionEnd=t}),10)),n.ui.search.term.set(e)}}(e.target.value,e.target)}}),Object(r.c)("div",{className:"search-status"},e&&j.searchingLabel)))},zi=function(t){var n={title:t.realname,folder:t.folder,mobileview:"editor"},e="".concat($e.global.protocol).concat($e.global.url).concat($e.global.port,"?").concat(function(t){var n="",e=0;for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&t[o]&&(n+="".concat(0===e?"":"&").concat(o.toLowerCase(),"=").concat(t[o]),e++);return n}(n));window.open(e,"popupDetached","width=600,height=600")},Mi=function(t){var n=Object(o.useState)(0),e=Object(c.a)(n,2),i=e[0],a=e[1];Object(o.useEffect)((function(){a(t.startingIndex)}),[t.startingIndex]);var l=function(n){var e=i;e=-1===n&&0===i?t.images.length-1:1===n&&i===t.images.length-1?0:i+n,a(e)};return Object(r.c)("div",{className:"lightbox-component"},Object(r.c)("div",{className:"lightbox-bg"}),Object(r.c)("div",{className:"lightbox-content"},t.images.map((function(n,e){return Object(r.c)("div",{key:e,className:"lightbox-image",style:{display:e===i?"flex":"none"}},Object(r.c)("img",{src:Ho(n.url)+tt()}),Object(r.c)("div",{className:"image-infos"},Object(r.c)("div",{className:"image-name",onClick:function(t){return zi(n.file)}},n.file.name," - ",n.title),Object(r.c)(nn,{popup:!1,buttons:[{class:"left",title:"left",icon:"faChevronLeft",action:function(){l(-1)}},{class:"close",title:"close",icon:"faTimes",action:function(){t.onClose()}},{class:"right",title:"right",icon:"faChevronRight",action:function(){l(1)}}]})))}))))},Bi={onAccept:function(){},onRefuse:function(){}},_i=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),a=e[0],l=e[1],s=Object(o.useState)(""),p=Object(c.a)(s,2),u=p[0],d=p[1],f=Object(o.useState)(null),g=Object(c.a)(f,2),b=g[0],h=g[1],m=Object(o.useState)(j.promptPopup.defaultTitle),v=Object(c.a)(m,2),w=v[0],x=v[1],O=Object(o.useState)(!1),k=Object(c.a)(O,2),y=k[0],C=k[1],T=function(t){l(!0),d(t.text),t.title&&x(t.title),t.userInput&&h(""),t.onAccept&&(Bi.onAccept=t.onAccept),t.onRefuse?(Bi.onRefuse=t.onRefuse,C(!0)):C(!1)},E=function(){l(!1),h(null),x(""),d(""),C(!1)},S={confirm:function(t,cb,n){T({title:"",text:t,onAccept:cb,onRefuse:function(t){function n(){return t.apply(this,arguments)}return n.toString=function(){return t.toString()},n}((function(){n&&n()}))})},show:function(t,n,cb){T({title:n,text:t,onAccept:cb,onRefuse:function(){}})},prompt:T};return{popupApi:S,PromptPopupComponent:function(){return Object(r.c)(i.a.Fragment,null,a&&Object(r.c)("div",{className:"prompt-popup-component"},Object(r.c)(q,{title:w,onClose:E,canBgClose:!1},Object(r.c)("div",null,Object(r.c)("div",{className:"content",dangerouslySetInnerHTML:{__html:u}}),Object(r.c)("br",null),null!==b&&Object(r.c)("div",null,Object(r.c)("input",{type:"text",value:b,onChange:function(t){h(t.target.value)}}),Object(r.c)("br",null)),Object(r.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){Bi.onAccept(b),E()}},j.promptPopup.accept),y&&Object(r.c)("button",{value:"submit",className:"refuse submit-button",onClick:function(t){Bi.onRefuse(b),E()}},j.promptPopup.refuse)))))}}},Hi=function(t){var n=Object(o.useContext)(ii),e=Object(o.useState)(-1),i=Object(c.a)(e,2),a=i[0],l=i[1];return Object(r.c)("div",{className:"tab-list-scroll-wrapper"},Object(r.c)("div",{className:"tab-list-invisible-scroll"},Object(r.c)("div",{className:"tab-list-wrapper"},t.tabs.map((function(e,o){return Object(r.c)(Wi,{key:o,tab:e,onDrop:function(t){l(t)},onDragEnter:function(t){l(t)},onDragEnd:function(t){n&&n.tabs.reorder(t,a),l(-1)},dragIndic:a,pos:o,onUpdate:t.onUpdate})})),(null===n||void 0===n?void 0:n.ui.browser.files.active.get)&&Object(r.c)("div",{className:"tab-wrapper tab-more",onClick:function(n){t.onUpdate("add")}},"+"))))},Ui=function(t){var n=Object(d.a)({},t),e=n.tab,o=n.pos,c="Six",a=e.grid.layout.length;return 2===a&&(c="Two"),3===a&&(c="Three"),4===a&&(c="Four"),5===a&&(c="Five"),c="faDice".concat(c),Object(r.c)("div",{className:"tab-and-drag-wrapper"},t.dragIndic===o&&Object(r.c)("div",{className:"drag-indic"},"\u25bc"),Object(r.c)("div",{className:"tab-wrapper ".concat(e.active?"active":""),draggable:!0,onDragEnter:function(){t.onDragEnter(o)},onDrop:function(){t.onDrop(o)},onDragEnd:function(){t.onDragEnd(o)}},Object(r.c)("div",{className:"active-ribbon"}),Object(r.c)("div",{className:"tab-name",onClick:function(){t.onUpdate("activate",e)}},"mobile"!==s()&&Object(r.c)("input",{type:"text",className:"tab-input-text",value:e.name,style:{width:10*e.name.length+"px"},onChange:function(n){t.onUpdate("rename",e,n.target.value)}}),"mobile"===s()&&Object(r.c)(i.a.Fragment,null,e.name)),e.grid.layout.length>1&&Object(r.c)("div",{className:"tab-nb-windows",onClick:function(){t.onUpdate("activate",e)}},Object(r.c)(Qt,{name:c,color:"#b2b2b2"})),Object(r.c)("div",{className:"tab-close",onClick:function(){oi((function(n){n.popup.confirm("".concat(j.deleteTabPrompt,' "').concat(e.name,'"?'),(function(){t.onUpdate("close",e)}))}))}},Object(r.c)(Qt,{name:"faPlus",color:"#b2b2b2"}))))},Wi=i.a.memo(Ui,(function(t,n){var e=!0,o=Object(g.cloneDeep)({n:t.tab,p:n.tab});return o.n.grid=o.p.grid={},o.n.refresh=o.p.refresh="",JSON.stringify(o.p)!==JSON.stringify(o.n)&&(e=!1),n.pos!==t.pos&&(e=!1),n.dragIndic!==t.dragIndic&&(e=!1),n.tab.active!==t.tab.active&&(e=!1),n.onUpdate!==t.onUpdate&&(e=!1),e})),qi=(s(),Object(d.a)({},W)),Vi=qi.els,Gi=qi.colors,Ji=(qi.font,qi.sizes),Yi=function(t,n){var e,o="//css\n\t\t.content-image {\n\t\t\t\twidth: 90%;\n\t\t}\n\t\t.full {\n\t\t\t\t.content-image {\n\t\t\t\t}\n\t\t}\n\n\t\t".concat("\n .main-wrapper.view-image {\n .mobile-view-toggler {\n display: none;\n }\n \n .left-wrapper {\n width: ".concat("desktop"===s()?15:40,"vw ;\n .left-wrapper-1 {\n width: 100%\n }\n .left-wrapper-2 {\n display: none;\n }\n }\n\n\n .right-wrapper.dual-viewer-view {\n display: none;\n }\n .right-wrapper {\n height: 100vh;\n }\n .right-wrapper.image-gallery-view {\n width: ").concat(100-("desktop"===s()?15:40),"vw;\n }\n }\n \n .main-wrapper.view-text {\n .right-wrapper.dual-viewer-view {\n \n }\n .right-wrapper.image-gallery-view {\n display: none;\n }\n }\n"),"\n\t\t").concat("\n.katex-display {\n\t\tdisplay: inline;\n\t\t.katex {\n\t\t\t\tdisplay: inline;\n\t\t\t\t.katex-html {\n\t\t\t\t\t\tdisplay: inline;\n\t\t\t\t}\n\t\t}\n}\n","\n\t\t").concat("\n.lightbox-component {\n position: fixed;\n\t\tz-index: 1002;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n \n .lightbox-bg {\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n position: absolute;\n\t\t\t\tbackground: rgb(0 0 0 / 82%);\n }\n\n .lightbox-content {\n\t\t\t\tborder-radius: 9px;\n\t\t\t\toverflow: hidden;\n position: absolute;\n width: 95vw;\n height: 95vh;\n background: black;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%); \n\n .lightbox-image {\n position: relative;\n justify-content: space-around;\n align-items: center;\n width: 100%;\n height: 100%;\n\n &:hover {\n .image-infos {\n display: block;\n }\n }\n .image-infos {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\theight: 55px;\n\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\tbackground: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);\n\t\t\t\t\t\t\t\tul {\n\t\t\t\t\t\t\t\t\t\tmargin-top: 5px;\n\t\t\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t\t\t\theight: 95vh;\n\t\t\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\tli {\n\t\t\t\t\t\t\t\t\t\t\t\t&.left,\n\t\t\t\t\t\t\t\t\t\t\t\t&.right {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 20%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjustify-content: space-evenly;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t&.left {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tz-index:3;\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t&.right {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tz-index:3;\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t&.close {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tz-index:4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n // position: relative;\n &:hover {\n .image-name {\n display: block;\n }\n }\n .image-name {\n display: none;\n cursor: pointer;\n color: grey;\n padding: 5px;\n font-size: 10px;\n position: absolute;\n top: 5px;\n left: 5px;\n }\n }\n img {\n max-width: 95vw;\n\t\t\t\t\t\t\t\tz-index:2;\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\tmax-height: 95vh;\n }\n }\n }\n}\n","\n\t\t").concat("\n .prompt-popup-component {\n\t\t\t\t.popup-wrapper {\n\t\t\t\t\t\tmin-width: 200px;\n\t\t\t\t\t\tmin-height: 100px;\n\t\t\t\t\t\ttext-align:center;\n\t\t\t\t}\n }\n","\n\n\t\t").concat("\n .app-view-switcher-component {\n margin: 0px 10px 10px 10px;\n ul.buttons-toolbar-component {\n li {\n margin-left: 5px;\n margin-right: 5px;\n }\n }\n }\n","\n\t\t").concat("\n ul.buttons-toolbar-component {\n list-style: none;\n padding: 0px;\n margin: 0px;\n button.toolbar-button {\n ".concat(W.els().button,";\n cursor: pointer;\n }\n\t\t\t\t&.vertical {\n\t\t\t\t\t\t.toolbar-button {\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t.inside-html-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor:").concat(W.colors.main,";\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.button-hover-popup {\n\t\t\t\t\t\t\t\t\t\t\t\tcolor:").concat(W.colors.main,";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.inside-html-wrapper {\n\t\t\t\t\t\t\t\t\t\twidth: 15px;\n\t\t\t\t\t\t\t\t\t\tspan {\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.button-hover-popup {\n\t\t\t\t\t\t\t\t\t\tmargin-left: 15px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t\t\t\t\t\t\tfont-size: 11px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t&.horizontal.with-popup {\n\t\t\t\t\t\t\t\tli button:hover .button-hover-popup {\n\t\t\t\t\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t&.horizontal {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tli {\n\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t.button-hover-popup {\n\t\t\t\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t\t\t\t\topacity: 0.2;\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\tbottom: 22px;\n\t\t\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.editor.interfaceGrey,";\n\t\t\t\t\t\t\t\t\t\tcolor: black;\n\t\t\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\t\t\tleft: 50%;\n\t\t\t\t\t\t\t\t\t\twidth: max-content;\n\t\t\t\t\t\t\t\t\t\tfont-size: 8px;\n\t\t\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\t\t\ttransform: translateX(-50%);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n }\n}\n"),"\n\n\t\t.main-wrapper {\n\t\t\t\tdisplay: flex;\n\n\t\t\t\t").concat("\n .image-gallery-component-wrapper {\n margin: 0px 17px;\n overflow-y: scroll;\n // height: calc(100vh - ".concat(W.sizes.search.padding+W.sizes.gallery.topH+("desktop"===s()?0:190),"px);\n height: calc(100vh - ").concat(W.sizes.search.padding+W.sizes.gallery.topH,"px);\n // height: 100%;\n width: 100%;\n\n .masonry-gallery {\n display: flex;\n list-style: none;\n flex-direction: row;\n flex-wrap: wrap;\n\n .masonry-col {\n width: ").concat("desktop"===s()?32:90,"%;\n margin-right: 1%;\n\n .masonry-col-item {\n position: relative;\n &:hover {\n .image-infos {\n display: block;\n }\n }\n .image-infos {\n display: none;\n ").concat(W.els().imageInfos,"\n }\n img {\n ").concat(W.els().images,"\n }\n margin-bottom: 10px;\n }\n }\n }\n }\n"),"\n\n\t\t\t\t").concat("\n.dropdown-wrapper {\n\t\t\n\t\tposition: relative;\n\t\t&.hover-active:hover {\n\t\t\t\t.context-menu {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\tpointer-events: all;\n\t\t\t\t}\n\t\t\t\t.dropdown-icon {\n\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\tcolor: ".concat(W.colors.main,";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\t.dropdown-icon {\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding: 10px;\n\t\t\t\ttop: -10px;\n\t\t\t\tsvg {\n\t\t\t\t\t\tcolor: #d4d1d1;\n\t\t\t\t}\n\t\t}\n\n\t\t.context-menu {\n\t\t\t\toverflow-y: scroll;\n\t\t\t\tz-index: 100;\n\t\t\t\tright: 10px;\n\t\t\t\ttop: 20px;\n\t\t\t\tpointer-events: none;\n\n\n\t\t\t\ttransition: 0.2s all;\n\t\t\t\ttransition-delay: 0.2s, 0s;\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 0;\n\n\t\t\t\tmin-width: 140px;\n\t\t\t\tpadding: 10px;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\tbackground: white;\n\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t}\t\n\n\t\t&.right {\n\t\t\t\t.dropdown-icon {\n\t\t\t\t\t\tright: 0px;\n\t\t\t\t}\n\t\t}\n}\n"),"\n\n\t\t\t\t").concat("\n.search-bar-component {\n input {\n\t\t\t\tborder-radius: 5px;\n width: calc(100% - ".concat(2*W.sizes.block+20,"px);\n border: none;\n background: white;\n\t\t\t\tpadding: 18px 9px;\n\t\t\t\tmargin: 0px 15px 15px 15px;\n\t\t\t\tbox-shadow: 0px 0px 6px rgb(0 0 0 / 5%);\n\t\t\t\tfont-size: 11px;\n margin: 0px ").concat(W.sizes.block,"px ").concat(W.sizes.block,"px ").concat(W.sizes.block,"px; \n &::placeholder {\n color: #afadad;\n }\n }\n .search-status {\n text-align: center;\n font-size: 8px;\n\t\t\t\tposition: relative;\n\t\t\t\tbottom:9px;\n\t\t\t\tcolor: grey;\n }\n}\n"),"\n\n\t\t\t\t").concat("\n.mobile-view-toggler {\n position: fixed;\n bottom: 0px;\n left: 0px;\n z-index: 10;\n display:flex;\n width: 100%;\n list-style: none;\n margin: 0px;\n padding: 0px;\n background: ".concat(W.colors.main,";\n li {\n flex: 1 1 auto;\n button {\n ").concat(W.els().button,";\n padding: 8px;\n width: 100%;\n svg {\n color: white;\n transform: scale(1.1);\n background: rgba(255,255,255,0);\n padding: 10px 40px;\n border-radius: 6px;\n }\n &:hover {\n svg {\n color: white;\n }\n }\n &.active {\n svg {\n color: white;\n background: rgba(255,255,255,0.2);\n }\n }\n }\n }\n}\n"),"\n\n\t\t\t\t").concat("\n.connection-status {\n font-size: 9px;\n z-index: 11;\n a {\n margin-left: 10px;\n color: white;\n }\n .back-online, .disconnected {\n position: absolute;\n text-align:center;\n color:white;\n top: 0px;\n left: 0px;\n width: 100vw;\n padding: 1px;\n }\n .back-online{\n background: green;\n }\n .disconnected{\n background: ".concat(W.colors.main,";\n }\n .connected {\n display:none;\n position: absolute;\n bottom: 5px;\n right: 5px;\n color: ").concat(W.colors.green,";\n }\n}\n"),"\n\n\t\t\t\t").concat("\n .setup-popup-component {\n .submit-button {\n margin-top: 10px;\n ".concat(W.els().redButton,";\n padding: 10px 20px;\n }\n .error {\n color: ").concat(W.colors.main,";\n }\n .success {\n color: ").concat(W.colors.green,";\n }\n }\n"),"\n\n\t\t\t\t").concat("\n .input-component {\n display: flex;\n align-items: center;\n padding-bottom: 10px;\n input, select {\n max-width: 100%;\n }\n &.select {\n span {\n width: 20%;\n }\n }\n span {\n width: 30%;\n font-weight: 700;\n text-transform: uppercase;\n }\n .input-wrapper {\n width: 70%;\n input {\n padding: 7px;\n border: none;\n background: #ececec;\n border-radius: 5px;\n }\n .explanation {\n font-size: 11px;\n color: grey;\n }\n }\n }\n","\n\n\t\t\t\t").concat("\n\n.content-blocks-wrapper {\n\t\tpadding: 0px 15px;\n}\n.simple-css-wrapper {\n\t\t/* overflow: hidden; */\n}\n\n.content-blocks-wrapper,\n.simple-css-wrapper,\n.simple-css-wrapper > div,\n.content-block,\n.iframe-view-wrapper\n{\n}\n\n.iframe-view-wrapper {\n\t\tposition: relative;\n\t\t.ctag-reload {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 4px;\n\t\t\t\tleft: 10px;\n\t\t\t\tcursor: pointer;\n\t\t\t\topacity: 0;\n\t\t\t\ttransition: 0.2s all; \n\t\t}\n\t\t&:hover {\n\t\t\t\t.ctag-reload {\n\t\t\t\t\t\topacity:0.5;\n\t\t\t\t}\n\t\t}\n\n\t\t&.hide iframe {\n\t\t\t\topacity: 0;\n\t\t}\n\t\tiframe {\n\t\t\t\ttransition: 0.3s all;\n\t\t\t\twidth: calc(100% );\n\t\t\t\t// border: 2px #eaeaea solid;\n\t\t\t\tborder: none;\n\t\t\t\tborder-radius: 5px;\n\t\t}\n\t\t.iframe-error {\n\t\t\t\tbackground: #ffddba;\n\t\t\t\tfont-size: 8px;\n\t\t\t\tpadding: 14px;\n\t\t\t\tborder: 2px #ffc080 solid;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\tline-height: 14px;\n\t\t}\n}\n\n.content-block.block-text {\n\t\tpadding-bottom: 0px;\n}\n\n/* .content-block-text > * { */\n/* \t\tpadding: 0px 15px; */\n/* } */\n\n.content-block.block-tag {\n\t\tpadding: 0px 0px 0px 0px;\n position: relative;\n left: -15px;\n top: 0;\n width: calc(100% + 20px);\n height: calc(100% );\n display: block;\n}\n\n","\n\n\t\t\t\t.no-file {\n\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\tmargin-top: 49vh;\n\t\t\t\t}\n\n\t\t\t\t").concat("\n.popup-wrapper-component {\n .overlay-click-popup {\n position: fixed;\n z-index:1000;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n background: rgba(0,0,0,0.1);\n }\n .popup-wrapper {\n position: fixed;\n z-index:1001;\n left: 50%;\n top:50%;\n &.ipad {\n top:20%;\n }\n width : auto;\n max-width: 90%;\n transform:translate(-50%,-50%);\n\t\t\t\tbackground: ".concat(W.colors.bgPopup,";\n border-radius:6px;\n box-shadow: 0px 0px 5px rgba(0,0,0,.2);\n .popupTitle {\n margin: 0px 0px 20px 0px;\n text-align: left;\n background: ").concat(W.colors.main,";\n color: white;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 14px;\n padding: 5px 0px 5px 20px;\n border-radius:6px 6px 0px 0px;\n }\n .popupContent {\n padding: 0px 20px 20px 20px;\n // min-width : 350px;\n }\n img{\n padding: 0px 5px 0px 0px;\n margin: 5px 5px 0px 0px;\n }\n }\n}\n"),"\n\n\n\t\t\t\t").concat("\n&.device-view-mobile {\n\t\t.popup-wrapper .popupContent {\n\t\t\t\twidth: 80vw;\n\t\t\t\t.field-wrapper {\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t.explanation {\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\tpadding: 5px 0px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinput {\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t}\n}\n\n.settings-popup-wrapper .popup-wrapper .popupContent {\n padding: 0px 20px;\n\t\twidth: 50vw;\n\t\tmin-height: 50vh;\n\t\tmax-height: 70vh;\n\t\toverflow-y: scroll;\n\n}\n\n.settings-panel {\n\n\t\th3 {\n\t\t\t\tcursor: pointer;\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\t.arrow {\n\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\tfont-size: 7px;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\tbottom: 2px;\n\t\t\t\t\t\tmargin-right: 10px;\n\t\t\t\t}\n\t\t}\n\t\t.fields-wrapper {\n\t\t\t\tdisplay: none;\n\t\t\t\t&.active {\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tpadding: 12px 12px 0px 12px;\n\t\t\t\t\t\tbackground: ".concat(W.colors.bgPopup2,";\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tborder: 1px ").concat(W.colors.bgPopup3," solid;\n\t\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t}\n\t\t\t\t.field-wrapper {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tpadding-bottom: 11px;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\t.input-and-html-wrapper {\n\t\t\t\t\t\t\t\twidth: 50%;\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t.input-component {\n\t\t\t\t\t\t\t\t\t\tflex: 1;\n\t\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 10px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.custom-html-wrapper {\n\t\t\t\t\t\t\t\t\t\tmargin-left: 20px;\n\t\t\t\t\t\t\t\t\t\t.qrcode-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\timg {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin: 5px 25px 0px 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 50px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\twidth: 150px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.explanation {\n\t\t\t\t\t\t\t\twidth: 50%;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n}\n\n\n\n\n.buttons {\n display: flex;\n padding: 20px 0px 0px 0px;\n button {\n width: 30%;\n padding: 10px;\n }\n}\n"),"\n\n\t\t\t\t").concat("\n.last-notes-component {\n padding: 0px ".concat(W.sizes.block,"px;\n \n h3 {\n\n }\n ul {\n height: ").concat(110,"px;\n overflow: hidden;\n &:hover {\n min-height: ").concat(110,"px;\n height: auto;\n }\n\n padding: 0px;\n margin: 0px;\n li {\n cursor: pointer;\n margin-bottom: 7px;\n overflow: hidden;\n height: ").concat(15,"px;\n list-style: none;\n font-size: 11px;\n font-weight: 400;\n svg {\n color: ").concat(W.colors.main,";\n margin-right: 10px;\n }\n }\n }\n}\n"),"\n\n\t\t\t\t").concat("\n&.device-view-mobile {\n\t\t.folder-tree-view-component {\n\t\t\t\tli.folder-wrapper {\n\t\t\t\t\t\t.context-menu-wrapper {\n\t\t\t\t\t\t\t\tright: -18px;\n\t\t\t\t\t\t\t\t.context-menu {\n\t\t\t\t\t\t\t\t\t\tright: 5px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n\n.folder-tree-view-component {\n\t\tpadding: ".concat(W.sizes.block,"px;\n\t\tpadding-right: 0px;\n\t\tmargin: 0px 0px 100px 0px;\n\t\twidth: calc(100% - ").concat(W.sizes.block*(a("desktop")&&!l()?1:2),"px);\n\n\t\tul.folder-children {\n\t\t\t\tmargin: 0px 0px 0px 0px;\n\t\t\t\tpadding: 0px 0px 0px 10px;\n\t\t}\n\n\t\tli.folder-wrapper {\n\n\t\t\t\tposition: relative;\n\t\t\t\tlist-style: none;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tcursor: pointer;\n\n\t\t\t\t.context-menu-wrapper {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tright: 20px;\n\t\t\t\t\t\ttop: -10px;\n\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\t.context-menu {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t\t\ttop: 15px;\n\t\t\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 4px rgb(0 0 0 / 10%);\n\t\t\t\t\t\t\t\tcolor: black;\n\t\t\t\t\t\t\t\tpadding: 0px 0px;\n\t\t\t\t\t\t\t\twidth: 100px;\n\t\t\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\t\tfont-size: 10px;\n\t\t\t\t\t\t\t\tul {\n\t\t\t\t\t\t\t\t\t\tlist-style: none;\n\t\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\tli {\n\t\t\t\t\t\t\t\t\t\t\t\tpadding: 4px 11px;\n\t\t\t\t\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.main,";\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t.folder-title:hover > .context-menu-wrapper {\n\t\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t\tdisplay:block;\n\t\t\t\t}\n\t\t\t\t&.current > .folder-title {\n\t\t\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\t\t\ttext-decoration: underline;\n\t\t\t\t}\n\t\t\t\t.folder-title {\n\t\t\t\t\t\tposition: relative;\n\n\t\t\t\t\t\t.title-label {\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\tz-index: 0;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.title-drag-bg {\n\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\ttop: -4px;\n\t\t\t\t\t\t\t\tz-index: -1;\n\t\t\t\t\t\t\t\tleft: -5px;\n\t\t\t\t\t\t\t\ttransition: 50ms;\n\t\t\t\t\t\t\t\tbackground: rgba(255,255,255,0);\n\t\t\t\t\t\t\t\tz-index:0;\n\t\t\t\t\t\t\t\tpointer-events: none;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t&.drag .title-drag-bg {\n\t\t\t\t\t\t\t\tbackground: rgba(255,255,255,0.6);\n\t\t\t\t\t\t\t\tpointer-events: all;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpadding: 1px;\n\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\t\t.icon {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tleft: 2px;\n\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\tpadding: 1px;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t\n}\n"),"\n\n\n\n\n\n\n\t\t\t\t////////////////////////////////////////////v \n\t\t\t\t// LEFT 1\n\t\t\t\t////////////////////////////////////////////v\n\t\t\t\t\n\t\t\t\t").concat("\n .new-file-button {\n ".concat(W.els().redButton,"\n ").concat(W.font.main,";\n padding: ").concat(a("desktop")?"14px 5px":"13px 7px",";\n margin: 13px 15px 15px 15px;\n\t\t\t\twidth: calc(100% - 30px); \n font-size: ").concat((a("desktop"),11),"px;\n svg {\n margin-right: ").concat(a("desktop")?"10px":"5px",";\n }\n \n }\n"),"\n\n\t\t\t\t&.device-view-mobile {\n\t\t\t\t\t\t.settings-button {\n\t\t\t\t\t\t\t\tbottom: 60px;\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t.settings-button {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tposition: fixed;\n\t\t\t\t\t\tbottom: 10px;\n\t\t\t\t\t\tleft: 10px;\n\t\t\t\t\t\tz-index: 11;\n\t\t\t\t}\n\n\n\n\t\t\t\t&.without-sidebar.device-view-desktop {\n\t\t\t\t\t\t.left-sidebar-indicator {\n\t\t\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 0%;\n\t\t\t\t\t\t\t\tz-index:100;\n\t\t\t\t\t\t\t\twidth: 18px;\n\t\t\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\t\t\tbackground: rgb(236, 236, 236);\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\t\t\tmargin: 0% 0px;\n\t\t\t\t\t\t\t\tborder-radius: 0px 5px;\n\t\t\t\t\t\t\t\t.left-wrapper {\n\t\t\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\t\t\t\t\ttransition: 0.2s all;\n\t\t\t\t\t\t\t\t\t\ttransition-delay: ").concat(W.anim.time,";\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\tleft: -").concat(Ji.desktop.l,"vw;\n\t\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.left-sidebar-indicator:hover {\n\t\t\t\t\t\t\t\t.left-wrapper {\n\t\t\t\t\t\t\t\t\t\tleft: 0vw;\n\t\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t.invisible-scrollbars {\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\tpadding-right: 18px;\n\t\t\t\t\t\toverflow-y: scroll;\n\t\t\t\t\t\theight: ").concat("desktop"===s()?"100vh":"calc(100vh - 48px)","; \n\t\t\t\t}\n\n\t\t\t\t.left-wrapper {\n\t\t\t\t\t\tbackground: ").concat(Gi.l2.bg,"; \n\t\t\t\t\t\twidth: ").concat("desktop"===s()?Ji.desktop.l:"navigator"!==t?0:100,"vw;\n\n\t\t\t\t\t\tdisplay: ").concat("desktop"===s()?"flex":"navigator"!==t?"none":"flex",";\n\n\n\t\t\t\t\t\t.left-wrapper-1 {\n\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\tbackground-image: url('").concat(W.assets.decoBgMap,"');\n\t\t\t\t\t\t\t\tbackground-color: ").concat(W.colors.bgInterface2,";\n\t\t\t\t\t\t\t\tbackground-blend-mode: color-burn;\n\t\t\t\t\t\t\t\tcolor: ").concat(W.colors.fontInterface2,";\n\t\t\t\t\t\t\t\twidth: ").concat(Ji.desktop.l1,'%;\n\t\t\t\t\t\t\t\theight:100vh;\n\t\t\t\t\t\t\t\tposition: relative;\n\n\n\t\t\t\t\t\t\t\th3.subtitle {\n\t\t\t\t\t\t\t\t\t\tmargin: 0px 0px 15px;\n\t\t\t\t\t\t\t\t\t\tfont-family: "Open sans", sans-serif;\n\t\t\t\t\t\t\t\t\t\ttext-transform: uppercase;\n\t\t\t\t\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: 800;\n\t\t\t\t\t\t\t\t\t\tfont-style: italic;\n\t\t\t\t\t\t\t\t\t\tcolor: ').concat(Gi.main,";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t////////////////////////////////////////////v \n\t\t\t\t\t\t// TEXT VIEW : LEFT 2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t////////////////////////////////////////////v2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.left-wrapper-2 {\n\t\t\t\t\t\t\t\twidth: ").concat(Ji.desktop.l2,"%;\n\t\t\t\t\t\t\t\theight:100vh;\n\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.bgInterface,";\n\n\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t.top-files-list-wrapper {\n\t\t\t\t\t\t\t\t\t\tpadding-top: ").concat(Ji.search.padding,"px;\n\t\t\t\t\t\t\t\t\t\theight: ").concat(Ji.search.h,"px;\n\t\t\t\t\t\t\t\t\t\t.subtitle-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t\t\t\t\t.folder-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 2px 16px 10px 20px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* margin-top: 4px; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: #aeadad;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.toggle-sidebar-btn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\th3.subtitle {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin: 0px ").concat(Ji.block,"px ").concat(Ji.block,"px ").concat(Ji.block,"px; \n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.counter {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 2px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: ").concat(Gi.l2.text,";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-weight: 800;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t.files-list-component {\n\t\t\t\t\t\t\t\tposition: relative\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.list-toolbar {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: -93px;\n\t\t\t\t\t\t\t\tright: 23px;\n\t\t\t\t\t\t\t\tcolor: ").concat(Gi.l2.text,";\n\t\t\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(Gi.l2.text,";\n\t\t\t\t\t\t\t\t\t\t").concat(Vi().button,"\n\t\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\t\t\tmargin-right: ").concat(Ji.block,"px; \n\t\t\t\t\t\t\t\t\t\tfont-size: 10px;\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tspan {\n\t\t\t\t\t\t\t\t\t\t\t\tmargin-right: 5px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.items-list-count {\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t\t\t\tfont-size: 10px;\n\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\ttop: 5px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t").concat("\n.list-wrapper {\n .list-wrapper-scroller{\n height: 100%;\n width: calc(100% + 20px);\n overflow-y:scroll;\n overflow: hidden;\n }\n\n .mobile-buttons-up-down {\n position: fixed;\n right: 0px;\n z-index: 10;\n top: 50%;\n div {\n background: #d6d6d6;\n padding: 10px;\n color:white;\n cursor: pointer;\n }\n }\n\n div.List {\n list-style: none;\n margin-right:20px;\n padding: 0px 0px 0px 0px;\n &.multiselect-mode {\n\t\t\t\t\t\tli .label {\n\t\t\t\t\t\t\t\tmargin-left: 4px;\n\t\t\t\t\t\t}\n }\n\n // NORMAL\n li {\n padding: ".concat(Ni.l2.fileLi.padding,"px ").concat(Ni.block-Ni.l2.fileLi.margin,"px;\n margin: ").concat(Ni.l2.fileLi.margin,"px ").concat(Ni.l2.fileLi.margin+5,"px ").concat(Ni.l2.fileLi.margin,"px ").concat(Ni.l2.fileLi.margin,"px ;\n display: block;\n cursor: pointer;\n position: relative;\n height: ").concat(Ni.l2.fileLi.height,"px;\n overflow: hidden;\n border: 2px rgba(0,0,0,0) solid;\n \n // ACTIVE\n &:hover,\n &.multiselected,\n &.active {\n }\n\n display: flex;\n justify-content: center;\n\t\t\t\t\t\t&.active .background-item-border,\n\t\t\t\t\t\t&.active .background-item {\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.main,";\n\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\tz-index: -1;\n\t\t\t\t\t\t\t\topacity: 0.2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t&.active .background-item-border {\n\t\t\t\t\t\t\t\twidth: calc(100% - 4px);\n\t\t\t\t\t\t\t\theight: calc(100% - 4px);\n\t\t\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\t\t\tborder: 2px ").concat(W.colors.main," solid;\n\t\t\t\t\t\t\t\topacity: 0.3;\n\t\t\t\t\t\t}\n \n\t\t\t\t\t\th3 {\n\t\t\t\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\t\t}\n .left {\n\t\t\t\t\t\t\t\t// width: calc(100% - ").concat(Ni.l2.fileLi.img,"px - 10px);\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\tpadding-right: 10px;\n\n\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\tflex-direction:column;\n\n\t\t\t\t\t\t\t\t.label {\n\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\tmax-height: 35px;\n\t\t\t\t\t\t\t\t\t\t//height: 46px;\n\t\t\t\t\t\t\t\t\t\t// display: flex;\n\t\t\t\t\t\t\t\t\t\t// align-items: center;\n\t\t\t\t\t\t\t\t\t\tmargin-bottom: 2px;\n\t\t\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(Ii.l2.title,";\n\t\t\t\t\t\t\t\t\t\tline-break: anywhere;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t.content {\n\t\t\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t\t\t\tmargin-bottom: 3px;\n\t\t\t\t\t\t\t\t\t\theight: 25px;\n\t\t\t\t\t\t\t\t\t\tfont-size: 9px;\n\t\t\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\t\t\tline-break: anywhere;\n\t\t\t\t\t\t\t\t\t\tword-break: break-all;\n\t\t\t\t\t\t\t\t\t\t").concat(a("desktop")?"":"max-height: 25px;","\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.date {\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(Ii.l2.date,";\n\t\t\t\t\t\t\t\t\t\tfont-size: 10px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: 700;\n\t\t\t\t\t\t\t\t}\n }\n\n .right {\n\t\t\t\t\t\t\t\t.picture {\n\t\t\t\t\t\t\t\t\t\twidth: ").concat(Ni.l2.fileLi.img,"px;\n\t\t\t\t\t\t\t\t\t\theight: ").concat(Ni.l2.fileLi.img,"px;\n\t\t\t\t\t\t\t\t\t\tbackground-size: cover;\n\t\t\t\t\t\t\t\t\t\tz-index: 1;\n\t\t\t\t\t\t\t\t\t\tmargin-top: 3px;\n\t\t\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\t\t\tborder: 2px white solid;\n\t\t\t\t\t\t\t\t}\n }\n }\n }\n}\n"),"\n\n\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t\n\n\n\n\n\n\n\n\n\n\t\t\t\t////////////////////////////////////////////v \n\t\t\t\t// IMAGE GALLERY VIEW\n\t\t\t\t////////////////////////////////////////////v\n\t\t\t\t.right-wrapper.image-gallery-view {\n\t\t\t\t\t\tbackground: ").concat(Gi.l2.bg,"; \n\t\t\t\t\t\t.image-gallery-header {\n\t\t\t\t\t\t\t\tpadding-top: ").concat(Ji.search.padding,"px;\n\t\t\t\t\t\t\t\theight: ").concat(Ji.gallery.topH,"px;\n\n\t\t\t\t\t\t\t\t.search-bar-component {\n\t\t\t\t\t\t\t\t\t\t// padding: 10px 0px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.image-gallery-component-wrapper {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t\t////////////////////////////////////////////v \n\t\t\t\t// TEXT VIEW : RIGHT\n\t\t\t\t\t\t\t\t\t\t\t\t\t ////////////////////////////////////////////v \n\t\t\t\t\t\t\t\t\t\t\t\t\t ").concat("\n.tab-list-scroll-wrapper {\n\t\theight: 44px;\n\t\tbackground: ".concat(W.colors.bgTabs,";\n border-radius: 0px 0px 0px 5px;\n\t\toverflow: hidden;\n\t\t.tab-list-invisible-scroll {\n\t\t\t\twidth: 100%;\n\t\t\t\toverflow-x: scroll;\n\t\t\t\tpadding-bottom: 18px;\n\t\t\t\t.tab-list-wrapper {\n\t\t\t\t\t\tpadding: 7px 0px 0px 13px;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tbackground: ").concat(W.colors.bgTabs,";\n\t\t\t\t\t\tborder-radius: 0px 0px 0px 5px;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t&>div:last-child {\n\t\t\t\t\t\t\t\tmargin-right: 30px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.tab-and-drag-wrapper {\n\t\t\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\t\t\t.drag-indic {\n\t\t\t\t\t\t\t\t\t\tz-index: 2;\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\ttop: -8px;\n\t\t\t\t\t\t\t\t\t\tleft: -6px;\n\t\t\t\t\t\t\t\t\t\twidth: 20px;\n\t\t\t\t\t\t\t\t\t\theight: 20px;\n\t\t\t\t\t\t\t\t\t\tcolor: #aaaaaa;\n\t\t\t\t\t\t\t\t\t\tfont-size: 8px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.tab-wrapper {\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\tmargin-right: 5px;\n\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.bgTab,";\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\tcolor: ").concat(W.colors.fontTab,";\n\t\t\t\t\t\t\t\tfont-family: ").concat(W.font.editor,";\n\t\t\t\t\t\t\t\theight: 35px;\n\t\t\t\t\t\t\t\tbox-shadow:rgb(0 0 0 / 20%) 0px -1px 2px ;\n\t\t\t\t\t\t\t\tborder-radius: 5px 5px 0px 0px;\n\t\t\t\t\t\t\t\tjustify-content: space-between;\n\t\t\t\t\t\t\t\tmax-height: 27px;\n\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t\t\t.tab-nb-windows {\n\t\t\t\t\t\t\t\t\t\tmargin-left: 10px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.active-ribbon {\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\theight: 2px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.active {\n\t\t\t\t\t\t\t\t\t\t.active-ribbon {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.main,";\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.bgTabActive,";\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.tab-more {\n\t\t\t\t\t\t\t\t\t\tmin-width: 30px;\n\t\t\t\t\t\t\t\t\t\twidth: 30px;\n\t\t\t\t\t\t\t\t\t\tmax-width: 30px;\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(W.font.main,";\n\t\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\tfont-size:14px;\n\t\t\t\t\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.tab-name {\n\t\t\t\t\t\t\t\t\t\tpadding: 10px 0px 10px 10px;\n\n\t\t\t\t\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\t\t\t\t\tcolor:").concat(W.colors.fontTab," ;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 11px;\n\t\t\t\t\t\t\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\t\t\t\t\t\tmin-width: 30px;\n\t\t\t\t\t\t\t\t\t\t\t\tmax-width: 100px;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(W.font.editor,";\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.tab-nb-windows {\n\t\t\t\t\t\t\t\t\t\tpadding: 10px 0px 10px 0px;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.tab-close {\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tmargin-left: 5px;\n\t\t\t\t\t\t\t\t\t\ttransform: rotate(45deg);\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tmargin-left: 5px;\n\t\t\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(W.font.main,";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n"),"\n\t\t\t\t").concat("\n\n.draggable-grid-wrapper {\n\t\t// remove transition\n\t\theight: 100%;\n\n\t\t.react-grid-item {\n\t\t\t\ttransition: all 0ms ease;\n\t\t\t\ttransition-property: left, top;\n\t\t\t\t.react-resizable-handle {\n\t\t\t\t\t\tbottom: 0px;\n\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\tcursor: se-resize;\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\tbackground: rgb(247,247,247);\n\t\t\t\t}\n\t\t\t\t.react-resizable-handle:after {\n\t\t\t\t\t\ttop: 7px;\n\t\t\t\t\t\topacity: 0.3;\n\t\t\t\t}\n\t\t}\n\n\t\t.draggable-grid-wrapper-in {\n\t\t\t\theight: 100%;\n\t\t\t\tposition: relative;\n\n\t\t\t\t.draggable-grid, .mobile-grid-view {\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t.window-wrapper {\n\t\t\t\t\t\t\t\t//overflow: hidden;\n\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\tcolor: ".concat(W.colors.fontEditor,";\n\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.bgEditor,";\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.1);\n\t\t\t\t\t\t\t\toverflow-y: hidden;\n\t\t\t\t\t\t\t\toverflow-x: hidden;\n\t\t\t\t\t\t\t\theight:100%;\n\n\t\t\t\t\t\t\t\t// height 100% everywhere\n\t\t\t\t\t\t\t\t.note-wrapper,\n\t\t\t\t\t\t\t\t.window-editor-wrapper,\n\t\t\t\t\t\t\t\t.dual-view-wrapper,\n\t\t\t\t\t\t\t\t.editor-area,\n\t\t\t\t\t\t\t\t.preview-area-wrapper,\n\t\t\t\t\t\t\t\t.preview-area,\n\t\t\t\t\t\t\t\t.main-editor-wrapper{\n\t\t\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.content-wrapper {\n\t\t\t\t\t\t\t\t\t\theight:100%;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.note-active-ribbon {\n\t\t\t\t\t\t\t\t\t\theight: 2px;\n\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.active {\n\t\t\t\t\t\t\t\t\t\t.note-active-ribbon {\n\t\t\t\t\t\t\t\t\t\t\t\t//background:").concat(W.colors.main,";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.dual-view-wrapper\n\t\t\t\t\t\t\t\t\t\t.editor-area\n\t\t\t\t\t\t\t\t\t\t.infos-editor-wrapper\n\t\t\t\t\t\t\t\t\t\t.title-input-wrapper\n\t\t\t\t\t\t\t\t\t\t.big-title {\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: ").concat(W.colors.main,";\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.note-wrapper {\n\t\t\t\t\t\t\t\t\t\t.editor-toolbar-dropdown {\n\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\ttop: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\n\n\n\n\t\t\t\t\t\t\t\t.window-buttons-bar {\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\tz-index:2;\n\t\t\t\t\t\t\t\t\t\tright: 30px;\n\t\t\t\t\t\t\t\t\t\ttop: 10px;\n\t\t\t\t\t\t\t\t\t\t.delete-button {display: none;}\n\t\t\t\t\t\t\t\t\t\t.add-button {display: none;}\n\t\t\t\t\t\t\t\t\t\t.drag-handle {\n\t\t\t\t\t\t\t\t\t\t\t\tcursor: grab;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.delete-button svg {\n\t\t\t\t\t\t\t\t\t\t\t\ttransform: rotate(45deg);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t&.can-add {\n\t\t\t\t\t\t\t\t\t\t\t\t.add-button {display: block;}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t&.can-remove {\n\t\t\t\t\t\t\t\t\t\t\t\t.delete-button {display: block;}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t// content css modification\n\t\t\t\t\t\t\t\t.dual-view-wrapper {\n\t\t\t\t\t\t\t\t\t\t.file-path-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\t\t\tposition:initial;\n\t\t\t\t\t\t\t\t\t\t\t\t.infos-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tz-index: 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition:absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tborder-bottom: 1px solid rgba(0 0 0 / 5%);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//box-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 32px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.main-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-left: 3px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-rigth: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 33px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.infos-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-left: 3px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-rigth: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: calc(100% - 10px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.title-input-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-left: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.press-to-save {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttop: -6px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: initial;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.big-title {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: calc(100% - 65px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(W.font.editor,";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 15px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t// ALL\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t&.device-desktop {\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 33px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//padding: 5px 5px 5px 5px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: ").concat(W.colors.bgPreview,";\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//padding: 10px 10px 10px 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t// FULL PREVIEW\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t&.device-desktop.view-preview {\n\t\t\t\t\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 0%;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t// FULL EDITOR\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t&.device-desktop.view-editor {\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t.scrolling-bar-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\ttop: 33px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n"),"\n\t\t\t\t").concat("\n.draggable-grid-wrapper \n.draggable-grid-wrapper-in \n.mobile-grid-view {\n\t\t.window-wrapper {\n\n\t\t\t\t.window-buttons-bar {\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\n\t\t\t\t.note-wrapper {\n\t\t\t\t\t\t.dual-view-wrapper {\n\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\tmargin-top: 47px;\n\t\t\t\t\t\t\t\t\t\t.infos-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\ttop: -43px;\n\t\t\t\t\t\t\t\t\t\t\t\t.title-input-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: ".concat(W.colors.main,";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.dropdown-icon {\n\t\t\t\t\t\t\t\t\t\t\t\ttop: -15px;\n\t\t\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.context-menu {\n\t\t\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.main-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t.textarea-editor {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: calc(100% - 300px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 20px 20px 70px 20px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: calc(100% - 40px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresize: none;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\theight: calc(100% - 165px);\n\t\t\t\t\t\t\t\t\t\t.preview-area {\n\t\t\t\t\t\t\t\t\t\t\t\ttop: 0px!important;\n\t\t\t\t\t\t\t\t\t\t\t\tbottom: 0px!important;\n\t\t\t\t\t\t\t\t\t\t\t\t.dates-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-content {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 0px 0px 50px 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.scrolling-bar-wrapper {\n\t\t\t\t\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n"),"\n\n\t\t\t\t").concat("\n .mobile-text-manip-toolbar {\n position: fixed;\n bottom: ".concat(W.sizes.mobile.editorBar+10,"px;\n display: flex;\n list-style: none;\n width: 100%;\n padding: 0px;\n align-content: center;\n justify-content: center;\n align-items: center;\n height: ").concat(W.sizes.mobile.editorBar,"px;\n background: ").concat(W.colors.editor.mobileToolbar.bg,";\n li {\n flex: 1 1 auto;\n justify-content: center;\n display: flex;\n }\n }\n"),"\n\t\t\t\t").concat("\n.view-editor .scrolling-bar-wrapper {\n}\n\n.scrolling-bar-wrapper {\n\t\toverflow: hidden;\n\t\tposition: absolute;\n\t\ttop: 33px;\n\t\theight: calc(100% - 53px);\n\t\tbackground: rgb(226,226,226);\n\t\twidth: 10px;\n\t\tright: 0px;\n\t\tposition: absolute;\n\n\t\t.scrolling-bar {\n\t\t\t\tcursor: ns-resize;\n\t\t\t\tbackground: #cdcccc;\n\t\t\t\theight: 20px;\n\n\t\t}\n}\n","\n\n\t\t\t\t&.without-sidebar.device-view-desktop {\n\t\t\t\t\t\t.right-wrapper.dual-viewer-view {\n\t\t\t\t\t\t\t\twidth: calc(100vw - 18px);\n\t\t\t\t\t\t\t\tmargin-left: 18px;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t.right-wrapper.dual-viewer-view {\n\n\t\t\t\t\t\twidth: ").concat("desktop"===s()?Ji.desktop.r:"navigator"!==t?100:0,"vw;\n\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\tdisplay: ").concat("desktop"===s()||"navigator"!==t?"block":"none",";\n\t\t\t\t\t\tpadding-top: 0px;\n\t\t\t\t\t\t.note-wrapper {\n\t\t\t\t\t\t\t\t.dual-view-wrapper.device-tablet, \n\t\t\t\t\t\t\t\t.dual-view-wrapper.device-mobile {\n\t\t\t\t\t\t\t\t\t\t.editor-area,\n\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.dual-view-wrapper {\n\t\t\t\t\t\t\t\t\t\t&.view-both.device-desktop {\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 50%;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t\t.__EDITOR_DESIGN HERE__ {}\n\t\t\t\t\t\t\t\t\t\t&.view-editor.device-desktop {\n\t\t\t\t\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* display:none */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: -9999px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t&.view-editor-with-map.device-desktop {\n\t\t\t\t\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 80%;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t.__MINIMAP_DESIGN HERE__ {}\n\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: calc(100% - 30px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransform: scale(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: -50%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbox-shadow: -4px 5px 10px rgba(0, 0, 0, 0.10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-transitions {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 50%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition-delay: ").concat(W.anim.time,";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-delay: 0ms; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-property: bottom; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tword-break: break-word;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransform: scale(0.2) translateZ(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransform-origin: 0px 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: calc(-80%);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// height: 500vh;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: calc(100% * 5);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-transitions {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-delay: 0ms; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-property: bottom; */\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-delay:").concat(W.anim.time,"; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-property: padding; */\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition-delay:").concat(W.anim.time,"; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-property: all; */\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-delay: 0ms; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* transition-property: bottom; */\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 73%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 80px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-right: 140px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding-left: 40px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t&.view-preview.device-desktop {\n\t\t\t\t\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 0%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.main-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: -9999px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* display:none; */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.preview-area {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\t\t\t\t\tdisplay: ").concat("desktop"===s()?"flex":"block",";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t").concat((e=t,"\n\n.editor-area {\n\t\twidth: ".concat(a("desktop")?"50%":"editor"===e?"100vw":"0vw",";\n\t\tdisplay: block;\n\n\t\tposition: ").concat(a("desktop")||"editor"===e?"relative":"absolute!important",";\n\t\ttop: ").concat("editor"!==e||a("desktop")?"-9999px":"0px",";\n\n\n\t\t.mobile-text-manip-toolbar {\n\t\t\t\tdisplay: ").concat("editor"!==e||a("desktop")?"none":"flex",";\n\t\t}\n\n\t\t.infos-editor-wrapper {\n\t\t\t\t").concat(a("desktop")?"":"height: ".concat(W.sizes.mobile.editorTopWrapper,"px;"),"\n\t\t\t\t").concat(a("desktop")?"width: calc(200% - ".concat(3*W.sizes.block*2,"px);"):"","\n\t\t\t\tpadding: 0px ").concat(a("desktop")?3*W.sizes.block:2*W.sizes.block,"px;\n\t\t\t\tposition: relative;\n\n\t\t\t\t").concat(Co(),"\n\n\t\t\t\t.title-input-wrapper {\n\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\tmargin-top: ").concat(a("desktop")?6:0,"px;\n\t\t\t\t\t\t.press-to-save {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 39px;\n\t\t\t\t\t\t\t\tfont-size: 8px;\n\t\t\t\t\t\t\t\tcolor: ").concat(W.colors.main,";\n\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t.toolbar-and-dates-wrapper {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\n\t\t\t\t.dates-wrapper {\n\t\t\t\t\t\tdisplay: ").concat(a("desktop")?"block":"none",";\n\t\t\t\t\t\t.date {\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t").concat(ve,"\n }\n}\n\n\n\n\n.main-editor-wrapper {\n ").concat(a("desktop")?"":"padding: 0px ".concat(2*W.sizes.block,"px 0px ").concat(2*W.sizes.block,"px;"),"\n ").concat(a("desktop")?"":"margin: 0px 0px ".concat(W.sizes.mobile.bottomBarHeight,"px 0px;"),"\n .monaco-editor {\n\t\t\t\tmargin: 0px;\n }\n .textarea-editor {\n\t\t\t\tborder: none;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: calc(100vh - ").concat(W.sizes.mobile.editorTopWrapper+W.sizes.mobile.editorBar+2*W.sizes.mobile.bottomBarHeight,"px);\n\t\t\t\tmargin: 0px;\n\t\t\t\tpadding: 0px;\n\t\t\t\tbackground: rgba(255,255,255,0.7);\n }\n}\n")),"\n\t\t\t\t\t\t\t\t\t\t").concat("\n.cm-selectionLayer {\n pointer-events: none;\n\tz-index:0!important;\n}\n.cm-selectionBackground {\n\tbackground: rgba(0,0,0,0.1);\n}\n\n\n.actionable-title {\n\t\tcolor: ".concat(W.colors.main,";\n\t\tposition: relative;\n\t\t&:before {\n\t\t\t\tcontent: \"\u279d\";\n\t\t\t\tposition: absolute;\n\t\t\t\tright: -20px;\n\t\t\t\tcolor: #c6c6c6;\n\t\t\t\tfont-size: 18px;\n\t\t\t\topacity: 0;\n\t\t\t\ttransition: 0.2s all;\n\t\t\t\tbottom: -3px;\n\t\t}\n\t\t&:hover {\n\t\t\t\t&:before {\n\t\t\t\t\t\topacity: 1\n\t\t\t\t}\n\t\t}\n\t\t&.h1 {\n\t\t\t\tfont-size: 15px;\n\t\t\t\tfont-weight: bold;\n\t\t\t\ttext-decoration: underline;\n\n\t\t}\n\t\t&.h2 {\n\t\t\t\tfont-size: 13px;\n\t\t\t\ttext-decoration: underline;\n\n\t\t}\n\t\t&.h3 {\n\t\t\t\tfont-size: 12px;\n\t\t}\n\n}\n\n\n.cm-matchingBracket {\n\t\tbackground-color: rgba(0,0,0,0)!important;\n}\n\n\n.cm-content {\n\t\t// font-family: 'Open sans', sans-serif;\n\t\tfont-family: Consolas, monaco, monospace;\n\t\tfont-size: 11px;\n}\n\n.cm-focused {\n\t\toutline: none!important;\n}\n.main-editor-wrapper {\n\t\twidth: calc(100% + 18px);\n\t\tmargin: 32px 0px 0px 0px;\n\t\tpadding: 0px;\n\t\twidth:100%;\n\t\theight: ").concat(a("desktop")?"calc(100% - 32px);":"calc(100% - 280px);",'; \n}\n\n.codemirror-editor-wrapper {\n\t\tmargin-right: 18px;\n}\n.codemirror-editor-wrapper, \t.cm-editor, .cm-theme {\n\t\theight: calc(100% - 30px);\n}\n.codemirror-editor-wrapper, \t.cm-editor, .cm-theme {\n\t\theight: 100% ;\n\t\toverflow:hidden;\n\t\tpadding: 0px;\n}\n.cm-editor {\n\t\tword-break: break-all;\n}\n.cm-content {\n\t\twidth: 100%;\n\t\toverflow:hidden;\n\t\twhite-space: pre-wrap;\n}\n.cm-scroller {\n\t\tleft: 15px;\n\t\tpadding-right: 15px;\n}\n.cm-line {\n}\n.cm-cursor {\n}\n\n.cm-tooltip-autocomplete {\n\t\tpadding: 10px 5px;\n\t\tbackground: white;\n\t\tborder-radius: 5px;\n\t\tborder: none;\n\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,0.3);\n\t\t[aria-selected="true"]{\n\t\t\t\tbackground: ').concat(W.colors.main,';\n\t\t\t\tborder-radius: 2px;\n\t\t}\n\n}\n\n.codemirror-mobile-fallback {\n\t\tmargin: 10px;\n\t\ttextarea {\n\t\t\t\twidth: calc(100% - 20px);\n\t\t\t\theight: calc(100vh - 350px);\n\t\t}\n}\n\n.test-success {\nbackground: orange;\ncolor: red;\ndisplay: block;\npadding-top: 50px;\n}\n.tiro-image {\n\t\tcolor: red;\n\t\tdisplay: block;\npadding: 20px;\n}\n.tiro-image-wrapper{\n\t\tposition: relative;\n\n\t\t&:before {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0px;\n\t\t\t\tleft: 50%;\n\t\t\t\tcontent: "x";\n\t\t\t\twidth: 50%;\n\t\t\t\theight: 100px;\n\t\t\t\tdisplay:block;\n\t\t\t\tbackground: orange;\n\n\t\t}\n}\n\n').concat(Rn(),"\n\n// FILE RESSOURCE PREVIEW\n").concat(Mo(),"\n\n// PREVIEW LINK\n").concat(Nt(),"\n\n"),"\n\n\n\t\t\t\t\t\t\t\t\t\t").concat("\n.preview-area {\n\t\tmargin-top: 5px;\n .infos-preview-wrapper {\n\t\t\t\tborder-bottom: 1px solid rgba(0 0 0 / 5%);\n display: ".concat(a("desktop")?"none":"block",";\n\t\t\t\tpadding: 5px 0px 12px 0px;\n\t\t}\n}\n.preview-area {\n position: relative;\n display: block;\n\t\toverflow: scroll; \n\t\twidth: calc(100% );\n padding-right: 30px;\n\n ").concat(Co,"\n\n .infos-preview-wrapper {\n }\n\t\t.infos-preview-wrapper h1.big-title {\n\t\t\t\twidth: calc(100% - 65px);\n\t\t\t\tfont-family: ").concat(W.font.editor,";\n\t\t\t\tcolor: grey;\n\t\t\t\tfont-size: 15px;\n\t\t\t\tmargin: 0px;\n\t\t\t\tpadding: 0px 14px;\n\t\t}\n}\n.content-blocks-wrapper {\n\t\t").concat(So(),"\n}\n.view-both .preview-area {\n\t\tmargin-top: 20px;\n}\n\n.preview-area-wrapper {\n\t\theight: calc(100% - 35px);\n margin-top: ").concat(a("desktop")?"140":"0","px;\n\n}\n\n"),"\n\n\t\t\t\t\t\t\t\t\t\t").concat(ve(),"\n\t\t\t\t\t\t\t\t\t\t").concat("\n.device-mobile {\n\t\t.upload-progress-bar-wrapper {\n\t\t\t\tbottom: 176px;\n\t\t}\n}\n.upload-progress-bar-wrapper {\n\t\t.label {\n\t\t\t\tposition: relative;\n\t\t}\n\t\t.bg-fill {\n\t\t\t\ttransition: 0.1s all;\n\t\t\t\tposition:absolute;\n\t\t\t\tbackground: #077e00;\n\t\t\t\theight: 100%;\n\t\t\t\ttop: 0px;\n\t\t\t\tleft: 0px;\n\t\t}\n\t\tposition:absolute;\n\t\tbottom: 0px;\n\t\twidth: 100%;\n\t\tleft: 0px;\n\t\t/* background: green; */\n\t\tbackground: #a0a0a0;\n\t\tcolor: white;\n\t\ttext-align: center;\n\t\tz-index:3;\n\t\tfont-size: 9px;\n\t\tpadding: 5px;\n}\n",'\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\th3 {\n\t\t\t\t\t\t\t\tmargin-bottom: 0px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpre {\n\t\t\t\t\t\t\t\twhite-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */\n\t\t\t\t\t\t\t\twhite-space: -pre-wrap; /* Opera */\n\t\t\t\t\t\t\t\twhite-space: -o-pre-wrap; /* Opera */\n\t\t\t\t\t\t\t\twhite-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */\n\t\t\t\t\t\t\t\tword-wrap: break-word; /* IE 5.5+ */\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n\n\n.preview-content {\n\t\tcounter-reset: h2counter;\n h1 {\n counter-reset: h2counter;\n }\n h2:before {\n content: counter(h2counter) ".\\0000a0\\0000a0";\n counter-increment: h2counter;\n counter-reset: h3counter;\n }\n h3:before {\n content: counter(h2counter) "." counter(h3counter) ".\\0000a0\\0000a0";\n counter-increment: h3counter;\n }\n}\n\n\n');return Object(Kt.a)(o,";","")},Ki="\n<style>\n.popupContent p {\n\t\tbackground: #dadada;\n padding: 3px 5px;\n\t\tmargin: 0px 4px;\n\t\tdisplay: inline-block;\n}\n</style>\n",$i=function(t,n,e,o){var i=function(t,n){console.log("[MOVEFILE] ".concat(t," -> ").concat(n)),ei().then((function(e){e.file.move(t,n,(function(){e&&e.ui.browser.goTo(e.ui.browser.folders.current.get)}))}))};return{askForMoveFile:i,promptAndBatchMoveFiles:function(n,e){ei().then((function(o){o.popup.confirm("Move <p>".concat(null===n||void 0===n?void 0:n.length,'</p> file(s) to <p>"').concat(e.key,'"</p>?\n<br>\n<br>\nRessources links will be automatically updated<br>\n').concat(Ki,"\n"),(function(){for(var o=0;o<n.length;o++){var c=n[o],r="".concat(c.path),a="".concat(e.key,"/").concat(c.name);i(r,a),t()}}))}))},promptAndMoveFolder:function(i){console.log(777,i);var c=Object(d.a)({},i),r=c.folder,a=c.folderToDropInto,l=c.folderBasePath,s=c.newTitle,p=c.renameOnly,u=[r.path,"".concat(p?ao(a):a.path,"/").concat(s||r.title)],f="".concat(l,"/").concat(u[0]),g="".concat(l,"/").concat(u[1]);ei().then((function(i){i.popup.confirm("\n".concat(j.moveFolderPrompt," <p>").concat(u[0],"</p> to <p>").concat(u[1],"</p>?\n").concat(Ki,"\n"),(function(){console.log("CONFIRM, DO IT"),function(t,n){console.log("[MOVEFOLDER] ".concat(t," -> ").concat(n)),ei().then((function(e){e.folders.move(t,n,(function(){e&&e.ui.browser.goTo(e.ui.browser.folders.current.get)}))}))}(f,g),t(),n(),e(),setTimeout((function(){o([ao(r),a.path],{cache:!1})}),100)}))}))}}},Xi="[LAST FILE]",Zi=x.log.verbose,Qi=function(){return{nature:"file",name:"",realname:"",path:"",folder:""}},tc=function(t){var n=Object(o.useState)({}),e=Object(c.a)(n,2),i=e[0],a=e[1];Object(o.useEffect)((function(){}),[t.files]);var l=Object(o.useReducer)((function(t){return t+1}),0),s=Object(c.a)(l,2)[1],p=Object(o.useState)(2),u=Object(c.a)(p,2),d=u[0],f=u[1];Object(o.useEffect)((function(){oi((function(t){f(t.userSettings.get("ui_filesList_sortMode"))}))}),[]);return Object(r.c)("div",{className:"files-list-component"},Object(r.c)("div",{className:"list-toolbar"},Object(r.c)("button",{type:"button",title:"sort",onClick:function(){var n=d+1>=X.length?0:d+1;oi((function(e){e.userSettings.set("ui_filesList_sortMode",n),f(n),t.onSortFiles(Z(t.files,n))}))}},Object(r.c)("span",null,t.files.length>0&&Object(r.c)("span",{className:"list-count"},"(",t.files.length,")"),$[d]),Object(r.c)(Qt,{name:"faSort",color:W.colors.l2.text}))),Object(r.c)("div",{className:"list-wrapper"},Object(r.c)(Ei,{files:t.files,filesPreview:i,hoverMode:!1,activeFileIndex:t.activeFileIndex,sortMode:d,onFileClicked:function(n){t.onFileClicked(n)},onFileDragStart:t.onFileDragStart,onFileDragEnd:t.onFileDragEnd,onVisibleItemsChange:function(t){!function(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=[],o=0;o<t.length;o++){var c=t[o];i[c]&&!n||e.push(c)}e.length>1&&oi((function(t){t.files.getPreviews(e,(function(t){Object(g.each)(t,(function(t){i[t.path]=t})),a(i),s()}))}))}(t,!0)}})))},nc="[PWA]",ec=x.log.verbose;Yt(Object(r.c)((function(){Object(o.useEffect)((function(){return ec&&console.log(nc," init"),"serviceWorker"in navigator&&navigator.serviceWorker.register("/service-worker.js"),window.addEventListener("beforeinstallprompt",(function(t){t.preventDefault(),ec&&console.log(nc," beforeinstallprompt WORKING=>",t),window.deferredPrompt=t})),console.log("========= [APP] MOUNTED on a ".concat(s())),new Promise((function(t,n){Xe||(Xe=h(di()),$e.log.socket&&console.log("[SOCKET] try connecting to ".concat(di(),"...")),(Ze=gi(Xe)).on("connectionSuccess",(function(n){$e.log.socket&&console.log("[SOCKET] connection successful!, socket.connected :".concat(Xe.connected),n),n.isRgGood||alert(j.rgNotWorking),t({socket:Xe,ipsServer:n.ipsServer,socketManager:Ze})})))})).then((function(t){D(!0),it&&it.status.ipsServer.set(t.ipsServer)})),window.onkeydown=function(t){var n=yi(t);Object(g.isNull)(ji[n])||(ji[n]=!0);var e="".concat(n,"-down");Ci[e]&&Ci[e]()},window.onkeyup=function(t){var n=yi(t);Object(g.isNull)(ji[n])||(ji[n]=!1);var e="".concat(n,"-up");Ci[e]&&Ci[e]()},function(){console.log("app will unmount")}}),[]);var t=function(){ct.active.set(-1)},n=function(){ot.ui.browser.files.set([])},e=(Object(g.debounce)((function(){}),100),function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),a=e[0],l=e[1],s=Object(o.useState)(""),p=Object(c.a)(s,2),u=p[0],d=p[1],f=Object(o.useState)(""),g=Object(c.a)(f,2),b=g[0],h=g[1],m=Object(o.useState)(""),v=Object(c.a)(m,2),w=v[0],O=v[1],k=Object(o.useState)(),y=Object(c.a)(k,2),C=y[0],T=y[1],E="[SETUP CONFIG]",S=x.log.verbose,I=Object(o.useRef)(0);return Object(o.useEffect)((function(){return S&&console.log(E," init socket listener"),I.current=Ze.on("getSetupInfos",(function(n){"SUCCESS_CONFIG_CREATION"===n.code?(T(["success","".concat(j.setupForm.successReload)]),setTimeout((function(){window.location.reload()}),3e3)):"ASK_SETUP"===n.code?(t.cleanAllApp(),l(!0),n.defaultFolder&&O(n.defaultFolder)):T(["error","".concat(n.code,": ").concat(n.message)])})),function(){S&&console.log(E," clean socket listener"),Ze.off(I.current)}}),[]),{displayWelcomePopup:a,SetupPopupComponent:function(t){return Object(r.c)(i.a.Fragment,null,a&&Object(r.c)("div",{className:"setup-popup-component"},Object(r.c)(q,{title:"Welcome to Tiro",onClose:function(){}},Object(r.c)("p",null,j.setupForm.introText)," ",Object(r.c)("br",null),Object(r.c)("div",null,Object(r.c)(V,{value:u,label:j.setupForm.user,explanation:j.setupForm.userExplanation,onChange:function(t){d(t)},shouldNotSelectOnClick:!0}),Object(r.c)(V,{value:b,label:j.setupForm.password,type:"password",explanation:j.setupForm.passwordExplanation,onChange:function(t){h(t)},shouldNotSelectOnClick:!0}),Object(r.c)(V,{value:w,label:j.setupForm.dataFolder,explanation:j.setupForm.folderExplanation,onChange:function(t){O(t)},shouldNotSelectOnClick:!0}),Object(r.c)("input",{type:"button",value:"submit",className:"submit-button",onClick:function(t){T(void 0),Ze.emit("sendSetupInfos",{form:{user:u,password:b,dataFolder:w},token:Q()})}}),C&&Object(r.c)("div",{className:C[0]},C[1])))))}}}({cleanAllApp:function(){console.log("[cleanAllApp]"),ft(),st(),t(),n()}})),a=e.SetupPopupComponent,l=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),a=e[0],l=e[1],s=Object(o.useState)(""),p=Object(c.a)(s,2),u=p[0],d=p[1],f=Object(o.useState)(""),g=Object(c.a)(f,2),b=g[0],h=g[1],m=Object(o.useState)(),v=Object(c.a)(m,2),w=v[0],x=v[1],O=Object(o.useRef)(0);Object(o.useEffect)((function(){return O.current=Ze.on("getLoginInfos",(function(n){switch(n.code){case"SUCCESS":if(!n.token)return;nt(n.token),l(!1),t.onLoginSuccess();break;case"WRONG_TOKEN":l(!0),x(["error",j.loginForm.wrongToken]);var e=n.loginInfos;null!==e&&void 0!==e&&e.demo_mode&&(d("viewer"),h(e.viewer_password)),t.onLoginAsked();break;case"WRONG_USER_PASSWORD":x(["error",j.loginForm.wrongUserPassword]),l(!0)}})),function(){Ze.off(O.current)}}),[]);var k=function(){x(void 0),Ze.emit("sendLoginInfos",{user:u,password:b,token:Q()})},y=Object(o.useState)(1),C=Object(c.a)(y,2),T=C[0],E=C[1];return{displayLoginPopup:a,LoginPopupComponent:function(t){return Object(r.c)(i.a.Fragment,null,a&&Object(r.c)("div",{className:"setup-popup-component"},Object(r.c)(q,{title:j.setupForm.title,onClose:function(){}},Object(r.c)("div",null,Object(r.c)(V,{shouldFocus:1===T,value:u,onEnterPressed:function(){E(2)},label:j.setupForm.user,onChange:function(t){d(t)}}),Object(r.c)(V,{shouldFocus:2===T,value:b,label:j.setupForm.password,type:"password",onEnterPressed:function(){k()},onChange:function(t){h(t)}}),Object(r.c)("button",{value:"submit",className:"submit-button",onClick:function(t){k()}},j.setupForm.submit),w&&Object(r.c)("div",{className:w[0]},w[1])))))}}}({onLoginAsked:function(){console.log("[cleanListAndFileContent]"),t(),n()},onLoginSuccess:function(){k(),m(),gt(),oi((function(t){t.ui.browser.folders.refreshFromBackend()})),lt(["/"])}}),p=l.LoginPopupComponent,u=vo(),b=u.userSettingsApi,m=u.refreshUserSettingsFromBackend,v=function(){var t=et("tabs",[]),n=Object(c.a)(t,3),e=n[0],o=n[1],i=n[2],r=function(t){o(t)},a=function(t){var n=Je({fullWindowFile:t});if(n){var o=[].concat(Object(f.a)(e),[n]),i=Ge(n.id,o);r(i)}},l=function(t){var n=[],o=Object(g.cloneDeep)(e);Object(g.each)(o,(function(e,o){e.id!==t&&n.push(e)})),r(n)},p=function(t){if(!t){var n=Object(g.cloneDeep)(e),o=Ve(n);if(!Object(g.isNumber)(o))return;t=n[o]}if(t.grid.layout[0]){var i,c=t.grid;return Object(g.each)(c.content,(function(t,n){t.active&&(i={layout:c.layout[n],content:c.content[n]})})),i}};return{tabs:e,updateTab:function(t,n,o){if("add"===t)ei().then((function(t){a(t.ui.browser.files.active.get)}));else if("close"===t){if(!n)return;l(n.id)}else if("rename"===t){if(!n)return;if(o.length>15)return;var i=Object(g.cloneDeep)(e);Object(g.each)(i,(function(t){t.id===n.id&&(t.name=o,t.manualName=!0)})),r(i)}else if("activate"===t){if(!n)return;var c=Ge(n.id,e),u=We(c);if(r(u),"desktop"!==s()){var d,f=null===(d=p(n))||void 0===d?void 0:d.content.file;if(!f)return;oi((function(t){t.ui.browser.goTo(f.folder,f.name)}))}}},refreshTabsFromBackend:i,updateActiveTabGrid:function(t){var n=Object(g.cloneDeep)(e),o=Ve(n);Object(g.isNumber)(o)&&(n[o].grid=t,r(n))},refreshWindowGrid:function(){var t=We(e);r(t)},tabsApi:{get:function(){return e},close:l,openInNewTab:a,reorder:function(t,n){var o=Object(g.cloneDeep)(e),i=o[t];o.splice(t,1),o.splice(n,0,i),r(o)},active:{get:function(){var t=null;return Object(g.each)(e,(function(n){n.active&&(t=n)})),t}}},windowsApi:{close:function(t){var n=Object(g.cloneDeep)(e);Object(g.each)(t,(function(t){Object(g.each)(n,(function(n,e){for(var o=0;o<n.grid.content.length;o++){var i=n.grid.content[o],c=n.grid.layout[o];i.i===t&&n.grid.content.splice(o,1),c.i===t&&n.grid.layout.splice(o,1)}}))}));var o=We(n);r(o)},active:{get:p,setContent:function(t){if(t){var n=Object(g.cloneDeep)(e),o=Ve(n);if(Object(g.isNumber)(o)){var i=n[o],c=i.grid.content;if(!(c.length<1)){var a=0;Object(g.each)(c,(function(t,n){!0===t.active&&(a=n)})),c[a].file=Object(g.cloneDeep)(t),i.manualName||(i.name=qe(t.name));var l=We(n);r(l)}}}}},updateWindows:function(t,n){var o=Object(g.cloneDeep)(e);Object(g.each)(t,(function(t){Object(g.each)(o,(function(e,o){Object(g.each)(e.grid.content,(function(e){e.i===t&&(e.file=n)}))}))}));var i=We(o);r(i)},getIdsFromFile:function(t){var n=[];return Object(g.each)(e,(function(e){Object(g.each)(e.grid.content,(function(e){e.file&&e.file.path===t&&n.push(e.i)}))})),n}}}}(),w=v.tabs,O=v.updateTab,k=v.refreshTabsFromBackend,y=v.updateActiveTabGrid,C=v.refreshWindowGrid,T=v.tabsApi,E=v.windowsApi,S=T.active.get(),I=_i(),N=I.PromptPopupComponent,F=I.popupApi,L=function(){var t=Object(o.useRef)([]),n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],a=e[1],l=Object(o.useState)(!1),s=Object(c.a)(l,2),p=s[0],u=s[1],d="(DISCONNECTED)",f=Object(o.useRef)(d);ae((function(){f.current=f.current===d?"(/!\\ DISCONNECTED /!\\)":d;var t=i?"".concat(mi()," (Connected)"):"".concat(mi()," ").concat(f.current);document.title=t}),1e3),Object(o.useEffect)((function(){return t.current[0]=Ze.on("disconnect",(function(){g(!1)})),t.current[1]=Ze.on("reconnect",(function(){g(!0),u(!0),setTimeout((function(){u(!1)}),1e3)})),t.current[2]=Ze.on("connect",(function(){g(!0),u(!0),setTimeout((function(){u(!1)}),1e3)})),function(){t.current.forEach((function(t){Ze.off(t)}))}}),[]);var g=function(t){x.log.verbose&&console.log("[SOCKET CONNECTION TOGGLE] to ".concat(t)),a(t)};return{isConnected:i,connectionStatusComponent:function(){var t=["connected","connected"];return p&&(t=["back-online","back online"]),i||(t=["disconnected","disconnected"]),Object(r.c)("div",{className:"connection-status"},Object(r.c)("div",{className:t[0]},t[1]))},toggleSocketConnection:g}}(),R=L.isConnected,A=L.connectionStatusComponent,D=L.toggleSocketConnection;ae((function(){}),1e3);var P=function(){var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[1],r=Object(o.useState)(0),a=Object(c.a)(r,2),l=a[0],s=a[1],p=Object(o.useRef)(0);return Object(o.useEffect)((function(){var t=Object(g.debounce)((function(){p.current=p.current+1,s(l+1),i(!0),setTimeout((function(){i(!1)}),200)}),200);return window.addEventListener("resize",(function(){t()})),function(){window.removeEventListener("resize",(function(){t()}))}}),[]),{forceResponsiveRender:e,frr:p,responsiveRefreshCounter:l,setResponsiveRefresh:s}}(),z=P.forceResponsiveRender,M=P.responsiveRefreshCounter,B=P.setResponsiveRefresh,_=Object(o.useRef)([]),H=Object(o.useState)(!1),U=Object(c.a)(H,2),G=U[0],J=U[1],Y=function(){var t=Object(o.useState)([]),n=Object(c.a)(t,2),e=n[0],i=n[1],r=Object(o.useState)(0),a=Object(c.a)(r,2),l=a[0],s=a[1];return{lightboxApi:{open:function(t,n){console.log("[LIGHTBOX] open ".concat(n.length," images to index ").concat(t),{images:n});var e=[];Object(g.each)(n,(function(t){if(Object(g.isString)(t)){var n={file:Qi(),title:"",url:t};e.push(n)}else e.push(t)})),i(e),s(t)},close:function(){console.log("[LIGHTBOX] close"),i([]),s(0)}},lightboxImages:e,lightboxIndex:l}}(),K=Y.lightboxApi,$=Y.lightboxImages,X=Y.lightboxIndex,Z=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],r=e[1],a=Object(o.useState)([]),l=Object(c.a)(a,2),s=l[0],p=l[1];return{isConnected:t.isConnected,searching:{get:i,set:r},ipsServer:{get:s,set:p,getLocal:function(){var t=s[0];return Object(g.each)(s,(function(n){n.startsWith("192.168")&&(t=n)})),t}},refresh:Object(d.a)(Object(d.a)({},t.refresh),{},{increment:function(){t.refresh.set(t.refresh.get+1)}})}}({isConnected:R,refresh:{get:M,set:B}}),tt=function(){var t="[NOTE HISTORY] ",n=x.log.verbose,e=Object(o.useRef)({}),i=function(){return(new Date).getTime()},c=function(e,o,i){n&&console.log("".concat(t," saveNoteHistory ").concat(e)),Ze.emit("createHistoryFile",{filePath:e,content:o,historyFileType:i,token:Q()})};return{save:c,intervalSave:function(o,r){var a=e.current[o];(!a||a&&a+6e4<i())&&(n&&console.log("".concat(t," ").concat(o,", time ").concat(1," expired/inexistand, PROCEED BACKUP")),c(o,r,"int"),e.current[o]=i())}}}(),ot=ci({popupApi:F,tabsApi:T,userSettingsApi:b,windowsApi:E,statusApi:Z,historyApi:tt,lightboxApi:K}),it=ot,ct=it.ui.browser.files,at=it.ui.browser.folders,lt=at.scan,st=at.clean,pt=at.base,ut=function(t){var n=et("files-history",[]),e=Object(c.a)(n,3),i=e[0],r=e[1],a=e[2];Object(o.useEffect)((function(){Zi&&console.log(Xi," activeFile changed!",t),t&&l(t)}),[t]);var l=function(t){Zi&&console.log(Xi,"Add to history",t.name);for(var n=!0,e=-1,o=i,c=0;c<i.length;c++)i[c].name===t.name&&(n=!1,e=c);n||o.splice(e,1),(o=o.slice(0,20)).unshift(t),r(o)};return bn(l,1e3),{filesHistory:i,cleanLastFilesHistory:function(){r([])},refreshFilesHistoryFromBackend:a}}(ct.active.get),dt=ut.filesHistory,ft=ut.cleanLastFilesHistory,gt=ut.refreshFilesHistoryFromBackend,bt=$i(t,n,st,lt),ht=(bt.askForMoveFile,bt.promptAndMoveFolder),mt=bt.promptAndBatchMoveFiles,vt=function(){var t=Object(o.useState)("navigator"),n=Object(c.a)(t,2),e=n[0],a=n[1];return{mobileView:e,setMobileView:a,MobileToolbarComponent:function(t){return hi(Object(r.c)(i.a.Fragment,null,"desktop"!==s()&&Object(r.c)(nn,{class:"mobile-view-toggler",buttons:[{icon:"faStream",class:"".concat("navigator"===e?"active":""),action:function(){a("navigator")}},{icon:"faPenNib",class:"".concat("editor"===e?"active":""),action:function(){a("editor")}},{icon:"faEye",class:"".concat("preview"===e?"active":""),action:function(){a("preview")}}]})),[e,t])}}}(),wt=vt.mobileView,xt=vt.MobileToolbarComponent;return window.api=it,Object(r.c)("div",{className:Yi(wt,it.userSettings.refresh.css.get)},Object(r.c)("div",{className:" ".concat("mobile"===s()?"mobile-view-".concat(wt):"")},Object(r.c)(ii.Provider,{value:ot},Object(r.c)(r.a,{styles:Object(r.b)("*{-webkit-print-color-adjust:exact!important;color-adjust:exact!important;}*:focus{outline:none;}body{margin:0;padding:0px;background:",W.colors.bg.light,";font-size:11px;font-family:",W.font.main,";}html,body{height:100vh;overflow:hidden;background:",W.colors.bgInterface,";}button,input{font-family:",W.font.main,";font-weight:700;color:",W.colors.l2.title,";}","\n@page {\n margin: 0;\n padding: 0;\n}\n\n.main-wrapper,\n#root,\n.print-body {\n\t// position: absolute;\n// top: 22px;\n\t\t// height: 1000vh;\n\t\t// overflow: scroll;\n}\n\n.print-wrapper {\n\t\tz-index: 10000000000000;\n\t\tbackground-color: white;\n\t\toverflow: hidden;\n width: 100%!important;\n\t\theight: 1000vh!important;\n position: fixed;\n top: 0;\n left: 0;\n margin: 0;\n padding: 15px;\n font-size: 14px;\n line-height: 18px;\n\t\tmargin-top: 0px!important;\n\t\tdisplay: block!important;\n}\n/* .print-wrapper { */\n/* \t\tz-index: 10000000000000; */\n/* \t\ttop: 0px; */\n/* \t\tleft: 0px; */\n/* \t\tposition: fixed; */\n/* \t\twidth: 100%!important; */\n/* \t\t/* height: 100vh; */ */\n/* } */\n\n"," body{position:relative;}","")}),Object(r.c)("div",{role:"dialog",className:"\n\t\t\t\t\t\t\t\tmain-wrapper\n\t\t\t\t\t\t\t\t".concat(it.userSettings.get("ui_sidebar")?"with-sidebar":"without-sidebar","\n\t\t\t\t\t\t\t\tdevice-view-").concat(s())},N(),p({}),a({}),A(),xt(z),Object(r.c)("div",{className:"left-sidebar-indicator"},Object(r.c)("div",{className:"left-wrapper"},Object(r.c)("div",{className:"left-wrapper-1"},Object(r.c)("div",{className:"invisible-scrollbars"},Object(r.c)(wi,{onNewFile:function(){oi((function(t){var n=t.ui.browser.folders.current.get;t.file.create(n,(function(e){var o=function(t){var n=t[0];return n?(Object(g.each)(t,(function(t){t.created&&n.created&&t.created>n.created&&(n=t)})),n):null}(e);o&&t.ui.browser.goTo(n,o.name,{openIn:"activeWindow"})}))}))}}),Object(r.c)(Di,{files:dt,onClick:function(t){ot.ui.browser.goTo(t.folder,t.name,{openIn:"active"})}}),Object(r.c)(Ri,{openFolders:at.open.get,folder:at.get,current:at.current.get,onFolderClicked:function(t){ot.ui.browser.goTo(t,null)},onFolderMenuAction:function(t,n,e){var o,i,c;"rename"===t&&e?(ht({folder:n,folderToDropInto:n,folderBasePath:pt,newTitle:e,renameOnly:!0}),lt([n.path],{cache:!1})):"create"===t&&e?(i=e,c=n,console.log("[askFolderCreate]",i,c),Ze.emit("askFolderCreate",{newFolderName:i,parent:c,token:Q()}),lt([n.path],{cache:!1})):"moveToTrash"===t?(ht({folder:n,folderToDropInto:rt,folderBasePath:pt,newTitle:e}),lt([n.path],{cache:!1})):"delete"===t&&(o=n,console.log("[askFolderDelete]",o),Ze.emit("askFolderDelete",{folderToDelete:o,token:Q()}),lt([n.path],{cache:!1})),lt(at.open.get,{cache:!1,background:!0})},onFolderOpen:function(t){lt([t],{cache:!1})},onFolderClose:function(t){},onFolderDragStart:function(t){console.log("[DRAG MOVE] onFolderDragStart",t),_.current=[{type:"folder",folder:t}]},onFolderDragEnd:function(){console.log("[DRAG MOVE] onFolderDragEnd"),_.current=[]},onFolderDrop:function(t){!function(t){console.log("[DRAG MOVE] processDragDropAction ->",_.current,t);var n=_.current[0];"file"===n.type&&n.files?mt(n.files,t):"folder"===n.type&&n.folder&&ht({folder:n.folder,folderToDropInto:t,folderBasePath:pt})}(t)}})),Object(r.c)("div",{className:"settings-button",onClick:function(){J(!G)}},Object(r.c)(Qt,{name:"faCog",color:"grey"})),G&&Object(r.c)(ui,{onClose:function(){J(!1)}})),Object(r.c)("div",{className:"left-wrapper-2"},Object(r.c)("div",{className:"top-files-list-wrapper"},Object(r.c)("div",{className:"subtitle-wrapper"},Object(r.c)("div",{className:"folder-wrapper"},it&&it.ui.browser.folders.current.get,!it.ui.browser.folders.current.get&&"/"),"mobile"!==s()&&Object(r.c)("div",{className:"toggle-sidebar-btn"},Object(r.c)(nn,{popup:!1,buttons:[{icon:"faThumbtack",title:"Toggle Sidebar",action:function(t){b.set("ui_sidebar",!b.get("ui_sidebar")),C()},active:!0===ot.userSettings.get("ui_sidebar")}],colors:["#d4d1d1","#615f5f"],size:.8}))),Object(r.c)(Pi,{term:ot.ui.search.term.get})),Object(r.c)("div",{className:"files-list-wrapper"},Object(r.c)(tc,{files:ct.get,activeFileIndex:ct.active.getIndex,onSortFiles:function(t){ot.ui.browser.files.set(t)},onFileClicked:function(t){ct.active.set(t);var n=ct.get[t];it.tabs.active.get()?E.active.setContent(n):it.tabs.openInNewTab(n)},onFileDragStart:function(t){console.log("[DRAG MOVE] onFileDragStart",t),_.current=[{type:"file",files:t}]},onFileDragEnd:function(){console.log("[DRAG MOVE] onFileDragEnd"),_.current=[]}}))))),Object(r.c)("div",{className:"right-wrapper dual-viewer-view"},Object(r.c)(Hi,{tabs:w,onUpdate:O}),S&&Object(r.c)(no,{tab:S,onGridUpdate:y}))))),$.length>0&&Object(r.c)(Mi,{images:$,startingIndex:X,onClose:ot.ui.lightbox.close}))}),null),document.getElementById("root"))}},[[372,11,12]]]);