phantasmal-world/8.3a5cee225e5403852e30.js

1 line
7.2 KiB
JavaScript
Raw Normal View History

2020-01-07 06:37:38 +08:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"0Xme":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var s=n("sDu+"),i=n("jJhE"),o=(n("x1yY"),n("4VsB")),r=n("FXpb");class l extends s.a{constructor(e,t,n,s,i){super(i),this.element=Object(r.s)({className:`${t} core_Input`}),this._value=new o.a(this,e,this.set_value),this.value=this._value,this.input_element=Object(r.m)({className:`${s} core_Input_inner`}),this.input_element.type=n,this.input_element.addEventListener("change",()=>{this._value.set_val(this.get_value(),{silent:!1})}),i&&i.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(e){super.set_enabled(e),this.input_element.disabled=!e}set_attr(e,t,n){if(null==t)return;const s=this.input_element,o=n||(e=>e);Object(i.a)(t)?(s[e]=o(t.val),this.disposable(t.observe(({value:t})=>s[e]=o(t)))):s[e]=o(t)}}},GN66:function(e,t,n){"use strict";n.r(t);var s=n("HjM1"),i=n("xs7i"),o=n("sZ1+"),r=(n("Czz9"),n("0Xme")),l=n("ExVU");n("vlF3");class c extends r.a{constructor(e=l.Duration.fromMillis(0),t){super(e,"core_DurationInput","text","core_DurationInput_inner",t),this.preferred_label_position="left",this.input_element.pattern="(60|[0-5][0-9]):(60|[0-5][0-9])",this.set_value(e),this.finalize_construction()}get_value(){const e=this.input_element.value;if(this.input_element.validity.valid)return l.Duration.fromObject({hours:parseInt(e.slice(0,2),10),minutes:parseInt(e.slice(3),10)});{const t=e.indexOf(":");return-1===t?l.Duration.fromObject({minutes:parseInt(e,10)}):l.Duration.fromObject({hours:parseInt(e.slice(0,t),10),minutes:parseInt(e.slice(t+1),10)})}}set_value(e){this.input_element.value=e.toFormat("hh:mm")}}var a=n("yar8"),u=n("ouMO"),d=n("rwco"),h=n("FXpb"),p=n("zsIO"),m=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function l(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}c((s=s.apply(e,t||[])).next())}))};const _=d.a.get("hunt_optimizer/gui/MethodsForEpisodeView");class f extends p.a{constructor(e,t){super(),this.element=Object(h.h)({className:"hunt_optimizer_MethodsForEpisodeView"}),this.episode=t,this.enemy_types=o.a.filter(e=>Object(o.d)(e).episode===this.episode);const n=Object(u.c)(),s=this.add(new a.b({class:"hunt_optimizer_MethodsForEpisodeView_table",values:n,sort:e=>{n.sort((t,n)=>{for(const{column:s,direction:i}of e){let e=0;switch(s.key){case"method":e=t.name.localeCompare(n.name);break;case"time":e=t.time.val.as("minutes")-n.time.val.as("minutes");break;default:{const i=o.c[s.key];i&&(e=(t.enemy_counts.get(i)||0)-(n.enemy_counts.get(i)||0))}}if(0!==e)return i===a.a.Asc?e:-e}return 0})},columns:[{key:"method",title:"Method",fixed:!0,width:250,sortable:!0,render_cell:e=>e.name},{key:"time",title:"Time",fixed:!0,width:60,input:!0,sortable:!0,render_cell(e,t){const n=t.add(new c(e.time.val));return t.add(n.value.observe(({value:t})=>e.set_user_time(t))),n.element}},...this.enemy_types.map(e=>({key:o.c[e],title:Object(o.d)(e).simple_name,width:90,text_align:"right",sortable:!0,render_cell(t){const n=t.enemy_counts.get(e);return null==n?"":n.toString()}}))]}));this.element.append(s.element),this.disposables(e.current.observe(({value:e})=>m(this,void 0,void 0,(function*(){try{const t=yield e;this.hunt_methods_observer&&this.hunt_methods_observer.dispose(),this.hunt_methods_observer=t.methods.observe(({value:e})=>{n.val=e.filter(e=>e.episode===this.episode)},{call_now:!0})}catch(e){_.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}dispose(){super.dispose(),this.hunt_methods_observer&&this.hunt_methods_observer.dispose()}}n.d(t,"MethodsView",(function(){return v}));var b=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function l(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}c((s=s.apply(e,t||[])).next())}))};c