\r\n\t\t*/\r\n\t\tfunction _rotateToOrientaion(width, height, orientation) {\r\n\t\t\tswitch (orientation) {\r\n\t\t\t\tcase 5:\r\n\t\t\t\tcase 6:\r\n\t\t\t\tcase 7:\r\n\t\t\t\tcase 8:\r\n\t\t\t\t\t_canvas.width = height;\r\n\t\t\t\t\t_canvas.height = width;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t_canvas.width = width;\r\n\t\t\t\t\t_canvas.height = height;\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.\r\n\t\t\t2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.\r\n\t\t\t3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.\r\n\t\t\t4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.\r\n\t\t\t5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.\r\n\t\t\t6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.\r\n\t\t\t7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.\r\n\t\t\t8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.\r\n\t\t\t*/\r\n\r\n\t\t\tvar ctx = _canvas.getContext('2d');\r\n\t\t\tswitch (orientation) {\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\t// horizontal flip\r\n\t\t\t\t\tctx.translate(width, 0);\r\n\t\t\t\t\tctx.scale(-1, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\t// 180 rotate left\r\n\t\t\t\t\tctx.translate(width, height);\r\n\t\t\t\t\tctx.rotate(Math.PI);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\t// vertical flip\r\n\t\t\t\t\tctx.translate(0, height);\r\n\t\t\t\t\tctx.scale(1, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\t// vertical flip + 90 rotate right\r\n\t\t\t\t\tctx.rotate(0.5 * Math.PI);\r\n\t\t\t\t\tctx.scale(1, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t// 90 rotate right\r\n\t\t\t\t\tctx.rotate(0.5 * Math.PI);\r\n\t\t\t\t\tctx.translate(0, -height);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\t// horizontal flip + 90 rotate right\r\n\t\t\t\t\tctx.rotate(0.5 * Math.PI);\r\n\t\t\t\t\tctx.translate(width, -height);\r\n\t\t\t\t\tctx.scale(-1, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 8:\r\n\t\t\t\t\t// 90 rotate left\r\n\t\t\t\t\tctx.rotate(-0.5 * Math.PI);\r\n\t\t\t\t\tctx.translate(-width, 0);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfunction _purge() {\r\n\t\t\tif (_imgInfo) {\r\n\t\t\t\t_imgInfo.purge();\r\n\t\t\t\t_imgInfo = null;\r\n\t\t\t}\r\n\t\t\t_binStr = _img = _canvas = _blob = null;\r\n\t\t\t_modified = false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn (extensions.Image = HTML5Image);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/Runtime.js\r\n\r\n/**\r\n * Runtime.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/*global ActiveXObject:true */\r\n\r\n/**\r\nDefines constructor for Flash runtime.\r\n\r\n@class moxie/runtime/flash/Runtime\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/Runtime\", [\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/core/utils/Env\",\r\n\t\"moxie/core/utils/Dom\",\r\n\t\"moxie/core/Exceptions\",\r\n\t\"moxie/runtime/Runtime\"\r\n], function(Basic, Env, Dom, x, Runtime) {\r\n\t\r\n\tvar type = 'flash', extensions = {};\r\n\r\n\t/**\r\n\tGet the version of the Flash Player\r\n\r\n\t@method getShimVersion\r\n\t@private\r\n\t@return {Number} Flash Player version\r\n\t*/\r\n\tfunction getShimVersion() {\r\n\t\tvar version;\r\n\r\n\t\ttry {\r\n\t\t\tversion = navigator.plugins['Shockwave Flash'];\r\n\t\t\tversion = version.description;\r\n\t\t} catch (e1) {\r\n\t\t\ttry {\r\n\t\t\t\tversion = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');\r\n\t\t\t} catch (e2) {\r\n\t\t\t\tversion = '0.0';\r\n\t\t\t}\r\n\t\t}\r\n\t\tversion = version.match(/\\d+/g);\r\n\t\treturn parseFloat(version[0] + '.' + version[1]);\r\n\t}\r\n\r\n\t/**\r\n\tConstructor for the Flash Runtime\r\n\r\n\t@class FlashRuntime\r\n\t@extends Runtime\r\n\t*/\r\n\tfunction FlashRuntime(options) {\r\n\t\tvar I = this, initTimer;\r\n\r\n\t\toptions = Basic.extend({ swf_url: Env.swf_url }, options);\r\n\r\n\t\tRuntime.call(this, options, type, {\r\n\t\t\taccess_binary: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\taccess_image_binary: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\tdisplay_media: Runtime.capTrue,\r\n\t\t\tdo_cors: Runtime.capTrue,\r\n\t\t\tdrag_and_drop: false,\r\n\t\t\treport_upload_progress: function() {\r\n\t\t\t\treturn I.mode === 'client';\r\n\t\t\t},\r\n\t\t\tresize_image: Runtime.capTrue,\r\n\t\t\treturn_response_headers: false,\r\n\t\t\treturn_response_type: function(responseType) {\r\n\t\t\t\tif (responseType === 'json' && !!window.JSON) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} \r\n\t\t\t\treturn !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\treturn_status_code: function(code) {\r\n\t\t\t\treturn I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]);\r\n\t\t\t},\r\n\t\t\tselect_file: Runtime.capTrue,\r\n\t\t\tselect_multiple: Runtime.capTrue,\r\n\t\t\tsend_binary_string: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\tsend_browser_cookies: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\tsend_custom_headers: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\tsend_multipart: Runtime.capTrue,\r\n\t\t\tslice_blob: Runtime.capTrue,\r\n\t\t\tstream_upload: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\tsummon_file_dialog: false,\r\n\t\t\tupload_filesize: function(size) {\r\n\t\t\t\treturn Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client';\r\n\t\t\t},\r\n\t\t\tuse_http_method: function(methods) {\r\n\t\t\t\treturn !Basic.arrayDiff(methods, ['GET', 'POST']);\r\n\t\t\t}\r\n\t\t}, { \r\n\t\t\t// capabilities that require specific mode\r\n\t\t\taccess_binary: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\taccess_image_binary: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\treport_upload_progress: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\treturn_response_type: function(responseType) {\r\n\t\t\t\treturn Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser'];\r\n\t\t\t},\r\n\t\t\treturn_status_code: function(code) {\r\n\t\t\t\treturn Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser'];\r\n\t\t\t},\r\n\t\t\tsend_binary_string: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\tsend_browser_cookies: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\tsend_custom_headers: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\tstream_upload: function(value) {\r\n\t\t\t\treturn value ? 'client' : 'browser';\r\n\t\t\t},\r\n\t\t\tupload_filesize: function(size) {\r\n\t\t\t\treturn Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser';\r\n\t\t\t}\r\n\t\t}, 'client');\r\n\r\n\r\n\t\t// minimal requirement for Flash Player version\r\n\t\tif (getShimVersion() < 10) {\r\n\t\t\tthis.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before\r\n\t\t}\r\n\r\n\r\n\t\tBasic.extend(this, {\r\n\r\n\t\t\tgetShim: function() {\r\n\t\t\t\treturn Dom.get(this.uid);\r\n\t\t\t},\r\n\r\n\t\t\tshimExec: function(component, action) {\r\n\t\t\t\tvar args = [].slice.call(arguments, 2);\r\n\t\t\t\treturn I.getShim().exec(this.uid, component, action, args);\r\n\t\t\t},\r\n\r\n\t\t\tinit: function() {\r\n\t\t\t\tvar html, el, container;\r\n\r\n\t\t\t\tcontainer = this.getShimContainer();\r\n\r\n\t\t\t\t// if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc)\r\n\t\t\t\tBasic.extend(container.style, {\r\n\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\ttop: '-8px',\r\n\t\t\t\t\tleft: '-8px',\r\n\t\t\t\t\twidth: '9px',\r\n\t\t\t\t\theight: '9px',\r\n\t\t\t\t\toverflow: 'hidden'\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// insert flash object\r\n\t\t\t\thtml = '';\r\n\r\n\t\t\t\tif (Env.browser === 'IE') {\r\n\t\t\t\t\tel = document.createElement('div');\r\n\t\t\t\t\tcontainer.appendChild(el);\r\n\t\t\t\t\tel.outerHTML = html;\r\n\t\t\t\t\tel = container = null; // just in case\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontainer.innerHTML = html;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Init is dispatched by the shim\r\n\t\t\t\tinitTimer = setTimeout(function() {\r\n\t\t\t\t\tif (I && !I.initialized) { // runtime might be already destroyed by this moment\r\n\t\t\t\t\t\tI.trigger(\"Error\", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));\r\n\t\t\t\t\t}\r\n\t\t\t\t}, 5000);\r\n\t\t\t},\r\n\r\n\t\t\tdestroy: (function(destroy) { // extend default destroy method\r\n\t\t\t\treturn function() {\r\n\t\t\t\t\tdestroy.call(I);\r\n\t\t\t\t\tclearTimeout(initTimer); // initialization check might be still onwait\r\n\t\t\t\t\toptions = initTimer = destroy = I = null;\r\n\t\t\t\t};\r\n\t\t\t}(this.destroy))\r\n\r\n\t\t}, extensions);\r\n\t}\r\n\r\n\tRuntime.addConstructor(type, FlashRuntime);\r\n\r\n\treturn extensions;\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/file/Blob.js\r\n\r\n/**\r\n * Blob.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/file/Blob\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/file/Blob\", [\r\n\t\"moxie/runtime/flash/Runtime\",\r\n\t\"moxie/file/Blob\"\r\n], function(extensions, Blob) {\r\n\r\n\tvar FlashBlob = {\r\n\t\tslice: function(blob, start, end, type) {\r\n\t\t\tvar self = this.getRuntime();\r\n\r\n\t\t\tif (start < 0) {\r\n\t\t\t\tstart = Math.max(blob.size + start, 0);\r\n\t\t\t} else if (start > 0) {\r\n\t\t\t\tstart = Math.min(start, blob.size);\r\n\t\t\t}\r\n\r\n\t\t\tif (end < 0) {\r\n\t\t\t\tend = Math.max(blob.size + end, 0);\r\n\t\t\t} else if (end > 0) {\r\n\t\t\t\tend = Math.min(end, blob.size);\r\n\t\t\t}\r\n\r\n\t\t\tblob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || '');\r\n\r\n\t\t\tif (blob) {\r\n\t\t\t\tblob = new Blob(self.uid, blob);\r\n\t\t\t}\r\n\t\t\treturn blob;\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.Blob = FlashBlob);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/file/FileInput.js\r\n\r\n/**\r\n * FileInput.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/file/FileInput\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/file/FileInput\", [\r\n\t\"moxie/runtime/flash/Runtime\"\r\n], function(extensions) {\r\n\t\r\n\tvar FileInput = {\t\t\r\n\t\tinit: function(options) {\r\n\t\t\tthis.getRuntime().shimExec.call(this, 'FileInput', 'init', {\r\n\t\t\t\tname: options.name,\r\n\t\t\t\taccept: options.accept,\r\n\t\t\t\tmultiple: options.multiple\r\n\t\t\t});\r\n\t\t\tthis.trigger('ready');\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.FileInput = FileInput);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/file/FileReader.js\r\n\r\n/**\r\n * FileReader.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/file/FileReader\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/file/FileReader\", [\r\n\t\"moxie/runtime/flash/Runtime\",\r\n\t\"moxie/core/utils/Encode\"\r\n], function(extensions, Encode) {\r\n\r\n\tvar _result = '';\r\n\r\n\tfunction _formatData(data, op) {\r\n\t\tswitch (op) {\r\n\t\t\tcase 'readAsText':\r\n\t\t\t\treturn Encode.atob(data, 'utf8');\r\n\t\t\tcase 'readAsBinaryString':\r\n\t\t\t\treturn Encode.atob(data);\r\n\t\t\tcase 'readAsDataURL':\r\n\t\t\t\treturn data;\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar FileReader = {\r\n\t\tread: function(op, blob) {\r\n\t\t\tvar target = this, self = target.getRuntime();\r\n\r\n\t\t\t// special prefix for DataURL read mode\r\n\t\t\tif (op === 'readAsDataURL') {\r\n\t\t\t\t_result = 'data:' + (blob.type || '') + ';base64,';\r\n\t\t\t}\r\n\r\n\t\t\ttarget.bind('Progress', function(e, data) {\r\n\t\t\t\tif (data) {\r\n\t\t\t\t\t_result += _formatData(data, op);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid);\r\n\t\t},\r\n\r\n\t\tgetResult: function() {\r\n\t\t\treturn _result;\r\n\t\t},\r\n\r\n\t\tdestroy: function() {\r\n\t\t\t_result = null;\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.FileReader = FileReader);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/file/FileReaderSync.js\r\n\r\n/**\r\n * FileReaderSync.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/file/FileReaderSync\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/file/FileReaderSync\", [\r\n\t\"moxie/runtime/flash/Runtime\",\r\n\t\"moxie/core/utils/Encode\"\r\n], function(extensions, Encode) {\r\n\t\r\n\tfunction _formatData(data, op) {\r\n\t\tswitch (op) {\r\n\t\t\tcase 'readAsText':\r\n\t\t\t\treturn Encode.atob(data, 'utf8');\r\n\t\t\tcase 'readAsBinaryString':\r\n\t\t\t\treturn Encode.atob(data);\r\n\t\t\tcase 'readAsDataURL':\r\n\t\t\t\treturn data;\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar FileReaderSync = {\r\n\t\tread: function(op, blob) {\r\n\t\t\tvar result, self = this.getRuntime();\r\n\r\n\t\t\tresult = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid);\r\n\t\t\tif (!result) {\r\n\t\t\t\treturn null; // or throw ex\r\n\t\t\t}\r\n\r\n\t\t\t// special prefix for DataURL read mode\r\n\t\t\tif (op === 'readAsDataURL') {\r\n\t\t\t\tresult = 'data:' + (blob.type || '') + ';base64,' + result;\r\n\t\t\t}\r\n\r\n\t\t\treturn _formatData(result, op, blob.type);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.FileReaderSync = FileReaderSync);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js\r\n\r\n/**\r\n * XMLHttpRequest.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/xhr/XMLHttpRequest\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/xhr/XMLHttpRequest\", [\r\n\t\"moxie/runtime/flash/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/file/Blob\",\r\n\t\"moxie/file/File\",\r\n\t\"moxie/file/FileReaderSync\",\r\n\t\"moxie/xhr/FormData\",\r\n\t\"moxie/runtime/Transporter\"\r\n], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) {\r\n\t\r\n\tvar XMLHttpRequest = {\r\n\r\n\t\tsend: function(meta, data) {\r\n\t\t\tvar target = this, self = target.getRuntime();\r\n\r\n\t\t\tfunction send() {\r\n\t\t\t\tmeta.transport = self.mode;\r\n\t\t\t\tself.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfunction appendBlob(name, blob) {\r\n\t\t\t\tself.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid);\r\n\t\t\t\tdata = null;\r\n\t\t\t\tsend();\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfunction attachBlob(blob, cb) {\r\n\t\t\t\tvar tr = new Transporter();\r\n\r\n\t\t\t\ttr.bind(\"TransportingComplete\", function() {\r\n\t\t\t\t\tcb(this.result);\r\n\t\t\t\t});\r\n\r\n\t\t\t\ttr.transport(blob.getSource(), blob.type, {\r\n\t\t\t\t\truid: self.uid\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// copy over the headers if any\r\n\t\t\tif (!Basic.isEmptyObj(meta.headers)) {\r\n\t\t\t\tBasic.each(meta.headers, function(value, header) {\r\n\t\t\t\t\tself.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// transfer over multipart params and blob itself\r\n\t\t\tif (data instanceof FormData) {\r\n\t\t\t\tvar blobField;\r\n\t\t\t\tdata.each(function(value, name) {\r\n\t\t\t\t\tif (value instanceof Blob) {\r\n\t\t\t\t\t\tblobField = name;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tself.shimExec.call(target, 'XMLHttpRequest', 'append', name, value);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (!data.hasBlob()) {\r\n\t\t\t\t\tdata = null;\r\n\t\t\t\t\tsend();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar blob = data.getBlob();\r\n\t\t\t\t\tif (blob.isDetached()) {\r\n\t\t\t\t\t\tattachBlob(blob, function(attachedBlob) {\r\n\t\t\t\t\t\t\tblob.destroy();\r\n\t\t\t\t\t\t\tappendBlob(blobField, attachedBlob);\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tappendBlob(blobField, blob);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (data instanceof Blob) {\r\n\t\t\t\tif (data.isDetached()) {\r\n\t\t\t\t\tattachBlob(data, function(attachedBlob) {\r\n\t\t\t\t\t\tdata.destroy();\r\n\t\t\t\t\t\tdata = attachedBlob.uid;\r\n\t\t\t\t\t\tsend();\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdata = data.uid;\r\n\t\t\t\t\tsend();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsend();\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetResponse: function(responseType) {\r\n\t\t\tvar frs, blob, self = this.getRuntime();\r\n\r\n\t\t\tblob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob');\r\n\r\n\t\t\tif (blob) {\r\n\t\t\t\tblob = new File(self.uid, blob);\r\n\r\n\t\t\t\tif ('blob' === responseType) {\r\n\t\t\t\t\treturn blob;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry { \r\n\t\t\t\t\tfrs = new FileReaderSync();\r\n\r\n\t\t\t\t\tif (!!~Basic.inArray(responseType, [\"\", \"text\"])) {\r\n\t\t\t\t\t\treturn frs.readAsText(blob);\r\n\t\t\t\t\t} else if ('json' === responseType && !!window.JSON) {\r\n\t\t\t\t\t\treturn JSON.parse(frs.readAsText(blob));\r\n\t\t\t\t\t}\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tblob.destroy();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tabort: function(upload_complete_flag) {\r\n\t\t\tvar self = this.getRuntime();\r\n\r\n\t\t\tself.shimExec.call(this, 'XMLHttpRequest', 'abort');\r\n\r\n\t\t\tthis.dispatchEvent('readystatechange');\r\n\t\t\t// this.dispatchEvent('progress');\r\n\t\t\tthis.dispatchEvent('abort');\r\n\r\n\t\t\t//if (!upload_complete_flag) {\r\n\t\t\t\t// this.dispatchEvent('uploadprogress');\r\n\t\t\t//}\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.XMLHttpRequest = XMLHttpRequest);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/runtime/Transporter.js\r\n\r\n/**\r\n * Transporter.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/runtime/Transporter\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/runtime/Transporter\", [\r\n\t\"moxie/runtime/flash/Runtime\",\r\n\t\"moxie/file/Blob\"\r\n], function(extensions, Blob) {\r\n\r\n\tvar Transporter = {\r\n\t\tgetAsBlob: function(type) {\r\n\t\t\tvar self = this.getRuntime()\r\n\t\t\t, blob = self.shimExec.call(this, 'Transporter', 'getAsBlob', type)\r\n\t\t\t;\r\n\t\t\tif (blob) {\r\n\t\t\t\treturn new Blob(self.uid, blob);\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.Transporter = Transporter);\r\n});\r\n\r\n// Included from: src/javascript/runtime/flash/image/Image.js\r\n\r\n/**\r\n * Image.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/flash/image/Image\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/flash/image/Image\", [\r\n\t\"moxie/runtime/flash/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/Transporter\",\r\n\t\"moxie/file/Blob\",\r\n\t\"moxie/file/FileReaderSync\"\r\n], function(extensions, Basic, Transporter, Blob, FileReaderSync) {\r\n\t\r\n\tvar Image = {\r\n\t\tloadFromBlob: function(blob) {\r\n\t\t\tvar comp = this, self = comp.getRuntime();\r\n\r\n\t\t\tfunction exec(srcBlob) {\r\n\t\t\t\tself.shimExec.call(comp, 'Image', 'loadFromBlob', srcBlob.uid);\r\n\t\t\t\tcomp = self = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (blob.isDetached()) { // binary string\r\n\t\t\t\tvar tr = new Transporter();\r\n\t\t\t\ttr.bind(\"TransportingComplete\", function() {\r\n\t\t\t\t\texec(tr.result.getSource());\r\n\t\t\t\t});\r\n\t\t\t\ttr.transport(blob.getSource(), blob.type, { ruid: self.uid });\r\n\t\t\t} else {\r\n\t\t\t\texec(blob.getSource());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tloadFromImage: function(img) {\r\n\t\t\tvar self = this.getRuntime();\r\n\t\t\treturn self.shimExec.call(this, 'Image', 'loadFromImage', img.uid);\r\n\t\t},\r\n\r\n\t\tgetAsBlob: function(type, quality) {\r\n\t\t\tvar self = this.getRuntime()\r\n\t\t\t, blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality)\r\n\t\t\t;\r\n\t\t\tif (blob) {\r\n\t\t\t\treturn new Blob(self.uid, blob);\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tgetAsDataURL: function() {\r\n\t\t\tvar self = this.getRuntime()\r\n\t\t\t, blob = self.Image.getAsBlob.apply(this, arguments)\r\n\t\t\t, frs\r\n\t\t\t;\r\n\t\t\tif (!blob) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tfrs = new FileReaderSync();\r\n\t\t\treturn frs.readAsDataURL(blob);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.Image = Image);\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/Runtime.js\r\n\r\n/**\r\n * RunTime.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/*global ActiveXObject:true */\r\n\r\n/**\r\nDefines constructor for Silverlight runtime.\r\n\r\n@class moxie/runtime/silverlight/Runtime\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/Runtime\", [\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/core/utils/Env\",\r\n\t\"moxie/core/utils/Dom\",\r\n\t\"moxie/core/Exceptions\",\r\n\t\"moxie/runtime/Runtime\"\r\n], function(Basic, Env, Dom, x, Runtime) {\r\n\t\r\n\tvar type = \"silverlight\", extensions = {};\r\n\r\n\tfunction isInstalled(version) {\r\n\t\tvar isVersionSupported = false, control = null, actualVer,\r\n\t\t\tactualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0;\r\n\r\n\t\ttry {\r\n\t\t\ttry {\r\n\t\t\t\tcontrol = new ActiveXObject('AgControl.AgControl');\r\n\r\n\t\t\t\tif (control.IsVersionSupported(version)) {\r\n\t\t\t\t\tisVersionSupported = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcontrol = null;\r\n\t\t\t} catch (e) {\r\n\t\t\t\tvar plugin = navigator.plugins[\"Silverlight Plug-In\"];\r\n\r\n\t\t\t\tif (plugin) {\r\n\t\t\t\t\tactualVer = plugin.description;\r\n\r\n\t\t\t\t\tif (actualVer === \"1.0.30226.2\") {\r\n\t\t\t\t\t\tactualVer = \"2.0.30226.2\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tactualVerArray = actualVer.split(\".\");\r\n\r\n\t\t\t\t\twhile (actualVerArray.length > 3) {\r\n\t\t\t\t\t\tactualVerArray.pop();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\twhile ( actualVerArray.length < 4) {\r\n\t\t\t\t\t\tactualVerArray.push(0);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treqVerArray = version.split(\".\");\r\n\r\n\t\t\t\t\twhile (reqVerArray.length > 4) {\r\n\t\t\t\t\t\treqVerArray.pop();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdo {\r\n\t\t\t\t\t\trequiredVersionPart = parseInt(reqVerArray[index], 10);\r\n\t\t\t\t\t\tactualVersionPart = parseInt(actualVerArray[index], 10);\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t} while (index < reqVerArray.length && requiredVersionPart === actualVersionPart);\r\n\r\n\t\t\t\t\tif (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) {\r\n\t\t\t\t\t\tisVersionSupported = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e2) {\r\n\t\t\tisVersionSupported = false;\r\n\t\t}\r\n\r\n\t\treturn isVersionSupported;\r\n\t}\r\n\r\n\t/**\r\n\tConstructor for the Silverlight Runtime\r\n\r\n\t@class SilverlightRuntime\r\n\t@extends Runtime\r\n\t*/\r\n\tfunction SilverlightRuntime(options) {\r\n\t\tvar I = this, initTimer;\r\n\r\n\t\toptions = Basic.extend({ xap_url: Env.xap_url }, options);\r\n\r\n\t\tRuntime.call(this, options, type, {\r\n\t\t\taccess_binary: Runtime.capTrue,\r\n\t\t\taccess_image_binary: Runtime.capTrue,\r\n\t\t\tdisplay_media: Runtime.capTrue,\r\n\t\t\tdo_cors: Runtime.capTrue,\r\n\t\t\tdrag_and_drop: false,\r\n\t\t\treport_upload_progress: Runtime.capTrue,\r\n\t\t\tresize_image: Runtime.capTrue,\r\n\t\t\treturn_response_headers: function(value) {\r\n\t\t\t\treturn value && I.mode === 'client';\r\n\t\t\t},\r\n\t\t\treturn_response_type: function(responseType) {\r\n\t\t\t\tif (responseType !== 'json') {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn !!window.JSON;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\treturn_status_code: function(code) {\r\n\t\t\t\treturn I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]);\r\n\t\t\t},\r\n\t\t\tselect_file: Runtime.capTrue,\r\n\t\t\tselect_multiple: Runtime.capTrue,\r\n\t\t\tsend_binary_string: Runtime.capTrue,\r\n\t\t\tsend_browser_cookies: function(value) {\r\n\t\t\t\treturn value && I.mode === 'browser';\r\n\t\t\t},\r\n\t\t\tsend_custom_headers: function(value) {\r\n\t\t\t\treturn value && I.mode === 'client';\r\n\t\t\t},\r\n\t\t\tsend_multipart: Runtime.capTrue,\r\n\t\t\tslice_blob: Runtime.capTrue,\r\n\t\t\tstream_upload: true,\r\n\t\t\tsummon_file_dialog: false,\r\n\t\t\tupload_filesize: Runtime.capTrue,\r\n\t\t\tuse_http_method: function(methods) {\r\n\t\t\t\treturn I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']);\r\n\t\t\t}\r\n\t\t}, { \r\n\t\t\t// capabilities that require specific mode\r\n\t\t\treturn_response_headers: function(value) {\r\n\t\t\t\treturn value ? 'client' : 'browser';\r\n\t\t\t},\r\n\t\t\treturn_status_code: function(code) {\r\n\t\t\t\treturn Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser'];\r\n\t\t\t},\r\n\t\t\tsend_browser_cookies: function(value) {\r\n\t\t\t\treturn value ? 'browser' : 'client';\r\n\t\t\t},\r\n\t\t\tsend_custom_headers: function(value) {\r\n\t\t\t\treturn value ? 'client' : 'browser';\r\n\t\t\t},\r\n\t\t\tuse_http_method: function(methods) {\r\n\t\t\t\treturn Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser'];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t// minimal requirement\r\n\t\tif (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') {\r\n\t\t\tthis.mode = false;\r\n\t\t}\r\n\r\n\r\n\t\tBasic.extend(this, {\r\n\t\t\tgetShim: function() {\r\n\t\t\t\treturn Dom.get(this.uid).content.Moxie;\r\n\t\t\t},\r\n\r\n\t\t\tshimExec: function(component, action) {\r\n\t\t\t\tvar args = [].slice.call(arguments, 2);\r\n\t\t\t\treturn I.getShim().exec(this.uid, component, action, args);\r\n\t\t\t},\r\n\r\n\t\t\tinit : function() {\r\n\t\t\t\tvar container;\r\n\r\n\t\t\t\tcontainer = this.getShimContainer();\r\n\r\n\t\t\t\tcontainer.innerHTML = '';\r\n\r\n\t\t\t\t// Init is dispatched by the shim\r\n\t\t\t\tinitTimer = setTimeout(function() {\r\n\t\t\t\t\tif (I && !I.initialized) { // runtime might be already destroyed by this moment\r\n\t\t\t\t\t\tI.trigger(\"Error\", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));\r\n\t\t\t\t\t}\r\n\t\t\t\t}, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac)\r\n\t\t\t},\r\n\r\n\t\t\tdestroy: (function(destroy) { // extend default destroy method\r\n\t\t\t\treturn function() {\r\n\t\t\t\t\tdestroy.call(I);\r\n\t\t\t\t\tclearTimeout(initTimer); // initialization check might be still onwait\r\n\t\t\t\t\toptions = initTimer = destroy = I = null;\r\n\t\t\t\t};\r\n\t\t\t}(this.destroy))\r\n\r\n\t\t}, extensions);\r\n\t}\r\n\r\n\tRuntime.addConstructor(type, SilverlightRuntime); \r\n\r\n\treturn extensions;\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/file/Blob.js\r\n\r\n/**\r\n * Blob.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/file/Blob\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/file/Blob\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/flash/file/Blob\"\r\n], function(extensions, Basic, Blob) {\r\n\treturn (extensions.Blob = Basic.extend({}, Blob));\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/file/FileInput.js\r\n\r\n/**\r\n * FileInput.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/file/FileInput\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/file/FileInput\", [\r\n\t\"moxie/runtime/silverlight/Runtime\"\r\n], function(extensions) {\r\n\t\r\n\tvar FileInput = {\r\n\t\tinit: function(options) {\r\n\r\n\t\t\tfunction toFilters(accept) {\r\n\t\t\t\tvar filter = '';\r\n\t\t\t\tfor (var i = 0; i < accept.length; i++) {\r\n\t\t\t\t\tfilter += (filter !== '' ? '|' : '') + accept[i].title + \" | *.\" + accept[i].extensions.replace(/,/g, ';*.');\r\n\t\t\t\t}\r\n\t\t\t\treturn filter;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.getRuntime().shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.name, options.multiple);\r\n\t\t\tthis.trigger('ready');\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.FileInput = FileInput);\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/file/FileDrop.js\r\n\r\n/**\r\n * FileDrop.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/file/FileDrop\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/file/FileDrop\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Dom\", \r\n\t\"moxie/core/utils/Events\"\r\n], function(extensions, Dom, Events) {\r\n\r\n\t// not exactly useful, since works only in safari (...crickets...)\r\n\tvar FileDrop = {\r\n\t\tinit: function() {\r\n\t\t\tvar comp = this, self = comp.getRuntime(), dropZone;\r\n\r\n\t\t\tdropZone = self.getShimContainer();\r\n\r\n\t\t\tEvents.addEvent(dropZone, 'dragover', function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.dataTransfer.dropEffect = 'copy';\r\n\t\t\t}, comp.uid);\r\n\r\n\t\t\tEvents.addEvent(dropZone, 'dragenter', function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tvar flag = Dom.get(self.uid).dragEnter(e);\r\n\t\t\t\t// If handled, then stop propagation of event in DOM\r\n\t\t\t\tif (flag) {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t}, comp.uid);\r\n\r\n\t\t\tEvents.addEvent(dropZone, 'drop', function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tvar flag = Dom.get(self.uid).dragDrop(e);\r\n\t\t\t\t// If handled, then stop propagation of event in DOM\r\n\t\t\t\tif (flag) {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t}, comp.uid);\r\n\r\n\t\t\treturn self.shimExec.call(this, 'FileDrop', 'init');\r\n\t\t}\r\n\t};\r\n\r\n\treturn (extensions.FileDrop = FileDrop);\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/file/FileReader.js\r\n\r\n/**\r\n * FileReader.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/file/FileReader\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/file/FileReader\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/flash/file/FileReader\"\r\n], function(extensions, Basic, FileReader) {\r\n\treturn (extensions.FileReader = Basic.extend({}, FileReader));\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js\r\n\r\n/**\r\n * FileReaderSync.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/file/FileReaderSync\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/file/FileReaderSync\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/flash/file/FileReaderSync\"\r\n], function(extensions, Basic, FileReaderSync) {\r\n\treturn (extensions.FileReaderSync = Basic.extend({}, FileReaderSync));\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js\r\n\r\n/**\r\n * XMLHttpRequest.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/xhr/XMLHttpRequest\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/xhr/XMLHttpRequest\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/flash/xhr/XMLHttpRequest\"\r\n], function(extensions, Basic, XMLHttpRequest) {\r\n\treturn (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest));\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/runtime/Transporter.js\r\n\r\n/**\r\n * Transporter.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/silverlight/runtime/Transporter\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/runtime/Transporter\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/flash/runtime/Transporter\"\r\n], function(extensions, Basic, Transporter) {\r\n\treturn (extensions.Transporter = Basic.extend({}, Transporter));\r\n});\r\n\r\n// Included from: src/javascript/runtime/silverlight/image/Image.js\r\n\r\n/**\r\n * Image.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n \r\n/**\r\n@class moxie/runtime/silverlight/image/Image\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/silverlight/image/Image\", [\r\n\t\"moxie/runtime/silverlight/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/runtime/flash/image/Image\"\r\n], function(extensions, Basic, Image) {\r\n\treturn (extensions.Image = Basic.extend({}, Image, {\r\n\r\n\t\tgetInfo: function() {\r\n\t\t\tvar self = this.getRuntime()\r\n\t\t\t, grps = ['tiff', 'exif', 'gps']\r\n\t\t\t, info = { meta: {} }\r\n\t\t\t, rawInfo = self.shimExec.call(this, 'Image', 'getInfo')\r\n\t\t\t;\r\n\r\n\t\t\tif (rawInfo.meta) {\r\n\t\t\t\tBasic.each(grps, function(grp) {\r\n\t\t\t\t\tvar meta = rawInfo.meta[grp]\r\n\t\t\t\t\t, tag\r\n\t\t\t\t\t, i\r\n\t\t\t\t\t, length\r\n\t\t\t\t\t, value\r\n\t\t\t\t\t;\r\n\t\t\t\t\tif (meta && meta.keys) {\r\n\t\t\t\t\t\tinfo.meta[grp] = {};\r\n\t\t\t\t\t\tfor (i = 0, length = meta.keys.length; i < length; i++) {\r\n\t\t\t\t\t\t\ttag = meta.keys[i];\r\n\t\t\t\t\t\t\tvalue = meta[tag];\r\n\t\t\t\t\t\t\tif (value) {\r\n\t\t\t\t\t\t\t\t// convert numbers\r\n\t\t\t\t\t\t\t\tif (/^(\\d|[1-9]\\d+)$/.test(value)) { // integer (make sure doesn't start with zero)\r\n\t\t\t\t\t\t\t\t\tvalue = parseInt(value, 10);\r\n\t\t\t\t\t\t\t\t} else if (/^\\d*\\.\\d+$/.test(value)) { // double\r\n\t\t\t\t\t\t\t\t\tvalue = parseFloat(value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tinfo.meta[grp][tag] = value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tinfo.width = parseInt(rawInfo.width, 10);\r\n\t\t\tinfo.height = parseInt(rawInfo.height, 10);\r\n\t\t\tinfo.size = parseInt(rawInfo.size, 10);\r\n\t\t\tinfo.type = rawInfo.type;\r\n\t\t\tinfo.name = rawInfo.name;\r\n\r\n\t\t\treturn info;\r\n\t\t}\r\n\t}));\r\n});\r\n\r\n// Included from: src/javascript/runtime/html4/Runtime.js\r\n\r\n/**\r\n * Runtime.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/*global File:true */\r\n\r\n/**\r\nDefines constructor for HTML4 runtime.\r\n\r\n@class moxie/runtime/html4/Runtime\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/html4/Runtime\", [\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/core/Exceptions\",\r\n\t\"moxie/runtime/Runtime\",\r\n\t\"moxie/core/utils/Env\"\r\n], function(Basic, x, Runtime, Env) {\r\n\t\r\n\tvar type = 'html4', extensions = {};\r\n\r\n\tfunction Html4Runtime(options) {\r\n\t\tvar I = this\r\n\t\t, Test = Runtime.capTest\r\n\t\t, True = Runtime.capTrue\r\n\t\t;\r\n\r\n\t\tRuntime.call(this, options, type, {\r\n\t\t\taccess_binary: Test(window.FileReader || window.File && File.getAsDataURL),\r\n\t\t\taccess_image_binary: false,\r\n\t\t\tdisplay_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))),\r\n\t\t\tdo_cors: false,\r\n\t\t\tdrag_and_drop: false,\r\n\t\t\tfilter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest\r\n\t\t\t\treturn (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10);\r\n\t\t\t}()),\r\n\t\t\tresize_image: function() {\r\n\t\t\t\treturn extensions.Image && I.can('access_binary') && Env.can('create_canvas');\r\n\t\t\t},\r\n\t\t\treport_upload_progress: false,\r\n\t\t\treturn_response_headers: false,\r\n\t\t\treturn_response_type: function(responseType) {\r\n\t\t\t\tif (responseType === 'json' && !!window.JSON) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} \r\n\t\t\t\treturn !!~Basic.inArray(responseType, ['text', 'document', '']);\r\n\t\t\t},\r\n\t\t\treturn_status_code: function(code) {\r\n\t\t\t\treturn !Basic.arrayDiff(code, [200, 404]);\r\n\t\t\t},\r\n\t\t\tselect_file: function() {\r\n\t\t\t\treturn Env.can('use_fileinput');\r\n\t\t\t},\r\n\t\t\tselect_multiple: false,\r\n\t\t\tsend_binary_string: false,\r\n\t\t\tsend_custom_headers: false,\r\n\t\t\tsend_multipart: true,\r\n\t\t\tslice_blob: false,\r\n\t\t\tstream_upload: function() {\r\n\t\t\t\treturn I.can('select_file');\r\n\t\t\t},\r\n\t\t\tsummon_file_dialog: Test(function() { // yeah... some dirty sniffing here...\r\n\t\t\t\treturn (Env.browser === 'Firefox' && Env.version >= 4) ||\r\n\t\t\t\t\t(Env.browser === 'Opera' && Env.version >= 12) ||\r\n\t\t\t\t\t!!~Basic.inArray(Env.browser, ['Chrome', 'Safari']);\r\n\t\t\t}()),\r\n\t\t\tupload_filesize: True,\r\n\t\t\tuse_http_method: function(methods) {\r\n\t\t\t\treturn !Basic.arrayDiff(methods, ['GET', 'POST']);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tBasic.extend(this, {\r\n\t\t\tinit : function() {\r\n\t\t\t\tthis.trigger(\"Init\");\r\n\t\t\t},\r\n\r\n\t\t\tdestroy: (function(destroy) { // extend default destroy method\r\n\t\t\t\treturn function() {\r\n\t\t\t\t\tdestroy.call(I);\r\n\t\t\t\t\tdestroy = I = null;\r\n\t\t\t\t};\r\n\t\t\t}(this.destroy))\r\n\t\t});\r\n\r\n\t\tBasic.extend(this.getShim(), extensions);\r\n\t}\r\n\r\n\tRuntime.addConstructor(type, Html4Runtime);\r\n\r\n\treturn extensions;\r\n});\r\n\r\n// Included from: src/javascript/runtime/html4/file/FileInput.js\r\n\r\n/**\r\n * FileInput.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/html4/file/FileInput\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/html4/file/FileInput\", [\r\n\t\"moxie/runtime/html4/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/core/utils/Dom\",\r\n\t\"moxie/core/utils/Events\",\r\n\t\"moxie/core/utils/Mime\",\r\n\t\"moxie/core/utils/Env\"\r\n], function(extensions, Basic, Dom, Events, Mime, Env) {\r\n\t\r\n\tfunction FileInput() {\r\n\t\tvar _uid, _files = [], _mimes = [], _options;\r\n\r\n\t\tfunction addInput() {\r\n\t\t\tvar comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid;\r\n\r\n\t\t\tuid = Basic.guid('uid_');\r\n\r\n\t\t\tshimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE\r\n\r\n\t\t\tif (_uid) { // move previous form out of the view\r\n\t\t\t\tcurrForm = Dom.get(_uid + '_form');\r\n\t\t\t\tif (currForm) {\r\n\t\t\t\t\tBasic.extend(currForm.style, { top: '100%' });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// build form in DOM, since innerHTML version not able to submit file for some reason\r\n\t\t\tform = document.createElement('form');\r\n\t\t\tform.setAttribute('id', uid + '_form');\r\n\t\t\tform.setAttribute('method', 'post');\r\n\t\t\tform.setAttribute('enctype', 'multipart/form-data');\r\n\t\t\tform.setAttribute('encoding', 'multipart/form-data');\r\n\r\n\t\t\tBasic.extend(form.style, {\r\n\t\t\t\toverflow: 'hidden',\r\n\t\t\t\tposition: 'absolute',\r\n\t\t\t\ttop: 0,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\twidth: '100%',\r\n\t\t\t\theight: '100%'\r\n\t\t\t});\r\n\r\n\t\t\tinput = document.createElement('input');\r\n\t\t\tinput.setAttribute('id', uid);\r\n\t\t\tinput.setAttribute('type', 'file');\r\n\t\t\tinput.setAttribute('name', _options.name || 'Filedata');\r\n\t\t\tinput.setAttribute('accept', _mimes.join(','));\r\n\r\n\t\t\tBasic.extend(input.style, {\r\n\t\t\t\tfontSize: '999px',\r\n\t\t\t\topacity: 0\r\n\t\t\t});\r\n\r\n\t\t\tform.appendChild(input);\r\n\t\t\tshimContainer.appendChild(form);\r\n\r\n\t\t\t// prepare file input to be placed underneath the browse_button element\r\n\t\t\tBasic.extend(input.style, {\r\n\t\t\t\tposition: 'absolute',\r\n\t\t\t\ttop: 0,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\twidth: '100%',\r\n\t\t\t\theight: '100%'\r\n\t\t\t});\r\n\r\n\t\t\tif (Env.browser === 'IE' && Env.version < 10) {\r\n\t\t\t\tBasic.extend(input.style, {\r\n\t\t\t\t\tfilter : \"progid:DXImageTransform.Microsoft.Alpha(opacity=0)\"\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tinput.onchange = function() { // there should be only one handler for this\r\n\t\t\t\tvar file;\r\n\r\n\t\t\t\tif (!this.value) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.files) {\r\n\t\t\t\t\tfile = this.files[0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfile = {\r\n\t\t\t\t\t\tname: this.value\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t_files = [file];\r\n\r\n\t\t\t\tthis.onchange = function() {}; // clear event handler\r\n\t\t\t\taddInput.call(comp);\r\n\r\n\t\t\t\t// after file is initialized as o.File, we need to update form and input ids\r\n\t\t\t\tcomp.bind('change', function onChange() {\r\n\t\t\t\t\tvar input = Dom.get(uid), form = Dom.get(uid + '_form'), file;\r\n\r\n\t\t\t\t\tcomp.unbind('change', onChange);\r\n\r\n\t\t\t\t\tif (comp.files.length && input && form) {\r\n\t\t\t\t\t\tfile = comp.files[0];\r\n\r\n\t\t\t\t\t\tinput.setAttribute('id', file.uid);\r\n\t\t\t\t\t\tform.setAttribute('id', file.uid + '_form');\r\n\r\n\t\t\t\t\t\t// set upload target\r\n\t\t\t\t\t\tform.setAttribute('target', file.uid + '_iframe');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tinput = form = null;\r\n\t\t\t\t}, 998);\r\n\r\n\t\t\t\tinput = form = null;\r\n\t\t\t\tcomp.trigger('change');\r\n\t\t\t};\r\n\r\n\r\n\t\t\t// route click event to the input\r\n\t\t\tif (I.can('summon_file_dialog')) {\r\n\t\t\t\tbrowseButton = Dom.get(_options.browse_button);\r\n\t\t\t\tEvents.removeEvent(browseButton, 'click', comp.uid);\r\n\t\t\t\tEvents.addEvent(browseButton, 'click', function(e) {\r\n\t\t\t\t\tif (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file]\r\n\t\t\t\t\t\tinput.click();\r\n\t\t\t\t\t}\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}, comp.uid);\r\n\t\t\t}\r\n\r\n\t\t\t_uid = uid;\r\n\r\n\t\t\tshimContainer = currForm = browseButton = null;\r\n\t\t}\r\n\r\n\t\tBasic.extend(this, {\r\n\t\t\tinit: function(options) {\r\n\t\t\t\tvar comp = this, I = comp.getRuntime(), shimContainer;\r\n\r\n\t\t\t\t// figure out accept string\r\n\t\t\t\t_options = options;\r\n\t\t\t\t_mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension'));\r\n\r\n\t\t\t\tshimContainer = I.getShimContainer();\r\n\r\n\t\t\t\t(function() {\r\n\t\t\t\t\tvar browseButton, zIndex, top;\r\n\r\n\t\t\t\t\tbrowseButton = Dom.get(options.browse_button);\r\n\r\n\t\t\t\t\t// Route click event to the input[type=file] element for browsers that support such behavior\r\n\t\t\t\t\tif (I.can('summon_file_dialog')) {\r\n\t\t\t\t\t\tif (Dom.getStyle(browseButton, 'position') === 'static') {\r\n\t\t\t\t\t\t\tbrowseButton.style.position = 'relative';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tzIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1;\r\n\r\n\t\t\t\t\t\tbrowseButton.style.zIndex = zIndex;\r\n\t\t\t\t\t\tshimContainer.style.zIndex = zIndex - 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/* Since we have to place input[type=file] on top of the browse_button for some browsers,\r\n\t\t\t\t\tbrowse_button loses interactivity, so we restore it here */\r\n\t\t\t\t\ttop = I.can('summon_file_dialog') ? browseButton : shimContainer;\r\n\r\n\t\t\t\t\tEvents.addEvent(top, 'mouseover', function() {\r\n\t\t\t\t\t\tcomp.trigger('mouseenter');\r\n\t\t\t\t\t}, comp.uid);\r\n\r\n\t\t\t\t\tEvents.addEvent(top, 'mouseout', function() {\r\n\t\t\t\t\t\tcomp.trigger('mouseleave');\r\n\t\t\t\t\t}, comp.uid);\r\n\r\n\t\t\t\t\tEvents.addEvent(top, 'mousedown', function() {\r\n\t\t\t\t\t\tcomp.trigger('mousedown');\r\n\t\t\t\t\t}, comp.uid);\r\n\r\n\t\t\t\t\tEvents.addEvent(Dom.get(options.container), 'mouseup', function() {\r\n\t\t\t\t\t\tcomp.trigger('mouseup');\r\n\t\t\t\t\t}, comp.uid);\r\n\r\n\t\t\t\t\tbrowseButton = null;\r\n\t\t\t\t}());\r\n\r\n\t\t\t\taddInput.call(this);\r\n\r\n\t\t\t\tshimContainer = null;\r\n\r\n\t\t\t\t// trigger ready event asynchronously\r\n\t\t\t\tcomp.trigger({\r\n\t\t\t\t\ttype: 'ready',\r\n\t\t\t\t\tasync: true\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\tgetFiles: function() {\r\n\t\t\t\treturn _files;\r\n\t\t\t},\r\n\r\n\t\t\tdisable: function(state) {\r\n\t\t\t\tvar input;\r\n\r\n\t\t\t\tif ((input = Dom.get(_uid))) {\r\n\t\t\t\t\tinput.disabled = !!state;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tdestroy: function() {\r\n\t\t\t\tvar I = this.getRuntime()\r\n\t\t\t\t, shim = I.getShim()\r\n\t\t\t\t, shimContainer = I.getShimContainer()\r\n\t\t\t\t;\r\n\t\t\t\t\r\n\t\t\t\tEvents.removeAllEvents(shimContainer, this.uid);\r\n\t\t\t\tEvents.removeAllEvents(_options && Dom.get(_options.container), this.uid);\r\n\t\t\t\tEvents.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid);\r\n\t\t\t\t\r\n\t\t\t\tif (shimContainer) {\r\n\t\t\t\t\tshimContainer.innerHTML = '';\r\n\t\t\t\t}\r\n\r\n\t\t\t\tshim.removeInstance(this.uid);\r\n\r\n\t\t\t\t_uid = _files = _mimes = _options = shimContainer = shim = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\treturn (extensions.FileInput = FileInput);\r\n});\r\n\r\n// Included from: src/javascript/runtime/html4/file/FileReader.js\r\n\r\n/**\r\n * FileReader.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/html4/file/FileReader\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/html4/file/FileReader\", [\r\n\t\"moxie/runtime/html4/Runtime\",\r\n\t\"moxie/runtime/html5/file/FileReader\"\r\n], function(extensions, FileReader) {\r\n\treturn (extensions.FileReader = FileReader);\r\n});\r\n\r\n// Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js\r\n\r\n/**\r\n * XMLHttpRequest.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/html4/xhr/XMLHttpRequest\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/html4/xhr/XMLHttpRequest\", [\r\n\t\"moxie/runtime/html4/Runtime\",\r\n\t\"moxie/core/utils/Basic\",\r\n\t\"moxie/core/utils/Dom\",\r\n\t\"moxie/core/utils/Url\",\r\n\t\"moxie/core/Exceptions\",\r\n\t\"moxie/core/utils/Events\",\r\n\t\"moxie/file/Blob\",\r\n\t\"moxie/xhr/FormData\"\r\n], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) {\r\n\t\r\n\tfunction XMLHttpRequest() {\r\n\t\tvar _status, _response, _iframe;\r\n\r\n\t\tfunction cleanup(cb) {\r\n\t\t\tvar target = this, uid, form, inputs, i, hasFile = false;\r\n\r\n\t\t\tif (!_iframe) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tuid = _iframe.id.replace(/_iframe$/, '');\r\n\r\n\t\t\tform = Dom.get(uid + '_form');\r\n\t\t\tif (form) {\r\n\t\t\t\tinputs = form.getElementsByTagName('input');\r\n\t\t\t\ti = inputs.length;\r\n\r\n\t\t\t\twhile (i--) {\r\n\t\t\t\t\tswitch (inputs[i].getAttribute('type')) {\r\n\t\t\t\t\t\tcase 'hidden':\r\n\t\t\t\t\t\t\tinputs[i].parentNode.removeChild(inputs[i]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'file':\r\n\t\t\t\t\t\t\thasFile = true; // flag the case for later\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tinputs = [];\r\n\r\n\t\t\t\tif (!hasFile) { // we need to keep the form for sake of possible retries\r\n\t\t\t\t\tform.parentNode.removeChild(form);\r\n\t\t\t\t}\r\n\t\t\t\tform = null;\r\n\t\t\t}\r\n\r\n\t\t\t// without timeout, request is marked as canceled (in console)\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tEvents.removeEvent(_iframe, 'load', target.uid);\r\n\t\t\t\tif (_iframe.parentNode) { // #382\r\n\t\t\t\t\t_iframe.parentNode.removeChild(_iframe);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// check if shim container has any other children, if - not, remove it as well\r\n\t\t\t\tvar shimContainer = target.getRuntime().getShimContainer();\r\n\t\t\t\tif (!shimContainer.children.length) {\r\n\t\t\t\t\tshimContainer.parentNode.removeChild(shimContainer);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tshimContainer = _iframe = null;\r\n\t\t\t\tcb();\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tBasic.extend(this, {\r\n\t\t\tsend: function(meta, data) {\r\n\t\t\t\tvar target = this, I = target.getRuntime(), uid, form, input, blob;\r\n\r\n\t\t\t\t_status = _response = null;\r\n\r\n\t\t\t\tfunction createIframe() {\r\n\t\t\t\t\tvar container = I.getShimContainer() || document.body\r\n\t\t\t\t\t, temp = document.createElement('div')\r\n\t\t\t\t\t;\r\n\r\n\t\t\t\t\t// IE 6 won't be able to set the name using setAttribute or iframe.name\r\n\t\t\t\t\ttemp.innerHTML = '';\r\n\t\t\t\t\t_iframe = temp.firstChild;\r\n\t\t\t\t\tcontainer.appendChild(_iframe);\r\n\r\n\t\t\t\t\t/* _iframe.onreadystatechange = function() {\r\n\t\t\t\t\t\tconsole.info(_iframe.readyState);\r\n\t\t\t\t\t};*/\r\n\r\n\t\t\t\t\tEvents.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8\r\n\t\t\t\t\t\tvar el;\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tel = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document;\r\n\r\n\t\t\t\t\t\t\t// try to detect some standard error pages\r\n\t\t\t\t\t\t\tif (/^4(0[0-9]|1[0-7]|2[2346])\\s/.test(el.title)) { // test if title starts with 4xx HTTP error\r\n\t\t\t\t\t\t\t\t_status = el.title.replace(/^(\\d+).*$/, '$1');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t_status = 200;\r\n\t\t\t\t\t\t\t\t// get result\r\n\t\t\t\t\t\t\t\t_response = Basic.trim(el.body.innerHTML);\r\n\r\n\t\t\t\t\t\t\t\t// we need to fire these at least once\r\n\t\t\t\t\t\t\t\ttarget.trigger({\r\n\t\t\t\t\t\t\t\t\ttype: 'progress',\r\n\t\t\t\t\t\t\t\t\tloaded: _response.length,\r\n\t\t\t\t\t\t\t\t\ttotal: _response.length\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\tif (blob) { // if we were uploading a file\r\n\t\t\t\t\t\t\t\t\ttarget.trigger({\r\n\t\t\t\t\t\t\t\t\t\ttype: 'uploadprogress',\r\n\t\t\t\t\t\t\t\t\t\tloaded: blob.size || 1025,\r\n\t\t\t\t\t\t\t\t\t\ttotal: blob.size || 1025\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\tif (Url.hasSameOrigin(meta.url)) {\r\n\t\t\t\t\t\t\t\t// if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm\r\n\t\t\t\t\t\t\t\t// which obviously results to cross domain error (wtf?)\r\n\t\t\t\t\t\t\t\t_status = 404;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcleanup.call(target, function() {\r\n\t\t\t\t\t\t\t\t\ttarget.trigger('error');\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tcleanup.call(target, function() {\r\n\t\t\t\t\t\t\ttarget.trigger('load');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}, target.uid);\r\n\t\t\t\t} // end createIframe\r\n\r\n\t\t\t\t// prepare data to be sent and convert if required\r\n\t\t\t\tif (data instanceof FormData && data.hasBlob()) {\r\n\t\t\t\t\tblob = data.getBlob();\r\n\t\t\t\t\tuid = blob.uid;\r\n\t\t\t\t\tinput = Dom.get(uid);\r\n\t\t\t\t\tform = Dom.get(uid + '_form');\r\n\t\t\t\t\tif (!form) {\r\n\t\t\t\t\t\tthrow new x.DOMException(x.DOMException.NOT_FOUND_ERR);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tuid = Basic.guid('uid_');\r\n\r\n\t\t\t\t\tform = document.createElement('form');\r\n\t\t\t\t\tform.setAttribute('id', uid + '_form');\r\n\t\t\t\t\tform.setAttribute('method', meta.method);\r\n\t\t\t\t\tform.setAttribute('enctype', 'multipart/form-data');\r\n\t\t\t\t\tform.setAttribute('encoding', 'multipart/form-data');\r\n\t\t\t\t\tform.setAttribute('target', uid + '_iframe');\r\n\r\n\t\t\t\t\tI.getShimContainer().appendChild(form);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (data instanceof FormData) {\r\n\t\t\t\t\tdata.each(function(value, name) {\r\n\t\t\t\t\t\tif (value instanceof Blob) {\r\n\t\t\t\t\t\t\tif (input) {\r\n\t\t\t\t\t\t\t\tinput.setAttribute('name', name);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tvar hidden = document.createElement('input');\r\n\r\n\t\t\t\t\t\t\tBasic.extend(hidden, {\r\n\t\t\t\t\t\t\t\ttype : 'hidden',\r\n\t\t\t\t\t\t\t\tname : name,\r\n\t\t\t\t\t\t\t\tvalue : value\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t// make sure that input[type=\"file\"], if it's there, comes last\r\n\t\t\t\t\t\t\tif (input) {\r\n\t\t\t\t\t\t\t\tform.insertBefore(hidden, input);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tform.appendChild(hidden);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// set destination url\r\n\t\t\t\tform.setAttribute(\"action\", meta.url);\r\n\r\n\t\t\t\tcreateIframe();\r\n\t\t\t\tform.submit();\r\n\t\t\t\ttarget.trigger('loadstart');\r\n\t\t\t},\r\n\r\n\t\t\tgetStatus: function() {\r\n\t\t\t\treturn _status;\r\n\t\t\t},\r\n\r\n\t\t\tgetResponse: function(responseType) {\r\n\t\t\t\tif ('json' === responseType) {\r\n\t\t\t\t\t// strip off ..
tags that might be enclosing the response\r\n\t\t\t\t\tif (Basic.typeOf(_response) === 'string' && !!window.JSON) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\treturn JSON.parse(_response.replace(/^\\s*]*>/, '').replace(/<\\/pre>\\s*$/, ''));\r\n\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t} else if ('document' === responseType) {\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn _response;\r\n\t\t\t},\r\n\r\n\t\t\tabort: function() {\r\n\t\t\t\tvar target = this;\r\n\r\n\t\t\t\tif (_iframe && _iframe.contentWindow) {\r\n\t\t\t\t\tif (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome\r\n\t\t\t\t\t\t_iframe.contentWindow.stop();\r\n\t\t\t\t\t} else if (_iframe.contentWindow.document.execCommand) { // IE\r\n\t\t\t\t\t\t_iframe.contentWindow.document.execCommand('Stop');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t_iframe.src = \"about:blank\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcleanup.call(this, function() {\r\n\t\t\t\t\t// target.dispatchEvent('readystatechange');\r\n\t\t\t\t\ttarget.dispatchEvent('abort');\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\treturn (extensions.XMLHttpRequest = XMLHttpRequest);\r\n});\r\n\r\n// Included from: src/javascript/runtime/html4/image/Image.js\r\n\r\n/**\r\n * Image.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/**\r\n@class moxie/runtime/html4/image/Image\r\n@private\r\n*/\r\ndefine(\"moxie/runtime/html4/image/Image\", [\r\n\t\"moxie/runtime/html4/Runtime\",\r\n\t\"moxie/runtime/html5/image/Image\"\r\n], function(extensions, Image) {\r\n\treturn (extensions.Image = Image);\r\n});\r\n\r\nexpose([\"moxie/core/utils/Basic\",\"moxie/core/I18n\",\"moxie/core/utils/Mime\",\"moxie/core/utils/Env\",\"moxie/core/utils/Dom\",\"moxie/core/Exceptions\",\"moxie/core/EventTarget\",\"moxie/core/utils/Encode\",\"moxie/runtime/Runtime\",\"moxie/runtime/RuntimeClient\",\"moxie/file/Blob\",\"moxie/file/File\",\"moxie/file/FileInput\",\"moxie/file/FileDrop\",\"moxie/runtime/RuntimeTarget\",\"moxie/file/FileReader\",\"moxie/core/utils/Url\",\"moxie/file/FileReaderSync\",\"moxie/xhr/FormData\",\"moxie/xhr/XMLHttpRequest\",\"moxie/runtime/Transporter\",\"moxie/image/Image\",\"moxie/core/utils/Events\"]);\r\n})(this);/**\r\n * o.js\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n */\r\n\r\n/*global moxie:true */\r\n\r\n/**\r\nGlobally exposed namespace with the most frequently used public classes and handy methods.\r\n\r\n@class o\r\n@static\r\n@private\r\n*/\r\n(function() {\r\n\t\"use strict\";\r\n\r\n\tvar o = {}, inArray = moxie.core.utils.Basic.inArray;\r\n\r\n\t// directly add some public classes\r\n\t// (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included)\r\n\t(function addAlias(ns) {\r\n\t\tvar name, itemType;\r\n\t\tfor (name in ns) {\r\n\t\t\titemType = typeof(ns[name]);\r\n\t\t\tif (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) {\r\n\t\t\t\taddAlias(ns[name]);\r\n\t\t\t} else if (itemType === 'function') {\r\n\t\t\t\to[name] = ns[name];\r\n\t\t\t}\r\n\t\t}\r\n\t})(window.moxie);\r\n\r\n\t// add some manually\r\n\to.Env = window.moxie.core.utils.Env;\r\n\to.Mime = window.moxie.core.utils.Mime;\r\n\to.Exceptions = window.moxie.core.Exceptions;\r\n\r\n\t// expose globally\r\n\twindow.mOxie = o;\r\n\tif (!window.o) {\r\n\t\twindow.o = o;\r\n\t}\r\n\treturn o;\r\n})();\r\n","/**\r\n * Plupload - multi-runtime File Uploader\r\n * v2.1.1\r\n *\r\n * Copyright 2013, Moxiecode Systems AB\r\n * Released under GPL License.\r\n *\r\n * License: http://www.plupload.com/license\r\n * Contributing: http://www.plupload.com/contributing\r\n *\r\n * Date: 2014-01-16\r\n */\r\n;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:\"slice_blob\",jpgresize:\"send_binary_string\",pngresize:\"send_binary_string\",progress:\"report_upload_progress\",multi_selection:\"select_multiple\",dragdrop:\"drag_and_drop\",drop_element:\"drag_and_drop\",headers:\"send_custom_headers\",canSendBinary:\"send_binary\",triggerDialog:\"summon_file_dialog\"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};return typeof t==\"string\"?o.each(t.split(/\\s*,\\s*/),function(e){r(e,!0)}):typeof t==\"object\"?o.each(t,function(e,t){r(t,e)}):t===!0&&(e.multipart||(n.send_binary_string=!0),e.chunk_size>0&&(n.slice_blob=!0),e.resize.enabled&&(n.send_binary_string=!0),o.each(e,function(e,t){r(t,!!e,!0)})),n}var r=e.setTimeout,i={},o={VERSION:\"2.1.1\",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,IMAGE_MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!==\"array\"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={\"<\":\"lt\",\">\":\"gt\",\"&\":\"amp\",'\"':\"quot\",\"'\":\"#39\"},n=/[<>&\\\"\\']/g;return e?(\"\"+e).replace(n,function(e){return t[e]?\"&\"+t[e]+\";\":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\\300-\\306]/g,\"A\",/[\\340-\\346]/g,\"a\",/\\307/g,\"C\",/\\347/g,\"c\",/[\\310-\\313]/g,\"E\",/[\\350-\\353]/g,\"e\",/[\\314-\\317]/g,\"I\",/[\\354-\\357]/g,\"i\",/\\321/g,\"N\",/\\361/g,\"n\",/[\\322-\\330]/g,\"O\",/[\\362-\\370]/g,\"o\",/[\\331-\\334]/g,\"U\",/[\\371-\\374]/g,\"u\"];for(t=0;t0?\"&\":\"?\")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\\D/.test(e))return o.translate(\"N/A\");var r=Math.pow(1024,4);return e>r?t(e/r,1)+\" \"+o.translate(\"tb\"):e>(r/=1024)?t(e/r,1)+\" \"+o.translate(\"gb\"):e>(r/=1024)?t(e/r,1)+\" \"+o.translate(\"mb\"):e>1024?Math.round(e/1024)+\" \"+o.translate(\"kb\"):e+\" \"+o.translate(\"b\")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter(\"mime_types\",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger(\"Error\",{code:o.FILE_EXTENSION_ERROR,message:o.translate(\"File extension error.\"),file:t}),n(!1)):n(!0)}),o.addFileFilter(\"max_file_size\",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger(\"Error\",{code:o.FILE_SIZE_ERROR,message:o.translate(\"File size error.\"),file:t}),n(!1)):n(!0)}),o.addFileFilter(\"prevent_duplicates\",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger(\"Error\",{code:o.FILE_DUPLICATE_ERROR,message:o.translate(\"Duplicate file error.\"),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind(\"FilesAdded\",C),this.bind(\"CancelUpload\",M),this.bind(\"BeforeUpload\",k),this.bind(\"UploadFile\",L),this.bind(\"UploadProgress\",A),this.bind(\"StateChanged\",O),this.bind(\"QueueChanged\",b),this.bind(\"Error\",D),this.bind(\"FileUploaded\",_),this.bind(\"Destroy\",P)}function x(e,n){var r=this,i=0,s=[],u={accept:e.filters.mime_types,runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\\s*,\\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can(\"slice_blob\"),multipart:e.can(\"send_multipart\"),multi_selection:e.can(\"select_multiple\")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind(\"mouseenter mouseleave mousedown mouseup\",function(r){v||(e.browse_button_hover&&(\"mouseenter\"===r.type?t.addClass(n,e.browse_button_hover):\"mouseleave\"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&(\"mousedown\"===r.type?t.addClass(n,e.browse_button_active):\"mouseup\"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind(\"error runtimeerror\",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can(\"drag_and_drop\"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind(\"error runtimeerror\",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n==\"function\"&&n(i)})}function T(e,n,r){var i=new t.Image;try{i.onload=function(){i.downsize(n.width,n.height,n.crop,n.preserve_headers)},i.onresize=function(){r(this.getAsBlob(e.type,n.quality)),this.destroy()},i.onerror=function(){r(e)},i.load(e)}catch(s){r(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case\"max_file_size\":e===\"max_file_size\"&&(a.max_file_size=a.filters.max_file_size=t);break;case\"chunk_size\":if(t=o.parseSize(t))a[e]=t;break;case\"filters\":o.typeOf(t)===\"array\"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\\s*\\*\\s*$/.test(e)?t.push(\"\\\\.*\"):t.push(\"\\\\.\"+e.replace(new RegExp(\"[\"+\"/^$.*+?|()[]{}\\\\\".replace(/./g,\"\\\\$&\")+\"]\",\"g\"),\"\\\\$&\"))})}),new RegExp(\"(\"+t.join(\"|\")+\")$\",\"i\")}(a.filters.mime_types));break;case\"resize\":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case\"prevent_duplicates\":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case\"browse_button\":case\"drop_element\":t=o.get(t);case\"container\":case\"runtimes\":case\"multi_selection\":case\"flash_swf_url\":case\"silverlight_xap_url\":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger(\"OptionChanged\",e,t,r)}var i=this,u=!1;typeof e==\"object\"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger(\"Destroy\"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger(\"Init\",{runtime:i.runtime}),i.trigger(\"PostInit\")):i.trigger(\"Error\",{code:o.INIT_ERROR,message:o.translate(\"Init error.\")})}))}function C(e,t){[].push.apply(f,t),e.trigger(\"QueueChanged\"),e.refresh()}function k(e,t){if(a.unique_names){var n=t.name.match(/\\.([^.]+)$/),r=\"part\";n&&(r=n[1]),t.target_name=t.id+\".\"+r}}function L(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger(\"Error\",{code:o.HTTP_ERROR,message:o.translate(\"HTTP Error.\"),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g,y;if(n.status==o.DONE||n.status==o.FAILED||e.state==o.STOPPED)return;g={name:n.target_name||n.name},s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger(\"UploadProgress\",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger(\"UploadProgress\",n),n.status=o.DONE,e.trigger(\"FileUploaded\",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(g.name=n.target_name||n.name,m.open(\"post\",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open(\"post\",i,!0),m.setRequestHeader(\"Content-Type\",\"application/octet-stream\"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s*Math.floor(n.loaded/s)),c=n.getSource(),e.settings.resize.enabled&&E(c,\"send_binary_string\")&&!!~t.inArray(c.type,[\"image/jpeg\",\"image/png\"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function A(e,t){y(t)}function O(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function M(){m&&m.abort()}function _(e){b(),r(function(){g.call(e)},1)}function D(e,t){t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger(\"CancelUpload\"),r(function(){g.call(e)},1)))}function P(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:\"file\",flash_swf_url:\"js/Moxie.swf\",silverlight_xap_url:\"js/Moxie.xap\",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit==\"function\"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)});if(!a.browse_button||!a.url){this.trigger(\"Error\",{code:o.INIT_ERROR,message:o.translate(\"Init error.\")});return}S.call(this),x.call(this,a,function(n){typeof a.init==\"function\"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger(\"Init\",{runtime:e.runtime}),e.trigger(\"PostInit\")):e.trigger(\"Error\",{code:o.INIT_ERROR,message:o.translate(\"Init error.\")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger(\"Refresh\")}),this.trigger(\"Refresh\")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger(\"StateChanged\"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger(\"StateChanged\"),this.trigger(\"CancelUpload\"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger(\"DisableBrowse\",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function l(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function c(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!f)return!1;e.ruid=f,e.connectRuntime(f)}c(new o.File(e))}else e instanceof t.Blob?(c(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){l(e,function(n){n||(a.push(e),s.trigger(\"FileFiltered\",e)),r(t,1)})})):t.inArray(i,[\"file\",\"blob\"])!==-1?c(new t.File(null,e)):i===\"node\"&&t.typeOf(e.files)===\"filelist\"?t.each(e.files,c):i===\"array\"&&(n=null,t.each(e,c))}var s=this,u=[],a=[],f;f=w(),c(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger(\"FilesAdded\",a)})},removeFile:function(e){var t=typeof e==\"string\"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(i=!0,this.stop()),this.trigger(\"FilesRemoved\",r),o.each(r,function(e){e.destroy()}),this.trigger(\"QueueChanged\"),this.refresh(),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger(\"Destroy\"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||\"\",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),[\"blob\",\"file\"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie);","/*!\r\n * Knockout JavaScript library v3.3.0\r\n * (c) Steven Sanderson - http://knockoutjs.com/\r\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\r\n */\r\n\r\n(function() {(function(p){var y=this||(0,eval)(\"this\"),w=y.document,M=y.navigator,u=y.jQuery,E=y.JSON;(function(p){\"function\"===typeof define&&define.amd?define([\"exports\",\"require\"],p):\"function\"===typeof require&&\"object\"===typeof exports&&\"object\"===typeof module?p(module.exports||exports):p(y.ko={})})(function(N,O){function J(a,d){return null===a||typeof a in Q?a===d:!1}function R(a,d){var c;return function(){c||(c=setTimeout(function(){c=p;a()},d))}}function S(a,d){var c;return function(){clearTimeout(c);\r\nc=setTimeout(a,d)}}function K(b,d,c,e){a.d[b]={init:function(b,k,h,l,g){var m,x;a.w(function(){var q=a.a.c(k()),n=!c!==!q,r=!x;if(r||d||n!==m)r&&a.Z.oa()&&(x=a.a.la(a.e.childNodes(b),!0)),n?(r||a.e.T(b,a.a.la(x)),a.Ja(e?e(g,q):g,b)):a.e.ma(b),m=n},null,{q:b});return{controlsDescendantBindings:!0}}};a.h.ka[b]=!1;a.e.R[b]=!0}var a=\"undefined\"!==typeof N?N:{};a.b=function(b,d){for(var c=b.split(\".\"),e=a,f=0;fa.a.m(c,b[g])&&c.push(b[g]);return c},Ka:function(a,b){a=a||[];for(var c=[],g=0,d=a.length;gd?g&&b.push(c):g||b.splice(d,1)},za:f,extend:d,Fa:c,Ga:f?c:d,A:b,pa:function(a,b){if(!a)return a;var c={},g;for(g in a)a.hasOwnProperty(g)&&(c[g]=b(a[g],g,a));return c},Ra:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Jb:function(b){b=a.a.O(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement(\"div\"),g=0,d=b.length;g<\r\nd;g++)c.appendChild(a.S(b[g]));return c},la:function(b,c){for(var g=0,d=b.length,e=[];gg?a.setAttribute(\"selected\",b):a.selected=b},ib:function(a){return null===a||a===p?\"\":a.trim?a.trim():a.toString().replace(/^[\\s\\xa0]+|[\\s\\xa0]+$/g,\"\")},Dc:function(a,b){a=a||\"\";return b.length>a.length?!1:a.substring(0,b.length)===b},jc:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3===a.nodeType?\r\na.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Qa:function(b){return a.a.jc(b,b.ownerDocument.documentElement)},tb:function(b){return!!a.a.vb(b,a.a.Qa)},v:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,c,d){var m=g&&l[c];if(!m&&u)u(b).bind(c,d);else if(m||\"function\"!=typeof b.addEventListener)if(\"undefined\"!=typeof b.attachEvent){var e=function(a){d.call(b,a)},f=\"on\"+c;b.attachEvent(f,e);a.a.C.fa(b,\r\nfunction(){b.detachEvent(f,e)})}else throw Error(\"Browser doesn't support addEventListener or attachEvent\");else b.addEventListener(c,d,!1)},qa:function(b,c){if(!b||!b.nodeType)throw Error(\"element must be a DOM node when calling triggerEvent\");var g;\"input\"===a.a.v(b)&&b.type&&\"click\"==c.toLowerCase()?(g=b.type,g=\"checkbox\"==g||\"radio\"==g):g=!1;if(u&&!g)u(b).trigger(c);else if(\"function\"==typeof w.createEvent)if(\"function\"==typeof b.dispatchEvent)g=w.createEvent(h[c]||\"HTMLEvents\"),g.initEvent(c,\r\n!0,!0,y,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(g);else throw Error(\"The supplied element doesn't support dispatchEvent\");else if(g&&b.click)b.click();else if(\"undefined\"!=typeof b.fireEvent)b.fireEvent(\"on\"+c);else throw Error(\"Browser doesn't support triggering events\");},c:function(b){return a.F(b)?b():b},cb:function(b){return a.F(b)?b.B():b},Ia:function(b,c,g){var d;c&&(\"object\"===typeof b.classList?(d=b.classList[g?\"add\":\"remove\"],a.a.o(c.match(m),function(a){d.call(b.classList,a)})):\"string\"===\r\ntypeof b.className.baseVal?e(b.className,\"baseVal\",c,g):e(b,\"className\",c,g))},Ha:function(b,c){var g=a.a.c(c);if(null===g||g===p)g=\"\";var d=a.e.firstChild(b);!d||3!=d.nodeType||a.e.nextSibling(d)?a.e.T(b,[b.ownerDocument.createTextNode(g)]):d.data=g;a.a.mc(b)},Rb:function(a,b){a.name=b;if(7>=g)try{a.mergeAttributes(w.createElement(\"\"),!1)}catch(c){}},mc:function(a){9<=g&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},kc:function(a){if(g){var b=a.style.width;\r\na.style.width=0;a.style.width=b}},Bc:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var g=[],d=b;d<=c;d++)g.push(d);return g},O:function(a){for(var b=[],c=0,g=a.length;c\",\"\"]||!f.indexOf(\"
\",\r\n\"\"]||(!f.indexOf(\" | \",\"
\"]||[0,\"\",\"\"],k=\"ignored\"+f[1]+b+f[2]+\"
\";for(\"function\"==typeof c.innerShiv?e.appendChild(c.innerShiv(k)):e.innerHTML=k;f[0]--;)e=e.lastChild;c=a.a.O(e.lastChild.childNodes)}return c};a.a.gb=function(b,d){a.a.Ra(b);d=a.a.c(d);if(null!==d&&d!==p)if(\"string\"!=typeof d&&(d=d.toString()),u)u(b).html(d);else for(var c=a.a.ca(d,b.ownerDocument),e=0;ef[0]?r+f[0]:f[0]),r);for(var r=1===v?r:Math.min(d+(f[1]||0),r),v=d+v-2,t=Math.max(r,v),G=[],A=[],p=2;dc;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.Vb(b);return a.a.jb(b,c,d)};c.prototype={save:function(b,c){var d=a.a.m(this.keys,b);0<=d?this.mb[d]=c:(this.keys.push(b),this.mb.push(c))},get:function(b){b=a.a.m(this.keys,b);return 0<=b?this.mb[b]:p}}})();a.b(\"toJS\",a.Vb);a.b(\"toJSON\",a.toJSON);(function(){a.i={s:function(b){switch(a.a.v(b)){case \"option\":return!0===b.__ko__hasDomDataOptionValue__?a.a.f.get(b,a.d.options.ab):7>=a.a.M?b.getAttributeNode(\"value\")&&b.getAttributeNode(\"value\").specified?\r\nb.value:b.text:b.value;case \"select\":return 0<=b.selectedIndex?a.i.s(b.options[b.selectedIndex]):p;default:return b.value}},Y:function(b,d,c){switch(a.a.v(b)){case \"option\":switch(typeof d){case \"string\":a.a.f.set(b,a.d.options.ab,p);\"__ko__hasDomDataOptionValue__\"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=d;break;default:a.a.f.set(b,a.d.options.ab,d),b.__ko__hasDomDataOptionValue__=!0,b.value=\"number\"===typeof d?d:\"\"}break;case \"select\":if(\"\"===d||null===d)d=p;for(var e=-1,f=0,k=b.options.length,\r\nh;f=n){c.push(x&&h.length?{key:x,\r\nvalue:h.join(\"\")}:{unknown:x||h.join(\"\")});x=n=0;h=[];continue}}else if(58===t){if(!n&&!x&&1===h.length){x=h.pop();continue}}else 47===t&&r&&1a.a.M&&(a.g.register=function(a){return function(b){w.createElement(b);\r\nreturn a.apply(this,arguments)}}(a.g.register),w.createDocumentFragment=function(b){return function(){var d=b(),f=a.g.$b,k;for(k in f)f.hasOwnProperty(k)&&d.createElement(k);return d}}(w.createDocumentFragment))})();(function(b){function d(b,c,d){c=c.template;if(!c)throw Error(\"Component '\"+b+\"' has no template\");b=a.a.la(c);a.e.T(d,b)}function c(a,b,c,d){var e=a.createViewModel;return e?e.call(a,d,{element:b,templateNodes:c}):d}var e=0;a.d.component={init:function(f,k,h,l,g){function m(){var a=x&&\r\nx.dispose;\"function\"===typeof a&&a.call(x);q=null}var x,q,n=a.a.O(a.e.childNodes(f));a.a.C.fa(f,m);a.w(function(){var l=a.a.c(k()),h,t;\"string\"===typeof l?h=l:(h=a.a.c(l.name),t=a.a.c(l.params));if(!h)throw Error(\"No component name specified\");var p=q=++e;a.g.get(h,function(e){if(q===p){m();if(!e)throw Error(\"Unknown component '\"+h+\"'\");d(h,e,f);var l=c(e,f,n,t);e=g.createChildContext(l,b,function(a){a.$component=l;a.$componentTemplateNodes=n});x=l;a.Ja(e,f)}})},null,{q:f});return{controlsDescendantBindings:!0}}};\r\na.e.R.component=!0})();var P={\"class\":\"className\",\"for\":\"htmlFor\"};a.d.attr={update:function(b,d){var c=a.a.c(d())||{};a.a.A(c,function(c,d){d=a.a.c(d);var k=!1===d||null===d||d===p;k&&b.removeAttribute(c);8>=a.a.M&&c in P?(c=P[c],k?b.removeAttribute(c):b[c]=d):k||b.setAttribute(c,d.toString());\"name\"===c&&a.a.Rb(b,k?\"\":d.toString())})}};(function(){a.d.checked={after:[\"value\",\"attr\"],init:function(b,d,c){function e(){var e=b.checked,f=x?k():e;if(!a.Z.Ca()&&(!l||e)){var h=a.k.u(d);g?m!==f?(e&&(a.a.ga(h,\r\nf,!0),a.a.ga(h,m,!1)),m=f):a.a.ga(h,f,e):a.h.ra(h,c,\"checked\",f,!0)}}function f(){var c=a.a.c(d());b.checked=g?0<=a.a.m(c,k()):h?c:k()===c}var k=a.Nb(function(){return c.has(\"checkedValue\")?a.a.c(c.get(\"checkedValue\")):c.has(\"value\")?a.a.c(c.get(\"value\")):b.value}),h=\"checkbox\"==b.type,l=\"radio\"==b.type;if(h||l){var g=h&&a.a.c(d())instanceof Array,m=g?k():p,x=l||g;l&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.w(e,null,{q:b});a.a.n(b,\"click\",e);a.w(f,null,{q:b})}}};a.h.V.checked=!0;a.d.checkedValue=\r\n{update:function(b,d){b.value=a.a.c(d())}}})();a.d.css={update:function(b,d){var c=a.a.c(d());null!==c&&\"object\"==typeof c?a.a.A(c,function(c,d){d=a.a.c(d);a.a.Ia(b,c,d)}):(c=String(c||\"\"),a.a.Ia(b,b.__ko__cssValue,!1),b.__ko__cssValue=c,a.a.Ia(b,c,!0))}};a.d.enable={update:function(b,d){var c=a.a.c(d());c&&b.disabled?b.removeAttribute(\"disabled\"):c||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,d){a.d.enable.update(b,function(){return!a.a.c(d())})}};a.d.event={init:function(b,d,c,\r\ne,f){var k=d()||{};a.a.A(k,function(h){\"string\"==typeof h&&a.a.n(b,h,function(b){var g,m=d()[h];if(m){try{var k=a.a.O(arguments);e=f.$data;k.unshift(e);g=m.apply(e,k)}finally{!0!==g&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===c.get(h+\"Bubble\")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={Ib:function(b){return function(){var d=b(),c=a.a.cb(d);if(!c||\"number\"==typeof c.length)return{foreach:d,templateEngine:a.P.Va};a.a.c(d);return{foreach:c.data,as:c.as,\r\nincludeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:a.P.Va}}},init:function(b,d){return a.d.template.init(b,a.d.foreach.Ib(d))},update:function(b,d,c,e,f){return a.d.template.update(b,a.d.foreach.Ib(d),c,e,f)}};a.h.ka.foreach=!1;a.e.R.foreach=!0;a.d.hasfocus={init:function(b,d,c){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if(\"activeElement\"in f){var g;try{g=f.activeElement}catch(m){g=\r\nf.body}e=g===b}f=d();a.h.ra(f,c,\"hasfocus\",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),k=e.bind(null,!1);a.a.n(b,\"focus\",f);a.a.n(b,\"focusin\",f);a.a.n(b,\"blur\",k);a.a.n(b,\"focusout\",k)},update:function(b,d){var c=!!a.a.c(d());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===c||(c?b.focus():b.blur(),a.k.u(a.a.qa,null,[b,c?\"focusin\":\"focusout\"]))}};a.h.V.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.h.V.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},\r\nupdate:function(b,d){a.a.gb(b,d())}};K(\"if\");K(\"ifnot\",!1,!0);K(\"with\",!0,!1,function(a,d){return a.createChildContext(d)});var L={};a.d.options={init:function(b){if(\"select\"!==a.a.v(b))throw Error(\"options binding applies only to SELECT elements\");for(;0a.a.M)var k=a.a.f.I(),h=a.a.f.I(),l=function(b){var c=this.activeElement;(c=c&&a.a.f.get(c,h))&&c(b)},g=function(b,c){var d=b.ownerDocument;a.a.f.get(d,k)||(a.a.f.set(d,k,!0),a.a.n(d,\"selectionchange\",l));a.a.f.set(b,h,c)};a.d.textInput={init:function(b,c,l){function h(c,d){a.a.n(b,c,d)}function k(){var d=a.a.c(c());if(null===d||d===p)d=\"\";w!==p&&d===w?setTimeout(k,4):b.value!==d&&(u=d,b.value=d)}function v(){A||\r\n(w=b.value,A=setTimeout(t,4))}function t(){clearTimeout(A);w=A=p;var d=b.value;u!==d&&(u=d,a.h.ra(c(),l,\"textInput\",d))}var u=b.value,A,w;10>a.a.M?(h(\"propertychange\",function(a){\"value\"===a.propertyName&&t()}),8==a.a.M&&(h(\"keyup\",t),h(\"keydown\",t)),8<=a.a.M&&(g(b,t),h(\"dragend\",v))):(h(\"input\",t),5>e&&\"textarea\"===a.a.v(b)?(h(\"keydown\",v),h(\"paste\",v),h(\"cut\",v)):11>d?h(\"keydown\",v):4>f&&(h(\"DOMAutoComplete\",t),h(\"dragdrop\",t),h(\"drop\",t)));h(\"change\",t);a.w(k,null,{q:b})}};a.h.V.textInput=!0;a.d.textinput=\r\n{preprocess:function(a,b,c){c(\"textInput\",a)}}})();a.d.uniqueName={init:function(b,d){if(d()){var c=\"ko_unique_\"+ ++a.d.uniqueName.fc;a.a.Rb(b,c)}}};a.d.uniqueName.fc=0;a.d.value={after:[\"options\",\"foreach\"],init:function(b,d,c){if(\"input\"!=b.tagName.toLowerCase()||\"checkbox\"!=b.type&&\"radio\"!=b.type){var e=[\"change\"],f=c.get(\"valueUpdate\"),k=!1,h=null;f&&(\"string\"==typeof f&&(f=[f]),a.a.ia(e,f),e=a.a.wb(e));var l=function(){h=null;k=!1;var e=d(),g=a.i.s(b);a.h.ra(e,c,\"value\",g)};!a.a.M||\"input\"!=\r\nb.tagName.toLowerCase()||\"text\"!=b.type||\"off\"==b.autocomplete||b.form&&\"off\"==b.form.autocomplete||-1!=a.a.m(e,\"propertychange\")||(a.a.n(b,\"propertychange\",function(){k=!0}),a.a.n(b,\"focus\",function(){k=!1}),a.a.n(b,\"blur\",function(){k&&l()}));a.a.o(e,function(c){var d=l;a.a.Dc(c,\"after\")&&(d=function(){h=a.i.s(b);setTimeout(l,0)},c=c.substring(5));a.a.n(b,c,d)});var g=function(){var e=a.a.c(d()),f=a.i.s(b);if(null!==h&&e===h)setTimeout(g,0);else if(e!==f)if(\"select\"===a.a.v(b)){var l=c.get(\"valueAllowUnset\"),\r\nf=function(){a.i.Y(b,e,l)};f();l||e===a.i.s(b)?setTimeout(f,0):a.k.u(a.a.qa,null,[b,\"change\"])}else a.i.Y(b,e)};a.w(g,null,{q:b})}else a.va(b,{checkedValue:d})},update:function(){}};a.h.V.value=!0;a.d.visible={update:function(b,d){var c=a.a.c(d()),e=\"none\"!=b.style.display;c&&!e?b.style.display=\"\":!c&&e&&(b.style.display=\"none\")}};(function(b){a.d[b]={init:function(d,c,e,f,k){return a.d.event.init.call(this,d,function(){var a={};a[b]=c();return a},e,f,k)}}})(\"click\");a.J=function(){};a.J.prototype.renderTemplateSource=\r\nfunction(){throw Error(\"Override renderTemplateSource\");};a.J.prototype.createJavaScriptEvaluatorBlock=function(){throw Error(\"Override createJavaScriptEvaluatorBlock\");};a.J.prototype.makeTemplateSource=function(b,d){if(\"string\"==typeof b){d=d||w;var c=d.getElementById(b);if(!c)throw Error(\"Cannot find template with ID \"+b);return new a.t.l(c)}if(1==b.nodeType||8==b.nodeType)return new a.t.ha(b);throw Error(\"Unknown template type: \"+b);};a.J.prototype.renderTemplate=function(a,d,c,e){a=this.makeTemplateSource(a,\r\ne);return this.renderTemplateSource(a,d,c,e)};a.J.prototype.isTemplateRewritten=function(a,d){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,d).data(\"isRewritten\")};a.J.prototype.rewriteTemplate=function(a,d,c){a=this.makeTemplateSource(a,c);d=d(a.text());a.text(d);a.data(\"isRewritten\",!0)};a.b(\"templateEngine\",a.J);a.kb=function(){function b(b,c,d,h){b=a.h.bb(b);for(var l=a.h.ka,g=0;g]*))?)*\\s+)data-bind\\s*=\\s*([\"'])([\\s\\S]*?)\\3/gi,c=/\\x3c!--\\s*ko\\b\\s*([\\s\\S]*?)\\s*--\\x3e/g;return{lc:function(b,\r\nc,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kb.xc(b,c)},d)},xc:function(a,f){return a.replace(d,function(a,c,d,e,m){return b(m,c,d,f)}).replace(c,function(a,c){return b(c,\"\\x3c!-- ko --\\x3e\",\"#comment\",f)})},dc:function(b,c){return a.H.$a(function(d,h){var l=d.nextSibling;l&&l.nodeName.toLowerCase()===c&&a.va(l,b,h)})}}}();a.b(\"__tr_ambtns\",a.kb.dc);(function(){a.t={};a.t.l=function(a){this.l=a};a.t.l.prototype.text=function(){var b=a.a.v(this.l),b=\"script\"===b?\"text\":\r\n\"textarea\"===b?\"value\":\"innerHTML\";if(0==arguments.length)return this.l[b];var d=arguments[0];\"innerHTML\"===b?a.a.gb(this.l,d):this.l[b]=d};var b=a.a.f.I()+\"_\";a.t.l.prototype.data=function(c){if(1===arguments.length)return a.a.f.get(this.l,b+c);a.a.f.set(this.l,b+c,arguments[1])};var d=a.a.f.I();a.t.ha=function(a){this.l=a};a.t.ha.prototype=new a.t.l;a.t.ha.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.l,d)||{};b.lb===p&&b.Na&&(b.lb=b.Na.innerHTML);return b.lb}a.a.f.set(this.l,\r\nd,{lb:arguments[0]})};a.t.l.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.l,d)||{}).Na;a.a.f.set(this.l,d,{Na:arguments[0]})};a.b(\"templateSources\",a.t);a.b(\"templateSources.domElement\",a.t.l);a.b(\"templateSources.anonymousTemplate\",a.t.ha)})();(function(){function b(b,c,d){var e;for(c=a.e.nextSibling(c);b&&(e=b)!==c;)b=a.e.nextSibling(e),d(e,b)}function d(c,d){if(c.length){var e=c[0],f=c[c.length-1],h=e.parentNode,k=a.L.instance,r=k.preprocessNode;if(r){b(e,f,function(a,\r\nb){var c=a.previousSibling,d=r.call(k,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.na(c,h))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.ub(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.H.Xb(b,[d])});a.a.na(c,h)}}function c(a){return a.nodeType?a:0a.a.M?0:b.nodes)?b.nodes():null)return a.a.O(d.cloneNode(!0).childNodes);b=b.text();return a.a.ca(b,e)};a.P.Va=new a.P;a.hb(a.P.Va);a.b(\"nativeTemplateEngine\",a.P);(function(){a.Ya=function(){var a=this.uc=function(){if(!u||!u.tmpl)return 0;try{if(0<=u.tmpl.tag.tmpl.open.toString().indexOf(\"__\"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,\r\ne,f,k){k=k||w;f=f||{};if(2>a)throw Error(\"Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.\");var h=b.data(\"precompiled\");h||(h=b.text()||\"\",h=u.template(null,\"{{ko_with $item.koBindingContext}}\"+h+\"{{/ko_with}}\"),b.data(\"precompiled\",h));b=[e.$data];e=u.extend({koBindingContext:e},f.templateOptions);e=u.tmpl(h,b,e);e.appendTo(k.createElement(\"div\"));u.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return\"{{ko_code ((function() { return \"+\r\na+\" })()) }}\"};this.addTemplate=function(a,b){w.write(\"