{"size": 2685, "ext": "js", "max_stars_repo_path": "libs/arcgis_js_api_3.34/esri/dijit/geoenrichment/ReportPlayer/dataProvider/commands/CreateImageCommand.js", "max_stars_repo_name": "GitHubYangZhiwen/arcgis-js-siteapp-3.x", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "libs/arcgis_js_api_3.34/esri/dijit/geoenrichment/ReportPlayer/dataProvider/commands/CreateImageCommand.js", "max_issues_repo_name": "GitHubYangZhiwen/arcgis-js-siteapp-3.x", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "libs/arcgis_js_api_3.34/esri/dijit/geoenrichment/ReportPlayer/dataProvider/commands/CreateImageCommand.js", "max_forks_repo_name": "GitHubYangZhiwen/arcgis-js-siteapp-3.x", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 335.625, "max_line_length": 521, "alphanum_fraction": 0.7988826816}
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.34/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/dataProvider/commands/CreateImageCommand","require dojo/_base/declare esri/dijit/geoenrichment/Deferred esri/dijit/geoenrichment/when dojo/sniff ./CreateHTMLCommand ../../PlayerCommands ./supportClasses/ProgressSteps ./createHTML/CommandMode esri/dijit/geoenrichment/ReportPlayer/config dojo/i18n!esri/nls/jsapi".split(" "),function(q,r,t,k,h,u,v,f,w,x,g){function y(){var e=new t;q(["./imageUtils/ImageSaveUtil","./imageUtils/NodeToCanvasUtil","./imageUtils/ImagePrintUtil",
"./createHTML/CSSFilesLoader"],function(c,b,a,d){l=c;m=b;n=a;p=d;e.resolve()});return e.promise}g=g.geoenrichment.dijit.ReportPlayer.ReportPlayer;var l,m,n,p;return r(u,{id:v.IMAGE,label:g.createImageCommandLabel,errorMessage:g.createImageError,_saveFiles:!1,_stopPrintableContainer:!1,_mode:w.SVG,_mergePageIndexes:!1,_convertUrlImages:!0,_hideUrlImages:!0,execute:function(e,c){var b=this,a=this.inherited(arguments);return y().then(function(){return k(a,function(d){function a(a){return!c.skipErrorNotification&&
b._handleError(a)}if(d&&d.svgStrings){var g=d.svgStrings.length,h=function(a){b._stepFinished(f.RENDER_IMAGE,a+1,g)};d.svgStrings=b._preProcessSVGStrings(d.svgStrings);return k(p.loadCssFontFiles(),function(){return n.printImages({svgStrings:d.svgStrings,nodeToCanvasFunc:b._nodeToCanvasFunc.bind(b),onRenderImage:h,scale:3}).then(function(a){return l.saveImages(a,{fileName:c.fileName,reportTitle:e.getReportTitle(),analysisAreas:e.getAnalysisAreas(),numPages:b._printableContainer.getNumberOfPages(),
confirmSaveFile:b._confirmSaveFile,skipSavingFile:c.skipSavingFile||x.createImageCommand.skipSavingFile,saveImageFunc:d.additionalFiles&&d.additionalFiles.length&&function(a){return b._saveMultipleFiles([a],d.additionalFiles,c.fileName)},saveMultipleImagesFunc:b._saveMultipleFiles&&function(a){return b._saveMultipleFiles(a,d.additionalFiles,c.fileName)}})}).otherwise(a).always(function(a){return k(b._printableContainer&&b._printableContainer.stop(),function(){return a})})})}})}.bind(this))},_saveMultipleFiles:null,
_stepFinished:function(e,c,b){if(this._currentProgressBack){var a=0;switch(e){case f.REPLACE_MAPS:a=10;break;case f.PREPARE_DOM:a=20;break;case f.RENDER_PAGE:a=20+40*c/b;break;case f.UNSET_LAYOUT:a=70;break;case f.RENDER_IMAGE:a=70+30*c/b}this._currentProgressBack(a/100)}},_preProcessSVGStrings:function(e){return e},_nodeToCanvasFunc:function(e,c,b){return m.svgNodeToCanvasFunc(e.children[0],c,b)},isBrowserSupported:function(){return!(h("ie")||h("trident"))}})});