pyscript-bootstrap-templates/examples/01_hello_world/resources/pyscript.js

5 lines
434 KiB
JavaScript
Raw Normal View History

2022-08-13 11:57:22 +02:00
!function(){"use strict";function t(){}function e(t){return t()}function i(){return Object.create(null)}function n(t){t.forEach(e)}function s(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function o(t){t.parentNode.removeChild(t)}let l;function a(t){l=t}const h=[],c=[],u=[],d=[],f=Promise.resolve();let p=!1;function m(t){u.push(t)}const g=new Set;let O=0;function w(){const t=l;do{for(;O<h.length;){const t=h[O];O++,a(t),y(t.$$)}for(a(null),h.length=0,O=0;c.length;)c.pop()();for(let t=0;t<u.length;t+=1){const e=u[t];g.has(e)||(g.add(e),e())}u.length=0}while(h.length);for(;d.length;)d.pop()();p=!1,g.clear(),a(t)}function y(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(m)}}const $=new Set;function x(t,e){t&&t.i&&($.delete(t),t.i(e))}function b(t,i,r,o){const{fragment:l,on_mount:a,on_destroy:h,after_update:c}=t.$$;l&&l.m(i,r),o||m((()=>{const i=a.map(e).filter(s);h?h.push(...i):n(i),t.$$.on_mount=[]})),c.forEach(m)}function v(t,e){const i=t.$$;null!==i.fragment&&(n(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function k(t,e){-1===t.$$.dirty[0]&&(h.push(t),p||(p=!0,f.then(w)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function S(e,s,r,h,c,u,d,f=[-1]){const p=l;a(e);const m=e.$$={fragment:null,ctx:null,props:u,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(p?p.$$.context:[])),callbacks:i(),dirty:f,skip_bound:!1,root:s.target||p.$$.root};d&&d(m.root);let g=!1;if(m.ctx=r?r(e,s.props||{},((t,i,...n)=>{const s=n.length?n[0]:i;return m.ctx&&c(m.ctx[t],m.ctx[t]=s)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](s),g&&k(e,t)),i})):[],m.update(),g=!0,n(m.before_update),m.fragment=!!h&&h(m.ctx),s.target){if(s.hydrate){const t=(O=s.target,Array.from(O.childNodes));m.fragment&&m.fragment.l(t),t.forEach(o)}else m.fragment&&m.fragment.c();s.intro&&x(e.$$.fragment),b(e,s.target,s.anchor,s.customElement),w()}var O;a(p)}class P{$destroy(){v(this,1),this.$destroy=t}$on(t,e){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}class I extends P{constructor(t){super(),S(this,t,null,null,r,{})}}function A(e){let i,n;return i=new I({}),{c(){var t;(t=i.$$.fragment)&&t.c()},m(t,e){b(i,t,e),n=!0},p:t,i(t){n||(x(i.$$.fragment,t),n=!0)},o(t){!function(t,e,i,n){if(t&&t.o){if($.has(t))return;$.add(t),(void 0).c.push((()=>{$.delete(t),n&&(i&&t.d(1),n())})),t.o(e)}}(i.$$.fragment,t),n=!1},d(t){v(i,t)}}}const Q=[];function C(e,i=t){let n;const s=new Set;function o(t){if(r(e,t)&&(e=t,n)){const t=!Q.length;for(const t of s)t[1](),Q.push(t,e);if(t){for(let t=0;t<Q.length;t+=2)Q[t][0](Q[t+1]);Q.length=0}}}return{set:o,update:function(t){o(t(e))},subscribe:function(r,l=t){const a=[r,l];return s.add(a),1===s.size&&(n=i(o)||t),r(e),()=>{s.delete(a),0===s.size&&(n(),n=null)}}}}const R=C({loaded:!1,premise:null}),T=C([{}]),q=C(!1),W=C("play"),M=C([]),E=C([]),D=C([]),_=C(),L=C();let Z=[],X=[],V=[];M.subscribe((t=>{Z=t}));E.subscribe((t=>{X=t}));const N=t=>{console.log("adding initializer",t),E.set([...X,t]),console.log("adding initializer",t)};D.subscribe((t=>{V=t}));function B(t,e){for(const i of e)t.classList.add(i)}function Y(t){const e=(new DOMParser).parseFromString(function(t){const e=t.split("\n");if(0==e.length)return t;const i=e.filter((t=>0!=t.trim().length)).map((t=>{const[e]=t.match(/^\s*/);return e.length})),n=Math.min(...i);return 0!=n?e.map((t=>t.substring(n))).join("\n"):t}(t),"text/html");return e.documentElement.textContent}function j(t,e){let i;console.warn("Caught an error in loadPaths:\r\n"+t),i=t.message.includes("TypeError: Failed to fetch")?'<p>PyScript: Access to local files\n (using "Paths:" in &lt;py-env&gt;)\n is not available when directly opening a HTML file;\
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
function Sp(t){return null==t}var Pp=function(t,e){var i,n="";for(i=0;i<e;i+=1)n+=t;return n},Ip=function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},Ap={isNothing:Sp,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:Sp(t)?[]:[t]},repeat:Pp,isNegativeZero:Ip,extend:function(t,e){var i,n,s,r;if(e)for(i=0,n=(r=Object.keys(e)).length;i<n;i+=1)t[s=r[i]]=e[s];return t}};function Qp(t,e){var i="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(i+='in "'+t.mark.name+'" '),i+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(i+="\n\n"+t.mark.snippet),n+" "+i):n}function Cp(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Qp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}Cp.prototype=Object.create(Error.prototype),Cp.prototype.constructor=Cp,Cp.prototype.toString=function(t){return this.name+": "+Qp(this,t)};var Rp=Cp;function Tp(t,e,i,n,s){var r="",o="",l=Math.floor(s/2)-1;return n-e>l&&(e=n-l+(r=" ... ").length),i-n>l&&(i=n+l-(o=" ...").length),{str:r+t.slice(e,i).replace(/\t/g,"→")+o,pos:n-e+r.length}}function qp(t,e){return Ap.repeat(" ",e-t.length)+t}var Wp=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var i,n=/\r?\n|\r|\0/g,s=[0],r=[],o=-1;i=n.exec(t.buffer);)r.push(i.index),s.push(i.index+i[0].length),t.position<=i.index&&o<0&&(o=s.length-2);o<0&&(o=s.length-1);var l,a,h="",c=Math.min(t.line+e.linesAfter,r.length).toString().length,u=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)a=Tp(t.buffer,s[o-l],r[o-l],t.position-(s[o]-s[o-l]),u),h=Ap.repeat(" ",e.indent)+qp((t.line-l+1).toString(),c)+" | "+a.str+"\n"+h;for(a=Tp(t.buffer,s[o],r[o],t.position,u),h+=Ap.repeat(" ",e.indent)+qp((t.line+1).toString(),c)+" | "+a.str+"\n",h+=Ap.repeat("-",e.indent+c+3+a.pos)+"^\n",l=1;l<=e.linesAfter&&!(o+l>=r.length);l++)a=Tp(t.buffer,s[o+l],r[o+l],t.position-(s[o]-s[o+l]),u),h+=Ap.repeat(" ",e.indent)+qp((t.line+l+1).toString(),c)+" | "+a.str+"\n";return h.replace(/\n$/,"")},Mp=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ep=["scalar","sequence","mapping"];var Dp=function(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===Mp.indexOf(e))throw new Rp('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=function(t){var e={};return null!==t&&Object.keys(t).forEach((function(i){t[i].forEach((function(t){e[String(t)]=i}))})),e}(e.styleAliases||null),-1===Ep.indexOf(this.kind))throw new Rp('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function _p(t,e){var i=[];return t[e].forEach((function(t){var e=i.length;i.forEach((function(i,n){i.tag===t.tag&&i.kind===t.kind&&i.multi===t.multi&&(e=n)})),i[e]=t})),i}function Lp(t){return this.extend(t)}Lp.prototype.extend=function(t){var e=[],i=[];if(t instanceof Dp)i.push(t);else if(Array.isArray(t))i=i.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Rp("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof Dp))throw new Rp("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new Rp("There is a non-scalar type in the implicit list of a schema.
//# sourceMappingURL=pyscript.min.js.map