ablok-photobooth 0.2.13 → 0.2.14
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.
|
@@ -38373,7 +38373,7 @@ const Kz = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20wid
|
|
|
38373
38373
|
}
|
|
38374
38374
|
async function v(M) {
|
|
38375
38375
|
const N = await g(M.src);
|
|
38376
|
-
N.selectable = !1, N.assetType = "foreground", c.add(N), c.centerObject(N), c.renderAll(), await p(N);
|
|
38376
|
+
N.selectable = !1, N.assetType = "foreground", c.add(N), c.centerObject(N), c.renderAll(), await p(N), Ae();
|
|
38377
38377
|
}
|
|
38378
38378
|
async function x(M) {
|
|
38379
38379
|
const N = await g(M.src);
|
|
@@ -618,4 +618,4 @@ __p += '`),je&&(ee+=`' +
|
|
|
618
618
|
function print() { __p += __j.call(arguments, '') }
|
|
619
619
|
`:`;
|
|
620
620
|
`)+ee+`return __p
|
|
621
|
-
}`;var He=Dd(function(){return Ze(y,ye+"return "+ee).apply(t,E)});if(He.source=ee,Ql(He))throw He;return He}function Rx(i){return At(i).toLowerCase()}function Kx(i){return At(i).toUpperCase()}function Vx(i,o,u){if(i=At(i),i&&(u||o===t))return Vh(i);if(!i||!(o=Yt(o)))return i;var d=wA(i),m=wA(o),y=Gh(d,m),E=jh(d,m)+1;return Br(d,y,E).join("")}function Gx(i,o,u){if(i=At(i),i&&(u||o===t))return i.slice(0,Wh(i)+1);if(!i||!(o=Yt(o)))return i;var d=wA(i),m=jh(d,wA(o))+1;return Br(d,0,m).join("")}function jx(i,o,u){if(i=At(i),i&&(u||o===t))return i.replace(ps,"");if(!i||!(o=Yt(o)))return i;var d=wA(i),m=Gh(d,wA(o));return Br(d,m).join("")}function $x(i,o){var u=Fe,d=Te;if(ct(o)){var m="separator"in o?o.separator:m;u="length"in o?Me(o.length):u,d="omission"in o?Yt(o.omission):d}i=At(i);var y=i.length;if(Bn(i)){var E=wA(i);y=E.length}if(u>=y)return i;var I=u-Cn(d);if(I<1)return d;var O=E?Br(E,0,I).join(""):i.slice(0,I);if(m===t)return O+d;if(E&&(I+=O.length-I),Fl(m)){if(i.slice(I).search(m)){var W,Y=O;for(m.global||(m=Ga(m.source,At(Do.exec(m))+"g")),m.lastIndex=0;W=m.exec(Y);)var ee=W.index;O=O.slice(0,ee===t?I:ee)}}else if(i.indexOf(Yt(m),I)!=I){var he=O.lastIndexOf(m);he>-1&&(O=O.slice(0,he))}return O+d}function Wx(i){return i=At(i),i&&ds.test(i)?i.replace(Pi,vv):i}var zx=Qn(function(i,o,u){return i+(u?" ":"")+o.toUpperCase()}),Ul=Mf("toUpperCase");function Od(i,o,u){return i=At(i),o=u?t:o,o===t?mv(i)?Ev(i):av(i):i.match(o)||[]}var Dd=Pe(function(i,o){try{return Wt(i,t,o)}catch(u){return Ql(u)?u:new ke(u)}}),Yx=JA(function(i,o){return rA(o,function(u){u=LA(u),YA(i,u,El(i[u],i))}),i});function Xx(i){var o=i==null?0:i.length,u=_e();return i=o?ot(i,function(d){if(typeof d[1]!="function")throw new nA(a);return[u(d[0]),d[1]]}):[],Pe(function(d){for(var m=-1;++m<o;){var y=i[m];if(Wt(y[0],this,d))return Wt(y[1],this,d)}})}function Jx(i){return v1(sA(i,p))}function Tl(i){return function(){return i}}function qx(i,o){return i==null||i!==i?o:i}var Zx=Hf(),eQ=Hf(!0);function Vt(i){return i}function kl(i){return df(typeof i=="function"?i:sA(i,p))}function tQ(i){return gf(sA(i,p))}function AQ(i,o){return mf(i,sA(o,p))}var rQ=Pe(function(i,o){return function(u){return gi(u,i,o)}}),nQ=Pe(function(i,o){return function(u){return gi(i,u,o)}});function Ol(i,o,u){var d=_t(o),m=Ls(o,d);u==null&&!(ct(o)&&(m.length||!d.length))&&(u=o,o=i,i=this,m=Ls(o,_t(o)));var y=!(ct(u)&&"chain"in u)||!!u.chain,E=ZA(i);return rA(m,function(I){var O=o[I];i[I]=O,E&&(i.prototype[I]=function(){var W=this.__chain__;if(y||W){var Y=i(this.__wrapped__),ee=Y.__actions__=Pt(this.__actions__);return ee.push({func:O,args:arguments,thisArg:i}),Y.__chain__=W,Y}return O.apply(i,fr([this.value()],arguments))})}),i}function iQ(){return xt._===this&&(xt._=Uv),this}function Dl(){}function sQ(i){return i=Me(i),Pe(function(o){return wf(o,i)})}var oQ=hl(ot),aQ=hl(Hh),lQ=hl(La);function Md(i){return Bl(i)?Ha(LA(i)):N1(i)}function cQ(i){return function(o){return i==null?t:Wr(i,o)}}var uQ=Pf(),hQ=Pf(!0);function Ml(){return[]}function Ll(){return!1}function fQ(){return{}}function dQ(){return""}function pQ(){return!0}function gQ(i,o){if(i=Me(i),i<1||i>F)return[];var u=b,d=Ut(i,b);o=_e(o),i-=b;for(var m=Ra(d,o);++u<i;)o(u);return m}function mQ(i){return Oe(i)?ot(i,LA):Xt(i)?[i]:Pt(Ad(At(i)))}function wQ(i){var o=++Sv;return At(i)+o}var BQ=Vs(function(i,o){return i+o},0),CQ=fl("ceil"),yQ=Vs(function(i,o){return i/o},1),vQ=fl("floor");function bQ(i){return i&&i.length?Ms(i,Vt,qa):t}function _Q(i,o){return i&&i.length?Ms(i,_e(o,2),qa):t}function EQ(i){return Rh(i,Vt)}function xQ(i,o){return Rh(i,_e(o,2))}function QQ(i){return i&&i.length?Ms(i,Vt,Al):t}function FQ(i,o){return i&&i.length?Ms(i,_e(o,2),Al):t}var SQ=Vs(function(i,o){return i*o},1),IQ=fl("round"),UQ=Vs(function(i,o){return i-o},0);function TQ(i){return i&&i.length?Pa(i,Vt):0}function kQ(i,o){return i&&i.length?Pa(i,_e(o,2)):0}return B.after=tE,B.ary=fd,B.assign=KE,B.assignIn=Qd,B.assignInWith=Ao,B.assignWith=VE,B.at=GE,B.before=dd,B.bind=El,B.bindAll=Yx,B.bindKey=pd,B.castArray=fE,B.chain=cd,B.chunk=vb,B.compact=bb,B.concat=_b,B.cond=Xx,B.conforms=Jx,B.constant=Tl,B.countBy=T_,B.create=jE,B.curry=gd,B.curryRight=md,B.debounce=wd,B.defaults=$E,B.defaultsDeep=WE,B.defer=AE,B.delay=rE,B.difference=Eb,B.differenceBy=xb,B.differenceWith=Qb,B.drop=Fb,B.dropRight=Sb,B.dropRightWhile=Ib,B.dropWhile=Ub,B.fill=Tb,B.filter=O_,B.flatMap=L_,B.flatMapDeep=H_,B.flatMapDepth=N_,B.flatten=sd,B.flattenDeep=kb,B.flattenDepth=Ob,B.flip=nE,B.flow=Zx,B.flowRight=eQ,B.fromPairs=Db,B.functions=ex,B.functionsIn=tx,B.groupBy=P_,B.initial=Lb,B.intersection=Hb,B.intersectionBy=Nb,B.intersectionWith=Pb,B.invert=rx,B.invertBy=nx,B.invokeMap=K_,B.iteratee=kl,B.keyBy=V_,B.keys=_t,B.keysIn=Kt,B.map=Xs,B.mapKeys=sx,B.mapValues=ox,B.matches=tQ,B.matchesProperty=AQ,B.memoize=qs,B.merge=ax,B.mergeWith=Fd,B.method=rQ,B.methodOf=nQ,B.mixin=Ol,B.negate=Zs,B.nthArg=sQ,B.omit=lx,B.omitBy=cx,B.once=iE,B.orderBy=G_,B.over=oQ,B.overArgs=sE,B.overEvery=aQ,B.overSome=lQ,B.partial=xl,B.partialRight=Bd,B.partition=j_,B.pick=ux,B.pickBy=Sd,B.property=Md,B.propertyOf=cQ,B.pull=Gb,B.pullAll=ad,B.pullAllBy=jb,B.pullAllWith=$b,B.pullAt=Wb,B.range=uQ,B.rangeRight=hQ,B.rearg=oE,B.reject=z_,B.remove=zb,B.rest=aE,B.reverse=bl,B.sampleSize=X_,B.set=fx,B.setWith=dx,B.shuffle=J_,B.slice=Yb,B.sortBy=eE,B.sortedUniq=A_,B.sortedUniqBy=r_,B.split=Lx,B.spread=lE,B.tail=n_,B.take=i_,B.takeRight=s_,B.takeRightWhile=o_,B.takeWhile=a_,B.tap=b_,B.throttle=cE,B.thru=Ys,B.toArray=_d,B.toPairs=Id,B.toPairsIn=Ud,B.toPath=mQ,B.toPlainObject=xd,B.transform=px,B.unary=uE,B.union=l_,B.unionBy=c_,B.unionWith=u_,B.uniq=h_,B.uniqBy=f_,B.uniqWith=d_,B.unset=gx,B.unzip=_l,B.unzipWith=ld,B.update=mx,B.updateWith=wx,B.values=In,B.valuesIn=Bx,B.without=p_,B.words=Od,B.wrap=hE,B.xor=g_,B.xorBy=m_,B.xorWith=w_,B.zip=B_,B.zipObject=C_,B.zipObjectDeep=y_,B.zipWith=v_,B.entries=Id,B.entriesIn=Ud,B.extend=Qd,B.extendWith=Ao,Ol(B,B),B.add=BQ,B.attempt=Dd,B.camelCase=bx,B.capitalize=Td,B.ceil=CQ,B.clamp=Cx,B.clone=dE,B.cloneDeep=gE,B.cloneDeepWith=mE,B.cloneWith=pE,B.conformsTo=wE,B.deburr=kd,B.defaultTo=qx,B.divide=yQ,B.endsWith=_x,B.eq=CA,B.escape=Ex,B.escapeRegExp=xx,B.every=k_,B.find=D_,B.findIndex=nd,B.findKey=zE,B.findLast=M_,B.findLastIndex=id,B.findLastKey=YE,B.floor=vQ,B.forEach=ud,B.forEachRight=hd,B.forIn=XE,B.forInRight=JE,B.forOwn=qE,B.forOwnRight=ZE,B.get=Sl,B.gt=BE,B.gte=CE,B.has=Ax,B.hasIn=Il,B.head=od,B.identity=Vt,B.includes=R_,B.indexOf=Mb,B.inRange=yx,B.invoke=ix,B.isArguments=Xr,B.isArray=Oe,B.isArrayBuffer=yE,B.isArrayLike=Rt,B.isArrayLikeObject=ft,B.isBoolean=vE,B.isBuffer=Cr,B.isDate=bE,B.isElement=_E,B.isEmpty=EE,B.isEqual=xE,B.isEqualWith=QE,B.isError=Ql,B.isFinite=FE,B.isFunction=ZA,B.isInteger=Cd,B.isLength=eo,B.isMap=yd,B.isMatch=SE,B.isMatchWith=IE,B.isNaN=UE,B.isNative=TE,B.isNil=OE,B.isNull=kE,B.isNumber=vd,B.isObject=ct,B.isObjectLike=ut,B.isPlainObject=vi,B.isRegExp=Fl,B.isSafeInteger=DE,B.isSet=bd,B.isString=to,B.isSymbol=Xt,B.isTypedArray=Sn,B.isUndefined=ME,B.isWeakMap=LE,B.isWeakSet=HE,B.join=Rb,B.kebabCase=Qx,B.last=aA,B.lastIndexOf=Kb,B.lowerCase=Fx,B.lowerFirst=Sx,B.lt=NE,B.lte=PE,B.max=bQ,B.maxBy=_Q,B.mean=EQ,B.meanBy=xQ,B.min=QQ,B.minBy=FQ,B.stubArray=Ml,B.stubFalse=Ll,B.stubObject=fQ,B.stubString=dQ,B.stubTrue=pQ,B.multiply=SQ,B.nth=Vb,B.noConflict=iQ,B.noop=Dl,B.now=Js,B.pad=Ix,B.padEnd=Ux,B.padStart=Tx,B.parseInt=kx,B.random=vx,B.reduce=$_,B.reduceRight=W_,B.repeat=Ox,B.replace=Dx,B.result=hx,B.round=IQ,B.runInContext=k,B.sample=Y_,B.size=q_,B.snakeCase=Mx,B.some=Z_,B.sortedIndex=Xb,B.sortedIndexBy=Jb,B.sortedIndexOf=qb,B.sortedLastIndex=Zb,B.sortedLastIndexBy=e_,B.sortedLastIndexOf=t_,B.startCase=Hx,B.startsWith=Nx,B.subtract=UQ,B.sum=TQ,B.sumBy=kQ,B.template=Px,B.times=gQ,B.toFinite=er,B.toInteger=Me,B.toLength=Ed,B.toLower=Rx,B.toNumber=lA,B.toSafeInteger=RE,B.toString=At,B.toUpper=Kx,B.trim=Vx,B.trimEnd=Gx,B.trimStart=jx,B.truncate=$x,B.unescape=Wx,B.uniqueId=wQ,B.upperCase=zx,B.upperFirst=Ul,B.each=ud,B.eachRight=hd,B.first=od,Ol(B,(function(){var i={};return DA(B,function(o,u){tt.call(B.prototype,u)||(i[u]=o)}),i})(),{chain:!1}),B.VERSION=r,rA(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){B[i].placeholder=B}),rA(["drop","take"],function(i,o){Ve.prototype[i]=function(u){u=u===t?1:Bt(Me(u),0);var d=this.__filtered__&&!o?new Ve(this):this.clone();return d.__filtered__?d.__takeCount__=Ut(u,d.__takeCount__):d.__views__.push({size:Ut(u,b),type:i+(d.__dir__<0?"Right":"")}),d},Ve.prototype[i+"Right"]=function(u){return this.reverse()[i](u).reverse()}}),rA(["filter","map","takeWhile"],function(i,o){var u=o+1,d=u==L||u==$;Ve.prototype[i]=function(m){var y=this.clone();return y.__iteratees__.push({iteratee:_e(m,3),type:u}),y.__filtered__=y.__filtered__||d,y}}),rA(["head","last"],function(i,o){var u="take"+(o?"Right":"");Ve.prototype[i]=function(){return this[u](1).value()[0]}}),rA(["initial","tail"],function(i,o){var u="drop"+(o?"":"Right");Ve.prototype[i]=function(){return this.__filtered__?new Ve(this):this[u](1)}}),Ve.prototype.compact=function(){return this.filter(Vt)},Ve.prototype.find=function(i){return this.filter(i).head()},Ve.prototype.findLast=function(i){return this.reverse().find(i)},Ve.prototype.invokeMap=Pe(function(i,o){return typeof i=="function"?new Ve(this):this.map(function(u){return gi(u,i,o)})}),Ve.prototype.reject=function(i){return this.filter(Zs(_e(i)))},Ve.prototype.slice=function(i,o){i=Me(i);var u=this;return u.__filtered__&&(i>0||o<0)?new Ve(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),o!==t&&(o=Me(o),u=o<0?u.dropRight(-o):u.take(o-i)),u)},Ve.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ve.prototype.toArray=function(){return this.take(b)},DA(Ve.prototype,function(i,o){var u=/^(?:filter|find|map|reject)|While$/.test(o),d=/^(?:head|last)$/.test(o),m=B[d?"take"+(o=="last"?"Right":""):o],y=d||/^find/.test(o);m&&(B.prototype[o]=function(){var E=this.__wrapped__,I=d?[1]:arguments,O=E instanceof Ve,W=I[0],Y=O||Oe(E),ee=function(Re){var je=m.apply(B,fr([Re],I));return d&&he?je[0]:je};Y&&u&&typeof W=="function"&&W.length!=1&&(O=Y=!1);var he=this.__chain__,ye=!!this.__actions__.length,Ee=y&&!he,He=O&&!ye;if(!y&&Y){E=He?E:new Ve(this);var xe=i.apply(E,I);return xe.__actions__.push({func:Ys,args:[ee],thisArg:t}),new iA(xe,he)}return Ee&&He?i.apply(this,I):(xe=this.thru(ee),Ee?d?xe.value()[0]:xe.value():xe)})}),rA(["pop","push","shift","sort","splice","unshift"],function(i){var o=ys[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);B.prototype[i]=function(){var m=arguments;if(d&&!this.__chain__){var y=this.value();return o.apply(Oe(y)?y:[],m)}return this[u](function(E){return o.apply(Oe(E)?E:[],m)})}}),DA(Ve.prototype,function(i,o){var u=B[o];if(u){var d=u.name+"";tt.call(_n,d)||(_n[d]=[]),_n[d].push({name:o,func:u})}}),_n[Ks(t,_).name]=[{name:"wrapper",func:t}],Ve.prototype.clone=Wv,Ve.prototype.reverse=zv,Ve.prototype.value=Yv,B.prototype.at=__,B.prototype.chain=E_,B.prototype.commit=x_,B.prototype.next=Q_,B.prototype.plant=S_,B.prototype.reverse=I_,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=U_,B.prototype.first=B.prototype.head,li&&(B.prototype[li]=F_),B}),yn=xv();Kr?((Kr.exports=yn)._=yn,ka._=yn):xt._=yn}).call(az)})(ah,ah.exports)),ah.exports}var cz=lz();const uz="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffffCC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='feather%20feather-rotate-cw'%3e%3cpolyline%20points='23%204%2023%2010%2017%2010'%3e%3c/polyline%3e%3cpath%20d='M20.49%2015a9%209%200%201%201-2.12-9.36L23%2010'%3e%3c/path%3e%3c/svg%3e",hz="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffffCC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='feather%20feather-x-circle'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%20fill='none'%3e%3c/circle%3e%3cline%20x1='15'%20y1='9'%20x2='9'%20y2='15'%20fill='none'%3e%3c/line%3e%3cline%20x1='9'%20y1='9'%20x2='15'%20y2='15'%20fill='none'%3e%3c/line%3e%3c/svg%3e",fz={class:"fabric-canvas__canvas"},dz={id:"fabricCanvas",ref:"canvasRef"},pz=Q.defineComponent({__name:"fabric-canvas",props:{modelValue:{type:String,default:""},jsonModel:{type:null,default:void 0},exportToSvg:{type:Boolean,default:!1},resetState:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},feature:{type:String,default:""},required:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!1},animationDuration:{type:Number,default:0}},emits:["update:modelValue","update:jsonModel","update:pending","on-ready"],setup(A,{expose:e,emit:t}){const r=t;e({setBackgroundImage:C,setOverlayImage:x,addCanvasObject:_});const n=A,s=Q.ref(),a=Q.ref(0),l=Q.ref(0);let c;const h=Q.ref();async function f(L,K){return new Promise(async $=>{const S=JSON.parse(K);if(S.backgroundImage){const M=await p(S.backgroundImage.src);M.set({opacity:1}),L.backgroundImage=M,L.centerObject(M)}if(S.overlayImage){const M=await p(S.overlayImage.src);M.set({opacity:1,left:a.value/2,top:l.value/2,scaleX:a.value/M.width,scaleY:l.value/M.height}),L.overlayImage=M}(await bc.enlivenObjects(S.objects,{reviver:void 0})).forEach(M=>{L.add(M)}),$(L)})}async function p(L){const K=await Qe(L);L.includes("data:image")||(K.filename=L);const $=bc.findScaleToCover(K,c),S=K instanceof nn;return K.set({left:0,top:0,opacity:S&&n.animationDuration>0?0:1,scaleX:$,scaleY:$,src:L}),K}async function g(L){!(L instanceof nn)||n.animationDuration===0||(n.emitPending&&r("update:pending",!0),await new Promise($=>{const S=n.animationDuration,F=Date.now(),M=()=>{const U=Date.now()-F,b=Math.min(U/S,1);L.set("opacity",b),c.renderAll(),b<1?requestAnimationFrame(M):(n.emitPending&&r("update:pending",!1),$())};requestAnimationFrame(M)}))}function w(L){const K=bc.findScaleToCover(L,c);return L.set({scaleX:K,scaleY:K}),L}async function C(L){const K=await p(L.src);c.backgroundImage=K,c.centerObject(K),c.renderAll(),await g(K),re()}async function v(L){const K=await p(L.src);K.selectable=!1,K.assetType="foreground",c.add(K),c.centerObject(K),c.renderAll(),await g(K)}async function x(L){const K=await p(L.src);K.set({left:a.value/2,top:l.value/2,scaleX:a.value/K.width,scaleY:l.value/K.height}),c.overlayImage=K,c.renderAll(),await g(K),re()}async function _(L){c.discardActiveObject();const K=await Qe(L.src);K.filename=L.src;const $=a.value/3,S=l.value/3,F=$/K.width,M=S/K.height,U=Math.min(F,M);K.set({scaleX:U,scaleY:U,left:a.value/2,top:l.value/2}),K.id=L.id,K.padding=8,c.add(K),c.setActiveObject(K),await g(K),c.renderAll()}function T(L,K){K.target.id;const $=K.target;return c.remove($),c.requestRenderAll(),!0}function H(){if(a.value=s.value.offsetWidth,l.value=s.value.offsetHeight,c.setDimensions({width:a.value,height:l.value}),c.backgroundImage&&(c.backgroundImage=w(c.backgroundImage),c.centerObject(c.backgroundImage)),c.overlayImage){const L=c.overlayImage;L.set({scaleX:a.value/L.width,scaleY:l.value/L.height})}c.getObjects().forEach(L=>{L.assetType==="foreground"&&(L=w(L),c.centerObject(L))}),c.renderAll()}const D=cz.debounce(()=>{H()},200,{trailing:!0,leading:!1});function N(L){return(K,$,S,F,M)=>{K.save(),K.translate($,S),K.rotate(bc.degreesToRadians(M.angle)),K.fillStyle=n.options.themeData?.colors?.primary,K.fillRect(-24/2,-24/2,24,24);const b=20;K.drawImage(L,-b/2,-b/2,b,b),K.restore()}}function V(){const L=document.createElement("img");L.src=uz;const K=document.createElement("img");K.src=hz,c.on("object:added",$=>{$.target&&$.target.controls&&($.target.set({transparentCorners:!1,cornerSize:16,cornerStyle:"circle",...n.options.themeData?.colors?.primary?{cornerColor:n.options.themeData?.colors?.primary,cornerStrokeColor:n.options.themeData?.colors?.primary,borderColor:n.options.themeData?.colors?.primary}:{}}),$.target.controls.ml.visible=!1,$.target.controls.mr.visible=!1,$.target.controls.mb.visible=!1,$.target.controls.mt.visible=!1,$.target.controls.mtr.visible=!1,$.target.controls.rotate=new Lr({x:.5,y:-.5,offsetX:32,offsetY:0,cursorStyle:"pointer",actionName:"rotate",actionHandler:JO.rotationWithSnapping,cursorStyleHandler:JO.rotationStyleHandler,render:N(L)}),$.target.controls.delete=new Lr({x:.5,y:-.5,offsetX:32,offsetY:32,cursorStyle:"pointer",mouseUpHandler:T,render:N(K)}))})}async function q(){return await new Promise(L=>{setTimeout(()=>{const K=n.exportToSvg?c.toSVG():c.toDataURL({multiplier:2});L(K)},200)})}function re(){setTimeout(async()=>{const L=c.toDatalessJSON(["selectable","assetType","filename"]);await sz("fabric-canvas",JSON.stringify(L));let K=!0;if(n.required)switch(K=!1,n.feature){case"overlay":L.overlayImage&&(K=!0);break;case"background":L.backgroundImage&&(K=!0);break;case"stickers":L.objects.length>1&&(K=!0);break;default:(L.objects.length>1||L.backgroundImage||L.overlayImage)&&(K=!0)}if(K){const $=await q();r("update:modelValue",$),r("update:jsonModel",L)}},120)}async function oe(L){try{return await nn.fromURL(L)}catch(K){throw console.error("Error loading image:",K),K}}async function Fe(L){const{objects:K,options:$}=await XW(L);return bc.groupSVGElements(K,$)}async function Te(L){const{objects:K,options:$}=await wD(L);return bc.groupSVGElements(K,$)}async function Qe(L){return L&&typeof L=="string"&&L.trim().startsWith("<")?await Te(L):L&&new RegExp(/([\w_/-]*\.svg$)|(image\/svg\+xml)/gi).test(L)?await Fe(L):await oe(L)}async function de(L,K){L&&!K&&v({src:L})}return Q.watch(()=>n.modelValue,async(L,K)=>{de(L,K)}),Q.onMounted(async()=>{a.value=s.value.offsetWidth,l.value=s.value.offsetHeight,window.addEventListener("resize",D),Ft.NUM_FRACTION_DIGITS=8;const L=sh.prototype._onTouchStart;sh.prototype._onTouchStart=function(K){const $=this.findTarget(K);this.allowTouchScrolling&&$.assetType&&!this.isDrawingMode||L.call(this,K)},c=new sh("fabricCanvas",{width:a.value,height:l.value,skipOffscreen:!0,allowTouchScrolling:!0}),n.resetState&&await oz("fabric-canvas"),h.value=await iz("fabric-canvas"),h.value?(await f(c,h.value),c.requestRenderAll(),requestAnimationFrame(()=>{c.renderAll()})):n.modelValue&&de(n.modelValue,""),c.on("object:added",re),c.on("object:removed",re),c.on("object:modified",re),V(),c.renderAll(),r("on-ready",c)}),(L,K)=>(Q.openBlock(),Q.createElementBlock("div",{class:"fabric-canvas",ref_key:"root",ref:s},[Q.createElementVNode("div",fz,[Q.createElementVNode("canvas",dz,null,512)]),Q.renderSlot(L.$slots,"default")],512))}}),gz={class:"creative-booth"},mz={class:"media-container"},wz=["innerHTML"],Bz={class:"creative-booth__thumbnails"},Cz=[{type:"background",thumbnail:"/themes/corp/backgrounds/corporate-your-background-1024x1024.jpg",src:"/themes/corp/backgrounds/corporate-your-background-1024x1024.jpg",mediaType:"image",filters:["asset-01","asset-02"]},{type:"background",thumbnail:"/themes/corp/backgrounds/corp-background-09-white.jpg",src:"/themes/corp/backgrounds/corp-background-09-white.jpg",mediaType:"image",filters:["asset-01","asset-02"]},{type:"overlay",src:"/themes/corp/overlays/corporate-your-overlay-1024x1024.png",mediaType:"image",filters:["asset-01"]},{type:"overlay",src:"/themes/corp/overlays/corp-overlay-02-white.png",mediaType:"image",filters:["asset-01"]},{type:"object",src:"/themes/corp/stickers/corporate-your-sticker-512x512.svg",mediaType:"svg",filters:["asset-02"]},{type:"object",src:"/themes/corp/stickers/corp-sticker-01.svg",mediaType:"svg"},{type:"object",src:"/themes/corp/stickers/corp-sticker-02.svg",mediaType:"svg",filters:["asset-01","asset-02"]}],yz=Q.defineComponent({__name:"creative-booth",props:{modelValue:{default:null},jsonModel:{type:null,default:void 0},config:{type:Object,default:null},feature:{type:String,default:""},required:{type:Boolean,default:!1},variant:{type:String,default:"light"},messages:{type:Object,default:{}},assets:{type:Array,default:()=>Cz},assetFilters:{type:Array,default:()=>[]},exportToSvg:{type:Boolean,default:!1},resetState:{type:Boolean,default:!1},ratio:{type:String,default:"4x3"},themeData:{type:Object,default:()=>({})},autoSelect:Number,ready:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!1},animationDuration:{type:Number,default:320}},emits:["update:modelValue","update:jsonModel","update:ready","update:pending"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref(),s=Q.ref(),a=Q.ref(!1),l=Q.computed(()=>t.assetFilters&&t.assetFilters.length>0?t.assets.filter(w=>!w.filters||w.filters.length==0||t.assetFilters.some(C=>w.filters.includes(C))):t.assets),c=Q.computed({get(){return t.modelValue},set(w){r("update:modelValue",w)}}),h=Q.computed({get(){return t.jsonModel},set(w){r("update:jsonModel",w)}}),f=Q.computed({get(){return t.pending},set(w){t.ready&&r("update:pending",w)}});Q.watch(s,async(w,C)=>{w&&w!==C&&r("update:modelValue",w)},{deep:!0});function p(w){if(typeof w<"u"){const C=l.value[w];switch(C.type){case"background":n.value?.setBackgroundImage(C);break;case"overlay":n.value.setOverlayImage(C);break;default:n.value.addCanvasObject(C)}}}const g=(async()=>{if(a.value=!0,t.autoSelect!==void 0){const w=t.autoSelect>=0?t.autoSelect:Math.floor(Math.random()*l.value.length);p(w)}r("update:ready",!0)});return(w,C)=>{const v=Q.resolveComponent("fabric-canvas"),x=Q.resolveComponent("media-thumbnails");return Q.openBlock(),Q.createElementBlock("div",gz,[Q.createElementVNode("div",mz,[Q.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=_=>c.value=_),"json-model":h.value,"onUpdate:jsonModel":C[1]||(C[1]=_=>h.value=_),pending:f.value,"onUpdate:pending":C[2]||(C[2]=_=>f.value=_),ref_key:"canvas",ref:n,"reset-state":A.resetState,options:{themeData:A.themeData},feature:A.feature,required:A.required,class:Q.normalizeClass(`${A.ratio?`aspect-ratio aspect-ratio--${A.ratio}`:""}`),onOnReady:g,"emit-pending":A.emitPending,"animation-duration":A.animationDuration},null,8,["modelValue","json-model","pending","reset-state","options","feature","required","class","emit-pending","animation-duration"])]),A.messages.headline?(Q.openBlock(),Q.createElementBlock("p",{key:0,class:"headline",innerHTML:A.messages.headline},null,8,wz)):Q.createCommentVNode("",!0),Q.createElementVNode("div",Bz,[a.value?(Q.openBlock(),Q.createBlock(x,{key:0,assets:l.value,onSelect:p},null,8,["assets"])):Q.createCommentVNode("",!0)])])}}}),vz={class:"face-swap"},bz={class:"position-relative"},_z=["innerHTML"],Ez={class:"face-swap__thumbnails"},xz=[{type:"target",thumbnail:"/faceswap/robotroll._avengers_black_widow_fbe3e886-525d-4c8b-b46c-b32856fae2bf.png",src:"/faceswap/robotroll._avengers_black_widow_fbe3e886-525d-4c8b-b46c-b32856fae2bf.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._batmans_joker_04afa7d0-430d-43f2-a7ce-815c6875a793.png",src:"/faceswap/robotroll._batmans_joker_04afa7d0-430d-43f2-a7ce-815c6875a793.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._catwoman_922f1bfa-9197-4e9a-aaeb-bce5d413a9b9.png",src:"/faceswap/robotroll._catwoman_922f1bfa-9197-4e9a-aaeb-bce5d413a9b9.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._christian_bale_as_american_psycho_abe2d5ab-58e8-4f21-94f9-b2b117af3d89.png",src:"/faceswap/robotroll._christian_bale_as_american_psycho_abe2d5ab-58e8-4f21-94f9-b2b117af3d89.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._dirty_harry_7ce45595-edba-4ef8-a513-39b179d94f57.png",src:"/faceswap/robotroll._dirty_harry_7ce45595-edba-4ef8-a513-39b179d94f57.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._evil_santa_claus_pointing_a_double_barrel_shotgun_at_bf603686-4980-449b-ad88-e8f362850aab.png",src:"/faceswap/robotroll._evil_santa_claus_pointing_a_double_barrel_shotgun_at_bf603686-4980-449b-ad88-e8f362850aab.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._homer_simpson_as_real_person_b14628bf-5a5a-45fe-b35a-e56960de4ad4.png",src:"/faceswap/robotroll._homer_simpson_as_real_person_b14628bf-5a5a-45fe-b35a-e56960de4ad4.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._james_bond_caa0af54-16b2-4d15-9e4d-45cc395c021b.png",src:"/faceswap/robotroll._james_bond_caa0af54-16b2-4d15-9e4d-45cc395c021b.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._neil_gaimans_sandman_d3ca51cd-2ef8-46d5-b1db-1474789783a4.png",src:"/faceswap/robotroll._neil_gaimans_sandman_d3ca51cd-2ef8-46d5-b1db-1474789783a4.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._pennywise_3f4c5997-9fd2-43e0-ab9b-17384fb58da9.png",src:"/faceswap/robotroll._pennywise_3f4c5997-9fd2-43e0-ab9b-17384fb58da9.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._queen_of_hearts_8de84ac6-3f61-4981-ac92-c63d90d63890.png",src:"/faceswap/robotroll._queen_of_hearts_8de84ac6-3f61-4981-ac92-c63d90d63890.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._red_dead_redemptions_arthur_morgan_portrait_36f8a066-6c2b-4a23-9c5e-a2a3964b0d3b.png",src:"/faceswap/robotroll._red_dead_redemptions_arthur_morgan_portrait_36f8a066-6c2b-4a23-9c5e-a2a3964b0d3b.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._thanos_38adb80e-08ac-49d4-95e0-d4d11cb5a11d.png",src:"/faceswap/robotroll._thanos_38adb80e-08ac-49d4-95e0-d4d11cb5a11d.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._the_godfather_062db832-61ce-4d18-a09d-045cadd4e281.png",src:"/faceswap/robotroll._the_godfather_062db832-61ce-4d18-a09d-045cadd4e281.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._wolverine_3f9cece6-e490-4be8-a5f9-d6e6abf0440f.png",src:"/faceswap/robotroll._wolverine_3f9cece6-e490-4be8-a5f9-d6e6abf0440f.png",mediaType:"image",filters:[]}],Qz=Q.defineComponent({__name:"face-swap",props:{modelValue:{default:null},config:{type:Object,default:null},variant:{type:String,default:"light"},messages:{type:Object,default:{}},assets:{type:Array,default:()=>xz},resetState:{type:Boolean,default:!1},ratio:{type:String,default:"4x3"},endpoint:{type:String,default:"/faceswap-json"},autoSelect:Number},emits:["update:modelValue"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref(),s=Q.ref(),a=Q.ref(),l=Q.ref(!1);Q.computed({get(){return t.modelValue},set(p){r("update:modelValue",p)}});const c=Q.computed(()=>a.value||n.value&&n.value.src||s.value);Q.watch(a,async(p,g)=>{p&&p!==g&&r("update:modelValue",p)},{deep:!0});function h(p){if(typeof p<"u"){const g=t.assets[p];n.value=g,a.value=null}}async function f(){const p=await O8(n.value.src),w={dataUrl:t.modelValue,targetDataUrl:p};l.value=!0;const C=i2;a.value=await C.processImage(t.endpoint,w,""),l.value=!1}return Q.onBeforeMount(()=>{s.value=t.modelValue}),(p,g)=>{const w=Q.resolveComponent("base-image"),C=Q.resolveComponent("loading-spinner"),v=Q.resolveComponent("media-thumbnails");return Q.openBlock(),Q.createElementBlock("div",vz,[Q.createElementVNode("div",bz,[Q.createElementVNode("div",{class:Q.normalizeClass(["media-container",`${A.ratio?`ratio ratio-${A.ratio}`:""}`])},[Q.createVNode(Q.Transition,{name:"fade",mode:"out-in"},{default:Q.withCtx(()=>[(Q.openBlock(),Q.createElementBlock("div",{key:c.value},[Q.createVNode(w,{src:c.value},null,8,["src"])]))]),_:1})],2),n.value?(Q.openBlock(),Q.createElementBlock("button",{key:0,type:"button",class:"btn face-swap__swap-face",onClick:f},[s.value&&!a.value&&!l.value?(Q.openBlock(),Q.createBlock(w,{key:0,src:s.value,class:"img-thumbnail"},null,8,["src"])):Q.createCommentVNode("",!0)])):Q.createCommentVNode("",!0),l.value?(Q.openBlock(),Q.createBlock(C,{key:1})):Q.createCommentVNode("",!0)]),A.messages.headline?(Q.openBlock(),Q.createElementBlock("p",{key:0,class:"headline",innerHTML:A.messages.headline},null,8,_z)):Q.createCommentVNode("",!0),Q.createElementVNode("div",Ez,[Q.createVNode(v,{assets:A.assets,onSelect:h},null,8,["assets"])])])}}}),Fz=["innerHTML"],Sz=Q.defineComponent({__name:"svg-canvas",props:{modelValue:{default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',type:String},scale:{type:Number,default:1},fillColor:String,groupedFill:Boolean},emits:["update:modelValue"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref();function s(a){const l=a.target;if(!l.closest(".read-only")){if(t.groupedFill&&t.fillColor){const g=l.closest("[data-group-class]").dataset.groupClass,w=l.closest("svg")?.querySelectorAll(`.${g}`);w&&Array.from(w).forEach(C=>{C.setAttribute("fill",t.fillColor),C.setAttribute("fill-opacity","1")})}else t.fillColor&&(l.setAttribute("fill",t.fillColor),l.setAttribute("fill-opacity","1"));const f=l.closest(".svg-canvas").querySelector("svg").outerHTML;r("update:modelValue",f)}}return(a,l)=>(Q.openBlock(),Q.createElementBlock("div",{class:Q.normalizeClass(["svg-canvas",`${A.scale>1?"overflow-scroll":""}`])},[Q.createElementVNode("div",{ref_key:"svg",ref:n,class:"svg-wrapper",innerHTML:A.modelValue,style:Q.normalizeStyle({transform:`scale(${A.scale})`}),onClick:l[0]||(l[0]=c=>s(c))},null,12,Fz)],2))}}),Iz={class:"svg-editor"},Uz={class:"svg-editor__frame"},Tz=Q.defineComponent({__name:"color-booth",props:{modelValue:String,name:String,src:String,required:Boolean,colors:Array,groupedFill:Boolean},emits:["update:modelValue"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref(""),s=Q.ref(1),a=Q.computed({get(){return t.modelValue},set(l){r("update:modelValue",l)}});return Q.onBeforeMount(()=>{n.value=t.colors?.length?t.colors[0]:""}),(l,c)=>(Q.openBlock(),Q.createElementBlock("div",Iz,[Q.createElementVNode("div",Uz,[Q.createVNode(Q.unref(Qj),{modelValue:s.value,"onUpdate:modelValue":c[1]||(c[1]=h=>s.value=h)},{default:Q.withCtx(()=>[Q.createVNode(Sz,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=h=>a.value=h),fillColor:n.value,scale:s.value,"grouped-fill":A.groupedFill},null,8,["modelValue","fillColor","scale","grouped-fill"])]),_:1},8,["modelValue"]),Q.createVNode(Q.unref(iR),{modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=h=>n.value=h),colors:A.colors,class:"mt-2"},null,8,["modelValue","colors"])])]))}});Vn.ColorBooth=Tz,Vn.CreativeBooth=yz,Vn.FabricCanvas=pz,Vn.FaceSwap=Qz,Vn.PhotoApp=h$,Object.defineProperty(Vn,Symbol.toStringTag,{value:"Module"})}));
|
|
621
|
+
}`;var He=Dd(function(){return Ze(y,ye+"return "+ee).apply(t,E)});if(He.source=ee,Ql(He))throw He;return He}function Rx(i){return At(i).toLowerCase()}function Kx(i){return At(i).toUpperCase()}function Vx(i,o,u){if(i=At(i),i&&(u||o===t))return Vh(i);if(!i||!(o=Yt(o)))return i;var d=wA(i),m=wA(o),y=Gh(d,m),E=jh(d,m)+1;return Br(d,y,E).join("")}function Gx(i,o,u){if(i=At(i),i&&(u||o===t))return i.slice(0,Wh(i)+1);if(!i||!(o=Yt(o)))return i;var d=wA(i),m=jh(d,wA(o))+1;return Br(d,0,m).join("")}function jx(i,o,u){if(i=At(i),i&&(u||o===t))return i.replace(ps,"");if(!i||!(o=Yt(o)))return i;var d=wA(i),m=Gh(d,wA(o));return Br(d,m).join("")}function $x(i,o){var u=Fe,d=Te;if(ct(o)){var m="separator"in o?o.separator:m;u="length"in o?Me(o.length):u,d="omission"in o?Yt(o.omission):d}i=At(i);var y=i.length;if(Bn(i)){var E=wA(i);y=E.length}if(u>=y)return i;var I=u-Cn(d);if(I<1)return d;var O=E?Br(E,0,I).join(""):i.slice(0,I);if(m===t)return O+d;if(E&&(I+=O.length-I),Fl(m)){if(i.slice(I).search(m)){var W,Y=O;for(m.global||(m=Ga(m.source,At(Do.exec(m))+"g")),m.lastIndex=0;W=m.exec(Y);)var ee=W.index;O=O.slice(0,ee===t?I:ee)}}else if(i.indexOf(Yt(m),I)!=I){var he=O.lastIndexOf(m);he>-1&&(O=O.slice(0,he))}return O+d}function Wx(i){return i=At(i),i&&ds.test(i)?i.replace(Pi,vv):i}var zx=Qn(function(i,o,u){return i+(u?" ":"")+o.toUpperCase()}),Ul=Mf("toUpperCase");function Od(i,o,u){return i=At(i),o=u?t:o,o===t?mv(i)?Ev(i):av(i):i.match(o)||[]}var Dd=Pe(function(i,o){try{return Wt(i,t,o)}catch(u){return Ql(u)?u:new ke(u)}}),Yx=JA(function(i,o){return rA(o,function(u){u=LA(u),YA(i,u,El(i[u],i))}),i});function Xx(i){var o=i==null?0:i.length,u=_e();return i=o?ot(i,function(d){if(typeof d[1]!="function")throw new nA(a);return[u(d[0]),d[1]]}):[],Pe(function(d){for(var m=-1;++m<o;){var y=i[m];if(Wt(y[0],this,d))return Wt(y[1],this,d)}})}function Jx(i){return v1(sA(i,p))}function Tl(i){return function(){return i}}function qx(i,o){return i==null||i!==i?o:i}var Zx=Hf(),eQ=Hf(!0);function Vt(i){return i}function kl(i){return df(typeof i=="function"?i:sA(i,p))}function tQ(i){return gf(sA(i,p))}function AQ(i,o){return mf(i,sA(o,p))}var rQ=Pe(function(i,o){return function(u){return gi(u,i,o)}}),nQ=Pe(function(i,o){return function(u){return gi(i,u,o)}});function Ol(i,o,u){var d=_t(o),m=Ls(o,d);u==null&&!(ct(o)&&(m.length||!d.length))&&(u=o,o=i,i=this,m=Ls(o,_t(o)));var y=!(ct(u)&&"chain"in u)||!!u.chain,E=ZA(i);return rA(m,function(I){var O=o[I];i[I]=O,E&&(i.prototype[I]=function(){var W=this.__chain__;if(y||W){var Y=i(this.__wrapped__),ee=Y.__actions__=Pt(this.__actions__);return ee.push({func:O,args:arguments,thisArg:i}),Y.__chain__=W,Y}return O.apply(i,fr([this.value()],arguments))})}),i}function iQ(){return xt._===this&&(xt._=Uv),this}function Dl(){}function sQ(i){return i=Me(i),Pe(function(o){return wf(o,i)})}var oQ=hl(ot),aQ=hl(Hh),lQ=hl(La);function Md(i){return Bl(i)?Ha(LA(i)):N1(i)}function cQ(i){return function(o){return i==null?t:Wr(i,o)}}var uQ=Pf(),hQ=Pf(!0);function Ml(){return[]}function Ll(){return!1}function fQ(){return{}}function dQ(){return""}function pQ(){return!0}function gQ(i,o){if(i=Me(i),i<1||i>F)return[];var u=b,d=Ut(i,b);o=_e(o),i-=b;for(var m=Ra(d,o);++u<i;)o(u);return m}function mQ(i){return Oe(i)?ot(i,LA):Xt(i)?[i]:Pt(Ad(At(i)))}function wQ(i){var o=++Sv;return At(i)+o}var BQ=Vs(function(i,o){return i+o},0),CQ=fl("ceil"),yQ=Vs(function(i,o){return i/o},1),vQ=fl("floor");function bQ(i){return i&&i.length?Ms(i,Vt,qa):t}function _Q(i,o){return i&&i.length?Ms(i,_e(o,2),qa):t}function EQ(i){return Rh(i,Vt)}function xQ(i,o){return Rh(i,_e(o,2))}function QQ(i){return i&&i.length?Ms(i,Vt,Al):t}function FQ(i,o){return i&&i.length?Ms(i,_e(o,2),Al):t}var SQ=Vs(function(i,o){return i*o},1),IQ=fl("round"),UQ=Vs(function(i,o){return i-o},0);function TQ(i){return i&&i.length?Pa(i,Vt):0}function kQ(i,o){return i&&i.length?Pa(i,_e(o,2)):0}return B.after=tE,B.ary=fd,B.assign=KE,B.assignIn=Qd,B.assignInWith=Ao,B.assignWith=VE,B.at=GE,B.before=dd,B.bind=El,B.bindAll=Yx,B.bindKey=pd,B.castArray=fE,B.chain=cd,B.chunk=vb,B.compact=bb,B.concat=_b,B.cond=Xx,B.conforms=Jx,B.constant=Tl,B.countBy=T_,B.create=jE,B.curry=gd,B.curryRight=md,B.debounce=wd,B.defaults=$E,B.defaultsDeep=WE,B.defer=AE,B.delay=rE,B.difference=Eb,B.differenceBy=xb,B.differenceWith=Qb,B.drop=Fb,B.dropRight=Sb,B.dropRightWhile=Ib,B.dropWhile=Ub,B.fill=Tb,B.filter=O_,B.flatMap=L_,B.flatMapDeep=H_,B.flatMapDepth=N_,B.flatten=sd,B.flattenDeep=kb,B.flattenDepth=Ob,B.flip=nE,B.flow=Zx,B.flowRight=eQ,B.fromPairs=Db,B.functions=ex,B.functionsIn=tx,B.groupBy=P_,B.initial=Lb,B.intersection=Hb,B.intersectionBy=Nb,B.intersectionWith=Pb,B.invert=rx,B.invertBy=nx,B.invokeMap=K_,B.iteratee=kl,B.keyBy=V_,B.keys=_t,B.keysIn=Kt,B.map=Xs,B.mapKeys=sx,B.mapValues=ox,B.matches=tQ,B.matchesProperty=AQ,B.memoize=qs,B.merge=ax,B.mergeWith=Fd,B.method=rQ,B.methodOf=nQ,B.mixin=Ol,B.negate=Zs,B.nthArg=sQ,B.omit=lx,B.omitBy=cx,B.once=iE,B.orderBy=G_,B.over=oQ,B.overArgs=sE,B.overEvery=aQ,B.overSome=lQ,B.partial=xl,B.partialRight=Bd,B.partition=j_,B.pick=ux,B.pickBy=Sd,B.property=Md,B.propertyOf=cQ,B.pull=Gb,B.pullAll=ad,B.pullAllBy=jb,B.pullAllWith=$b,B.pullAt=Wb,B.range=uQ,B.rangeRight=hQ,B.rearg=oE,B.reject=z_,B.remove=zb,B.rest=aE,B.reverse=bl,B.sampleSize=X_,B.set=fx,B.setWith=dx,B.shuffle=J_,B.slice=Yb,B.sortBy=eE,B.sortedUniq=A_,B.sortedUniqBy=r_,B.split=Lx,B.spread=lE,B.tail=n_,B.take=i_,B.takeRight=s_,B.takeRightWhile=o_,B.takeWhile=a_,B.tap=b_,B.throttle=cE,B.thru=Ys,B.toArray=_d,B.toPairs=Id,B.toPairsIn=Ud,B.toPath=mQ,B.toPlainObject=xd,B.transform=px,B.unary=uE,B.union=l_,B.unionBy=c_,B.unionWith=u_,B.uniq=h_,B.uniqBy=f_,B.uniqWith=d_,B.unset=gx,B.unzip=_l,B.unzipWith=ld,B.update=mx,B.updateWith=wx,B.values=In,B.valuesIn=Bx,B.without=p_,B.words=Od,B.wrap=hE,B.xor=g_,B.xorBy=m_,B.xorWith=w_,B.zip=B_,B.zipObject=C_,B.zipObjectDeep=y_,B.zipWith=v_,B.entries=Id,B.entriesIn=Ud,B.extend=Qd,B.extendWith=Ao,Ol(B,B),B.add=BQ,B.attempt=Dd,B.camelCase=bx,B.capitalize=Td,B.ceil=CQ,B.clamp=Cx,B.clone=dE,B.cloneDeep=gE,B.cloneDeepWith=mE,B.cloneWith=pE,B.conformsTo=wE,B.deburr=kd,B.defaultTo=qx,B.divide=yQ,B.endsWith=_x,B.eq=CA,B.escape=Ex,B.escapeRegExp=xx,B.every=k_,B.find=D_,B.findIndex=nd,B.findKey=zE,B.findLast=M_,B.findLastIndex=id,B.findLastKey=YE,B.floor=vQ,B.forEach=ud,B.forEachRight=hd,B.forIn=XE,B.forInRight=JE,B.forOwn=qE,B.forOwnRight=ZE,B.get=Sl,B.gt=BE,B.gte=CE,B.has=Ax,B.hasIn=Il,B.head=od,B.identity=Vt,B.includes=R_,B.indexOf=Mb,B.inRange=yx,B.invoke=ix,B.isArguments=Xr,B.isArray=Oe,B.isArrayBuffer=yE,B.isArrayLike=Rt,B.isArrayLikeObject=ft,B.isBoolean=vE,B.isBuffer=Cr,B.isDate=bE,B.isElement=_E,B.isEmpty=EE,B.isEqual=xE,B.isEqualWith=QE,B.isError=Ql,B.isFinite=FE,B.isFunction=ZA,B.isInteger=Cd,B.isLength=eo,B.isMap=yd,B.isMatch=SE,B.isMatchWith=IE,B.isNaN=UE,B.isNative=TE,B.isNil=OE,B.isNull=kE,B.isNumber=vd,B.isObject=ct,B.isObjectLike=ut,B.isPlainObject=vi,B.isRegExp=Fl,B.isSafeInteger=DE,B.isSet=bd,B.isString=to,B.isSymbol=Xt,B.isTypedArray=Sn,B.isUndefined=ME,B.isWeakMap=LE,B.isWeakSet=HE,B.join=Rb,B.kebabCase=Qx,B.last=aA,B.lastIndexOf=Kb,B.lowerCase=Fx,B.lowerFirst=Sx,B.lt=NE,B.lte=PE,B.max=bQ,B.maxBy=_Q,B.mean=EQ,B.meanBy=xQ,B.min=QQ,B.minBy=FQ,B.stubArray=Ml,B.stubFalse=Ll,B.stubObject=fQ,B.stubString=dQ,B.stubTrue=pQ,B.multiply=SQ,B.nth=Vb,B.noConflict=iQ,B.noop=Dl,B.now=Js,B.pad=Ix,B.padEnd=Ux,B.padStart=Tx,B.parseInt=kx,B.random=vx,B.reduce=$_,B.reduceRight=W_,B.repeat=Ox,B.replace=Dx,B.result=hx,B.round=IQ,B.runInContext=k,B.sample=Y_,B.size=q_,B.snakeCase=Mx,B.some=Z_,B.sortedIndex=Xb,B.sortedIndexBy=Jb,B.sortedIndexOf=qb,B.sortedLastIndex=Zb,B.sortedLastIndexBy=e_,B.sortedLastIndexOf=t_,B.startCase=Hx,B.startsWith=Nx,B.subtract=UQ,B.sum=TQ,B.sumBy=kQ,B.template=Px,B.times=gQ,B.toFinite=er,B.toInteger=Me,B.toLength=Ed,B.toLower=Rx,B.toNumber=lA,B.toSafeInteger=RE,B.toString=At,B.toUpper=Kx,B.trim=Vx,B.trimEnd=Gx,B.trimStart=jx,B.truncate=$x,B.unescape=Wx,B.uniqueId=wQ,B.upperCase=zx,B.upperFirst=Ul,B.each=ud,B.eachRight=hd,B.first=od,Ol(B,(function(){var i={};return DA(B,function(o,u){tt.call(B.prototype,u)||(i[u]=o)}),i})(),{chain:!1}),B.VERSION=r,rA(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){B[i].placeholder=B}),rA(["drop","take"],function(i,o){Ve.prototype[i]=function(u){u=u===t?1:Bt(Me(u),0);var d=this.__filtered__&&!o?new Ve(this):this.clone();return d.__filtered__?d.__takeCount__=Ut(u,d.__takeCount__):d.__views__.push({size:Ut(u,b),type:i+(d.__dir__<0?"Right":"")}),d},Ve.prototype[i+"Right"]=function(u){return this.reverse()[i](u).reverse()}}),rA(["filter","map","takeWhile"],function(i,o){var u=o+1,d=u==L||u==$;Ve.prototype[i]=function(m){var y=this.clone();return y.__iteratees__.push({iteratee:_e(m,3),type:u}),y.__filtered__=y.__filtered__||d,y}}),rA(["head","last"],function(i,o){var u="take"+(o?"Right":"");Ve.prototype[i]=function(){return this[u](1).value()[0]}}),rA(["initial","tail"],function(i,o){var u="drop"+(o?"":"Right");Ve.prototype[i]=function(){return this.__filtered__?new Ve(this):this[u](1)}}),Ve.prototype.compact=function(){return this.filter(Vt)},Ve.prototype.find=function(i){return this.filter(i).head()},Ve.prototype.findLast=function(i){return this.reverse().find(i)},Ve.prototype.invokeMap=Pe(function(i,o){return typeof i=="function"?new Ve(this):this.map(function(u){return gi(u,i,o)})}),Ve.prototype.reject=function(i){return this.filter(Zs(_e(i)))},Ve.prototype.slice=function(i,o){i=Me(i);var u=this;return u.__filtered__&&(i>0||o<0)?new Ve(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),o!==t&&(o=Me(o),u=o<0?u.dropRight(-o):u.take(o-i)),u)},Ve.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ve.prototype.toArray=function(){return this.take(b)},DA(Ve.prototype,function(i,o){var u=/^(?:filter|find|map|reject)|While$/.test(o),d=/^(?:head|last)$/.test(o),m=B[d?"take"+(o=="last"?"Right":""):o],y=d||/^find/.test(o);m&&(B.prototype[o]=function(){var E=this.__wrapped__,I=d?[1]:arguments,O=E instanceof Ve,W=I[0],Y=O||Oe(E),ee=function(Re){var je=m.apply(B,fr([Re],I));return d&&he?je[0]:je};Y&&u&&typeof W=="function"&&W.length!=1&&(O=Y=!1);var he=this.__chain__,ye=!!this.__actions__.length,Ee=y&&!he,He=O&&!ye;if(!y&&Y){E=He?E:new Ve(this);var xe=i.apply(E,I);return xe.__actions__.push({func:Ys,args:[ee],thisArg:t}),new iA(xe,he)}return Ee&&He?i.apply(this,I):(xe=this.thru(ee),Ee?d?xe.value()[0]:xe.value():xe)})}),rA(["pop","push","shift","sort","splice","unshift"],function(i){var o=ys[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);B.prototype[i]=function(){var m=arguments;if(d&&!this.__chain__){var y=this.value();return o.apply(Oe(y)?y:[],m)}return this[u](function(E){return o.apply(Oe(E)?E:[],m)})}}),DA(Ve.prototype,function(i,o){var u=B[o];if(u){var d=u.name+"";tt.call(_n,d)||(_n[d]=[]),_n[d].push({name:o,func:u})}}),_n[Ks(t,_).name]=[{name:"wrapper",func:t}],Ve.prototype.clone=Wv,Ve.prototype.reverse=zv,Ve.prototype.value=Yv,B.prototype.at=__,B.prototype.chain=E_,B.prototype.commit=x_,B.prototype.next=Q_,B.prototype.plant=S_,B.prototype.reverse=I_,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=U_,B.prototype.first=B.prototype.head,li&&(B.prototype[li]=F_),B}),yn=xv();Kr?((Kr.exports=yn)._=yn,ka._=yn):xt._=yn}).call(az)})(ah,ah.exports)),ah.exports}var cz=lz();const uz="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffffCC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='feather%20feather-rotate-cw'%3e%3cpolyline%20points='23%204%2023%2010%2017%2010'%3e%3c/polyline%3e%3cpath%20d='M20.49%2015a9%209%200%201%201-2.12-9.36L23%2010'%3e%3c/path%3e%3c/svg%3e",hz="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffffCC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='feather%20feather-x-circle'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%20fill='none'%3e%3c/circle%3e%3cline%20x1='15'%20y1='9'%20x2='9'%20y2='15'%20fill='none'%3e%3c/line%3e%3cline%20x1='9'%20y1='9'%20x2='15'%20y2='15'%20fill='none'%3e%3c/line%3e%3c/svg%3e",fz={class:"fabric-canvas__canvas"},dz={id:"fabricCanvas",ref:"canvasRef"},pz=Q.defineComponent({__name:"fabric-canvas",props:{modelValue:{type:String,default:""},jsonModel:{type:null,default:void 0},exportToSvg:{type:Boolean,default:!1},resetState:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},feature:{type:String,default:""},required:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!1},animationDuration:{type:Number,default:0}},emits:["update:modelValue","update:jsonModel","update:pending","on-ready"],setup(A,{expose:e,emit:t}){const r=t;e({setBackgroundImage:C,setOverlayImage:x,addCanvasObject:_});const n=A,s=Q.ref(),a=Q.ref(0),l=Q.ref(0);let c;const h=Q.ref();async function f(L,K){return new Promise(async $=>{const S=JSON.parse(K);if(S.backgroundImage){const M=await p(S.backgroundImage.src);M.set({opacity:1}),L.backgroundImage=M,L.centerObject(M)}if(S.overlayImage){const M=await p(S.overlayImage.src);M.set({opacity:1,left:a.value/2,top:l.value/2,scaleX:a.value/M.width,scaleY:l.value/M.height}),L.overlayImage=M}(await bc.enlivenObjects(S.objects,{reviver:void 0})).forEach(M=>{L.add(M)}),$(L)})}async function p(L){const K=await Qe(L);L.includes("data:image")||(K.filename=L);const $=bc.findScaleToCover(K,c),S=K instanceof nn;return K.set({left:0,top:0,opacity:S&&n.animationDuration>0?0:1,scaleX:$,scaleY:$,src:L}),K}async function g(L){!(L instanceof nn)||n.animationDuration===0||(n.emitPending&&r("update:pending",!0),await new Promise($=>{const S=n.animationDuration,F=Date.now(),M=()=>{const U=Date.now()-F,b=Math.min(U/S,1);L.set("opacity",b),c.renderAll(),b<1?requestAnimationFrame(M):(n.emitPending&&r("update:pending",!1),$())};requestAnimationFrame(M)}))}function w(L){const K=bc.findScaleToCover(L,c);return L.set({scaleX:K,scaleY:K}),L}async function C(L){const K=await p(L.src);c.backgroundImage=K,c.centerObject(K),c.renderAll(),await g(K),re()}async function v(L){const K=await p(L.src);K.selectable=!1,K.assetType="foreground",c.add(K),c.centerObject(K),c.renderAll(),await g(K),re()}async function x(L){const K=await p(L.src);K.set({left:a.value/2,top:l.value/2,scaleX:a.value/K.width,scaleY:l.value/K.height}),c.overlayImage=K,c.renderAll(),await g(K),re()}async function _(L){c.discardActiveObject();const K=await Qe(L.src);K.filename=L.src;const $=a.value/3,S=l.value/3,F=$/K.width,M=S/K.height,U=Math.min(F,M);K.set({scaleX:U,scaleY:U,left:a.value/2,top:l.value/2}),K.id=L.id,K.padding=8,c.add(K),c.setActiveObject(K),await g(K),c.renderAll()}function T(L,K){K.target.id;const $=K.target;return c.remove($),c.requestRenderAll(),!0}function H(){if(a.value=s.value.offsetWidth,l.value=s.value.offsetHeight,c.setDimensions({width:a.value,height:l.value}),c.backgroundImage&&(c.backgroundImage=w(c.backgroundImage),c.centerObject(c.backgroundImage)),c.overlayImage){const L=c.overlayImage;L.set({scaleX:a.value/L.width,scaleY:l.value/L.height})}c.getObjects().forEach(L=>{L.assetType==="foreground"&&(L=w(L),c.centerObject(L))}),c.renderAll()}const D=cz.debounce(()=>{H()},200,{trailing:!0,leading:!1});function N(L){return(K,$,S,F,M)=>{K.save(),K.translate($,S),K.rotate(bc.degreesToRadians(M.angle)),K.fillStyle=n.options.themeData?.colors?.primary,K.fillRect(-24/2,-24/2,24,24);const b=20;K.drawImage(L,-b/2,-b/2,b,b),K.restore()}}function V(){const L=document.createElement("img");L.src=uz;const K=document.createElement("img");K.src=hz,c.on("object:added",$=>{$.target&&$.target.controls&&($.target.set({transparentCorners:!1,cornerSize:16,cornerStyle:"circle",...n.options.themeData?.colors?.primary?{cornerColor:n.options.themeData?.colors?.primary,cornerStrokeColor:n.options.themeData?.colors?.primary,borderColor:n.options.themeData?.colors?.primary}:{}}),$.target.controls.ml.visible=!1,$.target.controls.mr.visible=!1,$.target.controls.mb.visible=!1,$.target.controls.mt.visible=!1,$.target.controls.mtr.visible=!1,$.target.controls.rotate=new Lr({x:.5,y:-.5,offsetX:32,offsetY:0,cursorStyle:"pointer",actionName:"rotate",actionHandler:JO.rotationWithSnapping,cursorStyleHandler:JO.rotationStyleHandler,render:N(L)}),$.target.controls.delete=new Lr({x:.5,y:-.5,offsetX:32,offsetY:32,cursorStyle:"pointer",mouseUpHandler:T,render:N(K)}))})}async function q(){return await new Promise(L=>{setTimeout(()=>{const K=n.exportToSvg?c.toSVG():c.toDataURL({multiplier:2});L(K)},200)})}function re(){setTimeout(async()=>{const L=c.toDatalessJSON(["selectable","assetType","filename"]);await sz("fabric-canvas",JSON.stringify(L));let K=!0;if(n.required)switch(K=!1,n.feature){case"overlay":L.overlayImage&&(K=!0);break;case"background":L.backgroundImage&&(K=!0);break;case"stickers":L.objects.length>1&&(K=!0);break;default:(L.objects.length>1||L.backgroundImage||L.overlayImage)&&(K=!0)}if(K){const $=await q();r("update:modelValue",$),r("update:jsonModel",L)}},120)}async function oe(L){try{return await nn.fromURL(L)}catch(K){throw console.error("Error loading image:",K),K}}async function Fe(L){const{objects:K,options:$}=await XW(L);return bc.groupSVGElements(K,$)}async function Te(L){const{objects:K,options:$}=await wD(L);return bc.groupSVGElements(K,$)}async function Qe(L){return L&&typeof L=="string"&&L.trim().startsWith("<")?await Te(L):L&&new RegExp(/([\w_/-]*\.svg$)|(image\/svg\+xml)/gi).test(L)?await Fe(L):await oe(L)}async function de(L,K){L&&!K&&v({src:L})}return Q.watch(()=>n.modelValue,async(L,K)=>{de(L,K)}),Q.onMounted(async()=>{a.value=s.value.offsetWidth,l.value=s.value.offsetHeight,window.addEventListener("resize",D),Ft.NUM_FRACTION_DIGITS=8;const L=sh.prototype._onTouchStart;sh.prototype._onTouchStart=function(K){const $=this.findTarget(K);this.allowTouchScrolling&&$.assetType&&!this.isDrawingMode||L.call(this,K)},c=new sh("fabricCanvas",{width:a.value,height:l.value,skipOffscreen:!0,allowTouchScrolling:!0}),n.resetState&&await oz("fabric-canvas"),h.value=await iz("fabric-canvas"),h.value?(await f(c,h.value),c.requestRenderAll(),requestAnimationFrame(()=>{c.renderAll()})):n.modelValue&&de(n.modelValue,""),c.on("object:added",re),c.on("object:removed",re),c.on("object:modified",re),V(),c.renderAll(),r("on-ready",c)}),(L,K)=>(Q.openBlock(),Q.createElementBlock("div",{class:"fabric-canvas",ref_key:"root",ref:s},[Q.createElementVNode("div",fz,[Q.createElementVNode("canvas",dz,null,512)]),Q.renderSlot(L.$slots,"default")],512))}}),gz={class:"creative-booth"},mz={class:"media-container"},wz=["innerHTML"],Bz={class:"creative-booth__thumbnails"},Cz=[{type:"background",thumbnail:"/themes/corp/backgrounds/corporate-your-background-1024x1024.jpg",src:"/themes/corp/backgrounds/corporate-your-background-1024x1024.jpg",mediaType:"image",filters:["asset-01","asset-02"]},{type:"background",thumbnail:"/themes/corp/backgrounds/corp-background-09-white.jpg",src:"/themes/corp/backgrounds/corp-background-09-white.jpg",mediaType:"image",filters:["asset-01","asset-02"]},{type:"overlay",src:"/themes/corp/overlays/corporate-your-overlay-1024x1024.png",mediaType:"image",filters:["asset-01"]},{type:"overlay",src:"/themes/corp/overlays/corp-overlay-02-white.png",mediaType:"image",filters:["asset-01"]},{type:"object",src:"/themes/corp/stickers/corporate-your-sticker-512x512.svg",mediaType:"svg",filters:["asset-02"]},{type:"object",src:"/themes/corp/stickers/corp-sticker-01.svg",mediaType:"svg"},{type:"object",src:"/themes/corp/stickers/corp-sticker-02.svg",mediaType:"svg",filters:["asset-01","asset-02"]}],yz=Q.defineComponent({__name:"creative-booth",props:{modelValue:{default:null},jsonModel:{type:null,default:void 0},config:{type:Object,default:null},feature:{type:String,default:""},required:{type:Boolean,default:!1},variant:{type:String,default:"light"},messages:{type:Object,default:{}},assets:{type:Array,default:()=>Cz},assetFilters:{type:Array,default:()=>[]},exportToSvg:{type:Boolean,default:!1},resetState:{type:Boolean,default:!1},ratio:{type:String,default:"4x3"},themeData:{type:Object,default:()=>({})},autoSelect:Number,ready:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!1},animationDuration:{type:Number,default:320}},emits:["update:modelValue","update:jsonModel","update:ready","update:pending"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref(),s=Q.ref(),a=Q.ref(!1),l=Q.computed(()=>t.assetFilters&&t.assetFilters.length>0?t.assets.filter(w=>!w.filters||w.filters.length==0||t.assetFilters.some(C=>w.filters.includes(C))):t.assets),c=Q.computed({get(){return t.modelValue},set(w){r("update:modelValue",w)}}),h=Q.computed({get(){return t.jsonModel},set(w){r("update:jsonModel",w)}}),f=Q.computed({get(){return t.pending},set(w){t.ready&&r("update:pending",w)}});Q.watch(s,async(w,C)=>{w&&w!==C&&r("update:modelValue",w)},{deep:!0});function p(w){if(typeof w<"u"){const C=l.value[w];switch(C.type){case"background":n.value?.setBackgroundImage(C);break;case"overlay":n.value.setOverlayImage(C);break;default:n.value.addCanvasObject(C)}}}const g=(async()=>{if(a.value=!0,t.autoSelect!==void 0){const w=t.autoSelect>=0?t.autoSelect:Math.floor(Math.random()*l.value.length);p(w)}r("update:ready",!0)});return(w,C)=>{const v=Q.resolveComponent("fabric-canvas"),x=Q.resolveComponent("media-thumbnails");return Q.openBlock(),Q.createElementBlock("div",gz,[Q.createElementVNode("div",mz,[Q.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=_=>c.value=_),"json-model":h.value,"onUpdate:jsonModel":C[1]||(C[1]=_=>h.value=_),pending:f.value,"onUpdate:pending":C[2]||(C[2]=_=>f.value=_),ref_key:"canvas",ref:n,"reset-state":A.resetState,options:{themeData:A.themeData},feature:A.feature,required:A.required,class:Q.normalizeClass(`${A.ratio?`aspect-ratio aspect-ratio--${A.ratio}`:""}`),onOnReady:g,"emit-pending":A.emitPending,"animation-duration":A.animationDuration},null,8,["modelValue","json-model","pending","reset-state","options","feature","required","class","emit-pending","animation-duration"])]),A.messages.headline?(Q.openBlock(),Q.createElementBlock("p",{key:0,class:"headline",innerHTML:A.messages.headline},null,8,wz)):Q.createCommentVNode("",!0),Q.createElementVNode("div",Bz,[a.value?(Q.openBlock(),Q.createBlock(x,{key:0,assets:l.value,onSelect:p},null,8,["assets"])):Q.createCommentVNode("",!0)])])}}}),vz={class:"face-swap"},bz={class:"position-relative"},_z=["innerHTML"],Ez={class:"face-swap__thumbnails"},xz=[{type:"target",thumbnail:"/faceswap/robotroll._avengers_black_widow_fbe3e886-525d-4c8b-b46c-b32856fae2bf.png",src:"/faceswap/robotroll._avengers_black_widow_fbe3e886-525d-4c8b-b46c-b32856fae2bf.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._batmans_joker_04afa7d0-430d-43f2-a7ce-815c6875a793.png",src:"/faceswap/robotroll._batmans_joker_04afa7d0-430d-43f2-a7ce-815c6875a793.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._catwoman_922f1bfa-9197-4e9a-aaeb-bce5d413a9b9.png",src:"/faceswap/robotroll._catwoman_922f1bfa-9197-4e9a-aaeb-bce5d413a9b9.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._christian_bale_as_american_psycho_abe2d5ab-58e8-4f21-94f9-b2b117af3d89.png",src:"/faceswap/robotroll._christian_bale_as_american_psycho_abe2d5ab-58e8-4f21-94f9-b2b117af3d89.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._dirty_harry_7ce45595-edba-4ef8-a513-39b179d94f57.png",src:"/faceswap/robotroll._dirty_harry_7ce45595-edba-4ef8-a513-39b179d94f57.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._evil_santa_claus_pointing_a_double_barrel_shotgun_at_bf603686-4980-449b-ad88-e8f362850aab.png",src:"/faceswap/robotroll._evil_santa_claus_pointing_a_double_barrel_shotgun_at_bf603686-4980-449b-ad88-e8f362850aab.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._homer_simpson_as_real_person_b14628bf-5a5a-45fe-b35a-e56960de4ad4.png",src:"/faceswap/robotroll._homer_simpson_as_real_person_b14628bf-5a5a-45fe-b35a-e56960de4ad4.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._james_bond_caa0af54-16b2-4d15-9e4d-45cc395c021b.png",src:"/faceswap/robotroll._james_bond_caa0af54-16b2-4d15-9e4d-45cc395c021b.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._neil_gaimans_sandman_d3ca51cd-2ef8-46d5-b1db-1474789783a4.png",src:"/faceswap/robotroll._neil_gaimans_sandman_d3ca51cd-2ef8-46d5-b1db-1474789783a4.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._pennywise_3f4c5997-9fd2-43e0-ab9b-17384fb58da9.png",src:"/faceswap/robotroll._pennywise_3f4c5997-9fd2-43e0-ab9b-17384fb58da9.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._queen_of_hearts_8de84ac6-3f61-4981-ac92-c63d90d63890.png",src:"/faceswap/robotroll._queen_of_hearts_8de84ac6-3f61-4981-ac92-c63d90d63890.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._red_dead_redemptions_arthur_morgan_portrait_36f8a066-6c2b-4a23-9c5e-a2a3964b0d3b.png",src:"/faceswap/robotroll._red_dead_redemptions_arthur_morgan_portrait_36f8a066-6c2b-4a23-9c5e-a2a3964b0d3b.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._thanos_38adb80e-08ac-49d4-95e0-d4d11cb5a11d.png",src:"/faceswap/robotroll._thanos_38adb80e-08ac-49d4-95e0-d4d11cb5a11d.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._the_godfather_062db832-61ce-4d18-a09d-045cadd4e281.png",src:"/faceswap/robotroll._the_godfather_062db832-61ce-4d18-a09d-045cadd4e281.png",mediaType:"image",filters:[]},{type:"target",thumbnail:"/faceswap/robotroll._wolverine_3f9cece6-e490-4be8-a5f9-d6e6abf0440f.png",src:"/faceswap/robotroll._wolverine_3f9cece6-e490-4be8-a5f9-d6e6abf0440f.png",mediaType:"image",filters:[]}],Qz=Q.defineComponent({__name:"face-swap",props:{modelValue:{default:null},config:{type:Object,default:null},variant:{type:String,default:"light"},messages:{type:Object,default:{}},assets:{type:Array,default:()=>xz},resetState:{type:Boolean,default:!1},ratio:{type:String,default:"4x3"},endpoint:{type:String,default:"/faceswap-json"},autoSelect:Number},emits:["update:modelValue"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref(),s=Q.ref(),a=Q.ref(),l=Q.ref(!1);Q.computed({get(){return t.modelValue},set(p){r("update:modelValue",p)}});const c=Q.computed(()=>a.value||n.value&&n.value.src||s.value);Q.watch(a,async(p,g)=>{p&&p!==g&&r("update:modelValue",p)},{deep:!0});function h(p){if(typeof p<"u"){const g=t.assets[p];n.value=g,a.value=null}}async function f(){const p=await O8(n.value.src),w={dataUrl:t.modelValue,targetDataUrl:p};l.value=!0;const C=i2;a.value=await C.processImage(t.endpoint,w,""),l.value=!1}return Q.onBeforeMount(()=>{s.value=t.modelValue}),(p,g)=>{const w=Q.resolveComponent("base-image"),C=Q.resolveComponent("loading-spinner"),v=Q.resolveComponent("media-thumbnails");return Q.openBlock(),Q.createElementBlock("div",vz,[Q.createElementVNode("div",bz,[Q.createElementVNode("div",{class:Q.normalizeClass(["media-container",`${A.ratio?`ratio ratio-${A.ratio}`:""}`])},[Q.createVNode(Q.Transition,{name:"fade",mode:"out-in"},{default:Q.withCtx(()=>[(Q.openBlock(),Q.createElementBlock("div",{key:c.value},[Q.createVNode(w,{src:c.value},null,8,["src"])]))]),_:1})],2),n.value?(Q.openBlock(),Q.createElementBlock("button",{key:0,type:"button",class:"btn face-swap__swap-face",onClick:f},[s.value&&!a.value&&!l.value?(Q.openBlock(),Q.createBlock(w,{key:0,src:s.value,class:"img-thumbnail"},null,8,["src"])):Q.createCommentVNode("",!0)])):Q.createCommentVNode("",!0),l.value?(Q.openBlock(),Q.createBlock(C,{key:1})):Q.createCommentVNode("",!0)]),A.messages.headline?(Q.openBlock(),Q.createElementBlock("p",{key:0,class:"headline",innerHTML:A.messages.headline},null,8,_z)):Q.createCommentVNode("",!0),Q.createElementVNode("div",Ez,[Q.createVNode(v,{assets:A.assets,onSelect:h},null,8,["assets"])])])}}}),Fz=["innerHTML"],Sz=Q.defineComponent({__name:"svg-canvas",props:{modelValue:{default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',type:String},scale:{type:Number,default:1},fillColor:String,groupedFill:Boolean},emits:["update:modelValue"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref();function s(a){const l=a.target;if(!l.closest(".read-only")){if(t.groupedFill&&t.fillColor){const g=l.closest("[data-group-class]").dataset.groupClass,w=l.closest("svg")?.querySelectorAll(`.${g}`);w&&Array.from(w).forEach(C=>{C.setAttribute("fill",t.fillColor),C.setAttribute("fill-opacity","1")})}else t.fillColor&&(l.setAttribute("fill",t.fillColor),l.setAttribute("fill-opacity","1"));const f=l.closest(".svg-canvas").querySelector("svg").outerHTML;r("update:modelValue",f)}}return(a,l)=>(Q.openBlock(),Q.createElementBlock("div",{class:Q.normalizeClass(["svg-canvas",`${A.scale>1?"overflow-scroll":""}`])},[Q.createElementVNode("div",{ref_key:"svg",ref:n,class:"svg-wrapper",innerHTML:A.modelValue,style:Q.normalizeStyle({transform:`scale(${A.scale})`}),onClick:l[0]||(l[0]=c=>s(c))},null,12,Fz)],2))}}),Iz={class:"svg-editor"},Uz={class:"svg-editor__frame"},Tz=Q.defineComponent({__name:"color-booth",props:{modelValue:String,name:String,src:String,required:Boolean,colors:Array,groupedFill:Boolean},emits:["update:modelValue"],setup(A,{emit:e}){const t=A,r=e,n=Q.ref(""),s=Q.ref(1),a=Q.computed({get(){return t.modelValue},set(l){r("update:modelValue",l)}});return Q.onBeforeMount(()=>{n.value=t.colors?.length?t.colors[0]:""}),(l,c)=>(Q.openBlock(),Q.createElementBlock("div",Iz,[Q.createElementVNode("div",Uz,[Q.createVNode(Q.unref(Qj),{modelValue:s.value,"onUpdate:modelValue":c[1]||(c[1]=h=>s.value=h)},{default:Q.withCtx(()=>[Q.createVNode(Sz,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=h=>a.value=h),fillColor:n.value,scale:s.value,"grouped-fill":A.groupedFill},null,8,["modelValue","fillColor","scale","grouped-fill"])]),_:1},8,["modelValue"]),Q.createVNode(Q.unref(iR),{modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=h=>n.value=h),colors:A.colors,class:"mt-2"},null,8,["modelValue","colors"])])]))}});Vn.ColorBooth=Tz,Vn.CreativeBooth=yz,Vn.FabricCanvas=pz,Vn.FaceSwap=Qz,Vn.PhotoApp=h$,Object.defineProperty(Vn,Symbol.toStringTag,{value:"Module"})}));
|