text: /*
    SFFileSystem
    A library for accessing local file system for
    the current website on the browser
  
    https://github.com/ScarletsFiction/SFFileSystem
  */
  function SFFileSystem(e){var t=this;if(void 0===o)var o={TEMPORARY:0,PERSISTENT:1};t.home=!1,t.storageLocation="",t.ready=!1,t.temporary=!0===e.temporary,t.FileErrorMessage=function(e){return 1===e.code?"Not found":2===e.code?"Security error":3===e.code?"Aborted":4===e.code?"Not readable":5===e.code?"Encoding error":6===e.code?"Modification not allowed":7===e.code?"Invalid state":8===e.code?"Syntax error":9===e.code?"Invalid modification":10===e.code?"Storage space zero":11===e.code?"Type mismatch":12===e.code?"Path error":13===e.code?"Failed to load directory":e.indexOf&&-1!==e.indexOf("quota")?"Storage quota exceeded":"Unknown error"},t.validateFileName=function(e){return"string"!=typeof e?e:e.replace(/[<>:\"\/\\|?*]/,"-")};var n=function(e,t,o){var n=this;this.getParent(function(i){n.optMove(i,e,function(e){t&&(a(e),t(e))},o)})},i=function(e,o,n,i,r){var c=this,f=function(e){c[r?"optMove":"optCopy"](e,o,function(e){n&&(a(e),n(e))},i)};"string"==typeof e?t.path(e,function(e){f(e)},!1,!1,this):f(e)},r=function(e,t,o,n){i.apply(this,[e,t,o,n,!0])},c=function(e,t){this.optParent(function(t){a(t),e(t)},t)};function a(e){e.isFile?s(e):w(e)}var f=function(e,t,o,n){this.createWriter(function(i){var r=!1;i.onwriteend=function(e){if(!n&&!r)return this.truncate(this.position),void(r=!0);t&&t(e)},i.onerror=o,"string"==typeof e&&(e=new Blob([e],{type:"text/plain"})),i.seek(0),i.write(e)},o)},u=function(e,t,o){f.apply(this,[e,t,o,!0])},l=function(e,t){this.file(function(t){var o=new FileReader;o.onloadend=function(){e&&e(this.result)},o.readAsText(t)})};function s(e){e.write=f,e.append=u,e.read=l,e.optCopy=e.copyTo,e.optMove=e.moveTo,e.optParent=e.getParent,e.rename=n,e.copyTo=i,e.moveTo=r,e.getParent=c}var d=function(e,t,o){this.optDirectory(e,{create:!0,exclusive:!1},function(e){t&&(w(e),t(e))},o)},p=function(e,t,o){this.optFile(e,{create:!0,exclusive:!1},function(e){t&&(s(e),t(e))},o)},h=function(e,t,o){this.optDirectory(e,null,function(e){t&&(w(e),t(e))},o)},y=function(e,t,o){this.optFile(e,null,function(e){t&&(s(e),t(e))},o)},v=function(e,t){var o=this;o.optFile(e,{create:!1},function(){t("file")},function(){o.optDirectory(e,{create:!1},function(){t("folder")},function(){t(!1)})})},m=function(e,t){this.createReader().readEntries(function(t){if(0==t.length)e([]);else{for(var o=0;o<t.length;o++)t[o].isFile?s(t[o]):w(t[o]);e(t)}},t)},g=function(e,t){this.createReader().readEntries(function(t){if(0==t.length)e([]);else{for(var o=[],n=0;n<t.length;n++)o.push(t[n].name);e(o)}},t)};function w(e){e.optDirectory=e.getDirectory,e.optFile=e.getFile,delete e.getDirectory,e.newFolder=d,e.newFile=p,e.getFolder=h,e.getFile=y,e.exist=v,e.contents=m,e.list=g,e.optCopy=e.copyTo,e.optMove=e.moveTo,e.optParent=e.getParent,e.rename=n,e.copyTo=i,e.moveTo=r,e.getParent=c}t.path=function(e,o,n,i,r){"/"!==e[0]&&r||(r=t.home);for(var c=e.split("/").filter(function(e){return"."!==e&&!!e}),a=c.length-1;a>=0;a--)".."===c[a]&&0!==a&&".."!==c[a-1]&&(a--,c.splice(a,2));if(0===c.length)return o(r);var f=0;!function e(t){if(".."===c[f])return f++,void r.getParent(e);t.getDirectory(c[f],{create:i,exclusive:!1},function(t){c[f+1]?(f++,e(t)):(w(t),o(t))},n)}(r)},t.exist=function(e,o){var n=(e=e.split("/")).pop();e=e.join("/"),t.path(e,function(e){e.exist(n,o)},function(){o(!1)})},t.list=function(e,o,n){t.path(e,function(e){e.list(o)},n)},t.contents=function(e,o,n){t.path(e,function(e){e.contents(o)},n)},function(){window.requestFileSystem||(window.requestFileSystem=window.webkitRequestFileSystem),e.initError||(e.initError=console.error);var n=function(){t.ready=!0,w(t.home),e.callback&&setTimeout(e.callback,500)},i=function(i){window.requestFileSystem(o[!0===t.temporary?"TEMPORARY":"PERSISTENT"],i,function(o){var i=!1;"undefined"!=typeof cordova&&(e.home&&cordova.file.externalRootDirectory?(i=!0,window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory,function(o){o.getDirectory(e.home,{create:!0},function(e){t.home=e,t.storageLocation="External Card",n()})},e.initError)):cordova.file.externalDataDirectory&&(i=!0,window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory,function(e){t.home=e,t.storageLocation="External Application Home",n()},e.initError))),i||(e.home?o.root.getDirectory(e.home,{create:!0},function(e){t.home=e,n()}):(t.home=o.root,n()),t.storageLocation="Internal Application Home")},e.initError)},r="undefined"!=typeof device&&"browser"!==device.platform?0:1099511627776;if(0!==r)return i(r);navigator.webkitPersistentStorage.requestQuota(r,function(e){self.grantedBytes=e,i(0)},e.initError)}()}
  //# sourceMappingURL=sffilesystem.min.js.map
  