@bluepic/embed 0.2.0-next.4 → 0.2.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bluepic-embed.es.js
CHANGED
|
@@ -100946,7 +100946,7 @@ async function uploadImage(m, c, ie, we, $e, Me) {
|
|
|
100946
100946
|
}
|
|
100947
100947
|
class BluepicEmbed extends EventTarget {
|
|
100948
100948
|
constructor(c, ie, we, $e) {
|
|
100949
|
-
if (super(), this.embedProjectSlugOrId = we, console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!", $e?.
|
|
100949
|
+
if (super(), this.embedProjectSlugOrId = we, console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!", $e?.embedApiBaseUrl), !ie && !this.embedProjectSlugOrId)
|
|
100950
100950
|
throw new Error("Either templateId or embedProjectId must be provided");
|
|
100951
100951
|
if (typeof c == "string") {
|
|
100952
100952
|
const Me = document.querySelector(c);
|
|
@@ -100957,7 +100957,7 @@ class BluepicEmbed extends EventTarget {
|
|
|
100957
100957
|
this.element = c;
|
|
100958
100958
|
else
|
|
100959
100959
|
throw new Error("Invalid element or selector provided");
|
|
100960
|
-
this.
|
|
100960
|
+
this.displayMode.value = $e?.displayMode ?? this.displayMode.value, this.allowPanAndZoom.value = $e?.allowPanAndZoom ?? this.allowPanAndZoom.value, this.embedApiBaseUrl.value = $e?.embedApiBaseUrl ?? this.embedApiBaseUrl.value, this.cloudflarePagesHostname.value = $e?.cloudflarePagesHostname ?? this.cloudflarePagesHostname.value, this.bxCoreVersion.value = $e?.bxCoreVersion ?? this.bxCoreVersion.value, this.branding.value = $e?.branding ?? this.branding.value, this.stripeEnv.value = $e?.stripeEnv ?? this.stripeEnv.value, this.init(), this.data.value = $e?.initData ?? this.data.value, watch(this.ready, (Me, Ze) => {
|
|
100961
100961
|
if (Me && !Ze) {
|
|
100962
100962
|
const ne = new CustomEvent("ready", {
|
|
100963
100963
|
detail: { templateId: this.templateId.value, data: unref(this.data.value) }
|
|
@@ -100998,7 +100998,7 @@ class BluepicEmbed extends EventTarget {
|
|
|
100998
100998
|
basePreview = ref$1();
|
|
100999
100999
|
init() {
|
|
101000
101000
|
const c = `bluepic-app-${nanoid()}`;
|
|
101001
|
-
this.embedProjectSlugOrId && getProjectWithRetries(this.embedApiBaseUrl.value, "template.bluepic.io", this.embedProjectSlugOrId, 3, 2e3, this.stripeEnv.value).then(
|
|
101001
|
+
this.embedProjectSlugOrId && (console.log("...getProjectWithRetries", this.embedApiBaseUrl.value, "template.bluepic.io", this.embedProjectSlugOrId, 3, 2e3, this.stripeEnv.value), getProjectWithRetries(this.embedApiBaseUrl.value, "template.bluepic.io", this.embedProjectSlugOrId, 3, 2e3, this.stripeEnv.value).then(
|
|
101002
101002
|
({ embedProject: $e, isAllowedToDisableBranding: Me, templates: Ze }) => {
|
|
101003
101003
|
if (this.embedProject.value = $e, this.displayMode.value = $e.config.layout, this.allowPanAndZoom.value = $e.config.allowPanAndZoom, this.branding.value = Me ? $e.config.bluepicBranding : !0, Ze) {
|
|
101004
101004
|
const ne = Ze[$e.templates[0]];
|
|
@@ -101006,7 +101006,7 @@ class BluepicEmbed extends EventTarget {
|
|
|
101006
101006
|
}
|
|
101007
101007
|
console.log("BRANDING", this.branding.value), this.templateId.value = $e.templates[0];
|
|
101008
101008
|
}
|
|
101009
|
-
);
|
|
101009
|
+
));
|
|
101010
101010
|
const ie = document.createElement("style");
|
|
101011
101011
|
ie.textContent = `
|
|
101012
101012
|
#${c} .fade-spinner-enter-active,
|
package/lib/bluepic-embed.umd.js
CHANGED
|
@@ -2939,7 +2939,7 @@ Use Save As... to download, then click back to return to this page.`)&&(location
|
|
|
2939
2939
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
2940
2940
|
`)},_domwindow:function(){return ni("domwindow")},_bigint:function(ci){return ni("bigint:"+ci.toString())},_process:function(){return ni("process")},_timer:function(){return ni("timer")},_pipe:function(){return ni("pipe")},_tcp:function(){return ni("tcp")},_udp:function(){return ni("udp")},_tty:function(){return ni("tty")},_statwatcher:function(){return ni("statwatcher")},_securecontext:function(){return ni("securecontext")},_connection:function(){return ni("connection")},_zlib:function(){return ni("zlib")},_context:function(){return ni("context")},_nodescript:function(){return ni("nodescript")},_httpparser:function(){return ni("httpparser")},_dataview:function(){return ni("dataview")},_signal:function(){return ni("signal")},_fsevent:function(){return ni("fsevent")},_tlswrap:function(){return ni("tlswrap")}}}function oi(){return{buf:"",write:function(li){this.buf+=li},end:function(li){this.buf+=li},read:function(){return this.buf}}}Pe.writeToStream=function(li,xi,di){return di===void 0&&(di=xi,xi={}),Zr(xi=Vr(li,xi),di).dispatch(li)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){(function(Ar){var Pr=typeof Uint8Array<"u"?Uint8Array:Array,Fr="+".charCodeAt(0),Yr="/".charCodeAt(0),Vr="0".charCodeAt(0),Xr="a".charCodeAt(0),Zr="A".charCodeAt(0),oi="-".charCodeAt(0),li="_".charCodeAt(0);function xi(di){return di=di.charCodeAt(0),di===Fr||di===oi?62:di===Yr||di===li?63:di<Vr?-1:di<Vr+10?di-Vr+26+26:di<Zr+26?di-Zr:di<Xr+26?di-Xr+26:void 0}Ar.toByteArray=function(di){var ni,ci;if(0<di.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var gr=di.length,gr=di.charAt(gr-2)==="="?2:di.charAt(gr-1)==="="?1:0,Ae=new Pr(3*di.length/4-gr),ze=0<gr?di.length-4:di.length,Ue=0;function tr(lr){Ae[Ue++]=lr}for(ni=0;ni<ze;ni+=4,0)tr((16711680&(ci=xi(di.charAt(ni))<<18|xi(di.charAt(ni+1))<<12|xi(di.charAt(ni+2))<<6|xi(di.charAt(ni+3))))>>16),tr((65280&ci)>>8),tr(255&ci);return gr==2?tr(255&(ci=xi(di.charAt(ni))<<2|xi(di.charAt(ni+1))>>4)):gr==1&&(tr((ci=xi(di.charAt(ni))<<10|xi(di.charAt(ni+1))<<4|xi(di.charAt(ni+2))>>2)>>8&255),tr(255&ci)),Ae},Ar.fromByteArray=function(di){var ni,ci,gr,Ae,ze=di.length%3,Ue="";function tr(lr){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(lr)}for(ni=0,gr=di.length-ze;ni<gr;ni+=3)ci=(di[ni]<<16)+(di[ni+1]<<8)+di[ni+2],Ue+=tr((Ae=ci)>>18&63)+tr(Ae>>12&63)+tr(Ae>>6&63)+tr(63&Ae);switch(ze){case 1:Ue=(Ue+=tr((ci=di[di.length-1])>>2))+tr(ci<<4&63)+"==";break;case 2:Ue=(Ue=(Ue+=tr((ci=(di[di.length-2]<<8)+di[di.length-1])>>10))+tr(ci>>4&63))+tr(ci<<2&63)+"="}return Ue}})(Pe===void 0?this.base64js={}:Pe)}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(ie,we,Pe){(function(Me,Ze,Fr,rr,pr,or,yr,kr,Br){var Ar=ie("base64-js"),Pr=ie("ieee754");function Fr(ei,Wr,pi){if(!(this instanceof Fr))return new Fr(ei,Wr,pi);var hi,Oi,qi,yn,ln=typeof ei;if(Wr==="base64"&&ln=="string")for(ei=(yn=ei).trim?yn.trim():yn.replace(/^\s+|\s+$/g,"");ei.length%4!=0;)ei+="=";if(ln=="number")hi=br(ei);else if(ln=="string")hi=Fr.byteLength(ei,Wr);else{if(ln!="object")throw new Error("First argument needs to be a number, array or string.");hi=br(ei.length)}if(Fr._useTypedArrays?Oi=Fr._augment(new Uint8Array(hi)):((Oi=this).length=hi,Oi._isBuffer=!0),Fr._useTypedArrays&&typeof ei.byteLength=="number")Oi._set(ei);else if(nr(yn=ei)||Fr.isBuffer(yn)||yn&&typeof yn=="object"&&typeof yn.length=="number")for(qi=0;qi<hi;qi++)Fr.isBuffer(ei)?Oi[qi]=ei.readUInt8(qi):Oi[qi]=ei[qi];else if(ln=="string")Oi.write(ei,0,Wr);else if(ln=="number"&&!Fr._useTypedArrays&&!pi)for(qi=0;qi<hi;qi++)Oi[qi]=0;return Oi}function Yr(ei,Wr,pi,hi){return Fr._charsWritten=Hr(function(Oi){for(var qi=[],yn=0;yn<Oi.length;yn++)qi.push(255&Oi.charCodeAt(yn));return qi}(Wr),ei,pi,hi)}function Vr(ei,Wr,pi,hi){return Fr._charsWritten=Hr(function(Oi){for(var qi,yn,ln=[],Rn=0;Rn<Oi.length;Rn++)yn=Oi.charCodeAt(Rn),qi=yn>>8,yn=yn%256,ln.push(yn),ln.push(qi);return ln}(Wr),ei,pi,hi)}function Xr(ei,Wr,pi){var hi="";pi=Math.min(ei.length,pi);for(var Oi=Wr;Oi<pi;Oi++)hi+=String.fromCharCode(ei[Oi]);return hi}function Zr(ei,Wr,pi,qi){qi||(mi(typeof pi=="boolean","missing or invalid endian"),mi(Wr!=null,"missing offset"),mi(Wr+1<ei.length,"Trying to read beyond buffer length"));var Oi,qi=ei.length;if(!(qi<=Wr))return pi?(Oi=ei[Wr],Wr+1<qi&&(Oi|=ei[Wr+1]<<8)):(Oi=ei[Wr]<<8,Wr+1<qi&&(Oi|=ei[Wr+1])),Oi}function oi(ei,Wr,pi,qi){qi||(mi(typeof pi=="boolean","missing or invalid endian"),mi(Wr!=null,"missing offset"),mi(Wr+3<ei.length,"Trying to read beyond buffer length"));var Oi,qi=ei.length;if(!(qi<=Wr))return pi?(Wr+2<qi&&(Oi=ei[Wr+2]<<16),Wr+1<qi&&(Oi|=ei[Wr+1]<<8),Oi|=ei[Wr],Wr+3<qi&&(Oi+=ei[Wr+3]<<24>>>0)):(Wr+1<qi&&(Oi=ei[Wr+1]<<16),Wr+2<qi&&(Oi|=ei[Wr+2]<<8),Wr+3<qi&&(Oi|=ei[Wr+3]),Oi+=ei[Wr]<<24>>>0),Oi}function li(ei,Wr,pi,hi){if(hi||(mi(typeof pi=="boolean","missing or invalid endian"),mi(Wr!=null,"missing offset"),mi(Wr+1<ei.length,"Trying to read beyond buffer length")),!(ei.length<=Wr))return hi=Zr(ei,Wr,pi,!0),32768&hi?-1*(65535-hi+1):hi}function xi(ei,Wr,pi,hi){if(hi||(mi(typeof pi=="boolean","missing or invalid endian"),mi(Wr!=null,"missing offset"),mi(Wr+3<ei.length,"Trying to read beyond buffer length")),!(ei.length<=Wr))return hi=oi(ei,Wr,pi,!0),2147483648&hi?-1*(4294967295-hi+1):hi}function di(ei,Wr,pi,hi){return hi||(mi(typeof pi=="boolean","missing or invalid endian"),mi(Wr+3<ei.length,"Trying to read beyond buffer length")),Pr.read(ei,Wr,pi,23,4)}function ni(ei,Wr,pi,hi){return hi||(mi(typeof pi=="boolean","missing or invalid endian"),mi(Wr+7<ei.length,"Trying to read beyond buffer length")),Pr.read(ei,Wr,pi,52,8)}function ci(ei,Wr,pi,hi,Oi){if(Oi||(mi(Wr!=null,"missing value"),mi(typeof hi=="boolean","missing or invalid endian"),mi(pi!=null,"missing offset"),mi(pi+1<ei.length,"trying to write beyond buffer length"),Ti(Wr,65535)),Oi=ei.length,!(Oi<=pi))for(var qi=0,yn=Math.min(Oi-pi,2);qi<yn;qi++)ei[pi+qi]=(Wr&255<<8*(hi?qi:1-qi))>>>8*(hi?qi:1-qi)}function gr(ei,Wr,pi,hi,Oi){if(Oi||(mi(Wr!=null,"missing value"),mi(typeof hi=="boolean","missing or invalid endian"),mi(pi!=null,"missing offset"),mi(pi+3<ei.length,"trying to write beyond buffer length"),Ti(Wr,4294967295)),Oi=ei.length,!(Oi<=pi))for(var qi=0,yn=Math.min(Oi-pi,4);qi<yn;qi++)ei[pi+qi]=Wr>>>8*(hi?qi:3-qi)&255}function Ae(ei,Wr,pi,hi,Oi){Oi||(mi(Wr!=null,"missing value"),mi(typeof hi=="boolean","missing or invalid endian"),mi(pi!=null,"missing offset"),mi(pi+1<ei.length,"Trying to write beyond buffer length"),wi(Wr,32767,-32768)),ei.length<=pi||ci(ei,0<=Wr?Wr:65535+Wr+1,pi,hi,Oi)}function ze(ei,Wr,pi,hi,Oi){Oi||(mi(Wr!=null,"missing value"),mi(typeof hi=="boolean","missing or invalid endian"),mi(pi!=null,"missing offset"),mi(pi+3<ei.length,"Trying to write beyond buffer length"),wi(Wr,2147483647,-2147483648)),ei.length<=pi||gr(ei,0<=Wr?Wr:4294967295+Wr+1,pi,hi,Oi)}function Ue(ei,Wr,pi,hi,Oi){Oi||(mi(Wr!=null,"missing value"),mi(typeof hi=="boolean","missing or invalid endian"),mi(pi!=null,"missing offset"),mi(pi+3<ei.length,"Trying to write beyond buffer length"),ii(Wr,34028234663852886e22,-34028234663852886e22)),ei.length<=pi||Pr.write(ei,Wr,pi,hi,23,4)}function tr(ei,Wr,pi,hi,Oi){Oi||(mi(Wr!=null,"missing value"),mi(typeof hi=="boolean","missing or invalid endian"),mi(pi!=null,"missing offset"),mi(pi+7<ei.length,"Trying to write beyond buffer length"),ii(Wr,17976931348623157e292,-17976931348623157e292)),ei.length<=pi||Pr.write(ei,Wr,pi,hi,52,8)}Pe.Buffer=Fr,Pe.SlowBuffer=Fr,Pe.INSPECT_MAX_BYTES=50,Fr.poolSize=8192,Fr._useTypedArrays=function(){try{var ei=new ArrayBuffer(0),Wr=new Uint8Array(ei);return Wr.foo=function(){return 42},Wr.foo()===42&&typeof Wr.subarray=="function"}catch{return!1}}(),Fr.isEncoding=function(ei){switch(String(ei).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Fr.isBuffer=function(ei){return!(ei==null||!ei._isBuffer)},Fr.byteLength=function(ei,Wr){var pi;switch(ei+="",Wr||"utf8"){case"hex":pi=ei.length/2;break;case"utf8":case"utf-8":pi=ur(ei).length;break;case"ascii":case"binary":case"raw":pi=ei.length;break;case"base64":pi=$r(ei).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":pi=2*ei.length;break;default:throw new Error("Unknown encoding")}return pi},Fr.concat=function(ei,Wr){if(mi(nr(ei),`Usage: Buffer.concat(list, [totalLength])
|
|
2941
2941
|
list should be an Array.`),ei.length===0)return new Fr(0);if(ei.length===1)return ei[0];if(typeof Wr!="number")for(Oi=Wr=0;Oi<ei.length;Oi++)Wr+=ei[Oi].length;for(var pi=new Fr(Wr),hi=0,Oi=0;Oi<ei.length;Oi++){var qi=ei[Oi];qi.copy(pi,hi),hi+=qi.length}return pi},Fr.prototype.write=function(ei,Wr,pi,hi){isFinite(Wr)?isFinite(pi)||(hi=pi,pi=void 0):(Rn=hi,hi=Wr,Wr=pi,pi=Rn),Wr=Number(Wr)||0;var Oi,qi,yn,ln,Rn=this.length-Wr;switch((!pi||Rn<(pi=Number(pi)))&&(pi=Rn),hi=String(hi||"utf8").toLowerCase()){case"hex":Oi=function(nn,ji,Kn,Bn){Kn=Number(Kn)||0;var Fn=nn.length-Kn;(!Bn||Fn<(Bn=Number(Bn)))&&(Bn=Fn),mi((Fn=ji.length)%2==0,"Invalid hex string"),Fn/2<Bn&&(Bn=Fn/2);for(var $o=0;$o<Bn;$o++){var gn=parseInt(ji.substr(2*$o,2),16);mi(!isNaN(gn),"Invalid hex string"),nn[Kn+$o]=gn}return Fr._charsWritten=2*$o,$o}(this,ei,Wr,pi);break;case"utf8":case"utf-8":qi=this,yn=Wr,ln=pi,Oi=Fr._charsWritten=Hr(ur(ei),qi,yn,ln);break;case"ascii":case"binary":Oi=Yr(this,ei,Wr,pi);break;case"base64":qi=this,yn=Wr,ln=pi,Oi=Fr._charsWritten=Hr($r(ei),qi,yn,ln);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":Oi=Vr(this,ei,Wr,pi);break;default:throw new Error("Unknown encoding")}return Oi},Fr.prototype.toString=function(ei,Wr,pi){var hi,Oi,qi,yn,ln=this;if(ei=String(ei||"utf8").toLowerCase(),Wr=Number(Wr)||0,(pi=pi!==void 0?Number(pi):ln.length)===Wr)return"";switch(ei){case"hex":hi=function(Rn,nn,ji){var Kn=Rn.length;(!nn||nn<0)&&(nn=0),(!ji||ji<0||Kn<ji)&&(ji=Kn);for(var Bn="",Fn=nn;Fn<ji;Fn++)Bn+=$e(Rn[Fn]);return Bn}(ln,Wr,pi);break;case"utf8":case"utf-8":hi=function(Rn,nn,ji){var Kn="",Bn="";ji=Math.min(Rn.length,ji);for(var Fn=nn;Fn<ji;Fn++)Rn[Fn]<=127?(Kn+=gi(Bn)+String.fromCharCode(Rn[Fn]),Bn=""):Bn+="%"+Rn[Fn].toString(16);return Kn+gi(Bn)}(ln,Wr,pi);break;case"ascii":case"binary":hi=Xr(ln,Wr,pi);break;case"base64":Oi=ln,yn=pi,hi=(qi=Wr)===0&&yn===Oi.length?Ar.fromByteArray(Oi):Ar.fromByteArray(Oi.slice(qi,yn));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":hi=function(Rn,nn,ji){for(var Kn=Rn.slice(nn,ji),Bn="",Fn=0;Fn<Kn.length;Fn+=2)Bn+=String.fromCharCode(Kn[Fn]+256*Kn[Fn+1]);return Bn}(ln,Wr,pi);break;default:throw new Error("Unknown encoding")}return hi},Fr.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Fr.prototype.copy=function(ei,Wr,pi,hi){if(Wr=Wr||0,(hi=hi||hi===0?hi:this.length)!==(pi=pi||0)&&ei.length!==0&&this.length!==0){mi(pi<=hi,"sourceEnd < sourceStart"),mi(0<=Wr&&Wr<ei.length,"targetStart out of bounds"),mi(0<=pi&&pi<this.length,"sourceStart out of bounds"),mi(0<=hi&&hi<=this.length,"sourceEnd out of bounds"),hi>this.length&&(hi=this.length);var Oi=(hi=ei.length-Wr<hi-pi?ei.length-Wr+pi:hi)-pi;if(Oi<100||!Fr._useTypedArrays)for(var qi=0;qi<Oi;qi++)ei[qi+Wr]=this[qi+pi];else ei._set(this.subarray(pi,pi+Oi),Wr)}},Fr.prototype.slice=function(ei,Wr){var pi=this.length;if(ei=vr(ei,pi,0),Wr=vr(Wr,pi,pi),Fr._useTypedArrays)return Fr._augment(this.subarray(ei,Wr));for(var hi=Wr-ei,Oi=new Fr(hi,void 0,!0),qi=0;qi<hi;qi++)Oi[qi]=this[qi+ei];return Oi},Fr.prototype.get=function(ei){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(ei)},Fr.prototype.set=function(ei,Wr){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(ei,Wr)},Fr.prototype.readUInt8=function(ei,Wr){if(Wr||(mi(ei!=null,"missing offset"),mi(ei<this.length,"Trying to read beyond buffer length")),!(ei>=this.length))return this[ei]},Fr.prototype.readUInt16LE=function(ei,Wr){return Zr(this,ei,!0,Wr)},Fr.prototype.readUInt16BE=function(ei,Wr){return Zr(this,ei,!1,Wr)},Fr.prototype.readUInt32LE=function(ei,Wr){return oi(this,ei,!0,Wr)},Fr.prototype.readUInt32BE=function(ei,Wr){return oi(this,ei,!1,Wr)},Fr.prototype.readInt8=function(ei,Wr){if(Wr||(mi(ei!=null,"missing offset"),mi(ei<this.length,"Trying to read beyond buffer length")),!(ei>=this.length))return 128&this[ei]?-1*(255-this[ei]+1):this[ei]},Fr.prototype.readInt16LE=function(ei,Wr){return li(this,ei,!0,Wr)},Fr.prototype.readInt16BE=function(ei,Wr){return li(this,ei,!1,Wr)},Fr.prototype.readInt32LE=function(ei,Wr){return xi(this,ei,!0,Wr)},Fr.prototype.readInt32BE=function(ei,Wr){return xi(this,ei,!1,Wr)},Fr.prototype.readFloatLE=function(ei,Wr){return di(this,ei,!0,Wr)},Fr.prototype.readFloatBE=function(ei,Wr){return di(this,ei,!1,Wr)},Fr.prototype.readDoubleLE=function(ei,Wr){return ni(this,ei,!0,Wr)},Fr.prototype.readDoubleBE=function(ei,Wr){return ni(this,ei,!1,Wr)},Fr.prototype.writeUInt8=function(ei,Wr,pi){pi||(mi(ei!=null,"missing value"),mi(Wr!=null,"missing offset"),mi(Wr<this.length,"trying to write beyond buffer length"),Ti(ei,255)),Wr>=this.length||(this[Wr]=ei)},Fr.prototype.writeUInt16LE=function(ei,Wr,pi){ci(this,ei,Wr,!0,pi)},Fr.prototype.writeUInt16BE=function(ei,Wr,pi){ci(this,ei,Wr,!1,pi)},Fr.prototype.writeUInt32LE=function(ei,Wr,pi){gr(this,ei,Wr,!0,pi)},Fr.prototype.writeUInt32BE=function(ei,Wr,pi){gr(this,ei,Wr,!1,pi)},Fr.prototype.writeInt8=function(ei,Wr,pi){pi||(mi(ei!=null,"missing value"),mi(Wr!=null,"missing offset"),mi(Wr<this.length,"Trying to write beyond buffer length"),wi(ei,127,-128)),Wr>=this.length||(0<=ei?this.writeUInt8(ei,Wr,pi):this.writeUInt8(255+ei+1,Wr,pi))},Fr.prototype.writeInt16LE=function(ei,Wr,pi){Ae(this,ei,Wr,!0,pi)},Fr.prototype.writeInt16BE=function(ei,Wr,pi){Ae(this,ei,Wr,!1,pi)},Fr.prototype.writeInt32LE=function(ei,Wr,pi){ze(this,ei,Wr,!0,pi)},Fr.prototype.writeInt32BE=function(ei,Wr,pi){ze(this,ei,Wr,!1,pi)},Fr.prototype.writeFloatLE=function(ei,Wr,pi){Ue(this,ei,Wr,!0,pi)},Fr.prototype.writeFloatBE=function(ei,Wr,pi){Ue(this,ei,Wr,!1,pi)},Fr.prototype.writeDoubleLE=function(ei,Wr,pi){tr(this,ei,Wr,!0,pi)},Fr.prototype.writeDoubleBE=function(ei,Wr,pi){tr(this,ei,Wr,!1,pi)},Fr.prototype.fill=function(ei,Wr,pi){if(Wr=Wr||0,pi=pi||this.length,mi(typeof(ei=typeof(ei=ei||0)=="string"?ei.charCodeAt(0):ei)=="number"&&!isNaN(ei),"value is not a number"),mi(Wr<=pi,"end < start"),pi!==Wr&&this.length!==0){mi(0<=Wr&&Wr<this.length,"start out of bounds"),mi(0<=pi&&pi<=this.length,"end out of bounds");for(var hi=Wr;hi<pi;hi++)this[hi]=ei}},Fr.prototype.inspect=function(){for(var ei=[],Wr=this.length,pi=0;pi<Wr;pi++)if(ei[pi]=$e(this[pi]),pi===Pe.INSPECT_MAX_BYTES){ei[pi+1]="...";break}return"<Buffer "+ei.join(" ")+">"},Fr.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(Fr._useTypedArrays)return new Fr(this).buffer;for(var ei=new Uint8Array(this.length),Wr=0,pi=ei.length;Wr<pi;Wr+=1)ei[Wr]=this[Wr];return ei.buffer};var lr=Fr.prototype;function vr(ei,Wr,pi){return typeof ei!="number"?pi:Wr<=(ei=~~ei)?Wr:0<=ei||0<=(ei+=Wr)?ei:0}function br(ei){return(ei=~~Math.ceil(+ei))<0?0:ei}function nr(ei){return(Array.isArray||function(Wr){return Object.prototype.toString.call(Wr)==="[object Array]"})(ei)}function $e(ei){return ei<16?"0"+ei.toString(16):ei.toString(16)}function ur(ei){for(var Wr=[],pi=0;pi<ei.length;pi++){var hi=ei.charCodeAt(pi);if(hi<=127)Wr.push(ei.charCodeAt(pi));else for(var Oi=pi,qi=(55296<=hi&&hi<=57343&&pi++,encodeURIComponent(ei.slice(Oi,pi+1)).substr(1).split("%")),yn=0;yn<qi.length;yn++)Wr.push(parseInt(qi[yn],16))}return Wr}function $r(ei){return Ar.toByteArray(ei)}function Hr(ei,Wr,pi,hi){for(var Oi=0;Oi<hi&&!(Oi+pi>=Wr.length||Oi>=ei.length);Oi++)Wr[Oi+pi]=ei[Oi];return Oi}function gi(ei){try{return decodeURIComponent(ei)}catch{return String.fromCharCode(65533)}}function Ti(ei,Wr){mi(typeof ei=="number","cannot write a non-number as a number"),mi(0<=ei,"specified a negative value for writing an unsigned value"),mi(ei<=Wr,"value is larger than maximum value for type"),mi(Math.floor(ei)===ei,"value has a fractional component")}function wi(ei,Wr,pi){mi(typeof ei=="number","cannot write a non-number as a number"),mi(ei<=Wr,"value larger than maximum allowed value"),mi(pi<=ei,"value smaller than minimum allowed value"),mi(Math.floor(ei)===ei,"value has a fractional component")}function ii(ei,Wr,pi){mi(typeof ei=="number","cannot write a non-number as a number"),mi(ei<=Wr,"value larger than maximum allowed value"),mi(pi<=ei,"value smaller than minimum allowed value")}function mi(ei,Wr){if(!ei)throw new Error(Wr||"Failed assertion")}Fr._augment=function(ei){return ei._isBuffer=!0,ei._get=ei.get,ei._set=ei.set,ei.get=lr.get,ei.set=lr.set,ei.write=lr.write,ei.toString=lr.toString,ei.toLocaleString=lr.toString,ei.toJSON=lr.toJSON,ei.copy=lr.copy,ei.slice=lr.slice,ei.readUInt8=lr.readUInt8,ei.readUInt16LE=lr.readUInt16LE,ei.readUInt16BE=lr.readUInt16BE,ei.readUInt32LE=lr.readUInt32LE,ei.readUInt32BE=lr.readUInt32BE,ei.readInt8=lr.readInt8,ei.readInt16LE=lr.readInt16LE,ei.readInt16BE=lr.readInt16BE,ei.readInt32LE=lr.readInt32LE,ei.readInt32BE=lr.readInt32BE,ei.readFloatLE=lr.readFloatLE,ei.readFloatBE=lr.readFloatBE,ei.readDoubleLE=lr.readDoubleLE,ei.readDoubleBE=lr.readDoubleBE,ei.writeUInt8=lr.writeUInt8,ei.writeUInt16LE=lr.writeUInt16LE,ei.writeUInt16BE=lr.writeUInt16BE,ei.writeUInt32LE=lr.writeUInt32LE,ei.writeUInt32BE=lr.writeUInt32BE,ei.writeInt8=lr.writeInt8,ei.writeInt16LE=lr.writeInt16LE,ei.writeInt16BE=lr.writeInt16BE,ei.writeInt32LE=lr.writeInt32LE,ei.writeInt32BE=lr.writeInt32BE,ei.writeFloatLE=lr.writeFloatLE,ei.writeFloatBE=lr.writeFloatBE,ei.writeDoubleLE=lr.writeDoubleLE,ei.writeDoubleBE=lr.writeDoubleBE,ei.fill=lr.fill,ei.inspect=lr.inspect,ei.toArrayBuffer=lr.toArrayBuffer,ei}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(ie,we,Pe){(function(Me,Ze,Ar,rr,pr,or,yr,kr,Br){var Ar=ie("buffer").Buffer,Pr=4,Fr=new Ar(Pr);Fr.fill(0),we.exports={hash:function(Yr,Vr,Xr,Zr){for(var oi=Vr(function(ci,gr){ci.length%Pr!=0&&(Ae=ci.length+(Pr-ci.length%Pr),ci=Ar.concat([ci,Fr],Ae));for(var Ae,ze=[],Ue=gr?ci.readInt32BE:ci.readInt32LE,tr=0;tr<ci.length;tr+=Pr)ze.push(Ue.call(ci,tr));return ze}(Yr=Ar.isBuffer(Yr)?Yr:new Ar(Yr),Zr),8*Yr.length),Vr=Zr,li=new Ar(Xr),xi=Vr?li.writeInt32BE:li.writeInt32LE,di=0;di<oi.length;di++)xi.call(li,oi[di],4*di,!0);return li}}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(ie,we,Pe){(function(Me,Ze,Ar,rr,pr,or,yr,kr,Br){var Ar=ie("buffer").Buffer,Pr=ie("./sha"),Fr=ie("./sha256"),Yr=ie("./rng"),Vr={sha1:Pr,sha256:Fr,md5:ie("./md5")},Xr=64,Zr=new Ar(Xr);function oi(ci,gr){var Ae=Vr[ci=ci||"sha1"],ze=[];return Ae||li("algorithm:",ci,"is not yet supported"),{update:function(Ue){return Ar.isBuffer(Ue)||(Ue=new Ar(Ue)),ze.push(Ue),Ue.length,this},digest:function(Ue){var tr=Ar.concat(ze),tr=gr?function(lr,vr,br){Ar.isBuffer(vr)||(vr=new Ar(vr)),Ar.isBuffer(br)||(br=new Ar(br)),vr.length>Xr?vr=lr(vr):vr.length<Xr&&(vr=Ar.concat([vr,Zr],Xr));for(var nr=new Ar(Xr),$e=new Ar(Xr),ur=0;ur<Xr;ur++)nr[ur]=54^vr[ur],$e[ur]=92^vr[ur];return br=lr(Ar.concat([nr,br])),lr(Ar.concat([$e,br]))}(Ae,gr,tr):Ae(tr);return ze=null,Ue?tr.toString(Ue):tr}}}function li(){var ci=[].slice.call(arguments).join(" ");throw new Error([ci,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
2942
|
-
`))}Zr.fill(0),Pe.createHash=function(ci){return oi(ci)},Pe.createHmac=oi,Pe.randomBytes=function(ci,gr){if(!gr||!gr.call)return new Ar(Yr(ci));try{gr.call(this,void 0,new Ar(Yr(ci)))}catch(Ae){gr(Ae)}};var xi,di=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],ni=function(ci){Pe[ci]=function(){li("sorry,",ci,"is not implemented yet")}};for(xi in di)ni(di[xi])}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){var Ar=ie("./helpers");function Pr(li,xi){li[xi>>5]|=128<<xi%32,li[14+(xi+64>>>9<<4)]=xi;for(var di=1732584193,ni=-271733879,ci=-1732584194,gr=271733878,Ae=0;Ae<li.length;Ae+=16){var ze=di,Ue=ni,tr=ci,lr=gr,di=Yr(di,ni,ci,gr,li[Ae+0],7,-680876936),gr=Yr(gr,di,ni,ci,li[Ae+1],12,-389564586),ci=Yr(ci,gr,di,ni,li[Ae+2],17,606105819),ni=Yr(ni,ci,gr,di,li[Ae+3],22,-1044525330);di=Yr(di,ni,ci,gr,li[Ae+4],7,-176418897),gr=Yr(gr,di,ni,ci,li[Ae+5],12,1200080426),ci=Yr(ci,gr,di,ni,li[Ae+6],17,-1473231341),ni=Yr(ni,ci,gr,di,li[Ae+7],22,-45705983),di=Yr(di,ni,ci,gr,li[Ae+8],7,1770035416),gr=Yr(gr,di,ni,ci,li[Ae+9],12,-1958414417),ci=Yr(ci,gr,di,ni,li[Ae+10],17,-42063),ni=Yr(ni,ci,gr,di,li[Ae+11],22,-1990404162),di=Yr(di,ni,ci,gr,li[Ae+12],7,1804603682),gr=Yr(gr,di,ni,ci,li[Ae+13],12,-40341101),ci=Yr(ci,gr,di,ni,li[Ae+14],17,-1502002290),di=Vr(di,ni=Yr(ni,ci,gr,di,li[Ae+15],22,1236535329),ci,gr,li[Ae+1],5,-165796510),gr=Vr(gr,di,ni,ci,li[Ae+6],9,-1069501632),ci=Vr(ci,gr,di,ni,li[Ae+11],14,643717713),ni=Vr(ni,ci,gr,di,li[Ae+0],20,-373897302),di=Vr(di,ni,ci,gr,li[Ae+5],5,-701558691),gr=Vr(gr,di,ni,ci,li[Ae+10],9,38016083),ci=Vr(ci,gr,di,ni,li[Ae+15],14,-660478335),ni=Vr(ni,ci,gr,di,li[Ae+4],20,-405537848),di=Vr(di,ni,ci,gr,li[Ae+9],5,568446438),gr=Vr(gr,di,ni,ci,li[Ae+14],9,-1019803690),ci=Vr(ci,gr,di,ni,li[Ae+3],14,-187363961),ni=Vr(ni,ci,gr,di,li[Ae+8],20,1163531501),di=Vr(di,ni,ci,gr,li[Ae+13],5,-1444681467),gr=Vr(gr,di,ni,ci,li[Ae+2],9,-51403784),ci=Vr(ci,gr,di,ni,li[Ae+7],14,1735328473),di=Xr(di,ni=Vr(ni,ci,gr,di,li[Ae+12],20,-1926607734),ci,gr,li[Ae+5],4,-378558),gr=Xr(gr,di,ni,ci,li[Ae+8],11,-2022574463),ci=Xr(ci,gr,di,ni,li[Ae+11],16,1839030562),ni=Xr(ni,ci,gr,di,li[Ae+14],23,-35309556),di=Xr(di,ni,ci,gr,li[Ae+1],4,-1530992060),gr=Xr(gr,di,ni,ci,li[Ae+4],11,1272893353),ci=Xr(ci,gr,di,ni,li[Ae+7],16,-155497632),ni=Xr(ni,ci,gr,di,li[Ae+10],23,-1094730640),di=Xr(di,ni,ci,gr,li[Ae+13],4,681279174),gr=Xr(gr,di,ni,ci,li[Ae+0],11,-358537222),ci=Xr(ci,gr,di,ni,li[Ae+3],16,-722521979),ni=Xr(ni,ci,gr,di,li[Ae+6],23,76029189),di=Xr(di,ni,ci,gr,li[Ae+9],4,-640364487),gr=Xr(gr,di,ni,ci,li[Ae+12],11,-421815835),ci=Xr(ci,gr,di,ni,li[Ae+15],16,530742520),di=Zr(di,ni=Xr(ni,ci,gr,di,li[Ae+2],23,-995338651),ci,gr,li[Ae+0],6,-198630844),gr=Zr(gr,di,ni,ci,li[Ae+7],10,1126891415),ci=Zr(ci,gr,di,ni,li[Ae+14],15,-1416354905),ni=Zr(ni,ci,gr,di,li[Ae+5],21,-57434055),di=Zr(di,ni,ci,gr,li[Ae+12],6,1700485571),gr=Zr(gr,di,ni,ci,li[Ae+3],10,-1894986606),ci=Zr(ci,gr,di,ni,li[Ae+10],15,-1051523),ni=Zr(ni,ci,gr,di,li[Ae+1],21,-2054922799),di=Zr(di,ni,ci,gr,li[Ae+8],6,1873313359),gr=Zr(gr,di,ni,ci,li[Ae+15],10,-30611744),ci=Zr(ci,gr,di,ni,li[Ae+6],15,-1560198380),ni=Zr(ni,ci,gr,di,li[Ae+13],21,1309151649),di=Zr(di,ni,ci,gr,li[Ae+4],6,-145523070),gr=Zr(gr,di,ni,ci,li[Ae+11],10,-1120210379),ci=Zr(ci,gr,di,ni,li[Ae+2],15,718787259),ni=Zr(ni,ci,gr,di,li[Ae+9],21,-343485551),di=oi(di,ze),ni=oi(ni,Ue),ci=oi(ci,tr),gr=oi(gr,lr)}return Array(di,ni,ci,gr)}function Fr(li,xi,di,ni,ci,gr){return oi((xi=oi(oi(xi,li),oi(ni,gr)))<<ci|xi>>>32-ci,di)}function Yr(li,xi,di,ni,ci,gr,Ae){return Fr(xi&di|~xi&ni,li,xi,ci,gr,Ae)}function Vr(li,xi,di,ni,ci,gr,Ae){return Fr(xi&ni|di&~ni,li,xi,ci,gr,Ae)}function Xr(li,xi,di,ni,ci,gr,Ae){return Fr(xi^di^ni,li,xi,ci,gr,Ae)}function Zr(li,xi,di,ni,ci,gr,Ae){return Fr(di^(xi|~ni),li,xi,ci,gr,Ae)}function oi(li,xi){var di=(65535&li)+(65535&xi);return(li>>16)+(xi>>16)+(di>>16)<<16|65535&di}we.exports=function(li){return Ar.hash(li,Pr,16)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){we.exports=function(Ar){for(var Pr,Fr=new Array(Ar),Yr=0;Yr<Ar;Yr++)(3&Yr)==0&&(Pr=4294967296*Math.random()),Fr[Yr]=Pr>>>((3&Yr)<<3)&255;return Fr}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){var Ar=ie("./helpers");function Pr(Vr,Xr){Vr[Xr>>5]|=128<<24-Xr%32,Vr[15+(Xr+64>>9<<4)]=Xr;for(var Zr,oi,li,xi=Array(80),di=1732584193,ni=-271733879,ci=-1732584194,gr=271733878,Ae=-1009589776,ze=0;ze<Vr.length;ze+=16){for(var Ue=di,tr=ni,lr=ci,vr=gr,br=Ae,nr=0;nr<80;nr++){xi[nr]=nr<16?Vr[ze+nr]:Yr(xi[nr-3]^xi[nr-8]^xi[nr-14]^xi[nr-16],1);var $e=Fr(Fr(Yr(di,5),($e=ni,oi=ci,li=gr,(Zr=nr)<20?$e&oi|~$e&li:!(Zr<40)&&Zr<60?$e&oi|$e&li|oi&li:$e^oi^li)),Fr(Fr(Ae,xi[nr]),(Zr=nr)<20?1518500249:Zr<40?1859775393:Zr<60?-1894007588:-899497514)),Ae=gr,gr=ci,ci=Yr(ni,30),ni=di,di=$e}di=Fr(di,Ue),ni=Fr(ni,tr),ci=Fr(ci,lr),gr=Fr(gr,vr),Ae=Fr(Ae,br)}return Array(di,ni,ci,gr,Ae)}function Fr(Vr,Xr){var Zr=(65535&Vr)+(65535&Xr);return(Vr>>16)+(Xr>>16)+(Zr>>16)<<16|65535&Zr}function Yr(Vr,Xr){return Vr<<Xr|Vr>>>32-Xr}we.exports=function(Vr){return Ar.hash(Vr,Pr,20,!0)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){function Ar(Xr,Zr){var oi=(65535&Xr)+(65535&Zr);return(Xr>>16)+(Zr>>16)+(oi>>16)<<16|65535&oi}function Pr(Xr,Zr){var oi,li=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),xi=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),di=new Array(64);Xr[Zr>>5]|=128<<24-Zr%32,Xr[15+(Zr+64>>9<<4)]=Zr;for(var ni,ci,gr=0;gr<Xr.length;gr+=16){for(var Ae=xi[0],ze=xi[1],Ue=xi[2],tr=xi[3],lr=xi[4],vr=xi[5],br=xi[6],nr=xi[7],$e=0;$e<64;$e++)di[$e]=$e<16?Xr[$e+gr]:Ar(Ar(Ar((ci=di[$e-2],Yr(ci,17)^Yr(ci,19)^Vr(ci,10)),di[$e-7]),(ci=di[$e-15],Yr(ci,7)^Yr(ci,18)^Vr(ci,3))),di[$e-16]),oi=Ar(Ar(Ar(Ar(nr,Yr(ci=lr,6)^Yr(ci,11)^Yr(ci,25)),lr&vr^~lr&br),li[$e]),di[$e]),ni=Ar(Yr(ni=Ae,2)^Yr(ni,13)^Yr(ni,22),Ae&ze^Ae&Ue^ze&Ue),nr=br,br=vr,vr=lr,lr=Ar(tr,oi),tr=Ue,Ue=ze,ze=Ae,Ae=Ar(oi,ni);xi[0]=Ar(Ae,xi[0]),xi[1]=Ar(ze,xi[1]),xi[2]=Ar(Ue,xi[2]),xi[3]=Ar(tr,xi[3]),xi[4]=Ar(lr,xi[4]),xi[5]=Ar(vr,xi[5]),xi[6]=Ar(br,xi[6]),xi[7]=Ar(nr,xi[7])}return xi}var Fr=ie("./helpers"),Yr=function(Xr,Zr){return Xr>>>Zr|Xr<<32-Zr},Vr=function(Xr,Zr){return Xr>>>Zr};we.exports=function(Xr){return Fr.hash(Xr,Pr,32,!0)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){Pe.read=function(Ar,Pr,Fr,Yr,gr){var Xr,Zr,oi=8*gr-Yr-1,li=(1<<oi)-1,xi=li>>1,di=-7,ni=Fr?gr-1:0,ci=Fr?-1:1,gr=Ar[Pr+ni];for(ni+=ci,Xr=gr&(1<<-di)-1,gr>>=-di,di+=oi;0<di;Xr=256*Xr+Ar[Pr+ni],ni+=ci,di-=8);for(Zr=Xr&(1<<-di)-1,Xr>>=-di,di+=Yr;0<di;Zr=256*Zr+Ar[Pr+ni],ni+=ci,di-=8);if(Xr===0)Xr=1-xi;else{if(Xr===li)return Zr?NaN:1/0*(gr?-1:1);Zr+=Math.pow(2,Yr),Xr-=xi}return(gr?-1:1)*Zr*Math.pow(2,Xr-Yr)},Pe.write=function(Ar,Pr,Fr,Yr,Vr,Ae){var Zr,oi,li=8*Ae-Vr-1,xi=(1<<li)-1,di=xi>>1,ni=Vr===23?Math.pow(2,-24)-Math.pow(2,-77):0,ci=Yr?0:Ae-1,gr=Yr?1:-1,Ae=Pr<0||Pr===0&&1/Pr<0?1:0;for(Pr=Math.abs(Pr),isNaN(Pr)||Pr===1/0?(oi=isNaN(Pr)?1:0,Zr=xi):(Zr=Math.floor(Math.log(Pr)/Math.LN2),Pr*(Yr=Math.pow(2,-Zr))<1&&(Zr--,Yr*=2),2<=(Pr+=1<=Zr+di?ni/Yr:ni*Math.pow(2,1-di))*Yr&&(Zr++,Yr/=2),xi<=Zr+di?(oi=0,Zr=xi):1<=Zr+di?(oi=(Pr*Yr-1)*Math.pow(2,Vr),Zr+=di):(oi=Pr*Math.pow(2,di-1)*Math.pow(2,Vr),Zr=0));8<=Vr;Ar[Fr+ci]=255&oi,ci+=gr,oi/=256,Vr-=8);for(Zr=Zr<<Vr|oi,li+=Vr;0<li;Ar[Fr+ci]=255&Zr,ci+=gr,Zr/=256,li-=8);Ar[Fr+ci-gr]|=128*Ae}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){var Ar,Pr,Fr;function Yr(){}(Me=we.exports={}).nextTick=(Pr=typeof window<"u"&&window.setImmediate,Fr=typeof window<"u"&&window.postMessage&&window.addEventListener,Pr?function(Vr){return window.setImmediate(Vr)}:Fr?(Ar=[],window.addEventListener("message",function(Vr){var Xr=Vr.source;Xr!==window&&Xr!==null||Vr.data!=="process-tick"||(Vr.stopPropagation(),0<Ar.length&&Ar.shift()())},!0),function(Vr){Ar.push(Vr),window.postMessage("process-tick","*")}):function(Vr){setTimeout(Vr,0)}),Me.title="browser",Me.browser=!0,Me.env={},Me.argv=[],Me.on=Yr,Me.addListener=Yr,Me.once=Yr,Me.off=Yr,Me.removeListener=Yr,Me.removeAllListeners=Yr,Me.emit=Yr,Me.binding=function(Vr){throw new Error("process.binding is not supported")},Me.cwd=function(){return"/"},Me.chdir=function(Vr){throw new Error("process.chdir is not supported")}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})})(object_hash);const hash=object_hash.exports,IMAGE_TTL_IN_SECONDS=60*60*24*1;function parseCloudflareImagesDeliveryUrl(m){try{const c=new URL(m);if(c.hostname==="imagedelivery.net"){const[,ie,we,Pe]=c.pathname.split("/")||[];if(ie&&we&&Pe)return{scopeId:ie,imageId:we,variant:Pe};throw new Error("Invalid Cloudflare Images URL")}throw new Error("Invalid Cloudflare Images URL")}catch{throw new Error("Invalid URL")}}async function uploadImage(m,c,ie,we,Pe,Me){const Ze=`${m}/api/image/session?${new URLSearchParams({key:hash({field:ie.field,templateId:c}),ttl:String(IMAGE_TTL_IN_SECONDS)})}`,ne=new FormData;ne.append("file",we,Pe);const rr=await fetchWithProgressV1({url:Ze,method:"POST",data:ne,onUploadProgress:Me});if(rr.type==="application/json")return JSON.parse(await rr.text());throw new Error("Invalid response from Cloudflare Images")}class BluepicEmbed extends EventTarget{constructor(c,ie,we,Pe){if(super(),this.embedProjectSlugOrId=we,console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!",Pe?.branding,"embedProjectSlugOrId",this.embedProjectSlugOrId),!ie&&!this.embedProjectSlugOrId)throw new Error("Either templateId or embedProjectId must be provided");if(typeof c=="string"){const Me=document.querySelector(c);if(!Me||!(Me instanceof HTMLElement))throw new Error(`Element with selector "${c}" not found or not an HTMLElement`);this.element=Me}else if(c instanceof HTMLElement)this.element=c;else throw new Error("Invalid element or selector provided");this.init(),this.displayMode.value=Pe?.displayMode??this.displayMode.value,this.allowPanAndZoom.value=Pe?.allowPanAndZoom??this.allowPanAndZoom.value,this.embedApiBaseUrl.value=Pe?.embedApiBaseUrl??this.embedApiBaseUrl.value,this.cloudflarePagesHostname.value=Pe?.cloudflarePagesHostname??this.cloudflarePagesHostname.value,this.bxCoreVersion.value=Pe?.bxCoreVersion??this.bxCoreVersion.value,this.branding.value=Pe?.branding??this.branding.value,this.stripeEnv.value=Pe?.stripeEnv??this.stripeEnv.value,this.data.value=Pe?.initData??this.data.value,vue.watch(this.ready,(Me,Ze)=>{if(Me&&!Ze){const ne=new CustomEvent("ready",{detail:{templateId:this.templateId.value,data:vue.unref(this.data.value)}});this.dispatchEvent(ne)}}),vue.watch(this.data,()=>{const Me=new CustomEvent("data",{detail:{data:vue.unref(this.data.value)}});this.dispatchEvent(Me)},{deep:!0})}element;embedApiBaseUrl=vue.ref("https://embed-api-v2.bluepic.workers.dev");cloudflarePagesHostname=vue.ref("bluepic-core-sandbox.pages.dev");editorRef=vue.ref();templateId=vue.ref();data=vue.ref();serial=vue.ref();allowPanAndZoom=vue.ref(!1);ready=vue.ref(!1);displayMode=vue.ref("auto");bxCoreVersion=vue.ref("auto");branding=vue.ref(!0);stripeEnv=vue.ref("prod");bxThemeStyleVars;embedProject=vue.ref();baseSerial=vue.ref();basePreview=vue.ref();init(){const c=`bluepic-app-${nanoid()}`;this.embedProjectSlugOrId&&getProjectWithRetries(this.embedApiBaseUrl.value,"template.bluepic.io",this.embedProjectSlugOrId,3,2e3,this.stripeEnv.value).then(({embedProject:Pe,isAllowedToDisableBranding:Me,templates:Ze})=>{if(this.embedProject.value=Pe,this.displayMode.value=Pe.config.layout,this.allowPanAndZoom.value=Pe.config.allowPanAndZoom,this.branding.value=Me?Pe.config.bluepicBranding:!0,Ze){const ne=Ze[Pe.templates[0]];this.baseSerial.value=ne.serial,ne.preview&&(this.basePreview.value=ne.preview)}console.log("BRANDING",this.branding.value),this.templateId.value=Pe.templates[0]});const ie=document.createElement("style");ie.textContent=`
|
|
2942
|
+
`))}Zr.fill(0),Pe.createHash=function(ci){return oi(ci)},Pe.createHmac=oi,Pe.randomBytes=function(ci,gr){if(!gr||!gr.call)return new Ar(Yr(ci));try{gr.call(this,void 0,new Ar(Yr(ci)))}catch(Ae){gr(Ae)}};var xi,di=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],ni=function(ci){Pe[ci]=function(){li("sorry,",ci,"is not implemented yet")}};for(xi in di)ni(di[xi])}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){var Ar=ie("./helpers");function Pr(li,xi){li[xi>>5]|=128<<xi%32,li[14+(xi+64>>>9<<4)]=xi;for(var di=1732584193,ni=-271733879,ci=-1732584194,gr=271733878,Ae=0;Ae<li.length;Ae+=16){var ze=di,Ue=ni,tr=ci,lr=gr,di=Yr(di,ni,ci,gr,li[Ae+0],7,-680876936),gr=Yr(gr,di,ni,ci,li[Ae+1],12,-389564586),ci=Yr(ci,gr,di,ni,li[Ae+2],17,606105819),ni=Yr(ni,ci,gr,di,li[Ae+3],22,-1044525330);di=Yr(di,ni,ci,gr,li[Ae+4],7,-176418897),gr=Yr(gr,di,ni,ci,li[Ae+5],12,1200080426),ci=Yr(ci,gr,di,ni,li[Ae+6],17,-1473231341),ni=Yr(ni,ci,gr,di,li[Ae+7],22,-45705983),di=Yr(di,ni,ci,gr,li[Ae+8],7,1770035416),gr=Yr(gr,di,ni,ci,li[Ae+9],12,-1958414417),ci=Yr(ci,gr,di,ni,li[Ae+10],17,-42063),ni=Yr(ni,ci,gr,di,li[Ae+11],22,-1990404162),di=Yr(di,ni,ci,gr,li[Ae+12],7,1804603682),gr=Yr(gr,di,ni,ci,li[Ae+13],12,-40341101),ci=Yr(ci,gr,di,ni,li[Ae+14],17,-1502002290),di=Vr(di,ni=Yr(ni,ci,gr,di,li[Ae+15],22,1236535329),ci,gr,li[Ae+1],5,-165796510),gr=Vr(gr,di,ni,ci,li[Ae+6],9,-1069501632),ci=Vr(ci,gr,di,ni,li[Ae+11],14,643717713),ni=Vr(ni,ci,gr,di,li[Ae+0],20,-373897302),di=Vr(di,ni,ci,gr,li[Ae+5],5,-701558691),gr=Vr(gr,di,ni,ci,li[Ae+10],9,38016083),ci=Vr(ci,gr,di,ni,li[Ae+15],14,-660478335),ni=Vr(ni,ci,gr,di,li[Ae+4],20,-405537848),di=Vr(di,ni,ci,gr,li[Ae+9],5,568446438),gr=Vr(gr,di,ni,ci,li[Ae+14],9,-1019803690),ci=Vr(ci,gr,di,ni,li[Ae+3],14,-187363961),ni=Vr(ni,ci,gr,di,li[Ae+8],20,1163531501),di=Vr(di,ni,ci,gr,li[Ae+13],5,-1444681467),gr=Vr(gr,di,ni,ci,li[Ae+2],9,-51403784),ci=Vr(ci,gr,di,ni,li[Ae+7],14,1735328473),di=Xr(di,ni=Vr(ni,ci,gr,di,li[Ae+12],20,-1926607734),ci,gr,li[Ae+5],4,-378558),gr=Xr(gr,di,ni,ci,li[Ae+8],11,-2022574463),ci=Xr(ci,gr,di,ni,li[Ae+11],16,1839030562),ni=Xr(ni,ci,gr,di,li[Ae+14],23,-35309556),di=Xr(di,ni,ci,gr,li[Ae+1],4,-1530992060),gr=Xr(gr,di,ni,ci,li[Ae+4],11,1272893353),ci=Xr(ci,gr,di,ni,li[Ae+7],16,-155497632),ni=Xr(ni,ci,gr,di,li[Ae+10],23,-1094730640),di=Xr(di,ni,ci,gr,li[Ae+13],4,681279174),gr=Xr(gr,di,ni,ci,li[Ae+0],11,-358537222),ci=Xr(ci,gr,di,ni,li[Ae+3],16,-722521979),ni=Xr(ni,ci,gr,di,li[Ae+6],23,76029189),di=Xr(di,ni,ci,gr,li[Ae+9],4,-640364487),gr=Xr(gr,di,ni,ci,li[Ae+12],11,-421815835),ci=Xr(ci,gr,di,ni,li[Ae+15],16,530742520),di=Zr(di,ni=Xr(ni,ci,gr,di,li[Ae+2],23,-995338651),ci,gr,li[Ae+0],6,-198630844),gr=Zr(gr,di,ni,ci,li[Ae+7],10,1126891415),ci=Zr(ci,gr,di,ni,li[Ae+14],15,-1416354905),ni=Zr(ni,ci,gr,di,li[Ae+5],21,-57434055),di=Zr(di,ni,ci,gr,li[Ae+12],6,1700485571),gr=Zr(gr,di,ni,ci,li[Ae+3],10,-1894986606),ci=Zr(ci,gr,di,ni,li[Ae+10],15,-1051523),ni=Zr(ni,ci,gr,di,li[Ae+1],21,-2054922799),di=Zr(di,ni,ci,gr,li[Ae+8],6,1873313359),gr=Zr(gr,di,ni,ci,li[Ae+15],10,-30611744),ci=Zr(ci,gr,di,ni,li[Ae+6],15,-1560198380),ni=Zr(ni,ci,gr,di,li[Ae+13],21,1309151649),di=Zr(di,ni,ci,gr,li[Ae+4],6,-145523070),gr=Zr(gr,di,ni,ci,li[Ae+11],10,-1120210379),ci=Zr(ci,gr,di,ni,li[Ae+2],15,718787259),ni=Zr(ni,ci,gr,di,li[Ae+9],21,-343485551),di=oi(di,ze),ni=oi(ni,Ue),ci=oi(ci,tr),gr=oi(gr,lr)}return Array(di,ni,ci,gr)}function Fr(li,xi,di,ni,ci,gr){return oi((xi=oi(oi(xi,li),oi(ni,gr)))<<ci|xi>>>32-ci,di)}function Yr(li,xi,di,ni,ci,gr,Ae){return Fr(xi&di|~xi&ni,li,xi,ci,gr,Ae)}function Vr(li,xi,di,ni,ci,gr,Ae){return Fr(xi&ni|di&~ni,li,xi,ci,gr,Ae)}function Xr(li,xi,di,ni,ci,gr,Ae){return Fr(xi^di^ni,li,xi,ci,gr,Ae)}function Zr(li,xi,di,ni,ci,gr,Ae){return Fr(di^(xi|~ni),li,xi,ci,gr,Ae)}function oi(li,xi){var di=(65535&li)+(65535&xi);return(li>>16)+(xi>>16)+(di>>16)<<16|65535&di}we.exports=function(li){return Ar.hash(li,Pr,16)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){we.exports=function(Ar){for(var Pr,Fr=new Array(Ar),Yr=0;Yr<Ar;Yr++)(3&Yr)==0&&(Pr=4294967296*Math.random()),Fr[Yr]=Pr>>>((3&Yr)<<3)&255;return Fr}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){var Ar=ie("./helpers");function Pr(Vr,Xr){Vr[Xr>>5]|=128<<24-Xr%32,Vr[15+(Xr+64>>9<<4)]=Xr;for(var Zr,oi,li,xi=Array(80),di=1732584193,ni=-271733879,ci=-1732584194,gr=271733878,Ae=-1009589776,ze=0;ze<Vr.length;ze+=16){for(var Ue=di,tr=ni,lr=ci,vr=gr,br=Ae,nr=0;nr<80;nr++){xi[nr]=nr<16?Vr[ze+nr]:Yr(xi[nr-3]^xi[nr-8]^xi[nr-14]^xi[nr-16],1);var $e=Fr(Fr(Yr(di,5),($e=ni,oi=ci,li=gr,(Zr=nr)<20?$e&oi|~$e&li:!(Zr<40)&&Zr<60?$e&oi|$e&li|oi&li:$e^oi^li)),Fr(Fr(Ae,xi[nr]),(Zr=nr)<20?1518500249:Zr<40?1859775393:Zr<60?-1894007588:-899497514)),Ae=gr,gr=ci,ci=Yr(ni,30),ni=di,di=$e}di=Fr(di,Ue),ni=Fr(ni,tr),ci=Fr(ci,lr),gr=Fr(gr,vr),Ae=Fr(Ae,br)}return Array(di,ni,ci,gr,Ae)}function Fr(Vr,Xr){var Zr=(65535&Vr)+(65535&Xr);return(Vr>>16)+(Xr>>16)+(Zr>>16)<<16|65535&Zr}function Yr(Vr,Xr){return Vr<<Xr|Vr>>>32-Xr}we.exports=function(Vr){return Ar.hash(Vr,Pr,20,!0)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){function Ar(Xr,Zr){var oi=(65535&Xr)+(65535&Zr);return(Xr>>16)+(Zr>>16)+(oi>>16)<<16|65535&oi}function Pr(Xr,Zr){var oi,li=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),xi=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),di=new Array(64);Xr[Zr>>5]|=128<<24-Zr%32,Xr[15+(Zr+64>>9<<4)]=Zr;for(var ni,ci,gr=0;gr<Xr.length;gr+=16){for(var Ae=xi[0],ze=xi[1],Ue=xi[2],tr=xi[3],lr=xi[4],vr=xi[5],br=xi[6],nr=xi[7],$e=0;$e<64;$e++)di[$e]=$e<16?Xr[$e+gr]:Ar(Ar(Ar((ci=di[$e-2],Yr(ci,17)^Yr(ci,19)^Vr(ci,10)),di[$e-7]),(ci=di[$e-15],Yr(ci,7)^Yr(ci,18)^Vr(ci,3))),di[$e-16]),oi=Ar(Ar(Ar(Ar(nr,Yr(ci=lr,6)^Yr(ci,11)^Yr(ci,25)),lr&vr^~lr&br),li[$e]),di[$e]),ni=Ar(Yr(ni=Ae,2)^Yr(ni,13)^Yr(ni,22),Ae&ze^Ae&Ue^ze&Ue),nr=br,br=vr,vr=lr,lr=Ar(tr,oi),tr=Ue,Ue=ze,ze=Ae,Ae=Ar(oi,ni);xi[0]=Ar(Ae,xi[0]),xi[1]=Ar(ze,xi[1]),xi[2]=Ar(Ue,xi[2]),xi[3]=Ar(tr,xi[3]),xi[4]=Ar(lr,xi[4]),xi[5]=Ar(vr,xi[5]),xi[6]=Ar(br,xi[6]),xi[7]=Ar(nr,xi[7])}return xi}var Fr=ie("./helpers"),Yr=function(Xr,Zr){return Xr>>>Zr|Xr<<32-Zr},Vr=function(Xr,Zr){return Xr>>>Zr};we.exports=function(Xr){return Fr.hash(Xr,Pr,32,!0)}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){Pe.read=function(Ar,Pr,Fr,Yr,gr){var Xr,Zr,oi=8*gr-Yr-1,li=(1<<oi)-1,xi=li>>1,di=-7,ni=Fr?gr-1:0,ci=Fr?-1:1,gr=Ar[Pr+ni];for(ni+=ci,Xr=gr&(1<<-di)-1,gr>>=-di,di+=oi;0<di;Xr=256*Xr+Ar[Pr+ni],ni+=ci,di-=8);for(Zr=Xr&(1<<-di)-1,Xr>>=-di,di+=Yr;0<di;Zr=256*Zr+Ar[Pr+ni],ni+=ci,di-=8);if(Xr===0)Xr=1-xi;else{if(Xr===li)return Zr?NaN:1/0*(gr?-1:1);Zr+=Math.pow(2,Yr),Xr-=xi}return(gr?-1:1)*Zr*Math.pow(2,Xr-Yr)},Pe.write=function(Ar,Pr,Fr,Yr,Vr,Ae){var Zr,oi,li=8*Ae-Vr-1,xi=(1<<li)-1,di=xi>>1,ni=Vr===23?Math.pow(2,-24)-Math.pow(2,-77):0,ci=Yr?0:Ae-1,gr=Yr?1:-1,Ae=Pr<0||Pr===0&&1/Pr<0?1:0;for(Pr=Math.abs(Pr),isNaN(Pr)||Pr===1/0?(oi=isNaN(Pr)?1:0,Zr=xi):(Zr=Math.floor(Math.log(Pr)/Math.LN2),Pr*(Yr=Math.pow(2,-Zr))<1&&(Zr--,Yr*=2),2<=(Pr+=1<=Zr+di?ni/Yr:ni*Math.pow(2,1-di))*Yr&&(Zr++,Yr/=2),xi<=Zr+di?(oi=0,Zr=xi):1<=Zr+di?(oi=(Pr*Yr-1)*Math.pow(2,Vr),Zr+=di):(oi=Pr*Math.pow(2,di-1)*Math.pow(2,Vr),Zr=0));8<=Vr;Ar[Fr+ci]=255&oi,ci+=gr,oi/=256,Vr-=8);for(Zr=Zr<<Vr|oi,li+=Vr;0<li;Ar[Fr+ci]=255&Zr,ci+=gr,Zr/=256,li-=8);Ar[Fr+ci-gr]|=128*Ae}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(ie,we,Pe){(function(Me,Ze,ne,rr,pr,or,yr,kr,Br){var Ar,Pr,Fr;function Yr(){}(Me=we.exports={}).nextTick=(Pr=typeof window<"u"&&window.setImmediate,Fr=typeof window<"u"&&window.postMessage&&window.addEventListener,Pr?function(Vr){return window.setImmediate(Vr)}:Fr?(Ar=[],window.addEventListener("message",function(Vr){var Xr=Vr.source;Xr!==window&&Xr!==null||Vr.data!=="process-tick"||(Vr.stopPropagation(),0<Ar.length&&Ar.shift()())},!0),function(Vr){Ar.push(Vr),window.postMessage("process-tick","*")}):function(Vr){setTimeout(Vr,0)}),Me.title="browser",Me.browser=!0,Me.env={},Me.argv=[],Me.on=Yr,Me.addListener=Yr,Me.once=Yr,Me.off=Yr,Me.removeListener=Yr,Me.removeAllListeners=Yr,Me.emit=Yr,Me.binding=function(Vr){throw new Error("process.binding is not supported")},Me.cwd=function(){return"/"},Me.chdir=function(Vr){throw new Error("process.chdir is not supported")}}).call(this,ie("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},ie("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})})(object_hash);const hash=object_hash.exports,IMAGE_TTL_IN_SECONDS=60*60*24*1;function parseCloudflareImagesDeliveryUrl(m){try{const c=new URL(m);if(c.hostname==="imagedelivery.net"){const[,ie,we,Pe]=c.pathname.split("/")||[];if(ie&&we&&Pe)return{scopeId:ie,imageId:we,variant:Pe};throw new Error("Invalid Cloudflare Images URL")}throw new Error("Invalid Cloudflare Images URL")}catch{throw new Error("Invalid URL")}}async function uploadImage(m,c,ie,we,Pe,Me){const Ze=`${m}/api/image/session?${new URLSearchParams({key:hash({field:ie.field,templateId:c}),ttl:String(IMAGE_TTL_IN_SECONDS)})}`,ne=new FormData;ne.append("file",we,Pe);const rr=await fetchWithProgressV1({url:Ze,method:"POST",data:ne,onUploadProgress:Me});if(rr.type==="application/json")return JSON.parse(await rr.text());throw new Error("Invalid response from Cloudflare Images")}class BluepicEmbed extends EventTarget{constructor(c,ie,we,Pe){if(super(),this.embedProjectSlugOrId=we,console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!",Pe?.embedApiBaseUrl),!ie&&!this.embedProjectSlugOrId)throw new Error("Either templateId or embedProjectId must be provided");if(typeof c=="string"){const Me=document.querySelector(c);if(!Me||!(Me instanceof HTMLElement))throw new Error(`Element with selector "${c}" not found or not an HTMLElement`);this.element=Me}else if(c instanceof HTMLElement)this.element=c;else throw new Error("Invalid element or selector provided");this.displayMode.value=Pe?.displayMode??this.displayMode.value,this.allowPanAndZoom.value=Pe?.allowPanAndZoom??this.allowPanAndZoom.value,this.embedApiBaseUrl.value=Pe?.embedApiBaseUrl??this.embedApiBaseUrl.value,this.cloudflarePagesHostname.value=Pe?.cloudflarePagesHostname??this.cloudflarePagesHostname.value,this.bxCoreVersion.value=Pe?.bxCoreVersion??this.bxCoreVersion.value,this.branding.value=Pe?.branding??this.branding.value,this.stripeEnv.value=Pe?.stripeEnv??this.stripeEnv.value,this.init(),this.data.value=Pe?.initData??this.data.value,vue.watch(this.ready,(Me,Ze)=>{if(Me&&!Ze){const ne=new CustomEvent("ready",{detail:{templateId:this.templateId.value,data:vue.unref(this.data.value)}});this.dispatchEvent(ne)}}),vue.watch(this.data,()=>{const Me=new CustomEvent("data",{detail:{data:vue.unref(this.data.value)}});this.dispatchEvent(Me)},{deep:!0})}element;embedApiBaseUrl=vue.ref("https://embed-api-v2.bluepic.workers.dev");cloudflarePagesHostname=vue.ref("bluepic-core-sandbox.pages.dev");editorRef=vue.ref();templateId=vue.ref();data=vue.ref();serial=vue.ref();allowPanAndZoom=vue.ref(!1);ready=vue.ref(!1);displayMode=vue.ref("auto");bxCoreVersion=vue.ref("auto");branding=vue.ref(!0);stripeEnv=vue.ref("prod");bxThemeStyleVars;embedProject=vue.ref();baseSerial=vue.ref();basePreview=vue.ref();init(){const c=`bluepic-app-${nanoid()}`;this.embedProjectSlugOrId&&(console.log("...getProjectWithRetries",this.embedApiBaseUrl.value,"template.bluepic.io",this.embedProjectSlugOrId,3,2e3,this.stripeEnv.value),getProjectWithRetries(this.embedApiBaseUrl.value,"template.bluepic.io",this.embedProjectSlugOrId,3,2e3,this.stripeEnv.value).then(({embedProject:Pe,isAllowedToDisableBranding:Me,templates:Ze})=>{if(this.embedProject.value=Pe,this.displayMode.value=Pe.config.layout,this.allowPanAndZoom.value=Pe.config.allowPanAndZoom,this.branding.value=Me?Pe.config.bluepicBranding:!0,Ze){const ne=Ze[Pe.templates[0]];this.baseSerial.value=ne.serial,ne.preview&&(this.basePreview.value=ne.preview)}console.log("BRANDING",this.branding.value),this.templateId.value=Pe.templates[0]}));const ie=document.createElement("style");ie.textContent=`
|
|
2943
2943
|
#${c} .fade-spinner-enter-active,
|
|
2944
2944
|
#${c} .fade-spinner-leave-active {
|
|
2945
2945
|
transition: opacity .3s ease;
|