@adriansteffan/reactive 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright-mcp/console-2026-09-20T12-17-32-043Z.log +1 -0
- package/.playwright-mcp/page-2026-09-20T12-17-32-084Z.yml +10 -0
- package/dist/{mod-HDegGPrf.js → mod-BTpABl23.js} +24 -23
- package/dist/mod.d.ts +2 -1
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +2 -2
- package/dist/{web-7BbR1Ad7.js → web-DV4cj_8Q.js} +1 -1
- package/dist/{web-CATfZO1Q.js → web-DprbPn6i.js} +1 -1
- package/package.json +1 -1
- package/src/components/plaininput.tsx +5 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[ 22ms] [ERROR] Failed to load resource: the server responded with a status of 404 (File not found) @ http://localhost:8799/favicon.ico:0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
- generic [active] [ref=e1]:
|
|
2
|
+
- generic [ref=e3]:
|
|
3
|
+
- paragraph [ref=e4]: Name?
|
|
4
|
+
- textbox "x" [ref=e5]
|
|
5
|
+
- generic [ref=e7]:
|
|
6
|
+
- paragraph [ref=e8]: Name?
|
|
7
|
+
- textbox "x" [ref=e9]
|
|
8
|
+
- generic [ref=e11]:
|
|
9
|
+
- paragraph [ref=e12]: Name?
|
|
10
|
+
- textbox "x" [ref=e13]
|
|
@@ -18736,46 +18736,47 @@ function xoe({
|
|
|
18736
18736
|
content: i,
|
|
18737
18737
|
buttonText: e = "Click me",
|
|
18738
18738
|
className: t = "",
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18739
|
+
centered: s = !1,
|
|
18740
|
+
next: r,
|
|
18741
|
+
updateStore: n,
|
|
18742
|
+
animate: a = !1,
|
|
18743
|
+
storeupdate: o,
|
|
18744
|
+
placeholder: l = "Enter your response here"
|
|
18744
18745
|
}) {
|
|
18745
|
-
const
|
|
18746
|
-
|
|
18747
|
-
},
|
|
18748
|
-
|
|
18746
|
+
const u = tr(wr()), [h, c] = Ue(""), d = (y) => {
|
|
18747
|
+
c(y.target.value);
|
|
18748
|
+
}, f = () => {
|
|
18749
|
+
o && n(o(h)), r({ value: h });
|
|
18749
18750
|
};
|
|
18750
|
-
return /* @__PURE__ */ V.jsx("div", { className: `min-h-screen ${
|
|
18751
|
+
return /* @__PURE__ */ V.jsx("div", { className: `min-h-screen ${s ? "flex items-center justify-center" : ""} ${u.containerBg}`, children: /* @__PURE__ */ V.jsxs("div", { className: `w-full max-w-prose mx-auto ${t} pt-20 pb-20 px-4 `, children: [
|
|
18751
18752
|
/* @__PURE__ */ V.jsx(
|
|
18752
18753
|
"article",
|
|
18753
18754
|
{
|
|
18754
|
-
className: `prose prose-2xl ${
|
|
18755
|
-
${
|
|
18755
|
+
className: `prose prose-2xl ${u.prose} text-xl ${u.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${u.text} leading-relaxed
|
|
18756
|
+
${a ? "animate-slide-down opacity-0" : ""}`,
|
|
18756
18757
|
children: i
|
|
18757
18758
|
}
|
|
18758
18759
|
),
|
|
18759
|
-
/* @__PURE__ */ V.jsx("div", { className: `mt-8 ${
|
|
18760
|
+
/* @__PURE__ */ V.jsx("div", { className: `mt-8 ${a ? "animate-slide-down opacity-0" : ""}`, children: /* @__PURE__ */ V.jsx(
|
|
18760
18761
|
"input",
|
|
18761
18762
|
{
|
|
18762
18763
|
type: "text",
|
|
18763
|
-
value:
|
|
18764
|
-
onChange:
|
|
18765
|
-
placeholder:
|
|
18766
|
-
className: `w-full px-4 py-3 border-2 ${
|
|
18764
|
+
value: h,
|
|
18765
|
+
onChange: d,
|
|
18766
|
+
placeholder: l,
|
|
18767
|
+
className: `w-full px-4 py-3 border-2 ${u.inputBorder} ${u.inputBg} ${u.inputText} rounded-xl text-lg focus:outline-none`
|
|
18767
18768
|
}
|
|
18768
18769
|
) }),
|
|
18769
18770
|
e && /* @__PURE__ */ V.jsx(
|
|
18770
18771
|
"div",
|
|
18771
18772
|
{
|
|
18772
|
-
className: `mt-8 flex justify-center ${
|
|
18773
|
-
style:
|
|
18773
|
+
className: `mt-8 flex justify-center ${a ? "animate-fade-in opacity-0" : ""}`,
|
|
18774
|
+
style: a ? { animationDelay: "1s" } : {},
|
|
18774
18775
|
children: /* @__PURE__ */ V.jsx(
|
|
18775
18776
|
"button",
|
|
18776
18777
|
{
|
|
18777
|
-
onClick:
|
|
18778
|
-
className: `${
|
|
18778
|
+
onClick: f,
|
|
18779
|
+
className: `${u.buttonBg} cursor-pointer px-8 py-3 border-2 ${u.buttonBorder} font-bold ${u.buttonText} text-lg rounded-xl ${u.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,
|
|
18779
18780
|
children: e
|
|
18780
18781
|
}
|
|
18781
18782
|
)
|
|
@@ -79175,7 +79176,7 @@ var ng;
|
|
|
79175
79176
|
i.UTF8 = "utf8", i.ASCII = "ascii", i.UTF16 = "utf16";
|
|
79176
79177
|
})(ng || (ng = {}));
|
|
79177
79178
|
const Pa = Su("Filesystem", {
|
|
79178
|
-
web: () => import("./web-
|
|
79179
|
+
web: () => import("./web-DV4cj_8Q.js").then((i) => new i.FilesystemWeb())
|
|
79179
79180
|
});
|
|
79180
79181
|
ai("Upload", async (i, e, t, s) => {
|
|
79181
79182
|
const r = i.sessionID || `sim_${Date.now()}_${Math.floor(At(0, 2176782336)).toString(36)}`, n = NV({
|
|
@@ -79433,7 +79434,7 @@ var vw;
|
|
|
79433
79434
|
i.None = "NONE", i.Slide = "SLIDE", i.Fade = "FADE";
|
|
79434
79435
|
})(vw || (vw = {}));
|
|
79435
79436
|
const b7 = Su("StatusBar"), w7 = Su("ImmersiveMode", {
|
|
79436
|
-
web: () => import("./web-
|
|
79437
|
+
web: () => import("./web-DprbPn6i.js").then((i) => new i.ImmersiveModeWeb())
|
|
79437
79438
|
});
|
|
79438
79439
|
xi("EnterFullscreen", "session");
|
|
79439
79440
|
ai("EnterFullscreen", Tu, {});
|
package/dist/mod.d.ts
CHANGED
|
@@ -333,11 +333,12 @@ export declare type ParticipantState = Record<string, any>;
|
|
|
333
333
|
*/
|
|
334
334
|
export declare function pipe<T, U>(array: T[], fn: (arr: T[]) => U): U;
|
|
335
335
|
|
|
336
|
-
export declare function PlainInput({ content, buttonText, className, next, updateStore, animate, storeupdate, placeholder, }: BaseComponentProps & {
|
|
336
|
+
export declare function PlainInput({ content, buttonText, className, centered, next, updateStore, animate, storeupdate, placeholder, }: BaseComponentProps & {
|
|
337
337
|
content: React.ReactNode;
|
|
338
338
|
buttonText?: string;
|
|
339
339
|
onButtonClick?: () => void;
|
|
340
340
|
className?: string;
|
|
341
|
+
centered?: boolean;
|
|
341
342
|
animate?: boolean;
|
|
342
343
|
storeupdate?: (entry: string) => {
|
|
343
344
|
[key: string]: any;
|
package/dist/reactive.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, H as i, C as t, a as r, D as o, c as n, d as l, e as m, f as u, g as c, h as p, Y as d, z as D, L as T, M as g, P as C, i as P, j as S, Q as v, R as A, k as h, l as x, F as _, T as k, m as B, n as E, o as I, p as f, U as M, V as F, X as L, q as R, r as U, s as b, t as w, u as G, v as K, w as y, x as O, y as q, B as H, G as j, I as N, J as Q, K as V, N as Y, O as Z, S as z, Z as J, _ as W, $ as X, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ia, a5 as ta, a6 as ra, a7 as oa, a8 as na, a9 as la, aa as ma, ab as ua, ac as ca, ad as pa, ae as da, af as Da, ag as Ta, ah as ga, ai as Ca, aj as Pa, ak as Sa, al as va, am as Aa, an as ha, ao as xa, ap as _a, aq as ka, ar as Ba, as as Ea, at as Ia, au as fa, av as Ma, aw as Fa } from "./mod-
|
|
1
|
+
import { A as e, H as i, C as t, a as r, D as o, c as n, d as l, e as m, f as u, g as c, h as p, Y as d, z as D, L as T, M as g, P as C, i as P, j as S, Q as v, R as A, k as h, l as x, F as _, T as k, m as B, n as E, o as I, p as f, U as M, V as F, X as L, q as R, r as U, s as b, t as w, u as G, v as K, w as y, x as O, y as q, B as H, G as j, I as N, J as Q, K as V, N as Y, O as Z, S as z, Z as J, _ as W, $ as X, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ia, a5 as ta, a6 as ra, a7 as oa, a8 as na, a9 as la, aa as ma, ab as ua, ac as ca, ad as pa, ae as da, af as Da, ag as Ta, ah as ga, ai as Ca, aj as Pa, ak as Sa, al as va, am as Aa, an as ha, ao as xa, ap as _a, aq as ka, ar as Ba, as as Ea, at as Ia, au as fa, av as Ma, aw as Fa } from "./mod-BTpABl23.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AudioDeviceContext,
|
|
4
4
|
i as Bounce,
|
package/dist/reactive.umd.js
CHANGED
|
@@ -10179,8 +10179,8 @@ Check the top-level render call using <`+Ce+">.")}return le}}function np(q,le){{
|
|
|
10179
10179
|
React keys must be passed directly to JSX without using spread:
|
|
10180
10180
|
let props = %s;
|
|
10181
10181
|
<%s key={someKey} {...props} />`,qu,yn,L0,yn),op[yn+qu]=!0}}return q===s?T0(Xt):S0(Xt),Xt}}function I0(q,le,Ce){return lp(q,le,Ce,!0)}function P0(q,le,Ce){return lp(q,le,Ce,!1)}var R0=P0,A0=I0;Bl.Fragment=s,Bl.jsx=R0,Bl.jsxs=A0}()),Bl}process.env.NODE_ENV==="production"?Am.exports=jne():Am.exports=zne();var S=Am.exports,rx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},nx=V.createContext&&V.createContext(rx),Wne=["attr","size","title"];function Gne(i,e){if(i==null)return{};var t=Kne(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r<n.length;r++)s=n[r],!(e.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}function Kne(i,e){if(i==null)return{};var t={};for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){if(e.indexOf(s)>=0)continue;t[s]=i[s]}return t}function uc(){return uc=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},uc.apply(this,arguments)}function ax(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function hc(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ax(Object(t),!0).forEach(function(s){Zne(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ax(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Zne(i,e,t){return e=Jne(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Jne(i){var e=Yne(i,"string");return typeof e=="symbol"?e:e+""}function Yne(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var s=t.call(i,e);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ox(i){return i&&i.map((e,t)=>V.createElement(e.tag,hc({key:t},e.attr),ox(e.child)))}function $l(i){return e=>V.createElement(Xne,uc({attr:hc({},i.attr)},e),ox(i.child))}function Xne(i){var e=t=>{var{attr:s,size:r,title:n}=i,a=Gne(i,Wne),o=r||t.size||"1em",l;return t.className&&(l=t.className),i.className&&(l=(l?l+" ":"")+i.className),V.createElement("svg",uc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,a,{className:l,style:hc(hc({color:i.color||t.color},t.style),i.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),n&&V.createElement("title",null,n),i.children)};return nx!==void 0?V.createElement(nx.Consumer,null,t=>e(t)):e(rx)}function eae(i){return $l({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"},child:[]}]})(i)}function lx(i){return $l({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"},child:[]},{tag:"path",attr:{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"},child:[]}]})(i)}function tae(i){return $l({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z",clipRule:"evenodd"},child:[]}]})(i)}function sae(i){return $l({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z",clipRule:"evenodd"},child:[]}]})(i)}function ux(i){return $l({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z",clipRule:"evenodd"},child:[]}]})(i)}const iae=({stream:i,isDark:e})=>{const t=V.useRef(null),s=V.useRef(null);return V.useEffect(()=>{if(!i||!t.current)return;const r=new(window.AudioContext||window.webkitAudioContext),n=r.createAnalyser(),a=r.createMediaStreamSource(i);n.fftSize=2048,a.connect(n);const o=t.current,l=o.getContext("2d",{alpha:!1});if(!l)return;const u=window.devicePixelRatio||1,h=o.getBoundingClientRect();o.width=h.width*u,o.height=h.height*u,l.scale(u,u),o.style.width=`${h.width}px`,o.style.height=`${h.height}px`;const c=new Uint8Array(n.fftSize),d=e?"#374151":"#ffffff",f=e?"#ffffff":"#000000",y=e?"#4B5563":"#E5E7EB",v=h.width,m=h.height,g=24,b=v/g,x=2;let I=0;const A=()=>{s.current=requestAnimationFrame(A),n.getByteTimeDomainData(c);let L=0;for(let O=0;O<c.length;O++){const k=(c[O]-128)/128;L+=k*k}const D=Math.min(1,Math.sqrt(L/c.length)*5);I+=(D-I)*.3,l.fillStyle=d,l.fillRect(0,0,v,m);const P=Math.round(I*g);for(let O=0;O<g;O++)l.fillStyle=O<P?f:y,l.fillRect(O*b+x/2,x,b-x,m-x*2)};return A(),()=>{s.current&&cancelAnimationFrame(s.current),a.disconnect(),r.close()}},[i,e]),S.jsx("canvas",{ref:t,width:300,height:60,className:`mx-auto border-2 border-black ${e?"bg-gray-700":"bg-white"}`})},Lm=V.forwardRef(({question:i,handleSaveVoiceData:e,handleDiscardVoiceData:t,deviceId:s,showPause:r=!0,showStop:n=!0,showVisualizer:a=!0,showDiscard:o=!0,discardLabel:l="New Recording",silenceWarningSec:u,silenceWarningText:h="We can't hear you — please speak up",onRecordingStart:c,onPause:d,onResume:f},y)=>{const v=qi(),m=xi(v),g=v.startsWith("dark"),b=X2(),[x,I]=V.useState(!1),[A,L]=V.useState(!1),[D,P]=V.useState(null),[O,k]=V.useState(null),[$,U]=V.useState(!1),_=V.useRef(null),F=V.useRef([]),H=V.useRef(0),Q=V.useRef(null),W=()=>{Q.current&&(clearInterval(Q.current),Q.current=null)},j=()=>{H.current=0,Q.current=setInterval(()=>{H.current+=100},100)},ne=()=>{Q.current=setInterval(()=>{H.current+=100},100)},X=()=>{const ve=_.current;ve&&(ve.state==="recording"||ve.state==="paused")&&(ve.stop(),ve.stream.getTracks().forEach(Ze=>Ze.stop()),I(!1),L(!1),W())};V.useImperativeHandle(y,()=>({stop:X})),V.useEffect(()=>{if(!O||!u||A){U(!1);return}const ve=window.AudioContext||window.webkitAudioContext,Ze=new ve,lt=Ze.createAnalyser();lt.fftSize=2048;const At=Ze.createMediaStreamSource(O);At.connect(lt);const Je=new Uint8Array(lt.fftSize);let Mt=0;const Wt=setInterval(()=>{lt.getByteTimeDomainData(Je);let We=0;for(let Gt=0;Gt<Je.length;Gt++){const Ut=(Je[Gt]-128)/128;We+=Ut*Ut}Math.sqrt(We/Je.length)<.02?(Mt+=100,Mt>=u*1e3&&U(!0)):(Mt=0,U(!1))},100);return()=>{clearInterval(Wt),At.disconnect(),Ze.close(),U(!1)}},[O,u,A]);const ue=async()=>{try{const ve=s??b,Ze={audio:ve?{deviceId:{exact:ve}}:!0},lt=await navigator.mediaDevices.getUserMedia(Ze);k(lt),_.current=new MediaRecorder(lt),F.current=[],_.current.ondataavailable=At=>{At.data.size>0&&F.current.push(At.data)},_.current.onstop=()=>{const At=new Blob(F.current,{type:"audio/webm"}),Je=URL.createObjectURL(At);P(Je),k(null),be(At,Je)},_.current.start(),I(!0),L(!1),j(),c==null||c()}catch(ve){console.error("Error accessing microphone:",ve)}},se=()=>{_.current&&_.current.state==="recording"&&(_.current.pause(),L(!0),W(),d==null||d(H.current))},ae=()=>{_.current&&_.current.state==="paused"&&(_.current.resume(),L(!1),ne(),f==null||f())},be=async(ve,Ze)=>{if(ve&&Ze){const lt=await new Promise(At=>{const Je=new FileReader;Je.onloadend=()=>{var Wt;const Mt=((Wt=Je.result)==null?void 0:Wt.toString().split(",")[1])||"";At(Mt)},Je.readAsDataURL(ve)});e({blob:ve,type:"audiorecording",url:Ze,data64:lt,timestamp:new Date().toISOString(),recordingDuration:H.current})}},de=()=>{const ve=_.current;ve&&(ve.state==="recording"||ve.state==="paused")&&(F.current=[],ve.onstop=null,ve.stop(),ve.stream.getTracks().forEach(Ze=>Ze.stop())),I(!1),L(!1),k(null),W(),t()},te=()=>{D&&URL.revokeObjectURL(D),P(null),L(!1),t()},pe=`flex items-center justify-center p-4 rounded-full border-2 ${m.buttonBorder} ${m.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none cursor-pointer transition-colors duration-200`;return S.jsxs("div",{className:"flex flex-col items-center space-y-4 p-4 px-8",children:[$&&S.jsx("div",{className:"fixed top-0 left-0 right-0 z-40 bg-yellow-300 text-black text-center py-3 px-4 border-b-2 border-black font-semibold shadow-[0px_2px_0px_rgba(0,0,0,1)]",children:h}),!D&&!x&&S.jsx("button",{onClick:ue,className:`${pe} ${m.buttonBg}`,"aria-label":"Start Recording",children:S.jsx(lx,{className:`w-6 h-6 ${m.buttonText}`})}),!D&&x&&S.jsxs("div",{className:"flex items-center space-x-4",children:[r&&S.jsx("button",{onClick:A?ae:se,className:`${pe} ${m.buttonBg}`,"aria-label":A?"Resume Recording":"Pause Recording",children:A?S.jsx(lx,{className:`w-6 h-6 ${m.buttonText}`}):S.jsx(tae,{className:`w-6 h-6 ${m.buttonText}`})}),n&&S.jsx("button",{onClick:X,className:`${pe} bg-red-500 text-white`,"aria-label":"Stop Recording",children:S.jsx(sae,{className:"w-6 h-6"})}),o&&A&&S.jsx("button",{onClick:de,className:`${pe} ${m.buttonBg}`,"aria-label":"Discard Recording",children:S.jsx(ux,{className:`w-6 h-6 ${m.buttonText}`})})]}),a&&x&&!A&&O&&S.jsx("div",{className:"w-full max-w-md mx-auto",children:S.jsx(iae,{stream:O,isDark:g})}),x&&S.jsxs("div",{className:"flex items-center space-x-2",children:[S.jsx("div",{className:`w-3 h-3 rounded-full ${A?"bg-yellow-500":"bg-red-500 animate-pulse"}`}),S.jsx("span",{className:`text-sm ${m.text}`,children:A?"Paused":"Recording..."})]}),D&&!x&&S.jsxs("div",{className:"flex flex-col items-center space-y-4 w-full max-w-md",children:[S.jsxs("audio",{controls:!0,preload:"none",className:"w-full",playsInline:!0,children:[S.jsx("source",{src:D,type:"audio/mp4"}),S.jsx("source",{src:D,type:"audio/webm"}),"Your browser does not support the audio element."]}),S.jsx("div",{className:"flex space-x-4",children:S.jsxs("button",{onClick:te,className:`border-2 ${m.buttonBorder} ${m.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none cursor-pointer flex items-center space-x-2 px-4 py-2 ${m.text} rounded-xl transition-colors duration-200`,children:[S.jsx(ux,{className:"w-4 h-4"}),S.jsx("span",{children:l})]})})]})]})});function rae({setValue:i}){return S.jsx(Lm,{handleSaveVoiceData:e=>i(e),handleDiscardVoiceData:()=>i(null)})}const hx="/backend";async function cx(i,e){return e instanceof FormData?await fetch(`${hx}${i}`,{method:"POST",body:e}):fetch(`${hx}${i}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}const dx="GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAAARQEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHYTbuMU6uEElTDZ1OsggE/TbuMU6uEHFO7a1OsggQ67AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsirXsYMPQkBNgI1MYXZmNTguNzYuMTAwV0GNTGF2ZjU4Ljc2LjEwMESJiEB/wAAAAAAAFlSua+KuAQAAAAAAAFnXgQFzxYhRMt5OPJYVP5yBACK1nIN1bmSGhkFfT1BVU1aqg2MuoFa7hATEtACDgQLhkZ+BAbWIQOdwAAAAAABiZIEQY6KTT3B1c0hlYWQBATgBgLsAAAAAABJUw2dAm3NzAQAAAAAAACdjwIBnyAEAAAAAAAAaRaOHRU5DT0RFUkSHjUxhdmY1OC43Ni4xMDBzcwEAAAAAAABgY8CLY8WIUTLeTjyWFT9nyAEAAAAAAAAjRaOHRU5DT0RFUkSHlkxhdmM1OC4xMzQuMTAwIGxpYm9wdXNnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjUwODAwMDAwMAAAH0O2dUJU54EAo5GBAACACINtgtAc/epJ/gE/wKOZgQAVgAinGl2KmC5fWspQj0PpJrkNsG40QKOVgQApgAihLxDkXfvcBBqwyPJFmpFgo5OBAD2ACKE40Hcyqlc9/1ttqV84o5SBAFGACKE40Hcyql5YIeRahOZfwKOXgQBlgAihTMA96uabsR453W080Xeb9h6jkYEAeYAIoTjQdzKqXDNU2kjGo5aBAI2ACKDZbPIJxX8xM7SEPNZetOMco5OBAKGACKE40Hcyqla9XawRHUWoo5OBALWACKE40Hcyqmb1XKO++uAQo5SBAMmACKEvEORd+8XekK1/rf/rrKOVgQDdgAihONB3MqpWRgIfsDV4YBUIo5OBAPGACKE40Hcyql5SyE1S2QFAo5SBAQWACKE40Hcyqla+8h2o+iaxgKOVgQEZgAihONB3MqpeqdUAtSaZmdKAo5OBAS2ACKFIA0bVUn3Jmsi7ollwo5OBAUGACKE40Hcyql6pt6b1uh3oo5WBAVWACKEvEORd+9/La7aeTKZnv/CjlYEBaYAIoTjO/AZGOE9OIX9kO96+gKOTgQF9gAihONB3MqpekAQ00UpCUKOTgQGRgAihSANG1VJz2oSiMZRZKqOQgQGlgAihONB3MqpeqbeK3KORgQG5gAihLxDkXfvfy2sJCQyjmoEBzYAIosXU/J/RyZHEovOUhd6Ypj7UPC8Bo5uBAeGACKRIuuxKsgM4Wle7xUaBZDTNWofASYGgAQAAAAAAABuhkoEB9QAIBkQ+QjevBKpbiF1qJHWihADN/mAcU7trkbuPs4EAt4r3gQHxggHg8IED";Zs("VoiceRecording","session"),Hs("VoiceRecording",async(i,e,t,s)=>{const n=await(t.respondTTS??t.respondBase64)(i,s),{participantState:a}=n;let o;if(t.respondTTS){const u=n.value,h=await ex(u);if(!h)throw new Error("TTS failed. Ensure say/espeak and ffmpeg are installed.");o=h}else o=n.value;const l=await tx(o)??Math.round(o.length/4);return{responseData:{type:"audiorecording",data64:o,timestamp:new Date().toISOString(),recordingDuration:l},participantState:a,duration:l}},{respondTTS:(i,e)=>({value:"This is a simulated voice recording for testing purposes.",participantState:e}),respondBase64:(i,e)=>({value:dx,participantState:e})});function px({content:i,buttonText:e,shortButtonText:t="Continue without improving",className:s="",containerClass:r,next:n,store:a,minDuration:o,shortRecordingWarning:l,showVisualizer:u=!0,eagerUpload:h=!0,animate:c=!1,name:d,silenceWarningSec:f,silenceWarningText:y}){const v=xi(qi()),m=e??(o!=null?"Save & Continue":"Continue"),g=V.useRef(null),b=V.useRef(!1),[x,I]=V.useState(null),[A,L]=V.useState(!1),[D,P]=V.useState(0),O=o!=null&&D<o,k=F=>{if(h&&F.data64&&(a!=null&&a._uploadId)){const H=z2(d??"recording");cx("/data",{sessionId:a._uploadId,files:[{filename:H,content:F.data64,encoding:"base64"}]}).then(()=>{F._audioPreUploaded=!0,F._audioPreUploadedFilename=H}).catch(()=>{})}I(F),L(!1),b.current&&(b.current=!1,n(F))},$=F=>{L(!0),P(F)},U=()=>{L(!1)},_=()=>{var F;b.current=!0,(F=g.current)==null||F.stop()};return S.jsx("div",{className:`min-h-screen ${r??v.containerBg}`,children:S.jsxs("div",{className:`max-w-prose mx-auto ${s} pt-20 pb-20 px-4 ${c?"animate-fade-in opacity-0":""}`,children:[i&&S.jsx("article",{className:`prose prose-2xl ${v.prose} text-xl ${v.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${v.text} leading-relaxed`,children:i}),S.jsx("div",{className:"pt-6",children:S.jsx(Lm,{ref:g,handleSaveVoiceData:k,handleDiscardVoiceData:()=>{I(null),L(!1)},showStop:o==null,showDiscard:o!=null,showVisualizer:u,silenceWarningSec:f,silenceWarningText:y,onPause:$,onResume:U})}),A&&O&&S.jsxs("div",{className:`mt-8 flex items-start space-x-3 p-4 border-2 ${v.buttonBorder} ${v.text} ${c?"animate-fade-in opacity-0":""}`,children:[S.jsx(eae,{className:"w-6 h-6 text-yellow-500 flex-shrink-0 mt-0.5"}),S.jsx("p",{className:"text-sm",children:l??"Your recording seems quite short. Please consider adding more detail to your description."})]}),A&&o!=null&&S.jsx("div",{className:`mt-8 flex justify-center ${c?"animate-fade-in opacity-0":""}`,children:S.jsx("button",{onClick:_,className:`${v.buttonBg} cursor-pointer px-8 py-3 border-2 ${v.buttonBorder} font-bold ${v.buttonText} text-lg rounded-xl ${v.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,children:O?t:m})}),x&&!A&&S.jsx("div",{className:`mt-16 flex justify-center ${c?"animate-fade-in opacity-0":""}`,children:S.jsx("button",{onClick:()=>n(x),className:`${v.buttonBg} cursor-pointer px-8 py-3 border-2 ${v.buttonBorder} font-bold ${v.buttonText} text-lg rounded-xl ${v.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,children:m})})]})})}function nae(i){return i.baseUrl??(i.provider==="huggingface"?`https://api-inference.huggingface.co/models/${i.model}/v1`:"https://api.openai.com/v1")}async function aae(i,e,t){const s=nae(i),r={model:i.model,messages:[{role:"user",content:e}]};t&&(r.response_format={type:"json_schema",json_schema:{name:"response",schema:t,strict:!0}});const n=await fetch(`${s}/chat/completions`,{method:"POST",headers:{Authorization:`Bearer ${i.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new Error(`LLM API error: ${n.status} ${n.statusText}`);return(await n.json()).choices[0].message.content}const fx=".reactive-cache",mx="llm.json";let On=null;async function oae(){if(On)return On;try{const i=await lc(),e=i("fs"),s=i("path").join(process.cwd(),fx,mx);if(e.existsSync(s))return On=JSON.parse(e.readFileSync(s,"utf8")),On}catch{}return On={},On}async function lae(){if(On)try{const i=await lc(),e=i("fs"),t=i("path"),s=t.join(process.cwd(),fx);e.mkdirSync(s,{recursive:!0}),e.writeFileSync(t.join(s,mx),JSON.stringify(On,null,2))}catch{}}async function uae(i,e,t){const s=t?JSON.stringify(t):"",r=`${i.provider}:${i.model}:${e}:${s}`,n=await oae();let a=n[r];return a||(a=await aae(i,e,t),n[r]=a,await lae()),a}function cc(i){return typeof i=="number"?i:i.type==="normal"?K.normal(i.mean,i.sd):K.uniform(i.min,i.max)}function gx(i){return Math.max(0,cc(i))}function vx(i){const e=i.dt??1,t=Math.sqrt(e),s=cc(i.startingPoint);if(i.contaminationRate&&K.uniform(0,1)<i.contaminationRate)return{choice:K.uniform(0,1)<.5?0:1,rt:K.uniform(0,i.timeLimit),finalEvidence:s,isContaminated:!0};const r=cc(i.driftRate),n=Math.max(0,cc(i.noiseLevel)),a=i.sensoryDelay!=null?gx(i.sensoryDelay):0,o=i.motorDelay!=null?gx(i.motorDelay):0;let l,u;Array.isArray(i.boundaries)?(u=i.boundaries[0],l=i.boundaries[1]):(l=i.boundaries,u=-i.boundaries);let h=a,c=s,d=!1,f=null;for(;h<i.timeLimit;){h+=e;let v=r,m=n;if(h<=i.stimOffset)i.stimulusCollapse&&h-a>(i.stimulusCollapse.delay??0)&&(l-=i.stimulusCollapse.rate*e,u+=i.stimulusCollapse.rate*e);else{const g=i.postStimStrategy;if(g.type==="snapshot"){const b=Math.abs(c-l),x=Math.abs(c-u);return{choice:b<=x?1:0,rt:h+o,finalEvidence:c,isContaminated:!1}}else g.type==="continue"?(v=g.residualDrift??0,m=n*(g.noiseMultiplier??1)):(v=0,h-i.stimOffset>(g.collapseDef.delay??0)&&(l-=g.collapseDef.rate*e,u+=g.collapseDef.rate*e))}if(c>=l){f=1,d=!0;break}if(c<=u){f=0,d=!0;break}if(c+=v*e+m*t*K.normal(0,1),c>=l){f=1,d=!0;break}if(c<=u){f=0,d=!0;break}}let y;return d?y=h+o:(y=i.timeLimit,f=null),{choice:f,rt:y,finalEvidence:c,isContaminated:!1}}function yx(i,e,t){if(i==null||e.length===0)return null;const s=Array.isArray(t)?t.map(r=>r.toLowerCase()):t?[t.toLowerCase()]:null;if(!s)return e[Math.floor(K.uniform(0,e.length))];if(i===1){const r=e.filter(n=>s.includes(n.toLowerCase()));if(r.length>0)return r[Math.floor(K.uniform(0,r.length))]}else{const r=e.filter(n=>!s.includes(n.toLowerCase()));if(r.length>0)return r[Math.floor(K.uniform(0,r.length))]}return e[Math.floor(K.uniform(0,e.length))]}Zs("Text","text"),Hs("Text",(i,e,t,s)=>{if(i.duration!=null)return{responseData:{},participantState:s,duration:i.duration};const r=t.respond(i,s);return{responseData:r.value,participantState:r.participantState,duration:r.value.reactionTime}},{respond:(i,e)=>({value:{key:"button",time:Date.now(),reactionTime:K.uniform(500,2e3)},participantState:e})});function dc({content:i,buttonText:e="Continue",className:t="",containerClass:s,centered:r=!1,next:n,animate:a=!1,allowedKeys:o=!1,duration:l}){const u=xi(qi()),h=V.useRef(0),c=l!=null;V.useEffect(()=>{window.scrollTo(0,0)},[]),V.useEffect(()=>{if(!c)return;const f=setTimeout(()=>n({}),l);return()=>clearTimeout(f)},[c,l,n]),V.useEffect(()=>{if(c)return;h.current=Ls();const f=y=>{const v=Ls();if(o===!0||Array.isArray(o)&&o.includes(y.key)){y.preventDefault();const g=v-h.current;n({key:y.key,time:v,reactionTime:g})}};return o&&window.addEventListener("keydown",f),()=>{o&&window.removeEventListener("keydown",f)}},[n,o,c]);const d=()=>{const f=Ls(),y=f-h.current;n({key:"button",time:f,reactionTime:y})};return S.jsx("div",{className:`min-h-screen ${r?"flex items-center justify-center":""} ${s??u.containerBg}`,children:S.jsxs("div",{className:`max-w-prose mx-auto ${t} pt-20 pb-20 px-4 `,children:[S.jsx("article",{className:`prose prose-2xl ${u.prose} text-xl ${u.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${u.text} leading-relaxed
|
|
10182
|
-
${a?"animate-slide-down opacity-0":""}`,children:i}),!c&&e&&S.jsx("div",{className:`mt-16 flex justify-center ${a?"animate-fade-in opacity-0":""}`,style:a?{animationDelay:"1s"}:{},children:S.jsx("button",{onClick:d,tabIndex:-1,onKeyDown:f=>{(f.key===" "||f.key==="Enter")&&f.preventDefault()},className:`${u.buttonBg} cursor-pointer px-8 py-3 border-2 ${u.buttonBorder} font-bold ${u.buttonText} text-lg rounded-xl ${u.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,children:e})})]})})}Zs("PlainInput","session"),Hs("PlainInput",(i,e,t,s)=>{const r=t.respond(i,s),n=String(r.value).length*K.uniform(50,150);return{responseData:{value:r.value},participantState:r.participantState,storeUpdates:i.storeupdate?i.storeupdate(r.value):void 0,duration:n}},{respond:(i,e)=>({value:"simulated_input",participantState:e})});function Cx({content:i,buttonText:e="Click me",className:t="",
|
|
10183
|
-
${
|
|
10182
|
+
${a?"animate-slide-down opacity-0":""}`,children:i}),!c&&e&&S.jsx("div",{className:`mt-16 flex justify-center ${a?"animate-fade-in opacity-0":""}`,style:a?{animationDelay:"1s"}:{},children:S.jsx("button",{onClick:d,tabIndex:-1,onKeyDown:f=>{(f.key===" "||f.key==="Enter")&&f.preventDefault()},className:`${u.buttonBg} cursor-pointer px-8 py-3 border-2 ${u.buttonBorder} font-bold ${u.buttonText} text-lg rounded-xl ${u.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,children:e})})]})})}Zs("PlainInput","session"),Hs("PlainInput",(i,e,t,s)=>{const r=t.respond(i,s),n=String(r.value).length*K.uniform(50,150);return{responseData:{value:r.value},participantState:r.participantState,storeUpdates:i.storeupdate?i.storeupdate(r.value):void 0,duration:n}},{respond:(i,e)=>({value:"simulated_input",participantState:e})});function Cx({content:i,buttonText:e="Click me",className:t="",centered:s=!1,next:r,updateStore:n,animate:a=!1,storeupdate:o,placeholder:l="Enter your response here"}){const u=xi(qi()),[h,c]=V.useState(""),d=y=>{c(y.target.value)},f=()=>{o&&n(o(h)),r({value:h})};return S.jsx("div",{className:`min-h-screen ${s?"flex items-center justify-center":""} ${u.containerBg}`,children:S.jsxs("div",{className:`w-full max-w-prose mx-auto ${t} pt-20 pb-20 px-4 `,children:[S.jsx("article",{className:`prose prose-2xl ${u.prose} text-xl ${u.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${u.text} leading-relaxed
|
|
10183
|
+
${a?"animate-slide-down opacity-0":""}`,children:i}),S.jsx("div",{className:`mt-8 ${a?"animate-slide-down opacity-0":""}`,children:S.jsx("input",{type:"text",value:h,onChange:d,placeholder:l,className:`w-full px-4 py-3 border-2 ${u.inputBorder} ${u.inputBg} ${u.inputText} rounded-xl text-lg focus:outline-none`})}),e&&S.jsx("div",{className:`mt-8 flex justify-center ${a?"animate-fade-in opacity-0":""}`,style:a?{animationDelay:"1s"}:{},children:S.jsx("button",{onClick:f,className:`${u.buttonBg} cursor-pointer px-8 py-3 border-2 ${u.buttonBorder} font-bold ${u.buttonText} text-lg rounded-xl ${u.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,children:e})})]})})}Zs("ProlificEnding",null),Hs("ProlificEnding",fo,{}),Em("ProlificEnding",[{name:"cc",defaultValue:"",type:"string",description:"Completion code of the Profilic experiment (more commonly supplied via the code)"}]);function bx({prolificCode:i,className:e,containerClass:t,centered:s,animate:r,data:n,updateStore:a}){let o=i??tn("cc","","string")??null;const l=S.jsxs("div",{className:"flex flex-col items-center",children:[S.jsx("svg",{className:"w-12 h-12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),S.jsxs("p",{className:"",children:["Thank you! Your data has been successfully submitted. ",S.jsx("br",{})," You can go back to Prolific and enter the code ",o," to finish the study. Alternatively, you can click on this link:"," ",S.jsx("a",{target:"_blank",className:"text-blue-400",href:`https://app.prolific.com/submissions/complete?cc=${o}`,children:"Go to Prolific"})]})]});return S.jsx(dc,{data:n,updateStore:a,className:e,containerClass:t,centered:s,animate:r,content:l,buttonText:"",next:()=>{}})}Zs("MicrophoneCheck","session"),Hs("MicrophoneCheck",fo,{});function hae({onMicrophoneSelect:i,disabled:e=!1}){var c;const t=xi(qi()),[s,r]=V.useState([]),[n,a]=V.useState(""),[o,l]=V.useState(!1);V.useEffect(()=>{navigator.mediaDevices.getUserMedia({audio:!0}).then(d=>{d.getTracks().forEach(f=>f.stop()),navigator.mediaDevices.enumerateDevices().then(f=>{const y=f.filter(v=>v.kind==="audioinput").map(v=>({deviceId:v.deviceId,label:v.label||`Microphone ${v.deviceId.slice(0,5)}`}));r(y),y.length>0&&!n&&(a(y[0].deviceId),i(y[0].deviceId))})}).catch(d=>{console.error("Error accessing microphone:",d)})},[]);const u=d=>{a(d),i(d),l(!1)},h=((c=s.find(d=>d.deviceId===n))==null?void 0:c.label)||"Select Microphone";return S.jsxs("div",{className:"relative w-64 mx-auto mt-8 mb-8",children:[S.jsx("button",{onClick:()=>!e&&l(!o),className:`w-full px-4 py-2 border-2 transition-all text-left font-bold ${t.buttonBg} ${t.buttonBorder} ${t.buttonShadow} ${e?`${t.buttonDisabledText} cursor-default`:`${t.buttonText} cursor-pointer hover:shadow-[1px_1px_0px_0px_rgba(0,0,0,1)] active:shadow-none active:translate-x-1 active:translate-y-1`} ${o?"shadow-none translate-x-1 translate-y-1":""}`,children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"truncate",children:h}),S.jsx("span",{className:`transition-transform ${o?"rotate-180":""}`,children:"▼"})]})}),o&&S.jsx("div",{className:"absolute w-full mt-2 z-50",children:S.jsx("ul",{className:`${t.buttonBg} border-2 ${t.buttonBorder} ${t.buttonShadow} max-h-60 overflow-auto`,children:s.map(d=>S.jsx("li",{onClick:()=>u(d.deviceId),className:`px-4 py-2 cursor-pointer hover:bg-black hover:text-white transition-colors ${n===d.deviceId?"bg-black text-white":t.buttonText} border-b-2 ${t.buttonBorder} last:border-b-0`,children:d.label},d.deviceId))})})]})}const wx=({next:i,updateStore:e,animate:t=!1,discardLabel:s})=>{const r=xi(qi()),[n,a]=V.useState(!1),[o,l]=V.useState(!1),[u,h]=V.useState(void 0),c=d=>{h(d),e({audioInputId:d})};return S.jsx("div",{className:`min-h-screen ${r.containerBg}`,children:S.jsxs("div",{className:`max-w-prose mx-auto mt-20 mb-20 px-4 ${t?"animate-fade-in opacity-0":""}`,children:[S.jsxs("article",{className:`prose prose-2xl ${r.prose} text-xl ${r.text} leading-relaxed`,children:[S.jsx("h1",{className:"text-3xl mb-6 font-semibold",children:"Let's test your microphone!"}),S.jsx("p",{children:"In this experiment, you will need to answer some questions verbally. To make sure that we don't lose your input, please select your preferred microphone using the menu below..."})]}),S.jsx(hae,{onMicrophoneSelect:c,disabled:o}),S.jsx("article",{className:`prose prose-2xl ${r.prose} text-xl ${r.text} leading-relaxed`,children:S.jsx("p",{children:"... and use the recording button below to make a test recording of your voice. After stopping the recording, you can use the play button to play back the audio."})}),S.jsx("div",{className:"mt-4 mb-12",children:S.jsx(Lm,{onRecordingStart:()=>l(!0),handleSaveVoiceData:()=>{a(!0),l(!1)},handleDiscardVoiceData:()=>{a(!1),l(!1)},deviceId:u,showPause:!1,showDiscard:!1,discardLabel:s})}),n&&S.jsxs("div",{className:"animate-fade-in opacity-0",children:[S.jsx("article",{className:`prose prose-2xl ${r.prose} text-xl ${r.text} leading-relaxed`,children:S.jsxs("p",{children:["Can you hear yourself? Great! You can continue on to the next step. ",S.jsx("br",{})," If you can't hear your voice, try one of the other options from the list or check any physical mute switches on your microphone. Be sure to also check that your computer audio is turned on so you can actually listen back to your test recording!"]})}),S.jsx("div",{className:"mt-16 flex justify-center",children:S.jsx("button",{onClick:()=>i({}),className:`${r.buttonBg} cursor-pointer px-8 py-3 border-2 ${r.buttonBorder} font-bold ${r.buttonText} text-lg rounded-xl ${r.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`,children:"Next"})})]})]})})};/*!
|
|
10184
10184
|
* surveyjs - Survey JavaScript library v2.4.1
|
|
10185
10185
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
10186
10186
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
package/package.json
CHANGED
|
@@ -27,6 +27,7 @@ function PlainInput({
|
|
|
27
27
|
content,
|
|
28
28
|
buttonText = 'Click me',
|
|
29
29
|
className = '',
|
|
30
|
+
centered = false,
|
|
30
31
|
next,
|
|
31
32
|
updateStore,
|
|
32
33
|
animate = false,
|
|
@@ -37,6 +38,7 @@ function PlainInput({
|
|
|
37
38
|
buttonText?: string;
|
|
38
39
|
onButtonClick?: () => void;
|
|
39
40
|
className?: string;
|
|
41
|
+
centered?: boolean;
|
|
40
42
|
animate?: boolean;
|
|
41
43
|
storeupdate?: (entry: string) => { [key: string]: any };
|
|
42
44
|
placeholder?: string;
|
|
@@ -56,8 +58,8 @@ function PlainInput({
|
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
return (
|
|
59
|
-
<div className={`min-h-screen ${th.containerBg}`}>
|
|
60
|
-
<div className={`max-w-prose mx-auto ${className}
|
|
61
|
+
<div className={`min-h-screen ${centered ? 'flex items-center justify-center' : ''} ${th.containerBg}`}>
|
|
62
|
+
<div className={`w-full max-w-prose mx-auto ${className} pt-20 pb-20 px-4 `}>
|
|
61
63
|
<article
|
|
62
64
|
className={`prose prose-2xl ${th.prose} text-xl ${th.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${th.text} leading-relaxed
|
|
63
65
|
${animate ? 'animate-slide-down opacity-0' : ''}`}
|
|
@@ -71,7 +73,7 @@ function PlainInput({
|
|
|
71
73
|
value={inputValue}
|
|
72
74
|
onChange={handleChange}
|
|
73
75
|
placeholder={placeholder}
|
|
74
|
-
className={`w-full px-4 py-3 border-2 ${th.inputBorder} ${th.inputBg} ${th.inputText} rounded-xl text-lg focus:outline-none
|
|
76
|
+
className={`w-full px-4 py-3 border-2 ${th.inputBorder} ${th.inputBg} ${th.inputText} rounded-xl text-lg focus:outline-none`}
|
|
75
77
|
/>
|
|
76
78
|
</div>
|
|
77
79
|
|