/**
 * @license RequireJS text 2.0.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors

//     Underscore may be freely distributed under the MIT license.

define("text",["module"],function(e){var t,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.14",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.lastIndexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i&&i.isBuild&&!i.inlineText){r();return}d.isBuild=i&&i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i[0]==="﻿"&&(i=i.substring(1)),t(i)}catch(s){r&&r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status||0,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r&&r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}),define("text!app/app.config.json",[],function(){return'{\r\n	"version": "0.4",\r\n	"default-language":"ko",\r\n\r\n	"maxImageWidth": 1600,\r\n	"maxImageHeight": 1600,\r\n	"minImageWidth": 50,\r\n	"minImageHeight": 50,\r\n\r\n	"resources": {\r\n		"font-family": [\r\n			"gulim",\r\n			"gulimche",\r\n			"dotum",\r\n			"dotumche",\r\n			"batang",\r\n			"batangche",\r\n			"gungsuh",\r\n			"gungsuhche",\r\n			"malgun gothic",\r\n			"tahoma",\r\n			"verdana",\r\n			"arial"\r\n		],\r\n		"font-size-unit": "px",\r\n		"font-size": [\r\n			8,9,10,11,12,14,16,18,20,24,28,32,36,40,44,48,54,60,66,72,80,88,96\r\n		]\r\n	},\r\n	"defaultFontConfig": {\r\n		"fontFamily": "",\r\n		"fontSize": "14px"\r\n	},\r\n	"ui": {\r\n		"toolbar": [\r\n			["history-reset"],\r\n			"|",\r\n			["history-undo", "history-redo"],\r\n			"|",\r\n			["resize-workspace"],\r\n			"|",\r\n			["move-layer", "rotate-left", "rotate-right", "inverse-h", "inverse-v"],\r\n			"|",\r\n			["crop-layer", "resize-layer"],\r\n			"|",\r\n			["insert-textbox", "insert-textballoon", "insert-sticker"],\r\n			"|",\r\n			["adjust-color", "apply-filter"]\r\n		],\r\n		"navigator": {\r\n			"zoom_steps": [10,20,30,40,50,100,150,200,300,400,500]\r\n		}\r\n	},\r\n\r\n	"assets": {\r\n		"stickers": [{\r\n			"id": "sticker_01",\r\n			"name": "sticker_01",\r\n			"src": "resources/images/stickers/sticker_01.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_02",\r\n			"name": "sticker_02",\r\n			"src": "resources/images/stickers/sticker_02.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_03",\r\n			"name": "sticker_03",\r\n			"src": "resources/images/stickers/sticker_03.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_04",\r\n			"name": "sticker_04",\r\n			"src": "resources/images/stickers/sticker_04.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_05",\r\n			"name": "sticker_05",\r\n			"src": "resources/images/stickers/sticker_05.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_06",\r\n			"name": "sticker_06",\r\n			"src": "resources/images/stickers/sticker_06.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_07",\r\n			"name": "sticker_07",\r\n			"src": "resources/images/stickers/sticker_07.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_08",\r\n			"name": "sticker_08",\r\n			"src": "resources/images/stickers/sticker_08.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_09",\r\n			"name": "sticker_09",\r\n			"src": "resources/images/stickers/sticker_09.png",\r\n			"width": 400,\r\n			"height": 400\r\n\r\n		},{\r\n			"id": "sticker_10",\r\n			"name": "sticker_10",\r\n			"src": "resources/images/stickers/sticker_10.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_11",\r\n			"name": "sticker_11",\r\n			"src": "resources/images/stickers/sticker_11.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_12",\r\n			"name": "sticker_12",\r\n			"src": "resources/images/stickers/sticker_12.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_13",\r\n			"name": "sticker_13",\r\n			"src": "resources/images/stickers/sticker_13.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_14",\r\n			"name": "sticker_14",\r\n			"src": "resources/images/stickers/sticker_14.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_15",\r\n			"name": "sticker_15",\r\n			"src": "resources/images/stickers/sticker_15.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_16",\r\n			"name": "sticker_16",\r\n			"src": "resources/images/stickers/sticker_16.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_17",\r\n			"name": "sticker_17",\r\n			"src": "resources/images/stickers/sticker_17.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_18",\r\n			"name": "sticker_18",\r\n			"src": "resources/images/stickers/sticker_18.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_19",\r\n			"name": "sticker_19",\r\n			"src": "resources/images/stickers/sticker_19.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_20",\r\n			"name": "sticker_20",\r\n			"src": "resources/images/stickers/sticker_20.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_21",\r\n			"name": "sticker_21",\r\n			"src": "resources/images/stickers/sticker_21.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_22",\r\n			"name": "sticker_22",\r\n			"src": "resources/images/stickers/sticker_22.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_23",\r\n			"name": "sticker_23",\r\n			"src": "resources/images/stickers/sticker_23.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_24",\r\n			"name": "sticker_24",\r\n			"src": "resources/images/stickers/sticker_24.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_25",\r\n			"name": "sticker_25",\r\n			"src": "resources/images/stickers/sticker_25.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_26",\r\n			"name": "sticker_26",\r\n			"src": "resources/images/stickers/sticker_26.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_27",\r\n			"name": "sticker_27",\r\n			"src": "resources/images/stickers/sticker_27.png",\r\n			"width": 400,\r\n			"height": 400\r\n		},{\r\n			"id": "sticker_28",\r\n			"name": "sticker_28",\r\n			"src": "resources/images/stickers/sticker_28.png",\r\n			"width": 400,\r\n			"height": 400\r\n		}],\r\n\r\n\r\n		"textballoons": [{\r\n			"id": "balloon_01",\r\n			"name": "balloon_01",\r\n			"src": "resources/images/balloons/balloon_01.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "58",\r\n          "y": "128",\r\n          "width": "284",\r\n          "height": "110"\r\n        }\r\n		},{\r\n			"id": "balloon_02",\r\n			"name": "balloon_02",\r\n			"src": "resources/images/balloons/balloon_02.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "58",\r\n          "y": "128",\r\n          "width": "284",\r\n          "height": "110"\r\n        }\r\n		},{\r\n			"id": "balloon_03",\r\n			"name": "balloon_03",\r\n			"src": "resources/images/balloons/balloon_03.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "50",\r\n          "y": "94",\r\n          "width": "298",\r\n          "height": "156"\r\n        }\r\n		},{\r\n			"id": "balloon_04",\r\n			"name": "balloon_04",\r\n			"src": "resources/images/balloons/balloon_04.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "50",\r\n          "y": "94",\r\n          "width": "298",\r\n          "height": "156"\r\n        }\r\n		},{\r\n			"id": "balloon_05",\r\n			"name": "balloon_05",\r\n			"src": "resources/images/balloons/balloon_05.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "68",\r\n          "y": "94",\r\n          "width": "276",\r\n          "height": "100"\r\n        }\r\n		},{\r\n			"id": "balloon_06",\r\n			"name": "balloon_06",\r\n			"src": "resources/images/balloons/balloon_06.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "68",\r\n          "y": "94",\r\n          "width": "276",\r\n          "height": "100"\r\n        }\r\n		},{\r\n			"id": "balloon_07",\r\n			"name": "balloon_07",\r\n			"src": "resources/images/balloons/balloon_07.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "34",\r\n          "y": "94",\r\n          "width": "334",\r\n          "height": "128"\r\n        }\r\n		},{\r\n			"id": "balloon_08",\r\n			"name": "balloon_08",\r\n			"src": "resources/images/balloons/balloon_08.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "34",\r\n          "y": "94",\r\n          "width": "334",\r\n          "height": "128"\r\n        }\r\n		},{\r\n			"id": "balloon_09",\r\n			"name": "balloon_09",\r\n			"src": "resources/images/balloons/balloon_09.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "60",\r\n          "y": "79",\r\n          "width": "278",\r\n          "height": "136"\r\n        }\r\n		},{\r\n			"id": "balloon_10",\r\n			"name": "balloon_10",\r\n			"src": "resources/images/balloons/balloon_10.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "60",\r\n          "y": "79",\r\n          "width": "278",\r\n          "height": "136"\r\n        }\r\n		},{\r\n			"id": "balloon_11",\r\n			"name": "balloon_11",\r\n			"src": "resources/images/balloons/balloon_11.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "60",\r\n          "y": "113",\r\n          "width": "284",\r\n          "height": "132"\r\n        }\r\n		},{\r\n			"id": "balloon_12",\r\n			"name": "balloon_12",\r\n			"src": "resources/images/balloons/balloon_12.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "60",\r\n          "y": "113",\r\n          "width": "284",\r\n          "height": "132"\r\n        }\r\n		},{\r\n			"id": "balloon_13",\r\n			"name": "balloon_13",\r\n			"src": "resources/images/balloons/balloon_13.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "49",\r\n          "y": "56",\r\n          "width": "300",\r\n          "height": "224"\r\n        }\r\n		},{\r\n			"id": "balloon_14",\r\n			"name": "balloon_14",\r\n			"src": "resources/images/balloons/balloon_14.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "49",\r\n          "y": "56",\r\n          "width": "300",\r\n          "height": "224"\r\n        }\r\n		},{\r\n			"id": "balloon_15",\r\n			"name": "balloon_15",\r\n			"src": "resources/images/balloons/balloon_15.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "60",\r\n          "y": "113",\r\n          "width": "284",\r\n          "height": "132"\r\n        }\r\n		},{\r\n			"id": "balloon_16",\r\n			"name": "balloon_16",\r\n			"src": "resources/images/balloons/balloon_16.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "95",\r\n          "y": "94",\r\n          "width": "205",\r\n          "height": "130"\r\n        }\r\n		},{\r\n			"id": "balloon_17",\r\n			"name": "balloon_17",\r\n			"src": "resources/images/balloons/balloon_17.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "78",\r\n          "y": "63",\r\n          "width": "254",\r\n          "height": "226"\r\n        }\r\n		},{\r\n			"id": "balloon_18",\r\n			"name": "balloon_18",\r\n			"src": "resources/images/balloons/balloon_18.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "104",\r\n          "y": "115",\r\n          "width": "190",\r\n          "height": "112"\r\n        }\r\n		},{\r\n			"id": "balloon_19",\r\n			"name": "balloon_19",\r\n			"src": "resources/images/balloons/balloon_19.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "86",\r\n          "y": "55",\r\n          "width": "230",\r\n          "height": "172"\r\n        }\r\n		},{\r\n			"id": "balloon_20",\r\n			"name": "balloon_20",\r\n			"src": "resources/images/balloons/balloon_20.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "27",\r\n          "y": "92",\r\n          "width": "342",\r\n          "height": "140"\r\n        }\r\n		},{\r\n			"id": "balloon_21",\r\n			"name": "balloon_21",\r\n			"src": "resources/images/balloons/balloon_21.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "76",\r\n          "y": "149",\r\n          "width": "242",\r\n          "height": "104"\r\n        }\r\n		},{\r\n			"id": "balloon_22",\r\n			"name": "balloon_22",\r\n			"src": "resources/images/balloons/balloon_22.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "94",\r\n          "y": "106",\r\n          "width": "216",\r\n          "height": "90"\r\n        }\r\n		},{\r\n			"id": "balloon_23",\r\n			"name": "balloon_23",\r\n			"src": "resources/images/balloons/balloon_23.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "139",\r\n          "y": "138",\r\n          "width": "158",\r\n          "height": "90"\r\n        }\r\n		},{\r\n			"id": "balloon_24",\r\n			"name": "balloon_24",\r\n			"src": "resources/images/balloons/balloon_24.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "127",\r\n          "y": "147",\r\n          "width": "138",\r\n          "height": "96"\r\n        }\r\n		},{\r\n			"id": "balloon_25",\r\n			"name": "balloon_25",\r\n			"src": "resources/images/balloons/balloon_25.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "30",\r\n          "y": "47",\r\n          "width": "340",\r\n          "height": "232"\r\n        }\r\n		},{\r\n			"id": "balloon_26",\r\n			"name": "balloon_26",\r\n			"src": "resources/images/balloons/balloon_26.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "38",\r\n          "y": "71",\r\n          "width": "326",\r\n          "height": "212"\r\n        }\r\n		},{\r\n			"id": "balloon_27",\r\n			"name": "balloon_27",\r\n			"src": "resources/images/balloons/balloon_27.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "69",\r\n          "y": "108",\r\n          "width": "248",\r\n          "height": "130"\r\n        }\r\n		},{\r\n			"id": "balloon_28",\r\n			"name": "balloon_28",\r\n			"src": "resources/images/balloons/balloon_28.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "61",\r\n          "y": "108",\r\n          "width": "288",\r\n          "height": "116"\r\n        }\r\n		},{\r\n			"id": "balloon_29",\r\n			"name": "balloon_29",\r\n			"src": "resources/images/balloons/balloon_29.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "49",\r\n          "y": "89",\r\n          "width": "300",\r\n          "height": "128"\r\n        }\r\n		},{\r\n			"id": "balloon_30",\r\n			"name": "balloon_30",\r\n			"src": "resources/images/balloons/balloon_30.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "77",\r\n          "y": "112",\r\n          "width": "245",\r\n          "height": "118"\r\n        }\r\n		},{\r\n			"id": "balloon_31",\r\n			"name": "balloon_31",\r\n			"src": "resources/images/balloons/balloon_31.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "59",\r\n          "y": "85",\r\n          "width": "288",\r\n          "height": "154"\r\n        }\r\n		},{\r\n			"id": "balloon_32",\r\n			"name": "balloon_32",\r\n			"src": "resources/images/balloons/balloon_32.png",\r\n			"width": 400,\r\n			"height": 400,\r\n			"textPos": {\r\n          "x": "59",\r\n          "y": "85",\r\n          "width": "288",\r\n          "height": "154"\r\n        }\r\n		}]\r\n	}\r\n}\r\n'}),function(){function e(e){function t(t,n,r,i,s,o){for(;s>=0&&o>s;s+=e){var u=i?i[s]:s;r=n(r,t[u],u,t)}return r}return function(n,r,i,s){r=b(r,s,4);var o=!C(n)&&y.keys(n),u=(o||n).length,a=e>0?0:u-1;return arguments.length<3&&(i=n[o?o[a]:a],a+=e),t(n,r,i,o,a,u)}}function t(e){return function(t,n,r){n=w(n,r);for(var i=N(t),s=e>0?0:i-1;s>=0&&i>s;s+=e)if(n(t[s],s,t))return s;return-1}}function n(e,t,n){return function(r,i,s){var o=0,u=N(r);if("number"==typeof s)e>0?o=s>=0?s:Math.max(s+u,o):u=s>=0?Math.min(s+1,u):s+u+1;else if(n&&s&&u)return s=n(r,i),r[s]===i?s:-1;if(i!==i)return s=t(l.call(r,o,u),y.isNaN),s>=0?s+o:-1;for(s=e>0?o:u-1;s>=0&&u>s;s+=e)if(r[s]===i)return s;return-1}}function r(e,t){var n=M.length,r=e.constructor,i=y.isFunction(r)&&r.prototype||u,s="constructor";for(y.has(e,s)&&!y.contains(t,s)&&t.push(s);n--;)s=M[n],s in e&&e[s]!==i[s]&&!y.contains(t,s)&&t.push(s)}var i=this,s=i._,o=Array.prototype,u=Object.prototype,a=Function.prototype,f=o.push,l=o.slice,c=u.toString,h=u.hasOwnProperty,p=Array.isArray,d=Object.keys,v=a.bind,m=Object.create,g=function(){},y=function(e){return e instanceof y?e:this instanceof y?void (this._wrapped=e):new y(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=y),exports._=y):i._=y,y.VERSION="1.8.3";var b=function(e,t,n){if(t===void 0)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,s){return e.call(t,n,r,i,s)}}return function(){return e.apply(t,arguments)}},w=function(e,t,n){return null==e?y.identity:y.isFunction(e)?b(e,t,n):y.isObject(e)?y.matcher(e):y.property(e)};y.iteratee=function(e,t){return w(e,t,1/0)};var E=function(e,t){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var i=1;r>i;i++)for(var s=arguments[i],o=e(s),u=o.length,a=0;u>a;a++){var f=o[a];t&&n[f]!==void 0||(n[f]=s[f])}return n}},S=function(e){if(!y.isObject(e))return{};if(m)return m(e);g.prototype=e;var t=new g;return g.prototype=null,t},x=function(e){return function(t){return null==t?void 0:t[e]}},T=Math.pow(2,53)-1,N=x("length"),C=function(e){var t=N(e);return"number"==typeof t&&t>=0&&T>=t};y.each=y.forEach=function(e,t,n){t=b(t,n);var r,i;if(C(e))for(r=0,i=e.length;i>r;r++)t(e[r],r,e);else{var s=y.keys(e);for(r=0,i=s.length;i>r;r++)t(e[s[r]],s[r],e)}return e},y.map=y.collect=function(e,t,n){t=w(t,n);for(var r=!C(e)&&y.keys(e),i=(r||e).length,s=Array(i),o=0;i>o;o++){var u=r?r[o]:o;s[o]=t(e[u],u,e)}return s},y.reduce=y.foldl=y.inject=e(1),y.reduceRight=y.foldr=e(-1),y.find=y.detect=function(e,t,n){var r;return r=C(e)?y.findIndex(e,t,n):y.findKey(e,t,n),r!==void 0&&r!==-1?e[r]:void 0},y.filter=y.select=function(e,t,n){var r=[];return t=w(t,n),y.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},y.reject=function(e,t,n){return y.filter(e,y.negate(w(t)),n)},y.every=y.all=function(e,t,n){t=w(t,n);for(var r=!C(e)&&y.keys(e),i=(r||e).length,s=0;i>s;s++){var o=r?r[s]:s;if(!t(e[o],o,e))return!1}return!0},y.some=y.any=function(e,t,n){t=w(t,n);for(var r=!C(e)&&y.keys(e),i=(r||e).length,s=0;i>s;s++){var o=r?r[s]:s;if(t(e[o],o,e))return!0}return!1},y.contains=y.includes=y.include=function(e,t,n,r){return C(e)||(e=y.values(e)),("number"!=typeof n||r)&&(n=0),y.indexOf(e,t,n)>=0},y.invoke=function(e,t){var n=l.call(arguments,2),r=y.isFunction(t);return y.map(e,function(e){var i=r?t:e[t];return null==i?i:i.apply(e,n)})},y.pluck=function(e,t){return y.map(e,y.property(t))},y.where=function(e,t){return y.filter(e,y.matcher(t))},y.findWhere=function(e,t){return y.find(e,y.matcher(t))},y.max=function(e,t,n){var r,i,s=-1/0,o=-1/0;if(null==t&&null!=e){e=C(e)?e:y.values(e);for(var u=0,a=e.length;a>u;u++)r=e[u],r>s&&(s=r)}else t=w(t,n),y.each(e,function(e,n,r){i=t(e,n,r),(i>o||i===-1/0&&s===-1/0)&&(s=e,o=i)});return s},y.min=function(e,t,n){var r,i,s=1/0,o=1/0;if(null==t&&null!=e){e=C(e)?e:y.values(e);for(var u=0,a=e.length;a>u;u++)r=e[u],s>r&&(s=r)}else t=w(t,n),y.each(e,function(e,n,r){i=t(e,n,r),(o>i||1/0===i&&1/0===s)&&(s=e,o=i)});return s},y.shuffle=function(e){for(var t,n=C(e)?e:y.values(e),r=n.length,i=Array(r),s=0;r>s;s++)t=y.random(0,s),t!==s&&(i[s]=i[t]),i[t]=n[s];return i},y.sample=function(e,t,n){return null==t||n?(C(e)||(e=y.values(e)),e[y.random(e.length-1)]):y.shuffle(e).slice(0,Math.max(0,t))},y.sortBy=function(e,t,n){return t=w(t,n),y.pluck(y.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(r>n||r===void 0)return-1}return e.index-t.index}),"value")};var k=function(e){return function(t,n,r){var i={};return n=w(n,r),y.each(t,function(r,s){var o=n(r,s,t);e(i,r,o)}),i}};y.groupBy=k(function(e,t,n){y.has(e,n)?e[n].push(t):e[n]=[t]}),y.indexBy=k(function(e,t,n){e[n]=t}),y.countBy=k(function(e,t,n){y.has(e,n)?e[n]++:e[n]=1}),y.toArray=function(e){return e?y.isArray(e)?l.call(e):C(e)?y.map(e,y.identity):y.values(e):[]},y.size=function(e){return null==e?0:C(e)?e.length:y.keys(e).length},y.partition=function(e,t,n){t=w(t,n);var r=[],i=[];return y.each(e,function(e,n,s){(t(e,n,s)?r:i).push(e)}),[r,i]},y.first=y.head=y.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:y.initial(e,e.length-t)},y.initial=function(e,t,n){return l.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},y.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:y.rest(e,Math.max(0,e.length-t))},y.rest=y.tail=y.drop=function(e,t,n){return l.call(e,null==t||n?1:t)},y.compact=function(e){return y.filter(e,y.identity)};var L=function(e,t,n,r){for(var i=[],s=0,o=r||0,u=N(e);u>o;o++){var a=e[o];if(C(a)&&(y.isArray(a)||y.isArguments(a))){t||(a=L(a,t,n));var f=0,l=a.length;for(i.length+=l;l>f;)i[s++]=a[f++]}else n||(i[s++]=a)}return i};y.flatten=function(e,t){return L(e,t,!1)},y.without=function(e){return y.difference(e,l.call(arguments,1))},y.uniq=y.unique=function(e,t,n,r){y.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=w(n,r));for(var i=[],s=[],o=0,u=N(e);u>o;o++){var a=e[o],f=n?n(a,o,e):a;t?(o&&s===f||i.push(a),s=f):n?y.contains(s,f)||(s.push(f),i.push(a)):y.contains(i,a)||i.push(a)}return i},y.union=function(){return y.uniq(L(arguments,!0,!0))},y.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=N(e);i>r;r++){var s=e[r];if(!y.contains(t,s)){for(var o=1;n>o&&y.contains(arguments[o],s);o++);o===n&&t.push(s)}}return t},y.difference=function(e){var t=L(arguments,!0,!0,1);return y.filter(e,function(e){return!y.contains(t,e)})},y.zip=function(){return y.unzip(arguments)},y.unzip=function(e){for(var t=e&&y.max(e,N).length||0,n=Array(t),r=0;t>r;r++)n[r]=y.pluck(e,r);return n},y.object=function(e,t){for(var n={},r=0,i=N(e);i>r;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},y.findIndex=t(1),y.findLastIndex=t(-1),y.sortedIndex=function(e,t,n,r){n=w(n,r,1);for(var i=n(t),s=0,o=N(e);o>s;){var u=Math.floor((s+o)/2);n(e[u])<i?s=u+1:o=u}return s},y.indexOf=n(1,y.findIndex,y.sortedIndex),y.lastIndexOf=n(-1,y.findLastIndex),y.range=function(e,t,n){null==t&&(t=e||0,e=0),n=n||1;for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),s=0;r>s;s++,e+=n)i[s]=e;return i};var A=function(e,t,n,r,i){if(r instanceof t){var s=S(e.prototype),o=e.apply(s,i);return y.isObject(o)?o:s}return e.apply(n,i)};y.bind=function(e,t){if(v&&e.bind===v)return v.apply(e,l.call(arguments,1));if(!y.isFunction(e))throw new TypeError("Bind must be called on a function");var n=l.call(arguments,2),r=function(){return A(e,r,t,this,n.concat(l.call(arguments)))};return r},y.partial=function(e){var t=l.call(arguments,1),n=function(){for(var r=0,i=t.length,s=Array(i),o=0;i>o;o++)s[o]=t[o]===y?arguments[r++]:t[o];for(;r<arguments.length;)s.push(arguments[r++]);return A(e,n,this,this,s)};return n},y.bindAll=function(e){var t,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(t=1;r>t;t++)n=arguments[t],e[n]=y.bind(e[n],e);return e},y.memoize=function(e,t){var n=function(r){var i=n.cache,s=""+(t?t.apply(this,arguments):r);return y.has(i,s)||(i[s]=e.apply(this,arguments)),i[s]};return n.cache={},n},y.delay=function(e,t){var n=l.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},y.defer=y.partial(y.delay,y,1),y.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:y.now(),o=null,s=e.apply(r,i),o||(r=i=null)};return function(){var f=y.now();u||n.leading!==!1||(u=f);var l=t-(f-u);return r=this,i=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),u=f,s=e.apply(r,i),o||(r=i=null)):o||n.trailing===!1||(o=setTimeout(a,l)),s}},y.debounce=function(e,t,n){var r,i,s,o,u,a=function(){var f=y.now()-o;t>f&&f>=0?r=setTimeout(a,t-f):(r=null,n||(u=e.apply(s,i),r||(s=i=null)))};return function(){s=this,i=arguments,o=y.now();var f=n&&!r;return r||(r=setTimeout(a,t)),f&&(u=e.apply(s,i),s=i=null),u}},y.wrap=function(e,t){return y.partial(t,e)},y.negate=function(e){return function(){return!e.apply(this,arguments)}},y.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},y.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},y.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},y.once=y.partial(y.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];y.keys=function(e){if(!y.isObject(e))return[];if(d)return d(e);var t=[];for(var n in e)y.has(e,n)&&t.push(n);return O&&r(e,t),t},y.allKeys=function(e){if(!y.isObject(e))return[];var t=[];for(var n in e)t.push(n);return O&&r(e,t),t},y.values=function(e){for(var t=y.keys(e),n=t.length,r=Array(n),i=0;n>i;i++)r[i]=e[t[i]];return r},y.mapObject=function(e,t,n){t=w(t,n);for(var r,i=y.keys(e),s=i.length,o={},u=0;s>u;u++)r=i[u],o[r]=t(e[r],r,e);return o},y.pairs=function(e){for(var t=y.keys(e),n=t.length,r=Array(n),i=0;n>i;i++)r[i]=[t[i],e[t[i]]];return r},y.invert=function(e){for(var t={},n=y.keys(e),r=0,i=n.length;i>r;r++)t[e[n[r]]]=n[r];return t},y.functions=y.methods=function(e){var t=[];for(var n in e)y.isFunction(e[n])&&t.push(n);return t.sort()},y.extend=E(y.allKeys),y.extendOwn=y.assign=E(y.keys),y.findKey=function(e,t,n){t=w(t,n);for(var r,i=y.keys(e),s=0,o=i.length;o>s;s++)if(r=i[s],t(e[r],r,e))return r},y.pick=function(e,t,n){var r,i,s={},o=e;if(null==o)return s;y.isFunction(t)?(i=y.allKeys(o),r=b(t,n)):(i=L(arguments,!1,!1,1),r=function(e,t,n){return t in n},o=Object(o));for(var u=0,a=i.length;a>u;u++){var f=i[u],l=o[f];r(l,f,o)&&(s[f]=l)}return s},y.omit=function(e,t,n){if(y.isFunction(t))t=y.negate(t);else{var r=y.map(L(arguments,!1,!1,1),String);t=function(e,t){return!y.contains(r,t)}}return y.pick(e,t,n)},y.defaults=E(y.allKeys,!0),y.create=function(e,t){var n=S(e);return t&&y.extendOwn(n,t),n},y.clone=function(e){return y.isObject(e)?y.isArray(e)?e.slice():y.extend({},e):e},y.tap=function(e,t){return t(e),e},y.isMatch=function(e,t){var n=y.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),s=0;r>s;s++){var o=n[s];if(t[o]!==i[o]||!(o in i))return!1}return!0};var _=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof y&&(e=e._wrapped),t instanceof y&&(t=t._wrapped);var i=c.call(e);if(i!==c.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var s="[object Array]"===i;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var o=e.constructor,u=t.constructor;if(o!==u&&!(y.isFunction(o)&&o instanceof o&&y.isFunction(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var a=n.length;a--;)if(n[a]===e)return r[a]===t;if(n.push(e),r.push(t),s){if(a=e.length,a!==t.length)return!1;for(;a--;)if(!_(e[a],t[a],n,r))return!1}else{var f,l=y.keys(e);if(a=l.length,y.keys(t).length!==a)return!1;for(;a--;)if(f=l[a],!y.has(t,f)||!_(e[f],t[f],n,r))return!1}return n.pop(),r.pop(),!0};y.isEqual=function(e,t){return _(e,t)},y.isEmpty=function(e){return null==e?!0:C(e)&&(y.isArray(e)||y.isString(e)||y.isArguments(e))?0===e.length:0===y.keys(e).length},y.isElement=function(e){return!!e&&1===e.nodeType},y.isArray=p||function(e){return"[object Array]"===c.call(e)},y.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},y.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){y["is"+e]=function(t){return c.call(t)==="[object "+e+"]"}}),y.isArguments(arguments)||(y.isArguments=function(e){return y.has(e,"callee")}),"function"!=typeof /./&&"object"!=typeof Int8Array&&(y.isFunction=function(e){return"function"==typeof e||!1}),y.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},y.isNaN=function(e){return y.isNumber(e)&&e!==+e},y.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===c.call(e)},y.isNull=function(e){return null===e},y.isUndefined=function(e){return e===void 0},y.has=function(e,t){return null!=e&&h.call(e,t)},y.noConflict=function(){return i._=s,this},y.identity=function(e){return e},y.constant=function(e){return function(){return e}},y.noop=function(){},y.property=x,y.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},y.matcher=y.matches=function(e){return e=y.extendOwn({},e),function(t){return y.isMatch(t,e)}},y.times=function(e,t,n){var r=Array(Math.max(0,e));t=b(t,n,1);for(var i=0;e>i;i++)r[i]=t(i);return r},y.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},y.now=Date.now||function(){return(new Date).getTime()};var D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},P=y.invert(D),H=function(e){var t=function(t){return e[t]},n="(?:"+y.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};y.escape=H(D),y.unescape=H(P),y.result=function(e,t,n){var r=null==e?void 0:e[t];return r===void 0&&(r=n),y.isFunction(r)?r.call(e):r};var B=0;y.uniqueId=function(e){var t=++B+"";return e?e+t:t},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var j=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},I=/\\|'|\r|\n|\u2028|\u2029/g,q=function(e){return"\\"+F[e]};y.template=function(e,t,n){!t&&n&&(t=n),t=y.defaults({},t,y.templateSettings);var r=RegExp([(t.escape||j).source,(t.interpolate||j).source,(t.evaluate||j).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){return s+=e.slice(i,u).replace(I,q),i=u+t.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(t.variable||"obj","_",s)}catch(u){throw u.source=s,u}var a=function(e){return o.call(this,e,y)},f=t.variable||"obj";return a.source="function("+f+"){\n"+s+"}",a},y.chain=function(e){var t=y(e);return t._chain=!0,t};var R=function(e,t){return e._chain?y(t).chain():t};y.mixin=function(e){y.each(y.functions(e),function(t){var n=y[t]=e[t];y.prototype[t]=function(){var e=[this._wrapped];return f.apply(e,arguments),R(this,n.apply(y,e))}})},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];y.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],R(this,n)}}),y.each(["concat","join","slice"],function(e){var t=o[e];y.prototype[e]=function(){return R(this,t.apply(this._wrapped,arguments))}}),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return y})}.call(this),define("app/lib/cache",["underscore"],function(e){var t=function(){this.init()};return t.prototype={init:function(){this.__data__={}},clear:function(){this.init()},get:function(e,t){if(this.__data__[e])return this.__data__[e][t]},set:function(t,n,r){if(t&&n&&r){this.__data__[t]=this.__data__[t]||{};var i={};i[n]=r,e.extend(this.__data__[t],i)}}},new t}),define("app/lib/promise",[],function(){function e(){}function t(e){setTimeout(e,0)}function i(e){try{return e.then}catch(t){return n=t,r}}function s(e,t){try{return e(t)}catch(i){return n=i,r}}function o(e,t,i){try{e(t,i)}catch(s){return n=s,r}}function u(t){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");if(typeof t!="function")throw new TypeError("not a function");this._deferredState=0,this._state=0,this._value=null,this._deferreds=null;if(t===e)return;v(t,this)}function a(t,n,r){return new t.constructor(function(i,s){var o=new u(e);o.then(i,s),f(t,new d(n,r,o))})}function f(e,t){while(e._state===3)e=e._value;u._onHandle&&u._onHandle(e);if(e._state===0){if(e._deferredState===0){e._deferredState=1,e._deferreds=t;return}if(e._deferredState===1){e._deferredState=2,e._deferreds=[e._deferreds,t];return}e._deferreds.push(t);return}l(e,t)}function l(e,i){t(function(){var t=e._state===1?i.onFulfilled:i.onRejected;if(t===null){e._state===1?c(i.promise,e._value):h(i.promise,e._value);return}var o=s(t,e._value);o===r?h(i.promise,n):c(i.promise,o)})}function c(e,t){if(t===e)return h(e,new TypeError("A promise cannot be resolved with itself."));if(t&&(typeof t=="object"||typeof t=="function")){var s=i(t);if(s===r)return h(e,n);if(s===e.then&&t instanceof u){e._state=3,e._value=t,p(e);return}if(typeof s=="function"){v(s.bind(t),e);return}}e._state=1,e._value=t,p(e)}function h(e,t){e._state=2,e._value=t,u._onReject&&u._onReject(e,t),p(e)}function p(e){e._deferredState===1&&(f(e,e._deferreds),e._deferreds=null);if(e._deferredState===2){for(var t=0;t<e._deferreds.length;t++)f(e,e._deferreds[t]);e._deferreds=null}}function d(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function v(e,t){var i=!1,s=o(e,function(e){if(i)return;i=!0,c(t,e)},function(e){if(i)return;i=!0,h(t,e)});!i&&s===r&&(i=!0,h(t,n))}var n=null,r={};return u._onHandle=null,u._onReject=null,u._noop=e,u.prototype.then=function(t,n){if(this.constructor!==u)return a(this,t,n);var r=new u(e);return f(this,new d(t,n,r)),r},u.all=function(e){var t=Array.prototype.slice.call(e);return new u(function(e,n){function i(s,o){if(o&&(typeof o=="object"||typeof o=="function")){var a=o.then;if(typeof a=="function"){var f=new u(a.bind(o));f.then(function(e){i(s,e)},n);return}}t[s]=o,--r===0&&e(t)}if(t.length===0)return e([]);var r=t.length;for(var s=0;s<t.length;s++)i(s,t[s])})},u.resolve=function(e){return new u(function(t){t(e)})},u.race=function(e){return new u(function(t,n){e.forEach(function(e){u.resolve(e).then(t,n)})})},u.prototype["catch"]=function(e){return this.then(null,e)},u.prototype.done=function(e,t){var n=arguments.length?this.then.apply(this,arguments):this;n.then(null,function(e){setTimeout(function(){throw e},0)})},u}),define("app/lib/lang",["jquery","underscore","app/lib/cache","app/lib/promise"],function(e,t,n,r){var i="cps-lang",s="cps-lang-org",o="cps-lang-type",u="data-",a=function(){};return a.prototype={__language_data__:{},defaultLang:"ko",currentLang:"ko",load:function(e){},reset:function(e){var t=this;e=e||this.currentLang,t.init({langCode:e}).then(function(){t.apply()})},apply:function(n){n=n||"";var r=this,a=function(n){return function(){e(n+" ["+u+i+"]").css("visibility","hidden"),e(n+" ["+u+i+"]").each(function(n,u){var a=e(this);if(!a.data(s)){var f=a.text();u.nodeName=="INPUT"&&u.type=="button"&&(f=a.attr("value")),a.data(s,f)}var l=a.data(i),c=r.get(l);typeof c!="string"&&(c=""),c=c||a.data(s);var h=a.data(o)||"text",p=h.split(",");c&&t.each(p,function(e){typeof r.applyTypeDefinitions[e]=="function"&&r.applyTypeDefinitions[e](a,c)})}),e(n+" ["+u+i+"]").css("visibility","visible")}}(n);setTimeout(function(){a()},0)},applyTypeDefinitions:{text:function(e,t){return e.text(t)},title:function(e,t){return e.attr("title",t)},alt:function(e,t){return e.attr("alt",t)}},init:function(t,n){e("style[data-cps-style-lang]").remove();var s=e('<style type="text/css" data-cps-style-lang="true"></style>');e("head").append(s),t=t||{};var o=t.langCode||this.defaultLang;this.currentLang=o;var u=this;e(" [data-"+i+"]").css("visibility","hidden");if(!u.__language_data__[o]){var a=NHIE.lib.requirePromise(["resources/lang/lang-"+o+".js"]);return a.then(function(){return NHIE.lib.requirePromise(["text!resources/lang/css/style-"+o+".css"])}).then(function(e){var t=e[0];s.get(0).textContent=t}),a}return r.resolve(!0)},get:function(e){if(!e)return;var t=this.currentLang||this.defaultLang,r=e.split("|")[0],i=this.__language_data__[t];if(i){if(!n.get("lang_"+t,r)){var s=i,o=r.split(".");for(var u=0,a=o.length;u<a;u++){if(!s[o[u]])return null;s=s[o[u]]}if(!s)return null;n.set("lang_"+t,r,s)}return n.get("lang_"+t,r)}},setData:function(e,n){this.__language_data__[e]=this.__language_data__[e]||{},t.extend(this.__language_data__[e],n)}},new a}),define("app/lib",["jquery","underscore","app/lib/cache","app/lib/lang","app/lib/promise","text!app/app.config.json"],function(e,t,n,r,i,s){var o=function(e){return n.get("template",e)||n.set("template",e,t.template(e)),n.get("template",e)},u=function(e,t){return typeof t.lang=="undefined"&&(t.NHIE_Lang=NHIE.Lang),o(e)(t)},a=function(e){var n=new i(function(n,r){try{require(e,function(){var e=[];t.each(arguments,function(t){e.push(t)}),n(e)})}catch(i){r(i)}});return n},f="canvas_cache",l={parseRequest:function(){var e,t=/\+/g,n=/([^&=]+)=?([^&]*)/g,r=function(e){return decodeURIComponent(e.replace(t," "))},i=window.location.search.substring(1);urlParams={};while(e=n.exec(i))urlParams[r(e[1])]=r(e[2]);return urlParams},getImage:function(t){var n=new i(function(n,r){var i=e('<img style="width:30px;height:30px; crossorigin="anonymous"/>');i.on("load",function(){n(i.get(0))}).on("error",function(e){NHIE.app.loading(!1),console.error(e),r(e)}),i.attr("src",t)});return n},canvasCache:{set:function(t){var r=t.id,i=NHIE.workspace.getLayerById(r),s=0,o="";if(i.empty)o="_CACHE::empty_canvas";else do o="_CACHE::"+r+"$"+s++;while(n.get(f,o));var u=t.getContext("2d");n.set(f,o,{width:t.width,height:t.height,data:u.getImageData(0,0,t.width,t.height)}),e(t).attr("data-canvascache-id",o)},get:function(e){return n.get(f,e)}},canvasManager:{resetImageData:function(t){var n=e(t),r=n.attr("data-canvascache-id");if(r&&l.canvasCache.get(r)){var i=l.canvasCache.get(r),s=e("<canvas></canvas>"),o=s.get(0);o.width=i.width,o.height=i.height;var u=o.getContext("2d");u.putImageData(i.data,0,0);var a=NHIE.lib.util.canvasManager.getCanvasModifyData(t),f={x:a.flip.h?-1:1,y:a.flip.v?-1:1},c={width:i.width,height:i.height};a.rotate%180&&(c={width:i.height,height:i.width}),t.height=c.height,t.width=c.width;var h=t.getContext("2d");h.save(),h.scale(f.x,f.y),h.translate(t.width/2*f.x,t.height/2*f.y),h.rotate(a.rotate/180*Math.PI*f.x*f.y),h.drawImage(o,o.width/-2*f.x,o.height/-2*f.y,o.width*f.x,o.height*f.y),h.restore(),s.remove()}},getCanvasModifyData:function(t){var n=e(t),r=e(t).parent();return{rotate:parseInt(r.attr("data-modify-rotate")||"0"),flip:JSON.parse(r.attr("data-modify-flip")||'{"h":false,"v":false}')}},cropCanvas:function(e){var t=e.getContext("2d"),n=e.width,r=e.height,i={x:[],y:[]},s=t.getImageData(0,0,e.width,e.height),o,u,a;console.log(n,r);if(!n||!r)return{};var f=[],l=[];for(u=0;u<r;u++)for(o=0;o<n;o++)a=(u*n+o)*4,s.data[a+3]>0&&(f.push(o),l.push(u));f.sort(function(e,t){return e-t}),l.sort(function(e,t){return e-t});var c=f.length-1;n=f[c]-f[0],r=l[c]-l[0];var h={x:f[0]-1,y:l[0]-1,w:n+2,h:r+2};if(isNaN(h.w)||isNaN(h.h)||isNaN(h.x)||isNaN(h.y))return{};var p=t.getImageData(h.x,h.y,h.w,h.h);return e.width=h.w,e.height=h.h,t.putImageData(p,0,0),h}},getConfig:function(e){e=e||"";var t={};if(typeof NHIE!="undefined")t=NHIE.config;else try{t=JSON.parse(s)}catch(n){}var r=e.split("."),i=null;if(r&&r.length){try{i=t;for(var o=0,u=r.length;o<u;o++){if(typeof i[r[o]]=="undefined")return null;i=i[r[o]]}}catch(n){}if(typeof i!="undefined")return i}},rotatePoint:function(e,t,n,r,i){var s=function(e){return e/180*Math.PI};return r=r||0,i=i||0,{x:r+(t-r)*Math.cos(s(e))-(n-i)*Math.sin(s(e)),y:i+(n-i)*Math.cos(s(e))+(t-r)*Math.sin(s(e))}},getEventTargetLayer:function(t){var n=e(t.target),r=null,i=null;if(n.hasClass("tracker-handle")){var s=n.parent();i=s.attr("data-target-layer-id")}else n.hasClass("layer-resizer")?i=n.attr("data-target-layer-id"):n.hasClass("layer-canvas")?i=n.attr("id"):n.hasClass("layer")&&(i=n.find("canvas").attr("id"));return NHIE.workspace.getLayerById(i)},spinner:function(t,n,r){if(n!==!1){r=r||{},r.color=r.color||"#000",r.size=r.size||"small";if(!t.find(".ui-panel-mask").length){var i=e('<div class="ui-spinner-mask"></div>'),s=e('<div class="spinner spinner-'+r.size+'"></div>');for(var o=0;o<12;o++){var u=e('<div class="spinner-stick spinner-stick-'+o+'"></div>');u.css({transform:"rotate("+30*o+"deg)",animationDelay:-1.2+.1*o+"s",backgroundColor:r.color}),s.append(u)}s.css({width:40,height:40,marginLeft:-20,marginTop:-20}),i.append(s),t.append(i)}}else t.find(".ui-spinner-mask").remove()}},c=function(){var e=navigator.userAgent.toLowerCase(),t=new RegExp("trident/.*rv:([0-9]{1,}[.0-9]{0,})");if(t.exec(e)!=null)var n=parseFloat(RegExp.$1);return{IsIE:!1,IsIE6:!1,IsIE7:!1,IsIE8:!1,IsIE9:!1,IsIE10:!1,IsIE11:!e.match(/msie (\d+)/)&&e.indexOf("trident")>0&&parseInt(e.match(/trident\/(\d+)/)[1],10)>=7||n==11,IsGecko:/gecko\//.test(e),IsOpera:!!window.opera,IsSafari:/applewebkit\//.test(e)&&!/chrome\//.test(e),IsChrome:/applewebkit\//.test(e)&&/chrome\//.test(e),IsEdge:/applewebkit\//.test(e)&&/chrome\//.test(e)&&/edge\//.test(e),IsMac:/macintosh/.test(e),IsIOS5:/(ipad|iphone)/.test(e)&&e.match(/applewebkit\/(\d*)/)[1]>=534&&e.match(/applewebkit\/(\d*)/)[1]<536,IsIOS6:/(ipad|iphone)/.test(e)&&e.match(/applewebkit\/(\d*)/)[1]>=536}}(),h=function(){var e=navigator.userAgent.toLowerCase(),t="",n=function(e){return e.replace(/(^\s*)|(\s*$)/g,"")};return c.IsIE?(t=parseInt(e.match(/msie (\d+)/)[1],10),t>=9&&parent.document.compatMode!="CSS1Compat"&&(t=8)):c.IsGecko?t=e.substring(e.indexOf("firefox/")+8):c.IsOpera?e.indexOf("version/")!=-1?t=n(e.substring(e.indexOf("version/")+8)):t=n(e.substring(0,e.indexOf("(")).replace("opera/","")):c.IsIOS5?t=e.match(/applewebkit\/(\d*)/)[1]:c.IsSafari?t=e.match(/version\/([\d|.]*)/i)[1]:c.IsChrome&&(t=parseInt(e.substring(e.indexOf("safari/")+7))),String(t)}(),p=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("linux")!=-1?"Linux":c.IsIOS5?"IOS5":e.indexOf("macintosh")!=-1?"Macintosh":e.indexOf("nt 6.0")!=-1?"Windows Vista/Server 2008":e.indexOf("nt 5.2")!=-1?"Windows Server 2003":e.indexOf("nt 5.1")!=-1?"Windows XP":e.indexOf("nt 5.0")!=-1?"Windows 2000":e.indexOf("nt")!=-1?"Windows NT":e.indexOf("9x 4.90")!=-1?"Windows Me":e.indexOf("98")!=-1?"Windows 98":e.indexOf("95")!=-1?"Windows 95":e.indexOf("win16")!=-1?"Windows 3.x":e.indexOf("windows")!=-1?"Windows":""}(),d={ERR_NO_IMAGE:"ERR_NO_IMAGE",ERR_FILE_SIZE_LIMIT:"ERR_FILE_SIZE_LIMIT",ERR_NO_FILE_SELECTED:"ERR_NO_FILE_SELECTED"};return{err:d,useragent:{info:c,version:h,os:p},cache:n,requirePromise:a,lang:r,tmpl:u,Promise:i,util:l}}),define("app/classes/Base",["underscore"],function(_){var initializing=!1,fnTest=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,Class=function(){},__classes__={hash:{},parentmap:{}};Class.extend=function(prop,to){if(!to){prop.classname||(prop.classname="Class");var _super=this.prototype;initializing=!0;var prototype=new this;initializing=!1;for(var name in prop)prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])?function(e,t){return function(){var n=this._super;this._super=_super[e];var r=t.apply(this,arguments);return this._super=n,r}}(name,prop[name]):prop[name];var str="function {{Class}}() {if(!initializing && this.construct )this.construct.apply(this, arguments);}{{Class}}.prototype = prototype;{{Class}}.prototype.constructor = {{Class}};{{Class}}.extend = arguments.callee;var tmp = {{Class}};";return str=str.replace(/{{Class}}/g,prop.classname),eval(str),__classes__.hash[prop.classname]=tmp.prototype,__classes__.parentmap[prop.classname]=this.prototype,tmp}var from=prop,result=from.extend(to);return to.classname&&(__classes__.hash[to.classname]=result.prototype,__classes__.parentmap[to.classname]=from.prototype),result};var ClassManager=Class.extend({__classes_hash:__classes__.hash,__classes_parentmap:__classes__.parentmap,getClass:function(e){return this.__classes_hash[e]},getSuperclass:function(e){if(this.getClass(e))return this.__classes_parentmap[e]}});Class.classManager=new ClassManager,Class.define=function(e,t){t.classname=e;var n=this.classManager.getClass(t.extend);return delete t.extend,n.extend(t)};var level=0,indent=function(){var e="";for(var t=0;t<level;t++)e+="   ";return e+level},extend_deeper=function obj_extender(e,t){return t&&_.each(t,function(t,n){if(typeof e[n]!="undefined")if(typeof e[n]!="object")e[n]=t;else{var r={};obj_extender(r,e[n]),typeof t=="object"?r=obj_extender(r,t):r=t,e[n]=r}else e[n]=t}),e};_.extend_deeper=extend_deeper;var cls_uid=0,Base=Class.extend({classname:"Base",construct:function(e){this.initConfig={},_.extend(this,e),_.extend_deeper(this.initConfig,e),this.id=e.id||this.classname+"_"+cls_uid++},getConfig:function(){return this.initConfig},superclass:function(){return Class.classManager.getSuperclass(this.classname)},getAllProps:function(e){var t=this,n=[];while(t&&t.classname)n.push(t),t=t.superclass();n.reverse();var r={};_.each(n,function(t){r=_.extend_deeper(r,t[e])});if(!_.isEmpty(r))return r},init:function(){},destroy:function(){console.log("destroy!!!!!",this)}});return Base.classes=Class.classManager,Base}),define("app/classes/Observable",["underscore","app/classes/Base"],function(e,t){var n=t.extend({classname:"Observable",construct:function(e){this._super(e),this._events={},this._suspendedEvents={},this.init()},init:function(e){this.initEvents()},addEventListener:function(e,t,n){var r=this;r._events[e]||(r._events[e]=[]),r._events[e].push({scope:n,handler:t})},on:function(e,t,n){this.addEventListener(e,t,n)},fireEvent:function(e){var t=this,n;if(t._events[e]&&t._events[e].length>0)for(var r=0;r<t._events[e].length;r++){var i=t._events[e][r],s=!1;t._suspendedEvents[e]||(s=!0);if(s&&typeof i.handler=="function"){var o=[];for(var r=0;r<arguments.length;r++)o.push(arguments[r]);o.shift(),n=i.handler.apply(i.scope||this,o)}}return n},suspendEvent:function(e){var t=this;t.classname==AppConstants.classname.Application?t._suspendedEvents[e]=!0:(t._suspendedEvents[e]=!0,t.events&&(t.events._suspended||(t.events._suspended={}),t.events._suspended[e]=!0))},resumeEvent:function(e){var t=this;t.classname==AppConstants.classname.Application?(t._suspendedEvents[e]=null,delete t._suspendedEvents[e]):(t._suspendedEvents[e]=null,t.events&&(t.events._suspended||(t.events._suspended={}),t.events._suspended[e]=null,delete t.events._suspended[e]))},getTarget:function(){return this.dom||null},initEvents:function(){var e=this,t=this.getAllProps("events");e.events=t,e.events&&$.each(e.events,function(t,n){e.addEventListener(t,n,e)})}});return n}),define("app/classes/ui/UIElement",["jquery","underscore","app/lib/promise","app/classes/Observable"],function(e,t,n,r){var i=0,s=r.extend({classname:"UIElement",defaultConfig:{renderTo:"body",template:{cls:"ui-element",tpl:""}},events:{render:function(){}},construct:function(n){n=n||{},n.renderTo=n.renderTo||this.renderTo||this.defaultConfig.renderTo;var r=JSON.parse(JSON.stringify(this.getAllProps("defaultConfig")||{}));n=t.extend_deeper(r,n);var s=this.template||{};s=t.extend_deeper(r.template,s),s=t.extend_deeper(s,n.template),n.template=s;var o="ui-elements-";if(!n.id&&!this.id){var u=0;u=i++;while(document.getElementById(o+ ++u));n.id=o+ ++u}this.rendered=!1;var a=!!n.clearWrapper;a&&e(n.renderTo).html(""),this._super(n),this.fireEvent("construct",this)},init:function(e){this._super(e);var t=document.getElementById(this.id);t?(this.dom=t,this.rendered=!0):(this.rendered=!1,this.container&&this.render())},getDom:function(){return this.dom},getBody:function(){var t=e(this.dom),n=e(this.dom).find(">."+this.template.bodyCls);return n.length==1?n.get(0):t.get(0)},setContent:function(t){var n=this.initConfig,r=n.renderTo;typeof r=="string"?r=e(r):r instanceof s&&(r=e(renderTarget.getBody()));if(r.length){var i=t;typeof i=="string"&&(i=e(t).get(0)),i.id=this.id,r.get(0).appendChild(i),this.dom=i}},getTemplateConfig:function(){return this.initConfig.template},render:function(t){return t=t||this.initConfig,this.rendered&&this.dom?(this.fireEvent("render",e(this.com)),n.resolve(e(this.com))):(this.dom||(this.rendered=!1),new n(function(n,r){if(!this.rendered){this.setContent(t.template.tpl),this.rendered=!0;var i=e(this.dom);this.fireEvent("render",i),n(i)}else this.fireEvent("render",i)}.bind(this)))},setApplication:function(e){this._app=e},getApplication:function(){return this._app},destroy:function(){e(this.dom).remove(),this.dom=null}});return s}),define("app/classes/ui/Dialog",["jquery","underscore","app/classes/ui/UIElement"],function(e,t,n){var r=n.extend({classname:"Dialog",renderTo:".nhie-body",template:{tpl:'<div class="dialog"></div>'},events:{render:function(n){console.log(this);var r=this,i=e(r.dom),s=r.contentData||{};r.content=NHIE.tmpl(r.content,s),r.type=r.type||"alert",r.type==="alert"?(r.buttons={},r.buttons[NHIE.Lang.PluginImageEditor_button_confirm]=function(){e(this).dialog("close")}):r.button_config&&r.button_config.length&&(r.buttons={},t.each(r.button_config,function(e){r.buttons[e.name]=e.action}));var o={title:r.title,draggable:!1,width:r.width||300,modal:!!r.modal,resizable:!!r.resizable,buttons:r.buttons||{}};r.destroyWhenClose?o.close=function(){e(this).dialog("close").remove(),typeof r.onClose=="function"&&r.onClose.apply(this)}:typeof r.onClose=="function"&&(o.close=r.onClose),i.html(r.content),i.dialog(o),r.onRenderDialog(i)}},construct:function(e){this._super(e);var t=this},show:function(e){return this.render()},hide:function(){},onRenderDialog:function(e){}});return r}),define("app/external_adapter",["jquery","underscore","app/lib","app/classes/ui/Dialog"],function(e,t,n,r){var i=n.Promise,s="kr";try{opener.NamoSELang.LangCode=="ko"?s="kr":s=opener.NamoSELang.LangCode||"kr"}catch(o){}var u=function(){var e={};try{e=opener.ce_ImageEditorPlugin}catch(t){console.error("error : opener is missing",t)}return e};return{localeCode:s,localeResource:{url:"../../../../js/lang/"+s,shim:"NamoSELang"},getInitialData:function(){var e=u().getInitialData();this._initialData=e;var t={};return t.checkImageTitle=e.checkImageTitle,e.editImageURL?(t.src=e.editImageURL,t.width=e.editImageWidth,t.height=e.editImageHeight,t.src.indexOf("data:image/")===0?t.type="datasrc":t.type="url",t.title=e.imageTitle):t.type="none",t},upload:function(e){var t;return e=e||{},e.type=(e.type||"").toLowerCase(),e.type==="form"?i.resolve(u().upload(e.data)).then(function(e){console.log(e);var t={};try{var r=JSON.parse(e);console.log(r);if(r.result==="success"){var i=r.addmsg[0],s=i.imageURL;s?(t.success=!0,t.src=s,t.width=i.imageOrgWidth,t.height=i.imageOrgHeight):(t.success=!1,t.message=n.err.ERR_NO_IMAGE)}else{t.success=!1;switch(t.result){case"invalid_size":t.message=n.err.ERR_FILE_SIZE_LIMIT;break;case"":t.message=""}}}catch(o){console.error(o),t.message=n.err.ERR_NO_IMAGE}return t}):i.resolve()},onApply:function(){var t=NHIE.workspace.getSize(),i=NHIE.adapter.getInitialData(),s=i.type==="none"?"TEXT":"ITEM",o="";n.Promise.resolve().then(function(){var t=n.Promise.resolve(i.title);if(i.checkImageTitle==="true"&&!i.title){var s="<p>"+NHIE.Lang.PluginImageEditor_msg_accessibility+"</p>"+'<div><input type="text" style="width:100%;"/></div>';t=new n.Promise(function(t,n){var i=new r({title:"Image Editor",type:"dialog",width:400,content:s,modal:!0,button_config:[{name:NHIE.Lang.PluginImageEditor_button_confirm,action:function(){var n=e(this),r=n.find("input"),i=r.val();i&&(t(i),e(this).dialog("close"))}}],onRenderDialog:function(e){var t=e.parent().find("button"),n=e.find("input");t.addClass("ui-state-disabled").attr("disabled","disabled"),n.off("keydown").on("keydown",function(){var e=(n.val()||"").trim();e?t.removeClass("ui-state-disabled").removeAttr("disabled"):t.addClass("ui-state-disabled").attr("disabled","disabled")}),n.focus()}});NHIE.app.loading(!1),i.show()})}return t}).then(function(e){return NHIE.app.__imageTitle=e||i.title,NHIE.app.loading(!0),NHIE.workspace.mergeLayers()}).then(function(e){function r(e){var t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]),i=r.length,s=new Uint8Array(i);while(i--)s[i]=r.charCodeAt(i);return new Blob([s],{type:n})}var t=e.toDataURL(),i=function(e){var t;e.split(",")[0].indexOf("base64")>=0?t=atob(e.split(",")[1]):t=unescape(e.split(",")[1]);var n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length);for(var i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return new Blob([r],{type:n})},o=null;n.useragent.info.IsIE10||n.useragent.info.IsIE11||n.useragent.info.IsEdge?o=t:o=t;var a=o;return console.log(a),NHIE.adapter.upload({type:"form",data:a}).then(function(t){console.log(t);if(t.success){var n=t.src;u().execute({src:n,alt:NHIE.app.__imageTitle,width:e.width,height:e.height,mode:s})}window.close()}).catch(function(e){console.error(e)})}).catch(function(e){console.error(e)}).then(function(){NHIE.app.loading(!1)})},onCancel:function(){console.log("close NHIE window");try{u().unmaskParent(),u().cancel()}catch(e){}},onUnload:function(){u().unmaskParent()}}}),define("app/launcher",["text!app/app.config.json","app/external_adapter"],function(config,adapter){config=config||"{}";try{config=JSON.parse(config)}catch(e){config={}}window.NHIE={adapter:adapter,config:config};var launchNHIE=function(){require(["text!../NHIE.config.json","app/nhie"],function(e,t){e=e||"{}";try{e=JSON.parse(e)}catch(n){e={}}config=_.extend(config,e),t.init(config),t.launch()})};adapter.localeResource&&adapter.localeResource.url?require([adapter.localeResource.url],function(langResource){adapter.localeResource.shim&&(langResource=eval(adapter.localeResource.shim+";")),NHIE.Lang=langResource,launchNHIE()}):(NHIE.Lang={},launchNHIE())});