You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lines
32 KiB

3 years ago
(()=>{var e={669:(e,t,n)=>{e.exports=n(609)},448:(e,t,n)=>{"use strict";var r=n(867),o=n(26),s=n(372),i=n(327),a=n(97),u=n(109),c=n(985),l=n(61);e.exports=function(e){return new Promise((function(t,n){var p=e.data,f=e.headers;r.isFormData(p)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(d+":"+m)}var g=a(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,s={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h};o(t,n,s),h=null}},h.onabort=function(){h&&(n(l("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){n(l("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||c(g))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;b&&(f[e.xsrfHeaderName]=b)}if("setRequestHeader"in h&&r.forEach(f,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete f[t]:h.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),n(e),h=null)})),p||(p=null),h.send(p)}))}},609:(e,t,n)=>{"use strict";var r=n(867),o=n(849),s=n(321),i=n(185);function a(e){var t=new s(e),n=o(s.prototype.request,t);return r.extend(n,s.prototype,t),r.extend(n,t),n}var u=a(n(655));u.Axios=s,u.create=function(e){return a(i(u.defaults,e))},u.Cancel=n(263),u.CancelToken=n(972),u.isCancel=n(502),u.all=function(e){return Promise.all(e)},u.spread=n(713),u.isAxiosError=n(268),e.exports=u,e.exports.default=u},263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:(e,t,n)=>{"use strict";var r=n(263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(867),o=n(327),s=n(782),i=n(572),a=n(185);function u(e){this.defaults=e,this.interceptors={request:new s,response:new s}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},u.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=u},782:(e,t,
/* Riot v5.1.4, @license MIT */
var o;return e[(o=n,o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=Ke(r),e}),{})}(r.components):{}):ke;return e=>{let{slots:i,attributes:a,props:u}=e;if(r&&r[T])return function(e,t){let{slots:n,attributes:r,props:o,css:s,template:i}=t;i&&z("Pure components can not have html"),s&&z("Pure components do not have css");const a=we(e({slots:n,attributes:r,props:o}),Be);return qe((e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(e===l){const[e]=n;e[T]=!0,Ye(e,a)}return a[e](...n),a}))}(r,{slots:i,attributes:a,props:u,css:t,template:n});const c=Oe(r)||{},p=Fe({css:t,template:s,componentAPI:c,name:o})({slots:i,attributes:a,props:u});return{mount:(e,t,n)=>p.mount(e,n,t),update:(e,t)=>p.update(t,e),unmount:e=>p.unmount(e)}}}function Fe(e){let{css:t,template:n,componentAPI:r,name:o}=e;return t&&o&&Ue.add(o,t),Pe(ze)(xe(we(r,Object.assign({},De,{[E]:{}})),Object.assign({[x]:null,[w]:null},Le,{name:o,css:t,template:n})))}function He(e,t){return Object.assign({},e,Oe(t))}function ze(e,t){let{slots:n,attributes:r,props:o}=t;return s=function(e){return[...u].reduce(((e,t)=>t(e)||e),e)}(xe(Object.create(e),{mount(t,s,i){return void 0===s&&(s={}),this[j]=function(e,t){void 0===t&&(t=[]);const n=t.map((t=>ie(e,t))),r={};return Object.assign(r,Object.assign({expressions:n},qe((e=>t=>(n.forEach((n=>n[e](t))),r)))))}(t,r).mount(i),Ee(this,O,Object.freeze(Object.assign({},Ie(t,o),$(this[j].expressions)))),this.state=He(this.state,s),this[A]=this.template.createDOM(t).clone(),Ye(t,this),e.name&&function(e,t){Re(e)!==t&&Ae(e,c,t)}(t,e.name),Ee(this,w,t),Ee(this,x,n),this.onBeforeMount(this.props,this.state),this[N]=i,this[A].mount(t,this,i),this.onMounted(this.props,this.state),this},update(e,t){void 0===e&&(e={}),t&&(this[N]=t,this[j].update(t));const n=$(this[j].expressions);if(!1!==this.shouldUpdate(n,this.props))return Ee(this,O,Object.freeze(Object.assign({},this.props,n))),this.state=He(this.state,e),this.onBeforeUpdate(this.props,this.state),this[A].update(this,this[N]),this.onUpdated(this.props,this.state),this},unmount(e){return this.onBeforeUnmount(this.props,this.state),this[j].unmount(),this[A].unmount(this,this[N],null===e?null:!e),this.onUnmounted(this.props,this.state),this}})),Object.keys(e).filter((t=>I(e[t]))).forEach((e=>{s[e]=s[e].bind(s)})),s;var s}const{DOM_COMPONENT_INSTANCE_PROPERTY:$e,COMPONENTS_IMPLEMENTATION_MAP:Ve,PLUGINS_SET:Xe}=S;var Ge=n(669),Je=n.n(Ge);var We,Ze;!function(e,t){let{css:n,template:r,exports:o}=t;Ve.has(e)&&z(`The component "${e}" was already registered`),Ve.set(e,Ke({name:e,css:n,template:r,exports:o}))}("tinkerforge-power-button",{css:null,exports:{state:{power:!0},handleClick(e){this.state.power?this.state.power=!1:this.state.power=!0,Je().put("/api/state",{power:this.state.power}).then((e=>{this.update()}))}},template:function(e,t,n,r){return e('<div class="tinkerforge-power-button"><button expr0="expr0" type="button"><span expr1="expr1"></span><span expr2="expr2"></span></button></div>',[{redundantAttribute:"expr0",selector:"[expr0]",expressions:[{type:t.EVENT,name:"onclick",evaluate:function(e){return e.handleClick}}]},{type:n.IF,evaluate:function(e){return e.state.power},redundantAttribute:"expr1",selector:"[expr1]",template:e("On",[])},{type:n.IF,evaluate:function(e){return!e.state.power},redundantAttribute:"expr2",selector:"[expr2]",template:e("Off",[])}])},name:"tinkerforge-power-button"}),Ne("tinkerforge-power-button").map((e=>function(e,t,n){const r=n||Re(e);return i.has(r)||z(`The component named "${r}" was never registered`),i.get(r)({props:t}).mount(e)}(e,We,Ze)))})()})();