diff --git a/baystation12.dme b/baystation12.dme index 8dc2efd5969..08979087f02 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1091,6 +1091,7 @@ #include "code\modules\nano\JSON Writer.dm" #include "code\modules\nano\nanoexternal.dm" #include "code\modules\nano\nanomanager.dm" +#include "code\modules\nano\nanomapgen.dm" #include "code\modules\nano\nanoui.dm" #include "code\modules\organs\blood.dm" #include "code\modules\organs\organ.dm" diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index d2b8d5e9625..4796afff998 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -84,7 +84,18 @@ crewmemberData["tox"] = round(H.getToxLoss(), 1) crewmemberData["fire"] = round(H.getFireLoss(), 1) crewmemberData["brute"] = round(H.getBruteLoss(), 1) - crewmemberData["name"] = (H.wear_id ? H.wear_id.name : "Unknown") + + crewmemberData["name"] = "Unknown" + crewmemberData["rank"] = "Unknown" + if(H.wear_id && istype(H.wear_id, /obj/item/weapon/card/id) ) + var/obj/item/weapon/card/id/I = H.wear_id + crewmemberData["name"] = I.name + crewmemberData["rank"] = I.rank + else if(H.wear_id && istype(H.wear_id, /obj/item/device/pda) ) + var/obj/item/device/pda/P = H.wear_id + crewmemberData["name"] = (P.id ? P.id.name : "Unknown") + crewmemberData["rank"] = (P.id ? P.id.rank : "Unknown") + var/area/A = get_area(H) crewmemberData["area"] = sanitize(A.name) crewmemberData["x"] = pos.x @@ -100,7 +111,16 @@ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) - ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 600) + ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800) + + // adding a template with the key "mapContent" enables the map ui functionality + ui.add_template("mapContent", "crew_monitor_map_content.tmpl") + // adding a template with the key "mapHeader" replaces the map header content + ui.add_template("mapHeader", "crew_monitor_map_header.tmpl") + + // we want to show the map by default + ui.set_show_map(1) + ui.set_initial_data(data) ui.open() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index fef38f3b35d..f6605059d01 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -127,7 +127,8 @@ var/list/admin_verbs_server = list( /datum/admins/proc/toggle_aliens, /datum/admins/proc/toggle_space_ninja, /client/proc/toggle_random_events, - /client/proc/check_customitem_activity + /client/proc/check_customitem_activity, + /client/proc/nanomapgen_DumpImage ) var/list/admin_verbs_debug = list( /client/proc/getruntimelog, /*allows us to access runtime logs to somebody*/ diff --git a/code/modules/nano/nanomapgen.dm b/code/modules/nano/nanomapgen.dm new file mode 100644 index 00000000000..dd65b7bbd08 --- /dev/null +++ b/code/modules/nano/nanomapgen.dm @@ -0,0 +1,90 @@ +// This file is a modified version of https://raw2.github.com/Baystation12/OldCode-BS12/master/code/TakePicture.dm + +#define NANOMAP_ICON_SIZE 4 +#define NANOMAP_MAX_ICON_DIMENSION 1024 + +#define NANOMAP_TILES_PER_IMAGE (NANOMAP_MAX_ICON_DIMENSION / NANOMAP_ICON_SIZE) + +#define NANOMAP_TERMINALERR 5 +#define NANOMAP_INPROGRESS 2 +#define NANOMAP_BADOUTPUT 2 +#define NANOMAP_SUCCESS 1 +#define NANOMAP_WATCHDOGSUCCESS 4 +#define NANOMAP_WATCHDOGTERMINATE 3 + + +//Call these procs to dump your world to a series of image files (!!) +//NOTE: Does not explicitly support non 32x32 icons or stuff with large pixel_* values, so don't blame me if it doesn't work perfectly + +/client/proc/nanomapgen_DumpImage() + set name = "Generate NanoUI Map" + set category = "Server" + + if(holder) + nanomapgen_DumpTile(1, 1, text2num(input(usr,"Enter the Z level to generate"))) + +/client/proc/nanomapgen_DumpTile(var/startX = 1, var/startY = 1, var/currentZ = 1, var/endX = -1, var/endY = -1) + + if (endX < 0 || endX > world.maxx) + endX = world.maxx + + if (endY < 0 || endY > world.maxy) + endY = world.maxy + + if (currentZ < 0 || currentZ > world.maxz) + usr << "NanoMapGen: ERROR: currentZ ([currentZ]) must be between 1 and [world.maxz]" + + sleep(3) + return NANOMAP_TERMINALERR + + if (startX > endX) + usr << "NanoMapGen: ERROR: startX ([startX]) cannot be greater than endX ([endX])" + + sleep(3) + return NANOMAP_TERMINALERR + + if (startY > endX) + usr << "NanoMapGen: ERROR: startY ([startY]) cannot be greater than endY ([endY])" + sleep(3) + return NANOMAP_TERMINALERR + + var/icon/Tile = icon(file("nano/mapbase1024.png")) + if (Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION) + world.log << "NanoMapGen: ERROR: BASE IMAGE DIMENSIONS ARE NOT [NANOMAP_MAX_ICON_DIMENSION]x[NANOMAP_MAX_ICON_DIMENSION]" + sleep(3) + return NANOMAP_TERMINALERR + + world.log << "NanoMapGen: GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])" + usr << "NanoMapGen: GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])" + + var/count = 0; + for(var/WorldX = startX, WorldX <= endX, WorldX++) + for(var/WorldY = startY, WorldY <= endY, WorldY++) + + var/atom/Turf = locate(WorldX, WorldY, currentZ) + + var/icon/TurfIcon = new(Turf.icon, Turf.icon_state) + TurfIcon.Scale(NANOMAP_ICON_SIZE, NANOMAP_ICON_SIZE) + + Tile.Blend(TurfIcon, ICON_OVERLAY, ((WorldX - 1) * NANOMAP_ICON_SIZE), ((WorldY - 1) * NANOMAP_ICON_SIZE)) + + count++ + + if (count % 8000 == 0) + world.log << "NanoMapGen: [count] tiles done" + sleep(1) + + var/mapFilename = "nanomap_z[currentZ]-new.png" + + world.log << "NanoMapGen: sending [mapFilename] to client" + + usr << browse(Tile, "window=picture;file=[mapFilename];display=0") + + world.log << "NanoMapGen: Done." + + usr << "NanoMapGen: Done. File [mapFilename] uploaded to your cache." + + if (Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION) + return NANOMAP_BADOUTPUT + + return NANOMAP_SUCCESS \ No newline at end of file diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 3620053db4d..b4d20155389 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -40,8 +40,16 @@ nanoui is used to open and update nano browser uis var/templates[0] // the layout key for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing) var/layout_key = "default" + // this sets whether to re-render the ui layout with each update (default 0, turning on will break the map ui if it's in use) + var/auto_update_layout = 0 + // this sets whether to re-render the ui content with each update (default 1) + var/auto_update_content = 1 // the default state to use for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing) var/state_key = "default" + // show the map ui, this is used by the default layout + var/show_map = 0 + // the map z level to display + var/map_z_level = 1 // initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on) var/list/initial_data[0] // set to 1 to update the ui automatically every master_controller tick @@ -166,8 +174,8 @@ nanoui is used to open and update nano browser uis * * @return nothing */ -/datum/nanoui/proc/set_auto_update(state = 1) - is_auto_updating = state +/datum/nanoui/proc/set_auto_update(nstate = 1) + is_auto_updating = nstate /** * Set the initial data for the ui. This is vital as the data structure set here cannot be changed when pushing new updates. @@ -190,6 +198,10 @@ nanoui is used to open and update nano browser uis "srcObject" = list("name" = src_object.name), "stateKey" = state_key, "status" = status, + "autoUpdateLayout" = auto_update_layout, + "autoUpdateContent" = auto_update_content, + "showMap" = show_map, + "mapZLevel" = map_z_level, "user" = list("name" = user.name) ) return config_data @@ -269,6 +281,26 @@ nanoui is used to open and update nano browser uis */ /datum/nanoui/proc/set_layout_key(nlayout_key) layout_key = lowertext(nlayout_key) + + /** + * Set the ui to update the layout (re-render it) on each update, turning this on will break the map ui (if it's being used) + * + * @param state int (bool) Set update to 1 or 0 (true/false) (default 0) + * + * @return nothing + */ +/datum/nanoui/proc/set_auto_update_layout(nstate) + auto_update_layout = nstate + + /** + * Set the ui to update the main content (re-render it) on each update + * + * @param state int (bool) Set update to 1 or 0 (true/false) (default 1) + * + * @return nothing + */ +/datum/nanoui/proc/set_auto_update_content(nstate) + auto_update_content = nstate /** * Set the state key for use in the frontend Javascript @@ -278,7 +310,27 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/set_state_key(nstate_key) - state_key = nstate_key + state_key = nstate_key + + /** + * Toggle showing the map ui + * + * @param nstate_key boolean 1 to show map, 0 to hide (default is 0) + * + * @return nothing + */ +/datum/nanoui/proc/set_show_map(nstate) + show_map = nstate + + /** + * Toggle showing the map ui + * + * @param nstate_key boolean 1 to show map, 0 to hide (default is 0) + * + * @return nothing + */ +/datum/nanoui/proc/set_map_z_level(nz) + map_z_level = nz /** * Set whether or not to use the "old" on close logic (mainly unset_machine()) @@ -416,8 +468,18 @@ nanoui is used to open and update nano browser uis update_status(0) // update the status if (status != STATUS_INTERACTIVE || user != usr) // If UI is not interactive or usr calling Topic is not the UI user return + + // This is used to toggle the nano map ui + var/map_update = 0 + if(href_list["showMap"]) + set_show_map(text2num(href_list["showMap"])) + map_update = 1 + + if(href_list["mapZLevel"]) + set_map_z_level(text2num(href_list["mapZLevel"])) + map_update = 1 - if (src_object && src_object.Topic(href, href_list)) + if ((src_object && src_object.Topic(href, href_list)) || map_update) nanomanager.update_uis(src_object) // update all UIs attached to src_object /** diff --git a/nano/css/icons.css b/nano/css/icons.css index e20af950536..385afb2e5f4 100644 --- a/nano/css/icons.css +++ b/nano/css/icons.css @@ -225,4 +225,87 @@ .uiIcon16.icon-grip-solid-vertical { background-position: -32px -224px; } .uiIcon16.icon-grip-solid-horizontal { background-position: -48px -224px; } .uiIcon16.icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.uiIcon16.icon-grip-diagonal-se { background-position: -80px -224px; } \ No newline at end of file +.uiIcon16.icon-grip-diagonal-se { background-position: -80px -224px; } + +.mapIcon16 { + position: absolute; + width: 16px; + height: 16px; + background-image: url(uiIcons16Green.png); + background-position: -144px -96px; + background-repeat: no-repeat; + zoom: 0.125; + margin-left: -1px; + /*margin-bottom: -1px;*/ +} +.mapIcon16.dead { + background-image: url(uiIcons16Red.png); +} + +/* Command Positions */ +.mapIcon16.rank-captain { + background-position: -224px -112px; +} +.mapIcon16.rank-headofpersonnel { + background-position: -112px -96px; +} +.mapIcon16.rank-headofsecurity { + background-position: -112px -128px; +} +.mapIcon16.rank-chiefengineer { + background-position: -176px -112px; +} +.mapIcon16.rank-researchdirector { + background-position: -128px -128px; +} +.mapIcon16.rank-chiefmedicalofficer { + background-position: -32px -128px; +} + +/* Engineering Positions */ +.mapIcon16.rank-stationengineer { + background-position: -176px -112px; +} +.mapIcon16.rank-atmospherictechnician { + background-position: -176px -112px; +} + +/* Medical Positions */ +.mapIcon16.rank-medicaldoctor { + background-position: -32px -128px; +} +.mapIcon16.rank-geneticist { + background-position: -32px -128px; +} +.mapIcon16.rank-psychiatrist { + background-position: -32px -128px; +} +.mapIcon16.rank-chemist { + background-position: -32px -128px; +} + +/* Science Positions */ +.mapIcon16.rank-scientist { + background-position: -128px -128px; +} +.mapIcon16.rank-geneticist { + background-position: -128px -128px; +} +.mapIcon16.rank-roboticist { + background-position: -128px -128px; +} +.mapIcon16.rank-xenobiologist { + background-position: -128px -128px; +} + +/* Security Positions */ +.mapIcon16.rank-warden { + background-position: -112px -128px; +} +.mapIcon16.rank-detective { + background-position: -112px -128px; +} +.mapIcon16.rank-securityofficer { + background-position: -112px -128px; +} + diff --git a/nano/css/layout_default.css b/nano/css/layout_default.css index df5ce06e77c..109beb2c72e 100644 --- a/nano/css/layout_default.css +++ b/nano/css/layout_default.css @@ -5,6 +5,8 @@ body { #uiWrapper { width: 100%; height: 100%; + -ms-user-select: none; + user-select: none; } #uiTitleWrapper { @@ -12,7 +14,7 @@ body { height: 30px; } -#uiTitle { +#uiTitleText { position: absolute; top: 6px; left: 44px; @@ -45,11 +47,73 @@ body { height: 24px; } +#uiMapWrapper { + clear: both; + padding: 8px; +} + +#uiMapHeader { + position: relative; + clear: both; +} + +#uiMapContainer { + position: relative; + width: 100%; + height: 600px; + overflow: hidden; + border: 1px solid #40628a; + background: url(nanomapBackground.png); +} + +#uiMap { + position: absolute; + top: 50%; + left: 50%; + margin: -512px 0 0 -512px; + width: 256px; + height: 256px; + overflow: hidden; + zoom: 4; +} + +#uiMapImage { + position: absolute; + bottom: 1px; + left: 1px; + width: 256px; + height: 256px; +} + +#uiMapContent { + position: absolute; + bottom: 0px; + left: 0px; + width: 256px; + height: 256px; +} + +#uiMapFooter { + position: relative; + clear: both; +} + #uiContent { clear: both; padding: 8px; } +#uiMapTooltip { + position: absolute; + right: 10px; + top: 10px; + border: 1px solid #40628a; + background-color: #272727; + padding: 8px; + display: none; + z-index: 9999; +} + #uiLoadingNotice { position: relative; background: url(uiNoticeBackground.jpg) 50% 50%; diff --git a/nano/css/shared.css b/nano/css/shared.css index ec9ff3f93d0..632e76b6996 100644 --- a/nano/css/shared.css +++ b/nano/css/shared.css @@ -49,7 +49,7 @@ hr { padding: 0px 4px 4px 0px; } -a:hover, .linkActive:hover { +a:hover, .zoomLink:hover, .linkActive:hover { background: #507aac; } @@ -73,6 +73,10 @@ a.white:hover { background: #40628a; } +.hidden { + display: none; +} + .linkOn, a.linkOn:link, a.linkOn:visited, a.linkOn:active, a.linkOn:hover, .selected, a.selected:link, a.selected:visited, a.selected:active, a.selected:hover { color: #ffffff; background: #2f943c; diff --git a/nano/images/nanomapBackground.png b/nano/images/nanomapBackground.png new file mode 100644 index 00000000000..f3ead016196 Binary files /dev/null and b/nano/images/nanomapBackground.png differ diff --git a/nano/images/nanomap_z1.png b/nano/images/nanomap_z1.png new file mode 100644 index 00000000000..8c4415ce5bd Binary files /dev/null and b/nano/images/nanomap_z1.png differ diff --git a/nano/images/source/uiIcons16Green.xcf b/nano/images/source/uiIcons16Green.xcf new file mode 100644 index 00000000000..a7027a28734 Binary files /dev/null and b/nano/images/source/uiIcons16Green.xcf differ diff --git a/nano/images/source/uiIcons16Red.xcf b/nano/images/source/uiIcons16Red.xcf new file mode 100644 index 00000000000..c07e4f64c7b Binary files /dev/null and b/nano/images/source/uiIcons16Red.xcf differ diff --git a/nano/images/uiIcons16Green.png b/nano/images/uiIcons16Green.png new file mode 100644 index 00000000000..de0e33db1c7 Binary files /dev/null and b/nano/images/uiIcons16Green.png differ diff --git a/nano/images/uiIcons16Red.png b/nano/images/uiIcons16Red.png new file mode 100644 index 00000000000..1c72dfe1430 Binary files /dev/null and b/nano/images/uiIcons16Red.png differ diff --git a/nano/js/libraries.min.js b/nano/js/libraries.min.js index 7b19cd3a5d1..fabe4e7dc54 100644 --- a/nano/js/libraries.min.js +++ b/nano/js/libraries.min.js @@ -1 +1 @@ -(function(e,t){function H(e){var t=e.length,n=w.type(e);if(w.isWindow(e)){return false}if(e.nodeType===1&&t){return true}return n==="array"||n!=="function"&&(t===0||typeof t==="number"&&t>0&&t-1 in e)}function j(e){var t=B[e]={};w.each(e.match(S)||[],function(e,n){t[n]=true});return t}function q(e,n,r,i){if(!w.acceptData(e)){return}var s,o,u=w.expando,a=e.nodeType,f=a?w.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===t&&typeof n==="string"){return}if(!l){if(a){l=e[u]=c.pop()||w.guid++}else{l=u}}if(!f[l]){f[l]=a?{}:{toJSON:w.noop}}if(typeof n==="object"||typeof n==="function"){if(i){f[l]=w.extend(f[l],n)}else{f[l].data=w.extend(f[l].data,n)}}o=f[l];if(!i){if(!o.data){o.data={}}o=o.data}if(r!==t){o[w.camelCase(n)]=r}if(typeof n==="string"){s=o[n];if(s==null){s=o[w.camelCase(n)]}}else{s=o}return s}function R(e,t,n){if(!w.acceptData(e)){return}var r,i,s=e.nodeType,o=s?w.cache:e,u=s?e[w.expando]:w.expando;if(!o[u]){return}if(t){r=n?o[u]:o[u].data;if(r){if(!w.isArray(t)){if(t in r){t=[t]}else{t=w.camelCase(t);if(t in r){t=[t]}else{t=t.split(" ")}}}else{t=t.concat(w.map(t,w.camelCase))}i=t.length;while(i--){delete r[t[i]]}if(n?!z(r):!w.isEmptyObject(r)){return}}}if(!n){delete o[u].data;if(!z(o[u])){return}}if(s){w.cleanData([e],true)}else if(w.support.deleteExpando||o!=o.window){delete o[u]}else{o[u]=null}}function U(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(I,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r==="string"){try{r=r==="true"?true:r==="false"?false:r==="null"?null:+r+""===r?+r:F.test(r)?w.parseJSON(r):r}catch(s){}w.data(e,n,r)}else{r=t}}return r}function z(e){var t;for(t in e){if(t==="data"&&w.isEmptyObject(e[t])){continue}if(t!=="toJSON"){return false}}return true}function it(){return true}function st(){return false}function ot(){try{return o.activeElement}catch(e){}}function ct(e,t){do{e=e[t]}while(e&&e.nodeType!==1);return e}function ht(e,t,n){if(w.isFunction(t)){return w.grep(e,function(e,r){return!!t.call(e,r,e)!==n})}if(t.nodeType){return w.grep(e,function(e){return e===t!==n})}if(typeof t==="string"){if(ut.test(t)){return w.filter(t,e,n)}t=w.filter(t,e)}return w.grep(e,function(e){return w.inArray(e,t)>=0!==n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement){while(t.length){n.createElement(t.pop())}}return n}function Mt(e,t){return w.nodeName(e,"table")&&w.nodeName(t.nodeType===1?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _t(e){e.type=(w.find.attr(e,"type")!==null)+"/"+e.type;return e}function Dt(e){var t=Ct.exec(e.type);if(t){e.type=t[1]}else{e.removeAttribute("type")}return e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++){w._data(n,"globalEval",!t||w._data(t[r],"globalEval"))}}function Ht(e,t){if(t.nodeType!==1||!w.hasData(e)){return}var n,r,i,s=w._data(e),o=w._data(t,s),u=s.events;if(u){delete o.handle;o.events={};for(n in u){for(r=0,i=u[n].length;r").css("cssText","display:block !important")).appendTo(t.documentElement);t=(It[0].contentWindow||It[0].contentDocument).document;t.write("
");t.close();n=fn(e,t);It.detach()}Qt[e]=n}return n}function fn(e,t){var n=w(t.createElement(e)).appendTo(t.body),r=w.css(n[0],"display");n.remove();return r}function vn(e,t,n,r){var i;if(w.isArray(t)){w.each(t,function(t,i){if(n||cn.test(e)){r(e,i)}else{vn(e+"["+(typeof i==="object"?t:"")+"]",i,n,r)}})}else if(!n&&w.type(t)==="object"){for(i in t){vn(e+"["+i+"]",t[i],n,r)}}else{r(e,t)}}function _n(e){return function(t,n){if(typeof t!=="string"){n=t;t="*"}var r,i=0,s=t.toLowerCase().match(S)||[];if(w.isFunction(n)){while(r=s[i++]){if(r[0]==="+"){r=r.slice(1)||"*";(e[r]=e[r]||[]).unshift(n)}else{(e[r]=e[r]||[]).push(n)}}}}}function Dn(e,t,n,r){function o(u){var a;i[u]=true;w.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f==="string"&&!s&&!i[f]){t.dataTypes.unshift(f);o(f);return false}else if(s){return!(a=f)}});return a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=w.ajaxSettings.flatOptions||{};for(i in n){if(n[i]!==t){(s[i]?e:r||(r={}))[i]=n[i]}}if(r){w.extend(true,e,r)}return e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes;while(f[0]==="*"){f.shift();if(s===t){s=e.mimeType||n.getResponseHeader("Content-Type")}}if(s){for(u in a){if(a[u]&&a[u].test(s)){f.unshift(u);break}}}if(f[0]in r){o=f[0]}else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}if(!i){i=u}}o=o||i}if(o){if(o!==f[0]){f.unshift(o)}return r[o]}}function Bn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1]){for(o in e.converters){f[o.toLowerCase()]=e.converters[o]}}s=l.shift();while(s){if(e.responseFields[s]){n[e.responseFields[s]]=t}if(!a&&r&&e.dataFilter){t=e.dataFilter(t,e.dataType)}a=s;s=l.shift();if(s){if(s==="*"){s=a}else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o){for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){if(o===true){o=f[i]}else if(f[i]!==true){s=u[0];l.unshift(u[1])}break}}}}if(o!==true){if(o&&e["throws"]){t=o(t)}else{try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}}}}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){setTimeout(function(){Xn=t});return Xn=w.now()}function Zn(e,t,n){var r,i=(Gn[t]||[]).concat(Gn["*"]),s=0,o=i.length;for(;s| t |