@tsocial/tvweb-sdk.platform 5.38.2 → 5.38.3

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.
Files changed (40) hide show
  1. package/build/esm/{chunk-7618f5a4.js → chunk-01c3fea1.js} +1 -1
  2. package/build/esm/chunk-2da8af58.js +1 -0
  3. package/build/esm/{chunk-3aa490f8.js → chunk-3a5e2fb7.js} +32 -32
  4. package/build/esm/chunk-443bbdef.js +1 -0
  5. package/build/esm/chunk-4c589d01.js +1 -0
  6. package/build/esm/{chunk-30dc9915.js → chunk-6000df97.js} +1 -1
  7. package/build/esm/chunk-62203103.js +1 -0
  8. package/build/esm/chunk-6c419352.js +1 -0
  9. package/build/esm/{chunk-da8ef78b.js → chunk-7b148a15.js} +5 -5
  10. package/build/esm/{chunk-48199d95.js → chunk-7fd5f30f.js} +2 -2
  11. package/build/esm/chunk-83b4e661.js +256 -0
  12. package/build/esm/{chunk-7fa83a52.js → chunk-85c7fccc.js} +1 -1
  13. package/build/esm/chunk-973e0c2c.js +1195 -0
  14. package/build/esm/{chunk-036bae4b.js → chunk-9a57dffd.js} +1 -1
  15. package/build/esm/{chunk-2118775a.js → chunk-cb78319b.js} +2 -2
  16. package/build/esm/chunk-df1a18df.js +1 -0
  17. package/build/esm/chunk-e6f33641.js +1 -0
  18. package/build/esm/chunk-ea488e70.js +1 -0
  19. package/build/esm/chunk-ec455fe3.js +3 -0
  20. package/build/esm/chunk-fc1ca1ea.js +1 -0
  21. package/build/esm/tvweb-sdk.platform.esm.min.js +1 -1
  22. package/build/tvweb-sdk.platform.cjs.min.js +651 -695
  23. package/build/tvweb-sdk.platform.standalone.js +5996 -7690
  24. package/build/tvweb-sdk.platform.standalone.min.js +651 -695
  25. package/build/types/index.d.ts +1 -9
  26. package/package.json +5 -5
  27. package/build/esm/chunk-0319b1ae.js +0 -45
  28. package/build/esm/chunk-2b4d00a3.js +0 -3
  29. package/build/esm/chunk-3b109c2f.js +0 -1
  30. package/build/esm/chunk-409b3310.js +0 -1
  31. package/build/esm/chunk-51b3fd2d.js +0 -1
  32. package/build/esm/chunk-6e5358d6.js +0 -1
  33. package/build/esm/chunk-71508ce2.js +0 -1
  34. package/build/esm/chunk-71ff4107.js +0 -1
  35. package/build/esm/chunk-88ec0901.js +0 -256
  36. package/build/esm/chunk-91b54c2c.js +0 -1
  37. package/build/esm/chunk-c747321c.js +0 -1195
  38. package/build/esm/chunk-d7bc8179.js +0 -1
  39. package/build/esm/chunk-ddb14dfb.js +0 -1
  40. package/build/esm/chunk-e5a92416.js +0 -1
