@tsocial/tvweb-sdk
Version:
TV Web SDK - The Standalone SDK
257 lines (247 loc) • 22.5 kB
JavaScript
import{aL as e,w as i,aM as r,aN as t,aO as o,e as s,n as n,ai as a,aj as l,aP as d,af as c,aQ as g,Y as f,r as u,H as h,P as p,z as m,s as _,V as b,j as w,o as v,v as k,B as R,b as y,aR as S}from"./chunk-554942c8.js";import{r as C,f as x,g as $,h as j,i as W,j as O,k as I,l as E,n as A,o as D,p as T}from"./chunk-306b4e50.js";var P,L,V,z,M,B,F,N,H,U,q,K,J,Y,Z,G,Q,X,ee,ei,er,et,eo,es,en,ea,el,ed,ec,eg,ef,eu,eh,ep,em=Object.freeze({__proto__:null,blink:e,flipY:i,slide:r,spin:t,splash:o});let e_=({curStep:e,faceDirection:i})=>{let r=n(e,"stepTimeConstraints.delayTime");return!!r&&(null===e.firstFrameSpottedAt?(e.name===i&&(e.firstFrameSpottedAt=new Date().getTime()),!0):!!(new Date().getTime()-e.firstFrameSpottedAt<r)||!1)},eb=(e,i)=>({radius:e.radius??s("Selfie.progressCircle.radius")({theme:i}),strokeWidth:e.strokeWidth??s("Selfie.progressCircle.strokeWidth")({theme:i}),progress:e.progress??s("Selfie.progressCircle.progress")({theme:i}),showErrorRing:e.showErrorRing??s("Selfie.progressCircle.showErrorRing")({theme:i}),activeColor:e.activeColor??s("Selfie.progressCircle.activeColor")({theme:i}),innerPadding:e.innerPadding??s("Selfie.progressCircle.innerPadding")({theme:i}),outsideRingColor:e.outsideRingColor??s("Selfie.progressCircle.outsideRingColor")({theme:i}),outsideRingOpacity:e.outsideRingOpacity??s("Selfie.progressCircle.outsideRingOpacity")({theme:i}),insideRingColor:e.insideRingColor??s("Selfie.progressCircle.insideRingColor")({theme:i}),insideRingWidth:e.insideRingWidth??s("Selfie.progressCircle.insideRingWidth")({theme:i}),insideRingStrokeDash:e.insideRingStrokeDash??s("Selfie.progressCircle.insideRingStrokeDash")({theme:i}),errorRingWidth:e.errorRingWidth??s("Selfie.progressCircle.errorRingWidth")({theme:i}),errorRingColor:e.errorRingColor??s("Selfie.progressCircle.errorRingColor")({theme:i}),dashedRingColor:e.dashedRingColor??s("Selfie.progressCircle.dashedRingColor")({theme:i}),dashedRingOpacity:e.dashedRingOpacity??s("Selfie.progressCircle.dashedRingOpacity")({theme:i}),dashedRingWidth:e.dashedRingWidth??s("Selfie.progressCircle.dashedRingWidth")({theme:i}),dashedRingLineThick:e.dashedRingLineThick??s("Selfie.progressCircle.dashedRingLineThick")({theme:i}),dashedRingLineSpacing:e.dashedRingLineSpacing??s("Selfie.progressCircle.dashedRingLineSpacing")({theme:i}),dashedInsideRingColor:e.dashedInsideRingColor??s("Selfie.progressCircle.dashedInsideRingColor")({theme:i}),dashedInsideRingWidth:e.dashedInsideRingWidth??s("Selfie.progressCircle.dashedInsideRingWidth")({theme:i}),showOutsideRing:e.showOutsideRing??s("Selfie.progressCircle.showOutsideRing")({theme:i}),showInsideRing:e.showInsideRing??s("Selfie.progressCircle.showInsideRing")({theme:i}),showDashedRing:e.showDashedRing??s("Selfie.progressCircle.showDashedRing")({theme:i})}),ew=(e,i)=>({radius:e.radius??s("Selfie.progressCircleV2.radius")({theme:i}),strokeWidth:e.strokeWidth??s("Selfie.progressCircleV2.strokeWidth")({theme:i}),progress:e.progress??s("Selfie.progressCircleV2.progress")({theme:i}),activeColor:e.activeColor??s("Selfie.progressCircleV2.activeColor")({theme:i}),neutralColor:e.neutralColor??s("Selfie.progressCircleV2.neutralColor")({theme:i}),errorColor:e.errorColor??s("Selfie.progressCircleV2.errorColor")({theme:i}),tickWidth:e.tickWidth??s("Selfie.progressCircleV2.tickWidth")({theme:i}),numberOfTicks:e.numberOfTicks??s("Selfie.progressCircleV2.numberOfTicks")({theme:i})}),ev=({incomingFrame:e,currentBestFrame:i})=>e?.isEyeClosed&&!i?.isEyeClosed?i:!e?.isEyeClosed&&i?.isEyeClosed?e:e?.blurScore>i?.blurScore?e:i;function ek(e){return new Promise(i=>{let r=new Image;r.onload=i,r.onerror=i,r.src=e})}function eR(){if(z)return V;z=1;var e=a(),i=l(),r=j();return V=function(t){if(!i(t))return!1;var o=e(t);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof t.message&&"string"==typeof t.name&&!r(t)}}function ey(){return ei?ee:(ei=1,ee=/<%=([\s\S]+?)%>/g)}var eS=f(function(){if(ep)return eh;ep=1;var e=function(){if(L)return P;L=1;var e=C(),i=x(),r=$();return P=i(function(i,t,o,s){e(t,r(t),i,s)})}(),i=function(){if(B)return M;B=1;var e=O(),i=W(),r=eR();return M=i(function(i,t){try{return e(i,void 0,t)}catch(e){return r(e)?e:Error(e)}})}(),r=function(){if(N)return F;N=1;var e=d();return F=function(i,r){return e(r,function(e){return i[e]})}}(),t=function(){if(U)return H;U=1;var e=c(),i=Object.prototype,r=i.hasOwnProperty;return H=function(t,o,s,n){return void 0===t||e(t,i[s])&&!r.call(n,s)?o:t}}(),o=function(){if(K)return q;K=1;var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return q=function(i){return"\\"+e[i]}}(),s=eR(),n=T(),a=function(){if(X)return Q;X=1;var e=A(),i=function(){if(G)return Z;G=1;var e=E(),i=Y?J:(Y=1,J=I()(Object.keys,Object)),r=Object.prototype.hasOwnProperty;return Z=function(t){if(!e(t))return i(t);var o=[];for(var s in Object(t))r.call(t,s)&&"constructor"!=s&&o.push(s);return o}}(),r=D();return Q=function(t){return r(t)?e(t):i(t)}}(),l=ey(),f=function(){if(eu)return ef;eu=1;var e=function(){if(ea)return en;ea=1;var e=function(){if(es)return eo;es=1;var e=et?er:(et=1,er=function(e){return function(i){return null==e?void 0:e[i]}});return eo=e({"&":"&","<":"<",">":">",'"':""","'":"'"})}(),i=g(),r=/[&<>"']/g,t=RegExp(r.source);return en=function(o){return(o=i(o))&&t.test(o)?o.replace(r,e):o}}(),i=ed?el:(ed=1,el=/<%-([\s\S]+?)%>/g),r=eg?ec:(eg=1,ec=/<%([\s\S]+?)%>/g),t=ey();return ef={escape:i,evaluate:r,interpolate:t,variable:"",imports:{_:{escape:e}}}}(),u=g(),h=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,m=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_=/[()=,{}\[\]\/\s]/,b=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,v=/['\n\r\u2028\u2029\\]/g,k=Object.prototype.hasOwnProperty;return eh=function(d,c,g){var R=f.imports._.templateSettings||f;g&&n(d,c,g)&&(c=void 0),d=u(d),c=e({},c,R,t);var y=e({},c.imports,R.imports,t),S=a(y),C=r(y,S),x,$,j=0,W=c.interpolate||w,O="__p += '",I=RegExp((c.escape||w).source+"|"+W.source+"|"+(W===l?b:w).source+"|"+(c.evaluate||w).source+"|$","g"),E=k.call(c,"sourceURL")?"//# sourceURL="+(c.sourceURL+"").replace(/\s/g," ")+"\n":"";d.replace(I,function(e,i,r,t,s,n){return r||(r=t),O+=d.slice(j,n).replace(v,o),i&&(x=!0,O+="' +\n__e("+i+") +\n'"),s&&($=!0,O+="';\n"+s+";\n__p += '"),r&&(O+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),j=n+e.length,e}),O+="';\n";var A=k.call(c,"variable")&&c.variable;if(A){if(_.test(A))throw Error("Invalid `variable` option passed into `_.template`")}else O="with (obj) {\n"+O+"\n}\n";O=($?O.replace(h,""):O).replace(p,"$1").replace(m,"$1;"),O="function("+(A||"obj")+") {\n"+(A?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(x?", __e = _.escape":"")+($?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+O+"return __p\n}";var D=i(function(){return Function(S,E+"return "+O).apply(void 0,C)});if(D.source=O,s(D))throw D;return D}}());let eC=[],ex=()=>{eC=[]},e$=(e,i,r,t)=>{t&&ex(),eC.push({id:null});let o=eC.length-1;if(e&&e.key){let t=new Blob([JSON.stringify(i)]);r.uploadFile({file:t,metadata:JSON.stringify({type:"selfie"}),label:"video"},{"X-TV-Key":e.key}).then(e=>{e&&e.data&&e.data.file_id?eC[o].id=e.data.file_id:eC[o].id=-1})}else{let e=new Blob([JSON.stringify(i)]);r.uploadFile({file:e,metadata:JSON.stringify({type:"selfie"}),label:"video"}).then(e=>{e&&e.data&&e.data.file_id?eC[o].id=e.data.file_id:eC[o].id=-1})}},ej=()=>new Promise(e=>{let i=setInterval(()=>{eC.every(e=>e.id)&&(e(),clearInterval(i))},200)}),eW=e=>e.enable?eC.some(e=>-1===e.id)?null:eC:[],eO=[],eI=null,eE=!1,eA=()=>eO,eD=()=>{eE=!0,eO=[];try{eI instanceof MediaStream&&(eI.getTracks().forEach(e=>e.stop()),eI=null)}catch(e){}};async function eT({outputImagesSize:e,videoEl:i,resultAnalyzeVideoAndWindowSizes:r}){let t;eD();let o=document.createElement("canvas");o.width=e,o.height=e;let s=o.getContext("2d");try{let n={mimeType:"video/webm"};try{let e=(eI=i?.captureStream()?.clone()).getVideoTracks()[0];await e.applyConstraints({width:{min:360,ideal:400},height:{min:360,ideal:400}})}catch(e){}MediaRecorder.isTypeSupported("video/mp4")&&(eE=!1,!function e(i,r,t,o){if(!i||!o)return;let{cropX:s,cropY:n,cropWidth:a,cropHeight:l}=o;i.drawImage(r,s,n,a,l,0,0,t,t),eE||requestAnimationFrame(()=>e(i,r,t,o))}(s,i,e,r),eI=o.captureStream(25),n={mimeType:"video/mp4",videoBitsPerSecond:25e5}),t=new MediaRecorder(eI,n);let a=async()=>{await new Promise((e,i)=>{t.ondataavailable=r=>(function(e,i,r){if(e.data.size>0){let r=new Blob([e.data],{type:"video/mp4"});eO.push(r),i()}else console.error("No video have recored!"),r()})(r,e,i),"inactive"!==t.state&&t.stop()})};t.stopVideoRecording=a,t.discardRecording=()=>{"inactive"!==t.state&&t.stop()}}catch(e){}return{mediaRecorder:t}}let eP={data:{settings:{sdk_settings:{passive_liveness_settings:{auto_capture:{enable:!0,show_capture_button:!0,show_countdown:!0,wait_for_best_image_time_ms_web:3e3},manual_capture:{show_countdown:!0,wait_for_best_image_time_ms_web:3e3},blur_check:{enable:!0,web_blurry_threshold:.4},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5,force_check:!1},web_is_required_frontal_face:!0},active_liveness_settings:{reset_flow_on_orientation_change:!0,wait_before_start_flow_ms:2e3,face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45,remain_time_show:10,format:"s",max_retry_count:0,non_stoppable:!1},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5,force_check:!1},exif_data_settings:{enable:!0},record_video:{enable:!1},save_encoded_frames:{enable:!1,enable_logging:!1,frames_batch_len:0,frames_interval_ms:180,quality_android:90,quality_ios:80},auto_gen_frame_ids:{enable:!1,max_items:50}}}}}},eL=30,eV=e=>{let{shouldStart:i,totalTime:r,totalDelayBetweenReset:t,interruptible:o=!0,onReset:s,onTick:n,onTimesUp:a}=e,l=u.useRef(new h({totalTime:r,totalDelayBetweenReset:t,interruptible:o}));return u.useEffect(()=>l.current.on("tick",({remainTime:e})=>{n({remainTime:e})}),[n]),u.useEffect(()=>l.current.on("delaystart",()=>{a()}),[a]),u.useEffect(()=>l.current.on("reset",({attemptCount:e,fromBackground:i})=>{s({attemptCount:e,fromBackground:i})}),[s]),u.useEffect(()=>i?l.current.start():()=>{},[i]),{stopTimer:u.useCallback(()=>{l.current.stop()},[])}},{ErrorDuration:ez}=_;function eM({children:e,errorMsg:i,className:r}){return b.isValidElement(e)?i?w.jsx("div",{className:r,children:b.cloneElement(e,{errorMsg:i})}):null:i?w.jsx("div",{className:r,children:i}):null}function eB({children:e,className:i,error:r}){let t=u.useRef(0),o=u.useRef(""),s=m(),n=u.useRef(ez.SHORT),{code:a,duration:l=ez.SHORT}=r||{},d=s(a);return Date.now()-t.current>=n.current?(t.current=Date.now(),n.current=l,o.current=d,eM({children:e,errorMsg:d,className:i})):eM({children:e,errorMsg:o.current,className:i})}eB.propTypes={children:p.node,className:p.string},eB.defaultProps={className:""};let eF=v.g`
transition: stroke-dashoffset 0.4s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
`,eN=v.circle`
transition: stroke-dashoffset 0.4s, stroke 0.4s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
fill: none;
`,eH=v.circle`
transition: stroke-dashoffset 0.4s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
`;function eU({className:e,style:i,radius:r,strokeWidth:t,progress:o,showErrorRing:s,activeColor:n,innerPadding:a,outsideRingColor:l,outsideRingOpacity:d,insideRingColor:c,insideRingWidth:g,insideRingStrokeDash:f,errorRingWidth:u,errorRingColor:h,dashedRingColor:p,dashedRingOpacity:m,dashedRingWidth:_,dashedRingLineThick:b,dashedRingLineSpacing:v,dashedInsideRingColor:k,dashedInsideRingWidth:R,showOutsideRing:y,showInsideRing:S,showDashedRing:C}){let x=2*r,$=2*r,j=r-2*t,W=2*Math.PI*j,O=j-_/2-t/2-a,I=2*Math.PI*O,E=O-R/2-_/2,A=2*Math.PI*E,D=E-g/2-R/2,T=E-u/2-R/2;return w.jsxs("svg",{className:e,style:i,width:x,height:$,viewBox:`0 0 ${x} ${$}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[y?w.jsxs(w.Fragment,{children:[w.jsx("circle",{"data-testid":"outsideRing",opacity:d,cx:r,cy:r,r:j,stroke:l}),w.jsx(eH,{"data-testid":"outsideAnimateRing",cx:r,cy:r,r:j,stroke:n,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${W} ${W}`,style:{strokeDashoffset:W-o/100*W}})]}):null,C?w.jsxs(w.Fragment,{children:[w.jsx("circle",{"data-testid":"dashedRing",opacity:m,cx:r,cy:r,r:O,stroke:p,strokeWidth:_,strokeDasharray:`${b} ${v}`}),w.jsx("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",children:w.jsx("circle",{cx:r,cy:r,r:O,stroke:n,strokeWidth:_,strokeDasharray:`${b} ${v}`})}),w.jsx("g",{mask:"url(#mask0)",children:w.jsx(eH,{"data-testid":"dashedAnimateRing",cx:r,cy:r,r:O,stroke:n,strokeWidth:_,strokeDasharray:`${I} ${I}`,style:{strokeDashoffset:I-o/100*I}})}),w.jsx("circle",{"data-testid":"dashedInsideRing",opacity:m,cx:r,cy:r,r:E,stroke:k,strokeWidth:R}),w.jsx(eH,{"data-testid":"dashedInsideAnimateRing",cx:r,cy:r,r:E,stroke:n,strokeWidth:R,strokeLinecap:"round",strokeDasharray:`${A} ${A}`,style:{strokeDashoffset:A-o/100*A}})]}):null,S?w.jsx("circle",{"data-testid":"insideRing",strokeDasharray:f,cx:r,cy:r,r:D,stroke:c,strokeWidth:g}):null,s?w.jsx("circle",{"data-testid":"errorRing",strokeDasharray:f,cx:r,cy:r,r:T,stroke:h,strokeWidth:u}):null]})}eU.propTypes={className:p.string,style:p.shape({}),radius:p.number,strokeWidth:p.number,progress:p.number,showErrorRing:p.bool,activeColor:p.string,innerPadding:p.number,outsideRingColor:p.string,outsideRingOpacity:p.number,insideRingColor:p.string,insideRingWidth:p.number,insideRingStrokeDash:p.string,errorRingColor:p.string,errorRingWidth:p.number,dashedRingColor:p.string,dashedRingOpacity:p.number,dashedRingWidth:p.number,dashedRingLineThick:p.number,dashedRingLineSpacing:p.number,dashedInsideRingColor:p.string,dashedInsideRingWidth:p.number,showOutsideRing:p.bool,showDashedRing:p.bool,showInsideRing:p.bool},eU.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,showErrorRing:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0};let{blink:eq,slide:eK,spin:eJ}=em,eY=k`
z-index: ${R+20};
color: #ffffff;
`,eZ=v.div`
${eY}
`,eG=k`
${eY}
${({top:e})=>e&&k`
top: ${e}px;
`}
${({bottom:e})=>e&&k`
bottom: ${e}px;
`}
${({centerY:e})=>e&&k`
top: 50%;
transform: translateY(-50%);
`}
font-size: ${s("Selfie.error.fontSize")};
font-weight: ${s("Selfie.error.fontWeight")};
background: ${s("Selfie.error.backgroundColor")};
color: ${s("Selfie.error.color")};
padding: ${s("Selfie.error.padding")};
border-radius: ${s("Selfie.error.borderRadius")};
position: absolute;
white-space: pre-wrap;
text-align: center;
max-width: 80%;
`;v(eB)`
${eG}
`;let eQ=v.div`
${eG}
`,eX=v.div`
z-index: ${R+20};
display: flex;
align-items: center;
position: absolute;
left: 50%;
transform: translate(-50%, 0);
${({top:e})=>e&&k`
top: ${e}px;
`}
`,e0=v(eZ)`
font-size: ${s("Selfie.countdown.fontSize")};
font-weight: ${s("Selfie.countdown.fontWeight")};
background: ${s("Selfie.countdown.backgroundColor")};
color: ${s("Selfie.countdown.color")};
padding: ${s("Selfie.countdown.padding")};
border-radius: ${s("Selfie.countdown.borderRadius")};
white-space: nowrap;
`,e1=v(e0)`
position: absolute;
left: 50%;
transform: translate(-50%, 0);
${({top:e})=>e&&k`
top: ${e}px;
`}
`,e2=v(eZ)`
position: absolute;
${({top:e})=>e&&k`
top: ${e}px;
`}
${({bottom:e})=>e&&k`
bottom: ${e}px;
`}
color: ${s("Selfie.Active.instruction.color")};
font-size: ${s("Selfie.Active.instruction.fontSize")};
font-weight: ${s("Selfie.Active.instruction.fontWeight")};
text-shadow: ${s("Selfie.Active.instruction.textShadow")};
background-color: ${s("Selfie.Active.instruction.backgroundColor")};
border: ${s("Selfie.Active.instruction.border")};
border-radius: ${s("Selfie.Active.instruction.borderRadius")};
`,e3=v.div`
height: ${()=>y.isMobile?"50px":"70px"};
position: absolute;
${({top:e})=>e&&k`
top: ${e}px;
`}
${({bottom:e})=>e&&k`
bottom: ${e}px;
`}
width: 100%;
display: flex;
justify-content: center;
align-items: center;
z-index: ${R+20};
`,e5=v.div`
width: ${s("Selfie.Active.imageHolder.width")};
height: ${s("Selfie.Active.imageHolder.height")};
border-radius: ${s("Selfie.Active.imageHolder.borderRadius")};
font-size: ${s("Selfie.Active.imageHolder.fontSize")};
color: ${s("Selfie.Active.imageHolder.color")};
font-weight: ${s("Selfie.Active.imageHolder.fontWeight")};
${({theme:e})=>"v2"===n(e,"themeVersion")?"border: unset;":`border: ${s("Selfie.Active.imageHolder.border")({theme:e})};`}
display: flex;
justify-content: center;
align-items: center;
& + & {
margin-left: 10px;
}
${e=>e.active?k`
img:not(.image_preview) {
border: ${s("Selfie.Active.imageHolder.activeStepBorder")};
border-radius: ${s("Selfie.Active.imageHolder.activeStepBorderRadius")};
}
`:k`
opacity: 0.3;
`}
img {
width: 100%;
margin: 0;
border-radius: ${s("Selfie.Active.imageHolder.borderRadius")};
}
img.image_preview {
border: ${s("Selfie.Active.imageHolder.border")};
}
`,e4=v.div`
color: #ffffff;
height: 70px;
position: absolute;
bottom: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
z-index: ${R+20};
`,e8=v.div`
${({disabled:e})=>e?k`
pointer-events: none;
`:k`
cursor: pointer;
`}
text-align: center;
img {
width: ${s("Selfie.captureIcon.width")};
}
`,e6=v.div`
position: absolute;
width: 100%;
top: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
font-size: 140px;
opacity: 0.6;
`,e9=v.div`
position: absolute;
width: 100%;
top: 0;
bottom: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
${eK.default};
${eq.default};
`,e7=v(eU)`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
`,ie=v(({className:e="",radius:i=80,neutralColor:r="#CBD5E1",activeColor:t="#0276F1",errorColor:o="#E84848",strokeWidth:s=2,tickWidth:n=15,numberOfTicks:a=200,progress:l=0,showErrorRing:d=!1})=>{let c=2*i,g=i-5,f=2*Math.PI*g,u=Array.from({length:a}).map((e,r)=>{let t=360*r/a+3;return w.jsx("use",{href:"#tick",transform:`rotate(${t} ${i} ${i})`},r)}),h=i-eL,p=2*Math.PI*h;return w.jsxs("svg",{height:c,width:c,viewBox:`0 0 ${c} ${c}`,className:e,xmlns:"http://www.w3.org/2000/svg",children:[d?w.jsx("circle",{cx:i,cy:i,r:i-eL,stroke:o,strokeWidth:s,fill:"none"}):w.jsxs(w.Fragment,{children:[w.jsx("circle",{cx:i,cy:i,r:h,stroke:r,strokeWidth:s,fill:"none"}),w.jsx(eN,{cx:i,cy:i,r:h,stroke:t,strokeWidth:s,strokeLinecap:"round",strokeDasharray:`${p} ${p}`,style:{strokeDashoffset:p-l/100*p}})]}),w.jsx("defs",{children:w.jsx("line",{id:"tick",x1:i,y1:"0",x2:i,y2:n,stroke:r,strokeWidth:s,strokeLinecap:"round"})}),w.jsx("g",{id:"border-segments",children:u}),w.jsx("mask",{id:"tickMask",maskUnits:"userSpaceOnUse",children:w.jsx("g",{id:"tick-mask-segments",children:u})}),w.jsx("g",{mask:"url(#tickMask)",children:w.jsx(eF,{strokeDasharray:`${f} ${f}`,style:{strokeDashoffset:f-l/100*f},children:w.jsx("circle",{cx:i,cy:i,r:g,stroke:t,strokeWidth:20,fill:"none"})})})]})})`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
`,ii=v(function({className:e=""}){return w.jsx("svg",{className:e,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"})})})`
width: 100%;
height: 100%;
vertical-align: middle;
margin: 0;
color: ${s("Selfie.backgroundColor")};
`,ir=v(function({className:e="",radius:i=160,backgroundColor:r="#fff",padding:t=0}){let o=2*i;return w.jsxs("svg",{className:e,width:o,height:o,viewBox:`0 0 ${o} ${o}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[w.jsxs("mask",{id:"CIRCLE_MASK",children:[w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#CIRCLE_MASK)"}),w.jsx("circle",{cx:i,cy:i,r:i-t,fill:"black"})]}),w.jsx("circle",{cx:i,cy:i,r:i,fill:"none"}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:r,mask:"url(#CIRCLE_MASK)"})]})})`
width: 100%;
height: 100%;
vertical-align: middle;
margin: 0;
color: ${s("Selfie.backgroundColor")};
`,it=v.div`
position: absolute;
z-index: -1;
background: rgba(223, 0, 0, 0.2);
border-radius: 50%;
width: 86%;
height: 86%;
top: 7%;
left: 7%;
`,io=S`
from {
opacity: 1;
}
to {
opacity: 0;
}
`,is=v.div`
position: absolute;
width: 100%;
top: 0;
bottom: 0;
z-index: -1;
background: rgba(255, 255, 255, 0.3);
animation: ${io} 1s infinite;
border-radius: 50%;
`,ia=v.div`
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
margin: auto;
width: ${s("Selfie.loadingIcon.width")};
height: ${s("Selfie.loadingIcon.height")};
img {
width: 100%;
}
z-index: ${R+20};
${eJ.default}
`,il=v.div`
text-align: center;
color: ${s("Selfie.title.color")};
font-size: ${s("Selfie.title.fontSize")};
font-weight: ${s("Selfie.title.fontWeight")};
background-color: ${s("Selfie.title.backgroundColor")};
position: absolute;
top: ${e=>e.y};
z-index: ${R+10};
display: flex;
align-items: center;
justify-content: center;
width: 100%;
`;export{eL as A,e4 as B,e6 as C,it as E,e2 as F,e9 as I,ia as L,e7 as O,eQ as S,il as T,ii as a,e1 as b,e8 as c,ew as d,ir as e,ie as f,eb as g,is as h,e3 as i,e5 as j,eX as k,e0 as l,eW as m,eP as n,e$ as o,ek as p,eA as q,eD as r,ex as s,eS as t,eV as u,eT as v,ej as w,e_ as x,ev as y};