lnbits-legend/lnbits/static/vendor/vue-qrcode-reader.umd.js

4 lines
72 KiB
JavaScript
Raw Normal View History

2024-09-25 12:09:00 +02:00
(function(ee,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],O):(ee=typeof globalThis<"u"?globalThis:ee||self,O(ee.VueQrcodeReader={},ee.Vue))})(this,function(ee,O){"use strict";var Wt=(r,o,i)=>{if(!o.has(r))throw TypeError("Cannot "+i)},jt=(r,o,i)=>(Wt(r,o,"read from private field"),i?i.call(r):o.get(r)),tn=(r,o,i)=>{if(o.has(r))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(r):o.set(r,i)},rn=(r,o,i,c)=>(Wt(r,o,"write to private field"),o.set(r,i),i);const Lt=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],nn=[...Lt,["unknown"]].map(r=>r[0]),Le=new Map(Lt);function an(r){for(const[o,i]of Le)if(r===i)return o;return"unknown"}function on(r){if(Ht(r))return{width:r.naturalWidth,height:r.naturalHeight};if(Bt(r))return{width:r.width.baseVal.value,height:r.height.baseVal.value};if(Vt(r))return{width:r.videoWidth,height:r.videoHeight};if(Nt(r))return{width:r.width,height:r.height};if(Gt(r))return{width:r.displayWidth,height:r.displayHeight};if(qt(r))return{width:r.width,height:r.height};if(zt(r))return{width:r.width,height:r.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Ht(r){try{return r instanceof HTMLImageElement}catch(o){return!1}}function Bt(r){try{return r instanceof SVGImageElement}catch(o){return!1}}function Vt(r){try{return r instanceof HTMLVideoElement}catch(o){return!1}}function qt(r){try{return r instanceof HTMLCanvasElement}catch(o){return!1}}function Nt(r){try{return r instanceof ImageBitmap}catch(o){return!1}}function zt(r){try{return r instanceof OffscreenCanvas}catch(o){return!1}}function Gt(r){try{return r instanceof VideoFrame}catch(o){return!1}}function Yt(r){try{return r instanceof Blob}catch(o){return!1}}function sn(r){try{return r instanceof ImageData}catch(o){return!1}}function cn(r,o){try{const i=new OffscreenCanvas(r,o);if(i.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return i;throw void 0}catch(i){const c=document.createElement("canvas");return c.width=r,c.height=o,c}}async function Jt(r){if(Ht(r)&&!await fn(r))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Bt(r)&&!await hn(r))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Gt(r)&&pn(r))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Vt(r)&&(r.readyState===0||r.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Nt(r)&&vn(r))throw new DOMException("The image source is detached.","InvalidStateError");const{width:o,height:i}=on(r);if(o===0||i===0)return null;const c=cn(o,i).getContext("2d");c.drawImage(r,0,0);try{return c.getImageData(0,0,o,i)}catch(l){throw new DOMException("Source would taint origin.","SecurityError")}}async function un(r){let o;try{if(globalThis.createImageBitmap)o=await createImageBitmap(r);else if(globalThis.Image){o=new Image;let i="";try{i=URL.createObjectURL(r),o.src=i,await o.decode()}finally{URL.revokeObjectURL(i)}}else return r}catch(i){throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await Jt(o)}function ln(r){const{width:o,height:i}=r;if(o===0||i===0)return null;const c=r.getContext("2d");try{return c.getImageData(0,0,o,i)}catch(l){throw new DOMException("Source would taint origin.","SecurityError")}}async function dn(r){if(Yt(r))return await un(r);if(sn(r)){if(mn(r))
`+s.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},n},Ir,Fr=e=>{var t=zr(e),n=J(t);return de(t),n},ot=(e,t)=>{var n=[],a={};function s(u){if(!a[u]&&!we[u]){if(Ke[u]){Ke[u].forEach(s);return}n.push(u),a[u]=!0}}throw t.forEach(s),new Ir(`${e}: `+n.map(Fr).join([", "]))},no=(e,t,n,a,s,u,d,f,m,w,_,T,E)=>{_=J(_),u=re(s,u),f&&(f=re(d,f)),w&&(w=re(m,w)),E=re(T,E);var M=Ga(_);Et(M,function(){ot(`Cannot construct ${_} due to unbound types`,[a])}),be([e,t,n],a?[a]:[],function(H){H=H[0];var N,F;a?(N=H.registeredClass,F=N.instancePrototype):F=rt.prototype;var Q=Ue(_,function(){if(Object.getPrototypeOf(this)!==y)throw new Ee("Use 'new' to construct "+_);if(P.constructor_body===void 0)throw new Ee(_+" has no accessible constructor");var en=P.constructor_body[arguments.length];if(en===void 0)throw new Ee(`Tried to invoke ctor of ${_} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(P.constructor_body).toString()}) parameters instead!`);return en.apply(this,arguments)}),y=Object.create(F,{constructor:{value:Q}});Q.prototype=y;var P=new Ya(_,Q,y,E,N,u,f,w);if(P.baseClass){var z,Y;(Y=(z=P.baseClass).__derivedClasses)!==null&&Y!==void 0||(z.__derivedClasses=[]),P.baseClass.__derivedClasses.push(P)}var Oe=new nt(_,P,!0,!1,!1),ct=new nt(_+"*",P,!1,!1,!1),Kr=new nt(_+" const*",P,!1,!0,!1);return Dr[e]={pointerType:ct,constPointerType:Kr},xr(M,Q),[Oe,ct,Kr]})},Mt=(e,t)=>{for(var n=[],a=0;a<e;a++)n.push(A[t+a*4>>2]);return n};function ao(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Dt(e,t,n,a,s,u){var d=t.length;d<2&&x("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=t[1]!==null&&n!==null,m=ao(t),w=t[0].name!=="void",_=d-2,T=new Array(_),E=[],M=[],H=function(){arguments.length!==_&&x(`function ${e} called with ${arguments.length} arguments, expected ${_}`),M.length=0;var N;E.length=f?2:1,E[0]=s,f&&(N=t[1].toWireType(M,this),E[1]=N);for(var F=0;F<_;++F)T[F]=t[F+2].toWireType(M,arguments[F]),E.push(T[F]);var Q=a.apply(null,E);function y(P){if(m)$t(M);else for(var z=f?1:2;z<t.length;z++){var Y=z===1?N:T[z-2];t[z].destructorFunction!==null&&t[z].destructorFunction(Y)}if(w)return t[0].fromWireType(P)}return y(Q)};return Ue(e,H)}var oo=(e,t,n,a,s,u)=>{var d=Mt(t,n);s=re(a,s),be([],[e],function(f){f=f[0];var m=`constructor ${f.name}`;if(f.registeredClass.constructor_body===void 0&&(f.registeredClass.constructor_body=[]),f.registeredClass.constructor_body[t-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${f.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return f.registeredClass.constructor_body[t-1]=()=>{ot(`Cannot construct ${f.name} due to unbound types`,d)},be([],d,w=>(w.splice(1,0,null),f.registeredClass.constructor_body[t-1]=Dt(m,w,null,s,u),[])),[]})},Ur=e=>{e=e.trim();const t=e.indexOf("(");return t!==-1?e.substr(0,t):e},io=(e,t,n,a,s,u,d,f,m)=>{var w=Mt(n,a);t=J(t),t=Ur(t),u=re(s,u),be([],[e],function(_){_=_[0];var T=`${_.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),f&&_.registeredClass.pureVirtualFunctions.push(t);function E(){ot(`Cannot call ${T} due to unbound types`,w)}var M=_.registeredClass.instancePrototype,H=M[t];return H===void 0||H.overloadTable===void 0&&H.className!==_.name&&H.argCount===n-2?(E.argCount=n-2,E.className=_.name,M[t]=E):(Ar(M,t,T),M[t].overloadTable[n-2]=E),be([],w,function(N){var F=Dt(T,N,_,u,d);return M[t].overloadTable===void 0?(F.argCount=n-2,M[t]=F):M[t].overloadTable[n-2]=F,[]}),[]})};function so(){Object.assign(Wr.prototype,{get(e){return this.allocated[e]},has(e){return this.allocated[e]!==void 0},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}})}function Wr(){this.allocated=[
feat: parse nested pydantic models `fetchone` and `fetchall` + add shortcuts for insert_query and update_query into `Database` (#2714) * feat: add shortcuts for insert_query and update_query into `Database` example: await db.insert("table_name", base_model) * remove where from argument * chore: code clean-up * extension manager * lnbits-qrcode components * parse date from dict * refactor: make `settings` a fixture * chore: remove verbose key names * fix: time column * fix: cast balance to `int` * extension toggle vue3 * vue3 @input migration * fix: payment extra and payment hash * fix dynamic fields and ext db migration * remove shadow on cards in dark theme * screwed up and made more css pushes to this branch * attempt to make chip component in settings dynamic fields * dynamic chips * qrscanner * clean init admin settings * make get_user better * add dbversion model * remove update_payment_status/extra/details * traces for value and assertion errors * refactor services * add PaymentFiatAmount * return Payment on api endpoints * rename to get_user_from_account * refactor: just refactor (#2740) * rc5 * Fix db cache (#2741) * [refactor] split services.py (#2742) * refactor: spit `core.py` (#2743) * refactor: make QR more customizable * fix: print.html * fix: qrcode options * fix: white shadow on dark theme * fix: datetime wasnt parsed in dict_to_model * add timezone for conversion * only parse timestamp for sqlite, postgres does it * log internal payment success * fix: export wallet to phone QR * Adding a customisable border theme, like gradient (#2746) * fixed mobile scan btn * fix test websocket * fix get_payments tests * dict_to_model skip none values * preimage none instead of defaulting to 0000... * fixup test real invoice tests * fixed pheonixd for wss * fix nodemanager test settings * fix lnbits funding * only insert extension when they dont exist --------- Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com> Co-authored-by: Tiago Vasconcelos <talvasconcelos@gmail.com> Co-authored-by: Arc <ben@arc.wales> Co-authored-by: Arc <33088785+arcbtc@users.noreply.github.com>
2024-10-29 09:58:22 +01:00
`,"%p":y=>y.tm_hour>=0&&y.tm_hour<12?"AM":"PM","%S":y=>E(y.tm_sec,2),"%t":()=>" ","%u":y=>y.tm_wday||7,"%U":y=>{var P=y.tm_yday+7-y.tm_wday;return E(Math.floor(P/7),2)},"%V":y=>{var P=Math.floor((y.tm_yday+7-(y.tm_wday+6)%7)/7);if((y.tm_wday+371-y.tm_yday-2)%7<=2&&P++,P){if(P==53){var z=(y.tm_wday+371-y.tm_yday)%7;z!=4&&(z!=3||!it(y.tm_year))&&(P=1)}}else{P=52;var Y=(y.tm_wday+7-y.tm_yday-1)%7;(Y==4||Y==5&&it(y.tm_year%400-1))&&P++}return E(P,2)},"%w":y=>y.tm_wday,"%W":y=>{var P=y.tm_yday+7-(y.tm_wday+6)%7;return E(Math.floor(P/7),2)},"%y":y=>(y.tm_year+1900).toString().substring(2),"%Y":y=>y.tm_year+1900,"%z":y=>{var P=y.tm_gmtoff,z=P>=0;return P=Math.abs(P)/60,P=P/60*100+P%60,(z?"+":"-")+("0000"+P).slice(-4)},"%Z":y=>y.tm_zone,"%%":()=>"%"};d=d.replace(/%%/g,"\0\0");for(var m in F)d.includes(m)&&(d=d.replace(new RegExp(m,"g"),F[m](u)));d=d.replace(/\0\0/g,"%");var Q=ai(d);return Q.length>t?0:(oi(Q,e),Q.length-1)},si=(e,t,n,a,s)=>ii(e,t,n,a);Pr=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Ra(),Ee=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},qa(),La(),Za(),Ir=i.UnboundTypeError=ro(Error,"UnboundTypeError"),so(),uo();var ci={s:Ca,u:$a,b:Sa,g:Pa,q:Ta,J:Ea,f:Oa,V:Ma,d:_a,da:Da,Q:Aa,_:ka,ca:no,ba:oo,w:io,Y:lo,x:ho,h:po,L:vo,M:yo,t:wo,o:bo,K:_o,C:Do,A:Ao,ea:Ro,$:xo,R:ko,ha:At,fa:Uo,Z:Bo,N:Vo,O:qo,aa:No,B:zo,X:Go,W:Qo,T:Ko,U:ei,E:Si,D:hi,F:_i,n:Pi,a:ui,e:mi,m:fi,k:yi,H:Ci,v:wi,G:$i,z:Ei,P:Mi,l:vi,j:pi,c:di,p:li,I:bi,r:Ti,i:gi,y:Oi,ga:ti,S:si},G=ba(),de=i._free=e=>(de=i._free=G.ka)(e),Ut=i._malloc=e=>(Ut=i._malloc=G.la)(e),zr=e=>(zr=G.na)(e),L=(e,t)=>(L=G.oa)(e,t),je=e=>(je=G.pa)(e),V=()=>(V=G.qa)(),q=e=>(q=G.ra)(e),Gr=e=>(Gr=G.sa)(e),Yr=e=>(Yr=G.ta)(e),Jr=(e,t,n)=>(Jr=G.ua)(e,t,n),Qr=e=>(Qr=G.va)(e);i.dynCall_viijii=(e,t,n,a,s,u,d)=>(i.dynCall_viijii=G.wa)(e,t,n,a,s,u,d);var Xr=i.dynCall_jiiii=(e,t,n,a,s)=>(Xr=i.dynCall_jiiii=G.xa)(e,t,n,a,s);i.dynCall_iiiiij=(e,t,n,a,s,u,d)=>(i.dynCall_iiiiij=G.ya)(e,t,n,a,s,u,d),i.dynCall_iiiiijj=(e,t,n,a,s,u,d,f,m)=>(i.dynCall_iiiiijj=G.za)(e,t,n,a,s,u,d,f,m),i.dynCall_iiiiiijj=(e,t,n,a,s,u,d,f,m,w)=>(i.dynCall_iiiiiijj=G.Aa)(e,t,n,a,s,u,d,f,m,w);function ui(e,t){var n=V();try{return B(e)(t)}catch(a){if(q(n),a!==a+0)throw a;L(1,0)}}function li(e,t,n,a){var s=V();try{B(e)(t,n,a)}catch(u){if(q(s),u!==u+0)throw u;L(1,0)}}function di(e,t,n){var a=V();try{B(e)(t,n)}catch(s){if(q(a),s!==s+0)throw s;L(1,0)}}function fi(e,t,n,a){var s=V();try{return B(e)(t,n,a)}catch(u){if(q(s),u!==u+0)throw u;L(1,0)}}function hi(e,t,n,a,s){var u=V();try{return B(e)(t,n,a,s)}catch(d){if(q(u),d!==d+0)throw d;L(1,0)}}function pi(e,t){var n=V();try{B(e)(t)}catch(a){if(q(n),a!==a+0)throw a;L(1,0)}}function mi(e,t,n){var a=V();try{return B(e)(t,n)}catch(s){if(q(a),s!==s+0)throw s;L(1,0)}}function vi(e){var t=V();try{B(e)()}catch(n){if(q(t),n!==n+0)throw n;L(1,0)}}function yi(e,t,n,a,s){var u=V();try{return B(e)(t,n,a,s)}catch(d){if(q(u),d!==d+0)throw d;L(1,0)}}function gi(e,t,n,a,s,u,d,f,m,w,_){var T=V();try{B(e)(t,n,a,s,u,d,f,m,w,_)}catch(E){if(q(T),E!==E+0)throw E;L(1,0)}}function wi(e,t,n,a,s,u,d){var f=V();try{return B(e)(t,n,a,s,u,d)}catch(m){if(q(f),m!==m+0)throw m;L(1,0)}}function bi(e,t,n,a,s){var u=V();try{B(e)(t,n,a,s)}catch(d){if(q(u),d!==d+0)throw d;L(1,0)}}function Ci(e,t,n,a,s,u){var d=V();try{return B(e)(t,n,a,s,u)}catch(f){if(q(d),f!==f+0)throw f;L(1,0)}}function $i(e,t,n,a,s,u,d,f){var m=V();try{return B(e)(t,n,a,s,u,d,f)}catch(w){if(q(m),w!==w+0)throw w;L(1,0)}}function _i(e,t,n,a){var s=V();try{return B(e)(t,n,a)}catch(u){if(q(s),u!==u+0)throw u;L(1,0)}}function Si(e,t,n,a){var s=V();try{return B(e)(t,n,a)}catch(u){if(q(s),u!==u+0)throw u;L(1,0)}}function Pi(e){var t=V();try{return B(e)()}catch(n){if(q(t),n!==n+0)throw n;L(1,0)}}function Ti(e,t,n,a,s,u,d,f){var m=V();try{B(e)(t,n,a,s,u,d,f)}catch(w){if(q(m),w!==w+0)throw w;L(1,0)}}function Ei(e,t,n,a,s,u,d,f,m,w,_,T){var E=V();try{return B(e)(t,n,a,s,u,d,f,m,w,_,T)}catch(M){if(q(E),M!==M+0)throw M;L(1,0)}}function Oi(e,t,n,a,s,u,d,f,m,w,_,T,E,M,H,N){var F=V();try{B(e)