/************************************************************************!
*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2015-2019 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/!function(e){var n={};function r(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)r.d(t,i,function(n){return e[n]}.bind(null,i));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=137)}({10:function(e,n,r){var t=r(2);function i(){this._operations=[],this._isRunning=!1}i.prototype.addOperation=function(e,n,r){if(this._isRunning)throw new t(t.INVALID_PARAMETER,"Cannot add operations after calling run()");this._operations.push({operation:e,argsArray:n||[],thisObject:r})},i.prototype.run=function(e,n){function r(n,r,t){e&&e(n,r,t)}if(this._isRunning)throw new t(t.INVALID_PARAMETER,"Cannot call run() more than once");this._isRunning=!0;var i=this._operations.length;0===i&&r(null,!1,[]);var o,a=0,s=!1,c=[],l=[];this._operations.forEach(function(e,u){e.argsArray.push(function(e,p){!function(e,u,p){if(e&&n&&n(e),!s){if(o=o||e,c[p])return s=!0,void r(new t(t.INVALID_PARAMETER,"Operation not valid: calls callback multiple times"));if(a++,l[p]=u,c[p]=!0,a===i){s=!0;var E=!!l.reduce(function(e,n){return e||n},!1);r(o||null,E,l)}}}(e,p,u)}),e.operation.apply(e.thisObject,e.argsArray)})},Object.freeze(i),Object.seal(i.prototype),e.exports=i},137:function(e,n,r){var t=r(14),i=r(32),o=r(138),a=r(33),s=r(139),c=process.argv.slice(2),l={darwin:{installPath:"/Library/Application Support/Adobe/Vulcan/specifiers/",appName:"CCLibrary.app",appFolder:"../../.."},win32:{installPath:t.join(process.env.CommonProgramFiles||"","Adobe","Vulcan","specifiers"),appName:"CCLibrary.exe",appFolder:".."},win64:{installPath:t.join(process.env.CommonProgramFiles||"","Adobe","Vulcan","specifiers"),appName:"CCLibrary.exe",appFolder:".."}},u=t.resolve(l[process.platform].installPath),p="/Library/Logs/CreativeCloud/Creative Cloud Libraries";"win32"===process.platform&&(p=t.join(process.env.TEMP,"CreativeCloud","Creative Cloud Libraries"));var E=t.resolve(p,"./CCLibraryProcessInstall.log");try{i.ensureDirSync(p)}catch(e){console.error("Error with log directory permissions ",e)}function _(){console.log.apply(console,arguments);try{var e=(new Date).toString()+":"+Array.prototype.slice.call(arguments).join(" ")+r(20).EOL;i.appendFileSync(E,e,"utf-8")}catch(e){console.error("Error writing to log file",e)}}s.setLoggerFunction(_);var d=(new Date).valueOf(),f=function(e,n){var r=(new Date).valueOf()-d,t=e?"Success ":"Failed ";_(t+="("+r+"ms)"),process.exit(e?0:n||1)},A=function(e){_("Killing CCLibrary process..."),"darwin"===process.platform?a.exec('pkill -f ".*CCLibrary.app/Contents/MacOS/../js/server.js$"',function(n){n?(_("Error while killing CCLibrary process : "+n),e(!1)):(_("CCLibrary process successfully killed."),e(!0))}):o.lookup({command:".*\\CCLibrary.exe"},function(n,r){if(n)_("Error while looking up CCLibrary process : "+n),e(!1);else if(r&&r.length>0){var t=r.length,i=null;_("Number of CCLibrary Instances: ",r.length),r.forEach(function(n){_("CCLibrary is running, trying to kill now: "+n.pid),o.kill(n.pid,function(r){_(r?"Error while killing CCLibrary("+n.pid+"): "+r:"Succesfully killed CCLibrary("+n.pid+")"),function(n){i=i||n,0==--t&&e(!i)}(r)})})}else _("CCLibrary is not running."),e(!1)})};if(process.on("unhandledRejection",function(e,n){_("Unhandled Rejection at:",n,"reason:",e)}),process.on("uncaughtException",function(e){_("Uncaught Exception:",e,e.stack)}),_("Version: ",global.version," Build: ","17"),process.chdir(__dirname),-1!==c.indexOf("install")){var L='<SpecifierManifest Version="1.0"><Name>cclibraries</Name><Version>1</Version><Locale></Locale><Group></Group><Path>{{path}}</Path></SpecifierManifest>'.replace("{{path}}",t.resolve(t.join(__dirname,l[process.platform].appFolder,l[process.platform].appName)));_("Installing..."),i.ensureDir(u,function(e){e&&(_("Unable to install: ",e),f(!1,101)),i.writeFile(t.join(u,"cclibraries.xml"),L,{encoding:"utf8"},function(e){e&&(_("Unable to install: ",e),f(!1,102));try{i.utimesSync(u,new Date,new Date)}catch(e){}A(function(){s.checkAndDeploy(function(e){_("CCLibrary process installed successfully."),f(!e,e?103:void 0)})})})})}else-1!==c.indexOf("uninstall")?A(function(){-1!==c.indexOf("--update=true")&&(_("Uninstalling as part of update: no action required"),f(!0)),_("Uninstalling..."),i.unlink(t.join(u,"cclibraries.xml"),function(e){e&&("ENOENT"===e.code?_("Vulcan specifier not installed. Nothing to remove."):(_("Unable to uninstall: ",e),f(!1,104))),s.checkAndUnDeploy(function(e){f(!e,e?105:void 0)})})}):-1!==c.indexOf("--test")?(_("Testing customhook OK"),f(!0)):(_("Expected to be invoked with argument: install or uninstall"),f(!1,100))},138:function(e,n){e.exports=require("ps-node")},139:function(e,n,r){var t=r(32),i=r(14),o=r(34),a=r(10),s=r(7),c=console.log,l={_getExtensionFolder:function(){var e="/Library/Application Support/Adobe/CEP/extensions";0===process.platform.indexOf("win")&&(e=(process.env["ProgramFiles(x86)"]||process.env.PROGRAMFILES).replace(/\\/g,"/")+"/Common Files/Adobe/CEP/extensions");return e},_getPanelsFolder:function(){var e="../Resources/panels";return e=i.join(__dirname,e)},_getOldPanels:function(){return o&&o.cepPanelsToRemove||[]},_getInstalledPanels:function(){var e=[];return o&&o.cepPanels&&o.cepPanels.forEach(function(n){n&&n.destination&&e.push(n.destination)}),e},_removePanels:function(e,n){var r=new a,i=function(e,n){var r=l._getExtensionFolder(),i=r+"/"+e;t.remove(i,function(t){if(t&&"ENOENT"!==t.code)return c(t),n(t);c("Removing Panel "+e+" from "+r),n(null)})};e.forEach(function(e){e&&r.addOperation(i,[e])}),r.run(function(){n(null)})},setLoggerFunction:function(e){c=e||console.log},checkAndDeploy:function(e){var n=l._getPanelsFolder(),r=l._getExtensionFolder(),i=function(e,i){var o=r+"/"+e,a=o+"/CSXS/manifest.xml";t.exists(a,function(r){if(r)return c("Panel already exists at: "+e),void i(null);var s=n+"/"+e+"/Contents",l=n+"/"+e+"/manifest.xml";t.remove(o,function(n){if(n)return c(n),i(n);c("Upgrading Panel "+e+" from "+s),t.copy(s,o,function(e){if(e)return c(e),i(e);var n=a+".temp";t.copy(l,n,function(e){if(e)return c(e),i(e);t.rename(n,a,function(e){if(e)return c(e),i(e);i(null)})})})})})},o=s.wrapCallback(e),u=new a;u.addOperation(function(e){t.exists(n,function(o){if(!o)return c("Could not find panels bundle."),void e(null);t.ensureDir(r,function(r){if(r)return c(r),e(r);t.readdir(n,function(n,r){if(n)return c(n),e(n);var t=new a;r.forEach(function(e){t.addOperation(i,[e])}),t.run(function(n){e(n)})})})})},[]),u.addOperation(l._removePanels,[l._getOldPanels()]),u.run(function(e){o(e)})},checkAndUnDeploy:function(e){var n=s.wrapCallback(e),r=new a;r.addOperation(l._removePanels,[l._getOldPanels()]),r.addOperation(l._removePanels,[l._getInstalledPanels()]),r.run(function(e){n(e)})}};e.exports=l},14:function(e,n){e.exports=require("path")},2:function(e,n){var r=["INVALID_PARAMETER","READ_ONLY","NOT_IMPLEMENTED","NOT_SUPPORTED","REQUIRES_FILESYSTEM","DELETED_LOCALLY"];function t(e,n,i,o){if(-1!==r.indexOf(e))if(Error.call(this),Error.captureStackTrace)Error.captureStackTrace(this,t);else{var a=new Error;a.name=this.name,this.stack=a.stack}this.code=e,this._message=n,this.message="["+e+"] "+n,this.libraryId=i,this.underlyingError=o}t.prototype=Object.create(Error.prototype),t.prototype.name="AdobeLibraryError",t.INVALID_PARAMETER="INVALID_PARAMETER",t.READ_ONLY="READ_ONLY",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.NOT_SUPPORTED="NOT_SUPPORTED",t.REQUIRES_FILESYSTEM="REQUIRES_FILESYSTEM",t.DELETED_LOCALLY="DELETED_LOCALLY",t.NOT_ALLOWED="NOT_ALLOWED",t.FILE_TOO_LARGE="FILE_TOO_LARGE",t.EXCEEDS_MAX_LIBRARY_SIZE="EXCEEDS_MAX_LIBRARY_SIZE",t.CORRUPTED_LIBRARY="CORRUPTED_LIBRARY",t.THUMBNAIL_NOT_AVAILABLE="THUMBNAIL_NOT_AVAILABLE",t.STALE_THUMBNAIL="STALE_THUMBNAIL",t.RENDITION_NOT_AVAILABLE="RENDITION_NOT_AVAILABLE",t.FS_ERROR="FS_ERROR",t.OUT_OF_SPACE="OUT_OF_SPACE",t.LOGGED_OUT="LOGGED_OUT",t.EXCEEDS_QUOTA="EXCEEDS_QUOTA",t.RETRYABLE_SERVER_ERROR="RETRYABLE_SERVER_ERROR",t.TRANSFER_ERROR="TRANSFER_ERROR",t.TRANSFER_ABORTED="TRANSFER_ABORTED",t.NETWORK_ERROR="NETWORK_ERROR",t.ACCESS_DENIED="ACCESS_DENIED",t.URL_VALIDATION_FAILED="URL_VALIDATION_FAILED",t.NO_COMPATIBLE_APP_FOUND="NO_COMPATIBLE_APP_FOUND",t.APP_LAUNCH_FAILED="APP_LAUNCH_FAILED",t.OPERATION_CANCELLED="OPERATION_CANCELLED",t.INVALID_DATA="INVALID_DATA",Object.freeze(t),Object.seal(t.prototype),e.exports=t},20:function(e,n){e.exports=require("os")},32:function(e,n){e.exports=require("fs-extra")},33:function(e,n){e.exports=require("child_process")},34:function(e){e.exports={name:"cc-libraries-api-js",version:"3.2.3",private:!0,description:"Adobe Creative Cloud Libraries API for JavaScript",dependencies:{"dcx-js":"git+ssh://git@git.corp.adobe.com:ProjectCentral/dcx-js.git#v1.7.18","fs-extra":"7.0.1",glob:"7.1.1",uuid:"3.3.2","uuid-browser":"3.1.0",yauzl:"2.9.1",yazl:"2.4.3"},optionalDependencies:{bufferutil:"1.3.0",ffi:"2.2.0","fs-ext":"1.2.1","idle-gc":"1.0.1","image-size":"0.6.2","node-ProxyResolver":"git+ssh://git@git.corp.adobe.com:ProjectCentral/node-ProxyResolver.git#v1.2.3","node-imslib":"git+ssh://git@git.corp.adobe.com:ProjectCentral/node-imslib.git#v1.2.7","node-vulcanjs":"git+ssh://git@git.corp.adobe.com:slade/VulcanJS.git#v1.2.4","node-thumbnailgenerator":"git+ssh://git@git.corp.adobe.com:ProjectCentral/node-ThumbnailGenerator.git#v1.3.2","ps-node":"^0.1.6",ref:"1.3.5",restify:"7.2.0",ws:"6.1.2",xml2js:"0.4.17","@ccx/ingest":"git+ssh://git@git.corp.adobe.com:CCX/Ingest.git#2.0.0"},devDependencies:{"7zip":"0.0.6","@babel/core":"^7.1.2","@babel/preset-env":"^7.1.0","@ccx/hyperdrive-builder":"git+ssh://git@git.corp.adobe.com:CCX/hyperdrive-builder.git#v3.0.14","babel-loader":"^8.0.4",fetch:"^1.1.0",grunt:"1.0.1","grunt-contrib-clean":"1.0.0","grunt-contrib-compress":"1.3.0","grunt-contrib-copy":"1.0.0","grunt-eslint":"21.0.0","grunt-jsdoc":"2.1.0","grunt-node-gyp":"3.1.0","ignore-loader":"^0.1.2","ink-docstrap":"1.3.0",istanbul:"0.4.5","jasmine-node":"1.14.5",matchdep:"1.0.1",mkdirp:"0.5.1",mockery:"2.0.0",mustache:"2.3.0",nock:"9.0.14","raw-loader":"^0.5.1",request:"2.87.0",sugar:"1.4.1",webpack:"^4.20.2","webpack-node-externals":"^1.7.2",zock:"git+ssh://git@git.corp.adobe.com:DMA/zock.git#master"},engines:{node:">=8.11.0"},bin:{"cc-libraries":"./scripts/cli"},main:"src/main.js",scripts:{test:"grunt test",install:"node ./scripts/skip_native || node-gyp rebuild",start:"node server",debug:"node server.js --debug"},cepPanels:[{source:"ftp://sjstore.corp.adobe.com/builds03/cclibs/develop/2.3.1050/CCLibraries.zxp",destination:"CC_LIBRARIES_PANEL_EXTENSION_2_3_1050"},{source:"ftp://sjstore.corp.adobe.com/builds03/cclibs/develop/2.6.64/CCLibraries.zxp",destination:"CC_LIBRARIES_PANEL_EXTENSION_2_6_64"},{source:"ftp://sjstore.corp.adobe.com/builds03/cclibs/develop/2.10.86/CCLibraries.zxp",destination:"CC_LIBRARIES_PANEL_EXTENSION_2_10_86"},{source:"ftp://sjstore.corp.adobe.com/builds03/cclibs/develop/2.11.27/CCLibraries.zxp",destination:"CC_LIBRARIES_PANEL_EXTENSION_2_11_27"},{source:"ftp://sjstore.corp.adobe.com/builds03/cclibs/develop/2.13.141/CCLibraries.zxp",destination:"CC_LIBRARIES_PANEL_EXTENSION_2_13_141"},{source:"ftp://sjstore.corp.adobe.com/builds03/cclibs/develop/3.2.108/CCLibraries.zxp",destination:"CC_LIBRARIES_PANEL_EXTENSION_3_2_108"}],cepPanelsToRemove:["CC_LIBRARIES_PANEL_EXTENSION_2_3_1012","CC_LIBRARIES_PANEL_EXTENSION_2_3_1026_DEV","CC_LIBRARIES_PANEL_EXTENSION_2_3_1038_DEV","CC_LIBRARIES_PANEL_EXTENSION_2_3_1044_DEV","CC_LIBRARIES_PANEL_EXTENSION_2_3_1046_DEV","CC_LIBRARIES_PANEL_EXTENSION_2_3_1047_DEV","CC_LIBRARIES_PANEL_EXTENSION_2_3_1048","CC_LIBRARIES_PANEL_EXTENSION_2_6_60_DEV","CC_LIBRARIES_PANEL_EXTENSION_2_10_56"],thor:[{product:"ACCC",subproduct:"Application",version:"4.7",certification:"Integration Ready",name:"ACCCx4_7_0_{{build}}",volume:"Creative Cloud",build:"^\\d+$"},{product:"ACCC",subproduct:"HDSetup",version:"4.7",certification:"Integration Ready",name:"HDSetup",volume:"Release"}]}},7:function(e,n){var r={wrapCallback:function(e){return function(){e&&e.apply(this,arguments)}},constructStringFromTemplate:function(e,n){var r=e;return Object.keys(n).forEach(function(e){r=r.replace("{{"+e+"}}",n[e])}),r},parseLocalisationFile:function(e){var n,r,t,i,o={},a=0,s=e.split(/\n/);for(a=0;a<s.length;a++)if(s[a]=s[a].replace(/^\s\s*/,"").replace(/\s\s*$/,""),s[a].length>0&&"#"!==s[a].match("^#")){for(r=(n=s[a].split("="))[0].replace(/^\s\s*/,"").replace(/\s\s*$/,""),t=1===n.length?"":n[1];t.match(/\\$/)&&"\\"===t.match(/\\$/).toString();)t=t.substring(0,t.length-1),t+=s[++a].replace(/\s\s*$/,"");for(i=2;i<n.length;i++)t+="="+n[i];t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),o[r]=t}return o},compareVersions:function(e,n){if(e=(e||"0").toString().replace(/(\.0)*$/,"").replace(/[^.0-9]+/gim,"."),n=(n||"0").toString().replace(/(\.0)*$/,"").replace(/[^.0-9]+/gim,"."),(isNaN(parseInt(e,10))||parseInt(e,10)>250)&&(e="0"),(isNaN(parseInt(n,10))||parseInt(n,10)>250)&&(n="0"),e===n)return 0;var r,t,i=e.split("."),o=n.split(".");for(r=0;r<i.length&&r<o.length;r++){if(t=parseInt(i[r],10)-parseInt(o[r],10),isNaN(t))return isNaN(parseInt(i[r],10))?1:-1;if(t>0)return-1;if(t<0)return 1}return(t=i.length-o.length)>0?-1:t<0?1:0}};Object.seal(r),e.exports=r}});