@@ -1,256 +0,0 @@
1
- import{aM as e,z as i,aN as r,aO as t,aP as s,m as o,b as n,r as a,K as l,P as d,D as c,s as g,Y as h,j as f,i as u,y as p,B as m,k as w,aQ as k}from"./chunk-c747321c.js";var b=Object.freeze({__proto__:null,blink:e,flipY:i,slide:r,spin:t,splash:s});let R=({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)},S=(e,i)=>({radius:e.radius??o("Selfie.progressCircle.radius")({theme:i}),strokeWidth:e.strokeWidth??o("Selfie.progressCircle.strokeWidth")({theme:i}),progress:e.progress??o("Selfie.progressCircle.progress")({theme:i}),showErrorRing:e.showErrorRing??o("Selfie.progressCircle.showErrorRing")({theme:i}),activeColor:e.activeColor??o("Selfie.progressCircle.activeColor")({theme:i}),innerPadding:e.innerPadding??o("Selfie.progressCircle.innerPadding")({theme:i}),outsideRingColor:e.outsideRingColor??o("Selfie.progressCircle.outsideRingColor")({theme:i}),outsideRingOpacity:e.outsideRingOpacity??o("Selfie.progressCircle.outsideRingOpacity")({theme:i}),insideRingColor:e.insideRingColor??o("Selfie.progressCircle.insideRingColor")({theme:i}),insideRingWidth:e.insideRingWidth??o("Selfie.progressCircle.insideRingWidth")({theme:i}),insideRingStrokeDash:e.insideRingStrokeDash??o("Selfie.progressCircle.insideRingStrokeDash")({theme:i}),errorRingWidth:e.errorRingWidth??o("Selfie.progressCircle.errorRingWidth")({theme:i}),errorRingColor:e.errorRingColor??o("Selfie.progressCircle.errorRingColor")({theme:i}),dashedRingColor:e.dashedRingColor??o("Selfie.progressCircle.dashedRingColor")({theme:i}),dashedRingOpacity:e.dashedRingOpacity??o("Selfie.progressCircle.dashedRingOpacity")({theme:i}),dashedRingWidth:e.dashedRingWidth??o("Selfie.progressCircle.dashedRingWidth")({theme:i}),dashedRingLineThick:e.dashedRingLineThick??o("Selfie.progressCircle.dashedRingLineThick")({theme:i}),dashedRingLineSpacing:e.dashedRingLineSpacing??o("Selfie.progressCircle.dashedRingLineSpacing")({theme:i}),dashedInsideRingColor:e.dashedInsideRingColor??o("Selfie.progressCircle.dashedInsideRingColor")({theme:i}),dashedInsideRingWidth:e.dashedInsideRingWidth??o("Selfie.progressCircle.dashedInsideRingWidth")({theme:i}),showOutsideRing:e.showOutsideRing??o("Selfie.progressCircle.showOutsideRing")({theme:i}),showInsideRing:e.showInsideRing??o("Selfie.progressCircle.showInsideRing")({theme:i}),showDashedRing:e.showDashedRing??o("Selfie.progressCircle.showDashedRing")({theme:i})}),_=(e,i)=>({radius:e.radius??o("Selfie.progressCircleV2.radius")({theme:i}),strokeWidth:e.strokeWidth??o("Selfie.progressCircleV2.strokeWidth")({theme:i}),progress:e.progress??o("Selfie.progressCircleV2.progress")({theme:i}),activeColor:e.activeColor??o("Selfie.progressCircleV2.activeColor")({theme:i}),neutralColor:e.neutralColor??o("Selfie.progressCircleV2.neutralColor")({theme:i}),errorColor:e.errorColor??o("Selfie.progressCircleV2.errorColor")({theme:i}),tickWidth:e.tickWidth??o("Selfie.progressCircleV2.tickWidth")({theme:i}),numberOfTicks:e.numberOfTicks??o("Selfie.progressCircleV2.numberOfTicks")({theme:i})}),y=({incomingFrame:e,currentBestFrame:i})=>e?.isEyeClosed&&!i?.isEyeClosed?i:!e?.isEyeClosed&&i?.isEyeClosed?e:e?.blurScore>i?.blurScore?e:i;function C(e){return new Promise(i=>{let r=new Image;r.onload=i,r.onerror=i,r.src=e})}let x=[],v=()=>{x=[]},$=(e,i,r,t)=>{t&&v(),x.push({id:null});let s=x.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?x[s].id=e.data.file_id:x[s].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?x[s].id=e.data.file_id:x[s].id=-1})}},W=()=>new Promise(e=>{let i=setInterval(()=>{x.every(e=>e.id)&&(e(),clearInterval(i))},200)}),j=e=>e.enable?x.some(e=>-1===e.id)?null:x:[],I=[],O=null,D=!1,A=()=>I,T=()=>{D=!0,I=[];try{O instanceof MediaStream&&(O.getTracks().forEach(e=>e.stop()),O=null)}catch(e){}};async function E({outputImagesSize:e,videoEl:i,resultAnalyzeVideoAndWindowSizes:r}){let t;T();let s=document.createElement("canvas");s.width=e,s.height=e;let o=s.getContext("2d");try{let n={mimeType:"video/webm"};try{let e=(O=i?.captureStream()?.clone()).getVideoTracks()[0];await e.applyConstraints({width:{min:360,ideal:400},height:{min:360,ideal:400}})}catch(e){}MediaRecorder.isTypeSupported("video/mp4")&&(D=!1,!function e(i,r,t,s){if(!i||!s)return;let{cropX:o,cropY:n,cropWidth:a,cropHeight:l}=s;i.drawImage(r,o,n,a,l,0,0,t,t),D||requestAnimationFrame(()=>e(i,r,t,s))}(o,i,e,r),O=s.captureStream(25),n={mimeType:"video/mp4",videoBitsPerSecond:25e5}),t=new MediaRecorder(O,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"});I.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 P={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}}}}}},V=30,L=e=>{let{shouldStart:i,totalTime:r,totalDelayBetweenReset:t,interruptible:s=!0,onReset:o,onTick:n,onTimesUp:d}=e,c=a.useRef(new l({totalTime:r,totalDelayBetweenReset:t,interruptible:s}));return a.useEffect(()=>c.current.on("tick",({remainTime:e})=>{n({remainTime:e})}),[n]),a.useEffect(()=>c.current.on("delaystart",()=>{d()}),[d]),a.useEffect(()=>c.current.on("reset",({attemptCount:e,fromBackground:i})=>{o({attemptCount:e,fromBackground:i})}),[o]),a.useEffect(()=>i?c.current.start():()=>{},[i]),{stopTimer:a.useCallback(()=>{c.current.stop()},[])}},{ErrorDuration:z}=g;function M({children:e,errorMsg:i,className:r}){return h.isValidElement(e)?i?f.jsx("div",{className:r,children:h.cloneElement(e,{errorMsg:i})}):null:i?f.jsx("div",{className:r,children:i}):null}function B({children:e,className:i,error:r}){let t=a.useRef(0),s=a.useRef(""),o=c(),n=a.useRef(z.SHORT),{code:l,duration:d=z.SHORT}=r||{},g=o(l);return Date.now()-t.current>=n.current?(t.current=Date.now(),n.current=d,s.current=g,M({children:e,errorMsg:g,className:i})):M({children:e,errorMsg:s.current,className:i})}B.propTypes={children:d.node,className:d.string},B.defaultProps={className:""};let N=u.g`
2
- transition: stroke-dashoffset 0.4s;
3
- transform: rotate(-90deg);
4
- transform-origin: 50% 50%;
5
- `,F=u.circle`
6
- transition: stroke-dashoffset 0.4s, stroke 0.4s;
7
- transform: rotate(-90deg);
8
- transform-origin: 50% 50%;
9
- fill: none;
10
- `,H=u.circle`
11
- transition: stroke-dashoffset 0.4s;
12
- transform: rotate(-90deg);
13
- transform-origin: 50% 50%;
14
- `;function K({className:e,style:i,radius:r,strokeWidth:t,progress:s,showErrorRing:o,activeColor:n,innerPadding:a,outsideRingColor:l,outsideRingOpacity:d,insideRingColor:c,insideRingWidth:g,insideRingStrokeDash:h,errorRingWidth:u,errorRingColor:p,dashedRingColor:m,dashedRingOpacity:w,dashedRingWidth:k,dashedRingLineThick:b,dashedRingLineSpacing:R,dashedInsideRingColor:S,dashedInsideRingWidth:_,showOutsideRing:y,showInsideRing:C,showDashedRing:x}){let v=2*r,$=2*r,W=r-2*t,j=2*Math.PI*W,I=W-k/2-t/2-a,O=2*Math.PI*I,D=I-_/2-k/2,A=2*Math.PI*D,T=D-g/2-_/2,E=D-u/2-_/2;return f.jsxs("svg",{className:e,style:i,width:v,height:$,viewBox:`0 0 ${v} ${$}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[y?f.jsxs(f.Fragment,{children:[f.jsx("circle",{"data-testid":"outsideRing",opacity:d,cx:r,cy:r,r:W,stroke:l}),f.jsx(H,{"data-testid":"outsideAnimateRing",cx:r,cy:r,r:W,stroke:n,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${j} ${j}`,style:{strokeDashoffset:j-s/100*j}})]}):null,x?f.jsxs(f.Fragment,{children:[f.jsx("circle",{"data-testid":"dashedRing",opacity:w,cx:r,cy:r,r:I,stroke:m,strokeWidth:k,strokeDasharray:`${b} ${R}`}),f.jsx("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",children:f.jsx("circle",{cx:r,cy:r,r:I,stroke:n,strokeWidth:k,strokeDasharray:`${b} ${R}`})}),f.jsx("g",{mask:"url(#mask0)",children:f.jsx(H,{"data-testid":"dashedAnimateRing",cx:r,cy:r,r:I,stroke:n,strokeWidth:k,strokeDasharray:`${O} ${O}`,style:{strokeDashoffset:O-s/100*O}})}),f.jsx("circle",{"data-testid":"dashedInsideRing",opacity:w,cx:r,cy:r,r:D,stroke:S,strokeWidth:_}),f.jsx(H,{"data-testid":"dashedInsideAnimateRing",cx:r,cy:r,r:D,stroke:n,strokeWidth:_,strokeLinecap:"round",strokeDasharray:`${A} ${A}`,style:{strokeDashoffset:A-s/100*A}})]}):null,C?f.jsx("circle",{"data-testid":"insideRing",strokeDasharray:h,cx:r,cy:r,r:T,stroke:c,strokeWidth:g}):null,o?f.jsx("circle",{"data-testid":"errorRing",strokeDasharray:h,cx:r,cy:r,r:E,stroke:p,strokeWidth:u}):null]})}K.propTypes={className:d.string,style:d.shape({}),radius:d.number,strokeWidth:d.number,progress:d.number,showErrorRing:d.bool,activeColor:d.string,innerPadding:d.number,outsideRingColor:d.string,outsideRingOpacity:d.number,insideRingColor:d.string,insideRingWidth:d.number,insideRingStrokeDash:d.string,errorRingColor:d.string,errorRingWidth:d.number,dashedRingColor:d.string,dashedRingOpacity:d.number,dashedRingWidth:d.number,dashedRingLineThick:d.number,dashedRingLineSpacing:d.number,dashedInsideRingColor:d.string,dashedInsideRingWidth:d.number,showOutsideRing:d.bool,showDashedRing:d.bool,showInsideRing:d.bool},K.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:U,slide:q,spin:J}=b,Y=p`
15
- z-index: ${m+20};
16
- color: #ffffff;
17
- `,Z=u.div`
18
- ${Y}
19
- `,G=p`
20
- ${Y}
21
- ${({top:e})=>e&&p`
22
- top: ${e}px;
23
- `}
24
- ${({bottom:e})=>e&&p`
25
- bottom: ${e}px;
26
- `}
27
- ${({centerY:e})=>e&&p`
28
- top: 50%;
29
- transform: translateY(-50%);
30
- `}
31
- font-size: ${o("Selfie.error.fontSize")};
32
- font-weight: ${o("Selfie.error.fontWeight")};
33
- background: ${o("Selfie.error.backgroundColor")};
34
- color: ${o("Selfie.error.color")};
35
- padding: ${o("Selfie.error.padding")};
36
- border-radius: ${o("Selfie.error.borderRadius")};
37
- position: absolute;
38
- white-space: pre-wrap;
39
- text-align: center;
40
- max-width: 80%;
41
- `;u(B)`
42
- ${G}
43
- `;let Q=u.div`
44
- ${G}
45
- `,X=u.div`
46
- z-index: ${m+20};
47
- display: flex;
48
- align-items: center;
49
- position: absolute;
50
- left: 50%;
51
- transform: translate(-50%, 0);
52
- ${({top:e})=>e&&p`
53
- top: ${e}px;
54
- `}
55
- `,ee=u(Z)`
56
- font-size: ${o("Selfie.countdown.fontSize")};
57
- font-weight: ${o("Selfie.countdown.fontWeight")};
58
- background: ${o("Selfie.countdown.backgroundColor")};
59
- color: ${o("Selfie.countdown.color")};
60
- padding: ${o("Selfie.countdown.padding")};
61
- border-radius: ${o("Selfie.countdown.borderRadius")};
62
- white-space: nowrap;
63
- `,ei=u(ee)`
64
- position: absolute;
65
- left: 50%;
66
- transform: translate(-50%, 0);
67
- ${({top:e})=>e&&p`
68
- top: ${e}px;
69
- `}
70
- `,er=u(Z)`
71
- position: absolute;
72
- ${({top:e})=>e&&p`
73
- top: ${e}px;
74
- `}
75
- ${({bottom:e})=>e&&p`
76
- bottom: ${e}px;
77
- `}
78
- color: ${o("Selfie.Active.instruction.color")};
79
- font-size: ${o("Selfie.Active.instruction.fontSize")};
80
- font-weight: ${o("Selfie.Active.instruction.fontWeight")};
81
- text-shadow: ${o("Selfie.Active.instruction.textShadow")};
82
- background-color: ${o("Selfie.Active.instruction.backgroundColor")};
83
- border: ${o("Selfie.Active.instruction.border")};
84
- border-radius: ${o("Selfie.Active.instruction.borderRadius")};
85
- `,et=u.div`
86
- height: ${()=>w.isMobile?"50px":"70px"};
87
- position: absolute;
88
- ${({top:e})=>e&&p`
89
- top: ${e}px;
90
- `}
91
- ${({bottom:e})=>e&&p`
92
- bottom: ${e}px;
93
- `}
94
- width: 100%;
95
- display: flex;
96
- justify-content: center;
97
- align-items: center;
98
- z-index: ${m+20};
99
- `,es=u.div`
100
- width: ${o("Selfie.Active.imageHolder.width")};
101
- height: ${o("Selfie.Active.imageHolder.height")};
102
- border-radius: ${o("Selfie.Active.imageHolder.borderRadius")};
103
- font-size: ${o("Selfie.Active.imageHolder.fontSize")};
104
- color: ${o("Selfie.Active.imageHolder.color")};
105
- font-weight: ${o("Selfie.Active.imageHolder.fontWeight")};
106
-
107
- ${({theme:e})=>"v2"===n(e,"themeVersion")?"border: unset;":`border: ${o("Selfie.Active.imageHolder.border")({theme:e})};`}
108
-
109
- display: flex;
110
- justify-content: center;
111
- align-items: center;
112
-
113
- & + & {
114
- margin-left: 10px;
115
- }
116
-
117
- ${e=>e.active?p`
118
- img:not(.image_preview) {
119
- border: ${o("Selfie.Active.imageHolder.activeStepBorder")};
120
- border-radius: ${o("Selfie.Active.imageHolder.activeStepBorderRadius")};
121
- }
122
- `:p`
123
- opacity: 0.3;
124
- `}
125
-
126
- img {
127
- width: 100%;
128
- margin: 0;
129
- border-radius: ${o("Selfie.Active.imageHolder.borderRadius")};
130
- }
131
- img.image_preview {
132
- border: ${o("Selfie.Active.imageHolder.border")};
133
- }
134
- `,eo=u.div`
135
- color: #ffffff;
136
- height: 70px;
137
- position: absolute;
138
- bottom: 0;
139
- width: 100%;
140
- display: flex;
141
- justify-content: center;
142
- align-items: center;
143
- z-index: ${m+20};
144
- `,en=u.div`
145
- ${({disabled:e})=>e?p`
146
- pointer-events: none;
147
- `:p`
148
- cursor: pointer;
149
- `}
150
- text-align: center;
151
-
152
- img {
153
- width: ${o("Selfie.captureIcon.width")};
154
- }
155
- `,ea=u.div`
156
- position: absolute;
157
- width: 100%;
158
- top: 0;
159
- bottom: 0;
160
- display: flex;
161
- justify-content: center;
162
- align-items: center;
163
- color: #ffffff;
164
- font-size: 140px;
165
- opacity: 0.6;
166
- `,el=u.div`
167
- position: absolute;
168
- width: 100%;
169
- top: 0;
170
- bottom: 0;
171
- display: flex;
172
- flex-direction: column;
173
- justify-content: center;
174
- align-items: center;
175
- ${q.default};
176
- ${U.default};
177
- `,ed=u(K)`
178
- position: absolute;
179
- top: 0;
180
- left: 0;
181
- width: 100%;
182
- height: 100%;
183
- `,ec=u(({className:e="",radius:i=80,neutralColor:r="#CBD5E1",activeColor:t="#0276F1",errorColor:s="#E84848",strokeWidth:o=2,tickWidth:n=15,numberOfTicks:a=200,progress:l=0,showErrorRing:d=!1})=>{let c=2*i,g=i-5,h=2*Math.PI*g,u=Array.from({length:a}).map((e,r)=>{let t=360*r/a+3;return f.jsx("use",{href:"#tick",transform:`rotate(${t} ${i} ${i})`},r)}),p=i-V,m=2*Math.PI*p;return f.jsxs("svg",{height:c,width:c,viewBox:`0 0 ${c} ${c}`,className:e,xmlns:"http://www.w3.org/2000/svg",children:[d?f.jsx("circle",{cx:i,cy:i,r:i-V,stroke:s,strokeWidth:o,fill:"none"}):f.jsxs(f.Fragment,{children:[f.jsx("circle",{cx:i,cy:i,r:p,stroke:r,strokeWidth:o,fill:"none"}),f.jsx(F,{cx:i,cy:i,r:p,stroke:t,strokeWidth:o,strokeLinecap:"round",strokeDasharray:`${m} ${m}`,style:{strokeDashoffset:m-l/100*m}})]}),f.jsx("defs",{children:f.jsx("line",{id:"tick",x1:i,y1:"0",x2:i,y2:n,stroke:r,strokeWidth:o,strokeLinecap:"round"})}),f.jsx("g",{id:"border-segments",children:u}),f.jsx("mask",{id:"tickMask",maskUnits:"userSpaceOnUse",children:f.jsx("g",{id:"tick-mask-segments",children:u})}),f.jsx("g",{mask:"url(#tickMask)",children:f.jsx(N,{strokeDasharray:`${h} ${h}`,style:{strokeDashoffset:h-l/100*h},children:f.jsx("circle",{cx:i,cy:i,r:g,stroke:t,strokeWidth:20,fill:"none"})})})]})})`
184
- position: absolute;
185
- top: 0;
186
- left: 0;
187
- width: 100%;
188
- height: 100%;
189
- `,eg=u(function({className:e=""}){return f.jsx("svg",{className:e,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.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"})})})`
190
- width: 100%;
191
- height: 100%;
192
- vertical-align: middle;
193
- margin: 0;
194
- color: ${o("Selfie.backgroundColor")};
195
- `,eh=u(function({className:e="",radius:i=160,backgroundColor:r="#fff",padding:t=0}){let s=2*i;return f.jsxs("svg",{className:e,width:s,height:s,viewBox:`0 0 ${s} ${s}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("mask",{id:"CIRCLE_MASK",children:[f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#CIRCLE_MASK)"}),f.jsx("circle",{cx:i,cy:i,r:i-t,fill:"black"})]}),f.jsx("circle",{cx:i,cy:i,r:i,fill:"none"}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:r,mask:"url(#CIRCLE_MASK)"})]})})`
196
- width: 100%;
197
- height: 100%;
198
- vertical-align: middle;
199
- margin: 0;
200
- color: ${o("Selfie.backgroundColor")};
201
- `,ef=u.div`
202
- position: absolute;
203
- z-index: -1;
204
- background: rgba(223, 0, 0, 0.2);
205
- border-radius: 50%;
206
- width: 86%;
207
- height: 86%;
208
- top: 7%;
209
- left: 7%;
210
- `,eu=k`
211
- from {
212
- opacity: 1;
213
- }
214
-
215
- to {
216
- opacity: 0;
217
- }
218
- `,ep=u.div`
219
- position: absolute;
220
- width: 100%;
221
- top: 0;
222
- bottom: 0;
223
- z-index: -1;
224
- background: rgba(255, 255, 255, 0.3);
225
- animation: ${eu} 1s infinite;
226
- border-radius: 50%;
227
- `,em=u.div`
228
- top: 0;
229
- left: 0;
230
- right: 0;
231
- bottom: 0;
232
- position: absolute;
233
- margin: auto;
234
- width: ${o("Selfie.loadingIcon.width")};
235
- height: ${o("Selfie.loadingIcon.height")};
236
-
237
- img {
238
- width: 100%;
239
- }
240
-
241
- z-index: ${m+20};
242
- ${J.default}
243
- `,ew=u.div`
244
- text-align: center;
245
- color: ${o("Selfie.title.color")};
246
- font-size: ${o("Selfie.title.fontSize")};
247
- font-weight: ${o("Selfie.title.fontWeight")};
248
- background-color: ${o("Selfie.title.backgroundColor")};
249
- position: absolute;
250
- top: ${e=>e.y};
251
- z-index: ${m+10};
252
- display: flex;
253
- align-items: center;
254
- justify-content: center;
255
- width: 100%;
256
- `;export{V as A,eo as B,ea as C,ef as E,er as F,el as I,em as L,ed as O,Q as S,ew as T,eg as a,ei as b,en as c,_ as d,eh as e,ec as f,S as g,ep as h,et as i,es as j,X as k,ee as l,j as m,P as n,$ as o,C as p,A as q,T as r,v as s,R as t,L as u,E as v,W as w,y as x};
@@ -1 +0,0 @@
1
- import{A as e,C as r,U as s,r as a,m as n,c as t,s as o,j as i,a4 as c,az as l,b as u,P as p,k as m}from"./chunk-c747321c.js";import{p as d,g as f,S as h,a as g,O as C,C as j,E as y,b as D,B as F,c as x,L as S}from"./chunk-88ec0901.js";import{u as b,C as k}from"./chunk-409b3310.js";import{M as I,O as T,W as E,C as R}from"./chunk-da8ef78b.js";import{D as L}from"./chunk-2b4d00a3.js";import{u as v}from"./chunk-51b3fd2d.js";import"./chunk-036bae4b.js";import"./chunk-ddb14dfb.js";import"./chunk-6e5358d6.js";let P=m.isMobile?{width:{ideal:640}}:null;function A(p){let{apiCheck:m,onLivenessDetectionDone:L,captureFrameSettings:A,onFramesCaptured:M,frontCamera:H,flipVideoHorizontal:O,customDirectionIcon:U,customStepTimeConstraints:w,onProcessing:V,customErrors:$,apiCredentials:_,outputEncryptionSettings:B,cameraScale:K,defaultCameraId:N,passiveModeAuto:z,offsetFaceY:G,styledComponent:Y,serviceSettings:W,onReset:q,isLoading:J}=p,Q=e(),{onErrorCallback:X,onCloseCallback:Z}=v(),ee=r.useAsset("bg_camera_mask.png"),er=r.useAsset("bg_camera_mask_red.png"),es=s("IDCapturing.loadingIcon.src","ic_loading.gif"),[ea,en]=a.useState({}),{yFaceDetectionError:et,yFaceVerificationStepsWrapper:eo}=ea,[ei,ec]=a.useState(""),[el,eu]=a.useState(),ep=a.useMemo(()=>({backgroundColor:n("Selfie.backgroundColor")({theme:Q})}),[Q]),em=a.useCallback(({lostY:e,height:r,clientHeight:s})=>{let a=e+25,n=a+30;en({yFaceDetectionError:a,yFaceVerificationStepsWrapper:n+r+20});let t=Math.floor(e),o=Math.floor(s-e),i=Math.floor(n);return 0!==G&&(i+G<t||i+G+r>o)?X({code:`offsetFaceY must be in [-${i-t}, ${o-r-i}]`}):i+=G,{y:i}},[G,X]),{shouldResetFlowOnOrientationChange:ed,countdownToTakePicture:ef,cropArea:eh,curStepIndex:eg,faceDetectionError:eC,resetFlow:ej,handleTriggerPassiveMode:ey,handleVideoPlayed:eD,refVideo:eF,showCountdown:ex,steps:eS,refIsReseting:eb,videoPlayed:ek,warmupDone:eI,showCaptureButton:eT,shouldShowCountdown:eE,showLoading:eR}=b({currentOrientation:el,apiCheck:m,bgCameraMask:ee,bgCameraMaskRed:er,surroundStyle:ep,onLivenessDetectionDone:L,onError:X,cropAreaDimension:em,customDirectionIcon:U,captureFrameSettings:A,onFramesCaptured:M,setRemainingTime:ec,customStepTimeConstraints:w,onProcessing:V,customErrors:$,apiCredentials:_,outputEncryptionSettings:B,cameraScale:K,passiveModeAuto:z,serviceSettings:W,onReset:q});a.useEffect(()=>{"string"==typeof eS[0]?.directionIcon&&Promise.all(eS.map(e=>d(e.directionIcon)))},[eS]);let{CloseCameraButton:eL}=Y,ev=f(p,Q),eP=eb.current?0:eg/eS.length*100,{lang:eA}=t.useSDKSettings(),eM=a.useRef(0),eH=a.useRef({}),eO=a.useRef(o.ErrorDuration.SHORT),eU=a.useMemo(()=>{let{msg:e,duration:r=o.ErrorDuration.SHORT}=eC||{},s=e?.[eA];return Date.now()-eM.current>=eO.current&&(eM.current=Date.now(),eO.current=r,eH.current=s),eH.current},[eC,eg]),ew=a.useCallback(e=>{eu(e),ed?ej():e===I.LANDSCAPE?eF.current?.pause():eF.current?.play()},[eF,ej,ed]);return i.jsx(T,{onOrientationChange:ew,children:i.jsxs(c,{frontCamera:H,onVideoPlayed:eD,onClose:Z,flipHorizontal:O??H,ref:eF,videoSettings:P,onError:X,scale:K,defaultCameraId:N,closeButton:eL||i.jsx(l,{}),children:[!eI&&i.jsx(E,{}),ek?i.jsxs(i.Fragment,{children:["string"==typeof eU?i.jsx(h,{top:et-15,className:"face-detection-error",children:eU}):null,eh.current?i.jsxs(R,{x:`${eh.current.x}px`,y:`${eh.current.y}px`,width:`${eh.current.width}px`,height:`${eh.current.height}px`,surroundStyle:eh.current.surroundStyle,children:[i.jsx(g,{}),i.jsx(C,{...ev,progress:eP,showErrorRing:!!eC&&n("Selfie.progressCircle.showErrorRing")({theme:Q})}),eE?i.jsx(j,{children:ef}):null,eC&&i.jsx(y,{})]}):null,ei&&i.jsx(D,{top:eo-30,children:ei}),eT?i.jsx(F,{children:i.jsx(x,{onClick:ey,disabled:ex,children:u(Q,"Selfie.captureIcon.src")?i.jsx("img",{src:u(Q,"Selfie.captureIcon.src"),alt:""}):i.jsx(k,{fillColor:"rgba(193, 197, 204, 1)"})})}):null]}):null,(eR||J)&&i.jsx(S,{children:i.jsx("img",{src:es,alt:""})})]})})}A.propTypes={apiCheck:p.bool,mode:p.string,onLivenessDetectionDone:p.func,onClose:p.func,onError:p.func,onReset:p.func,captureFrameSettings:p.shape({}),onFramesCaptured:p.func,frontCamera:p.bool,isLoading:p.bool,flipVideoHorizontal:p.bool,customDirectionIcon:p.shape({}),customStepTimeConstraints:p.shape({}),onProcessing:p.func,customErrors:p.shape({}),apiCredentials:p.shape({accessKey:p.string,secretKey:p.string,apiUrl:p.string}),outputEncryptionSettings:p.shape({}),cameraScale:p.number,defaultCameraId:p.string,passiveModeAuto:p.bool,offsetFaceY:p.number,styledComponent:p.shape({CloseCameraButton:p.node}),serviceSettings:p.shape({})},A.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:()=>{},onReset:()=>{},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:()=>{},frontCamera:!0,isLoading:!1,flipVideoHorizontal:null,customDirectionIcon:{[o.FaceDirection.LEFT]:i.jsx(L,{type:o.FaceDirection.LEFT}),[o.FaceDirection.RIGHT]:i.jsx(L,{type:o.FaceDirection.RIGHT}),[o.FaceDirection.UP]:i.jsx(L,{type:o.FaceDirection.UP}),[o.FaceDirection.FRONTAL]:i.jsx(L,{type:o.FaceDirection.FRONTAL})},customStepTimeConstraints:{[o.FaceDirection.UP]:{delayTime:0},[o.FaceDirection.LEFT]:{delayTime:0},[o.FaceDirection.RIGHT]:{delayTime:0},[o.FaceDirection.FRONTAL]:{delayTime:2e3}},onProcessing:()=>{},customErrors:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},serviceSettings:{enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0}};export{A as default};