PageSourceSearch

https://www.projectread.ai/_next/static/chunks/pages/dev/playground/irregular-words-95d01872580ef704.js

js projectread.ai collected 2026-09-24 10:36:24 UTC 37,502 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4908d259-4814-4a9d-a289-f0ea42cfbdaa",e._sentryDebugIdIdentifier="sentry-dbid-4908d259-4814-4a9d-a289-f0ea42cfbdaa")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([["2009"],{37789:function(e,t,n){e=n.nmd(e),(window.__NEXT_P=window.__NEXT_P||[]).push(["/dev/playground/irregular-words",function(){return n(47962)}]),e.hot&&e.hot.dispose(function(){window.__NEXT_P.push(["/dev/playground/irregular-words"])})},6785:function(e,t,n){"use strict";n.d(t,{u:()=>b});var r=n(90515),o=n(97496),i=n(22226),l=n(69814),a=n(95931),s=n(32560),d=n(11823);function c(){let e=(0,r._)(["\n  0% { opacity: 0; transform: translateY(8px); }\n  100% { opacity: 1; transform: translateY(0); }\n"]);return c=function(){return e},e}function p(){let e=(0,r._)(["\n  0% { opacity: 0; transform: translateX(-8px); }\n  100% { opacity: 1; transform: translateX(0); }\n"]);return p=function(){return e},e}function u(){let e=(0,r._)(["\n  0% { opacity: 0; transform: translateY(-8px); }\n  100% { opacity: 1; transform: translateY(0); }\n"]);return u=function(){return e},e}function h(){let e=(0,r._)(["\n  0% { opacity: 0; transform: translateX(8px); }\n  100% { opacity: 1; transform: translateX(0); }\n"]);return h=function(){return e},e}let m=(0,i.keyframes)(c()),g=(0,i.keyframes)(p()),f=(0,i.keyframes)(u()),x=(0,i.keyframes)(h()),v={light:{background:d.r.colors.n0,text:d.r.colors.n100},dark:{background:d.r.colors.n100,text:d.r.colors.n30}},b=e=>{let{content:t,children:n,contentProps:r,theme:i="dark",...c}=e,p=(0,a.useRef)(null),[u,h]=(0,a.useState)();(0,s.t)(p,h,void 0,u);let{background:b,text:y}=v[i];return(0,o.BX)(l.fC,{open:u,delayDuration:100,...c,children:[(0,o.tZ)(l.xz,{ref:p,onTouchStart:()=>{h(!0)},asChild:!0,children:n}),(0,o.tZ)(l.h_,{children:(0,o.BX)(l.VY,{sideOffset:5,css:{borderRadius:4,padding:"12px 10px",backgroundColor:b,color:y,fontSize:13,fontWeight:550,lineHeight:1.4,boxShadow:"".concat(d.r.colors.n30," 0px 8px 42px -12px, ").concat(d.r.colors.n30," 0px 8px 24px -16px"),userSelect:"none",maxWidth:300,animationDuration:"400ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",zIndex:10,'&[data-state="delayed-open"]':{'&[data-side="top"]':{animationName:f},'&[data-side="right"]':{animationName:x},'&[data-side="bottom"]':{animationName:m},'&[data-side="left"]':{animationName:g}}},...r,children:[(0,o.tZ)(l.Eh,{css:{fill:b}}),(0,o.tZ)("div",{css:{"& > :first-child":{marginTop:0},"& > :last-child":{marginBottom:0}},children:t})]})})]})}},53058:function(e,t,n){"use strict";n.d(t,{I:()=>l});var r=n(97496),o=n(11823);let i=["checked","onChange","value","id","name","disabled"],l=e=>{let{label:t,description:n,className:l,...a}=e,[s,d]=Object.keys(a).reduce((e,t)=>{let[n,r]=e;return(i.includes(t)?n:r)[t]=a[t],[n,r]},[{},{}]);return(0,r.BX)("label",{css:{...o.r.titleS,display:"flex",alignItems:"flex-start",gap:12,cursor:"pointer"},className:l,...d,children:[(0,r.tZ)("input",{...s,type:"checkbox",css:{marginTop:"0.2em",accentColor:o.r.colors.n80,"&:checked":{backgroundColor:o.r.colors.n80,borderColor:o.r.colors.n80}}}),(0,r.BX)("div",{css:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:[(0,r.tZ)("div",{css:{userSelect:"none"},children:t}),n&&(0,r.tZ)("div",{css:o.r.bodyS,children:n})]})]})}},16258:function(e,t,n){"use strict";n.d(t,{BK:()=>d,MR:()=>c,yt:()=>s});var r=n(97496),o=n(95931),i=n(53058),l=n(56480),a=n(11823);let s=e=>{let{label:t,identifier:n,hint:s,error:d,children:c,labelStyles:p,className:u,...h}=e,m=o.Children.toArray(c).some(e=>(0,o.isValidElement)(e)&&e.type===i.I);return(0,r.BX)("div",{css:{"--input-border-color":d?a.r.colors.red100:void 0,marginBlock:16},className:u?"form-input ".concat(u):"form-input",...h,children:[!m&&(0,r.tZ)("label",{htmlFor:n,css:[a.r.label,p],children:t}),c,(d||s)&&(0,r.BX)("div",{css:{...a.r.bodyS,display:"flex",gap:8,alignItems:"baseline",margin:"4px 2px 0",svg:{flexShrink:0,fontSize:16,color:a.r.colors.red100,translate:"0 3px",marginTop:-3}},children:[d&&(0,r.tZ)(l.G,{}),(0,r.tZ)("span",{children:d||s})]})]})},d=e=>{let{name:t,description:n,children:o,...i}=e;return(0,r.BX)("div",{css:{marginBlock:16,borderBlock:"1px solid ".concat(a.r.colors.n10),paddingBlock:8,"&:first-child, & + &":{borderTop:0,paddingBlockStart:0}},...i,children:[(0,r.tZ)("h3",{css:{...a.r.titleS,color:a.r.colors.n80},children:t}),n&&(0,r.tZ)("p",{css:{...a.r.bodyS,marginBlockStart:"0.5em"},children:n}),o]})},c=e=>
1{let{cols:t,breakpoint:n,children:o,...i}=e;return(0,r.tZ)("div",{css:{display:"grid",gridTemplateColumns:"repeat(".concat(t,", 1fr)"),gap:16,marginBlock:16,"& > .form-input":{marginBlock:0},[n||a.r.mobile]:{gridTemplateColumns:"1fr"}},...i,children:o})}},51976:function(e,t,n){"use strict";n.d(t,{T:()=>i,o:()=>l});var r=n(97496),o=n(11823);let i={borderRadius:4,border:"1px solid var(--input-border-color, ".concat(o.r.colors.n30,")"),width:"100%",padding:"0.75em 1em",fontSize:14,fontWeight:500,background:o.r.colors.n0,color:o.r.colors.n70,transition:"border-color 0.2s","&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 50px ".concat(o.r.colors.n0," inset"),WebkitTextFillColor:o.r.colors.n70},"&:focus, &:focus-within":{outline:"none",borderColor:o.r.colors.n50},"&::placeholder":{color:o.r.colors.n40}},l=e=>(0,r.tZ)("input",{css:i,...e})},25791:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(97496),o=n(11823);let i=e=>{let{as:t,title:n,titleElement:i="h1",pad:l,max:a,children:s,...d}=e,c="boolean"==typeof l&&l?{"--cardPadding":"32px",[o.r.mobile]:{"--cardPadding":"24px"},[o.r.mobileSmall]:{"--cardPadding":"16px"}}:{"--cardPadding":"".concat(l||0,"px")};return(0,r.BX)(null!=t?t:"div",{css:{...c,marginInline:"auto",maxWidth:"min(100%, calc(100vw - 40px), ".concat(null!=a?a:720,"px)"),color:o.r.colors.n70,background:o.r.colors.n10,borderRadius:10,boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.025)",padding:"var(--cardPadding)"},...d,children:[n&&(0,r.tZ)(i,{css:{...o.r.titleM,fontSize:20,color:o.r.colors.n80,paddingBottom:12,borderBottom:"1px solid ".concat(o.r.colors.n30),marginBottom:24},children:n}),s]})}},54963:function(e,t,n){"use strict";n.d(t,{Y:()=>s,o:()=>d});var r=n(97496),o=n(41779),i=n(6785),l=n(85205),a=n(11823);let s=e=>{let{noButton:t,...n}=e,a=t?"div":o.i;return(0,r.tZ)(i.u,{...n,children:(0,r.tZ)(a,{css:{flexShrink:0},children:(0,r.tZ)(l.s,{})})})},d=e=>{let{as:t,label:n,children:o,tipFirst:i,...l}=e;return(0,r.BX)(null!=t?t:"div",{css:{display:"inline-flex",flexDirection:i?"row-reverse":"row",justifyContent:i?"flex-end":"flex-start",alignItems:"center",gap:4,button:{marginInline:"0.25em",...a.r.noPrint}},...l,children:[n,(0,r.tZ)(s,{content:o,noButton:!0})]})}},74153:function(e,t,n){"use strict";n.d(t,{L:()=>o});var r=n(95931);function o(e){let[t,n]=(0,r.useState)();return(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let r=-1,o=-1,i=(e,t)=>{let i=Math.round(e),l=Math.round(t);(i!==r||l!==o)&&(r=i,o=l,n({width:i,height:l}))};{let e=t.getBoundingClientRect();i(e.width,e.height)}let l=new ResizeObserver(e=>{for(let n of e){if(n.target!==t)continue;let e=n.borderBoxSize[0];e?i(e.inlineSize,e.blockSize):i(n.contentRect.width,n.contentRect.height)}});return l.observe(t,{box:"border-box"}),()=>{l.disconnect()}},[e]),t}},27196:function(e,t,n){"use strict";n.d(t,{G:()=>o});var r=n(95931);let o=(e,t)=>{(0,r.useEffect)(()=>{let n=n=>{n.key===e&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])}},32560:function(e,t,n){"use strict";n.d(t,{t:()=>o});var r=n(95931);let o=function(e,t,n){let o=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=(0,r.useCallback)(r=>{e.current&&r.target&&!e.current.contains(r.target)&&t(n)},[e,t,n]);(0,r.useEffect)(()=>(setTimeout(()=>{o?document.addEventListener("click",i):document.removeEventListener("click",i)},1),()=>{document.removeEventListener("click",i)}),[i,o])}},85205:function(e,t,n){"use strict";n.d(t,{s:()=>o});var r=n(97496);let o=e=>(0,r.tZ)("svg",{viewBox:"0 0 24 24",width:"1em",...e,children:(0,r.tZ)("path",{fill:"currentColor",d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})})},97451:function(e,t,n){"use strict";n.d(t,{d:()=>d});var r=n(97496),o=n(16024),i=n.n(o),l=n(12122),a=n(75619),s=n(24829);let d=e=>{let{title:t,description:n,noIndex:o,canonicalUrl:d,image:c}=e,p=t.includes("Project Read")?t:"".concat(t," \xb7 Project Read");(null==d?void 0:d.startsWith("/"))&&(d=new URL(d,a._n).toString());let u=c&&"string"!=typeof c?(0,l.ZA)({...s.dJ.parse(c),baseUrl:a.NZ,width:1200,height:800}):{src:null!=c?c:"".concat(a._n,"og-image.jpg"),width:void 0,height:void 0};return(0,r.BX)(i(),{children:[(0,r.tZ)("title",{children:p}),(0,r.tZ)("meta",{name:"og:title",content:p}),n&&(0,r.tZ)("meta",{name:"description",content:n}),n&&(0,r.tZ)("meta",{name:"og:description",content:n}),(0,r.tZ)("meta",{property:"og:image",content:u.src}),u.width&&(0,r.tZ)("meta",{property:"og:image:width",content:"".concat(u.width)},"width"),u.height&&(0,r.tZ)("meta",{property:"og:image:height",content:"".concat(u.height)},"height"),o&&(0,r.tZ)("meta",{name:"robots",content:"noindex"}),d&&(0,r.tZ)("link",{rel:"canonical",content:d})]})}},75622:function(e,t,n){"use strict";n.d(t,{u:()=>r});let r=(e,t,n)=>Math.min(n,Math.max(t,e))},47962:function(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>es,__N_SSP:()=>ea}
1);var r=n(97496),o=n(40006),i=n(20178),l=n.n(i),a=n(95931),s=n(99168),d=n(16258),c=n(51976),p=n(25791),u=n(23023),h=n(4622),m=n(8e3),g=n(41779),f=n(54963),x=n(49677);x.Z_().trim().regex(/^(?:e_ɇ|[A-Za-z']+_(?:∅|[a-z]{1,2}(?:·[a-z]{1,2})?))$/u).brand(),x.Km(["manual","heuristic_v1"]);var v=n(76271);let b=e=>Array.from(e).map((e,t)=>({id:"grapheme-tile-".concat(t),sourceIndex:t,text:e})),y=e=>e.map((e,t)=>({id:"phoneme-tile-".concat(t),sourceIndex:t,text:e})),I=e=>({graphemeGroups:e.graphemeGroups.map(e=>({...e,tiles:[...e.tiles]})),phonemeGroups:e.phonemeGroups.map(e=>({...e,tiles:[...e.tiles]}))}),w=(e,t)=>e.findIndex(e=>e.id===t),G=(e,t,n)=>1===Math.abs(w(e,t)-w(e,n)),Z=e=>e.tiles.map(e=>e.text).join("\xb7"),k=e=>{let{phonemeGroupId:t,graphemeGroups:n,leftIndex:r,rightIndex:o}=e,i=n[r],l=n[o];n.splice(r,2,{phonemeGroupId:t,id:i.id,silentType:"plain",tiles:[...i.tiles,...l.tiles]})},C=e=>{let{leftIndex:t,phonemeGroups:n,rightIndex:r}=e,o=n[t],i=n[r];return n.splice(t,2,{id:o.id,tiles:[...o.tiles,...i.tiles]}),{mergedId:o.id,removedId:i.id}},_=(e,t)=>e.graphemeGroups.findIndex(e=>e.phonemeGroupId===t),S=e=>{let{phonemes:t,word:n}=e;return{graphemeGroups:b(n).map((e,t)=>({phonemeGroupId:null,id:"grapheme-group-".concat(t),silentType:"plain",tiles:[e]})),phonemeGroups:y(t).map((e,t)=>({id:"phoneme-group-".concat(t),tiles:[e]}))}},B=e=>{var t,n,r,o;let{graphemeGroupId:i,alignment:{graphemeGroups:l,phonemeGroups:a}}=e,s=w(l,i);if(s<0)return new Set;let d=null!=(n=null==(t=l[s])?void 0:t.phonemeGroupId)?n:null,c=-1;for(let e=s-1;e>=0;e--){let t=null==(r=l[e])?void 0:r.phonemeGroupId;if(t){c=w(a,t);break}}let p=a.length;for(let e=s+1;e<l.length;e++){let t=null==(o=l[e])?void 0:o.phonemeGroupId;if(t){p=w(a,t);break}}return new Set(a.filter((e,t)=>{var n;let r=_({graphemeGroups:l,phonemeGroups:a},e.id);return(-1===r||(null==(n=l[r])?void 0:n.id)===i)&&t>c&&t<p&&(e.id===d||-1===r)}).map(e=>e.id))},M=e=>{let{graphemeGroupId:t,phonemeGroupId:n,alignment:r}=e,o=I(r),i=w(o.graphemeGroups,t);return i<0||null!=n&&!B({graphemeGroupId:t,alignment:r}).has(n)?null:(o.graphemeGroups[i]={...o.graphemeGroups[i],phonemeGroupId:n,silentType:n?"plain":o.graphemeGroups[i].silentType},o)};var X=n(75622),z=n(11823);let R={exact:{accent:z.r.colors.green100,label:"Standard GPC"},single:{accent:z.r.colors.yellow100,label:"Non-standard mapping"},sequence:{accent:z.r.colors.yellow100,label:"Non-standard mapping"},invalid:{accent:z.r.colors.red100,label:"Atypical phoneme sequence"},silent:{accent:z.r.colors.n70,label:"Silent grapheme"}},P=e=>{let t={groups:[],rowWidth:0,tiles:[]},n=0;for(let r of e){let e=44+42*Math.max(0,r.tiles.length-1);for(let[o,i]of(t.groups.push({center:n+e/2,id:r.id,left:n,width:e}),r.tiles.entries()))t.tiles.push({groupId:r.id,id:i.id,left:n+42*o,tileIndex:o});n+=e+18}return t.rowWidth=Math.max(0,n-18),t};var T=n(74153),W=n(27367);let j=e=>{var t,n;let{state:{alignment:o,selectedGraphemeId:i},derivedGroups:l,dispatch:d,onReset:c,onRestore:p,resetDisabled:u,restoreDisabled:h}=e,m=(0,a.useRef)(null),g=null!=(n=null==(t=(0,T.L)(m))?void 0:t.width)?n:0,[x,v]=(0,a.useState)(null),b=P(o.graphemeGroups),y=P(o.phonemeGroups),I=Math.max(b.rowWidth,y.rowWidth,420),w=Math.max(g,I),G=(w-b.rowWidth)/2,Z=(w-y.rowWidth)/2;return(0,r.BX)("div",{css:{background:z.r.colors.n0,border:"1px solid ".concat(z.r.colors.n30),borderRadius:16,padding:16},children:[(0,r.BX)("div",{css:{display:"flex",justifyContent:"space-between",gap:8,alignItems:"start"},children:[(0,r.BX)(s.W4,{children:[(0,r.tZ)(s.zx,{level:"secondary",size:"S",disabled:h,onClick:p,children:"Restore heuristic"}),(0,r.tZ)(s.zx,{level:"secondary",size:"S",disabled:u,onClick:c,children:"Reset to tiles"})]}),(0,r.tZ)(f.Y,{content:(0,r.tZ)(r.HY,{children:"Drag tiles sideways to join or detach them. Grouped tiles snap together with no gap. Click a grapheme once, then click a phoneme to connect it. The selection clears after a successful connection, and you can cancel it by clicking the same grapheme again or pressing Esc."})})]}),(0,r.tZ)("div",{css:{maxWidth:"calc(100% + 32px)",overflowX:"auto",marginInline:-16,paddingInline:16},children:(0,r.BX)("div",{ref:m,css:{position:"relative",width:"100%",minWidth:I,height:310,marginInline:"auto"},children:[(0,r.tZ)(A,{top:47,children:"Grapheme Groups"}),(0,r.tZ)(N,{activeDrag:x,setActiveDrag:v,dispatch:d,groups:o.graphemeGroups,kind:"grapheme",offset:G,rowTop:75,selectedGraphemeId:i}),(0,r.tZ)("svg",{width:w,height:310,css:{position:"absolute",inset:0},children:l.map(e=>e.phonemeGroup?(0,r.tZ)(E,{...e,wordOffset:G,phonemeOffset:Z,graphemePosition:b.groups.find(t=>
1t.id===e.id),phonemePosition:y.groups.find(t=>t.id===e.phonemeGroupId),active:i===e.id,dispatch:d},"".concat(e.id,"-").concat(e.phonemeGroupId)):null)}),(0,r.tZ)(A,{top:247,children:"Phoneme Groups"}),(0,r.tZ)(N,{activeDrag:x,setActiveDrag:v,dispatch:d,groups:o.phonemeGroups,kind:"phoneme",offset:Z,rowTop:197,selectedGraphemeId:i,validPhonemeTargets:null==i?new Set:B({graphemeGroupId:i,alignment:o})})]})}),(0,r.tZ)(D,{})]})},D=()=>(0,r.BX)("div",{css:{...z.r.titleXS,fontWeight:550,display:"flex",justifyContent:"center",alignItems:"baseline",gap:24,borderTop:"1px solid ".concat(z.r.colors.n20),paddingTop:16,[z.r.max(640)]:{flexDirection:"column",gap:8},".entry":{"&:before":{content:'""',display:"inline-block",background:"var(--accent, ".concat(z.r.colors.n30,")"),width:16,height:4,marginRight:4,borderRadius:4,verticalAlign:"middle"}}},children:[(0,r.tZ)("div",{className:"entry",style:{"--accent":R.exact.accent},children:"Standard GPC"}),(0,r.tZ)("div",{className:"entry",style:{"--accent":R.single.accent},children:"Non-standard mapping"}),(0,r.tZ)("div",{className:"entry",style:{"--accent":R.invalid.accent},children:"Atypical phoneme sequence"})]}),N=e=>{let{activeDrag:t,setActiveDrag:n,dispatch:o,groups:i,kind:l,offset:s,rowTop:d,selectedGraphemeId:c,validPhonemeTargets:p}=e,u=(0,a.useRef)(!1),h=P(i);return(0,r.tZ)("div",{css:{position:"absolute",left:s,top:d,height:42},children:h.tiles.map(e=>{var a;let s=i.find(t=>t.id===e.groupId),d=null==s?void 0:s.tiles[e.tileIndex];if(!s||!d)return null;let h=i.findIndex(e=>e.id===s.id),m=s.tiles.length,g="grapheme"===l&&s.id===c,f="phoneme"===l&&null!=c&&(null==p?void 0:p.has(s.id)),x="phoneme"===l&&null!=c&&!f&&(null==t?void 0:t.kind)!=="phoneme",v=1===m||0===e.tileIndex||e.tileIndex===m-1,b=(e=>{let{activeDrag:t,group:n,groupIndex:r,groups:o,kind:i,tileIndex:l}=e;if((null==t?void 0:t.kind)!==i||t.groupId!==n.id||t.tileIndex!==l)return 0;let a=t.currentClientX-t.startClientX,s=r<o.length-1;return 1===n.tiles.length?(0,X.u)(a,r>0?-42:0,42*!!s):0===l?(0,X.u)(a,-42,0):l===n.tiles.length-1?(0,X.u)(a,0,42):0})({activeDrag:t,group:s,groupIndex:h,groups:i,kind:l,tileIndex:e.tileIndex}),y=(null==t?void 0:t.kind)===l&&t.groupId===s.id&&t.tileIndex===e.tileIndex,I=(a=e.tileIndex,1===m?16:0===a?"16px 4px 4px 16px":a===m-1?"4px 16px 16px 4px":4);return(0,r.tZ)("button",{"data-testid":"".concat(l,"-tile-").concat(d.sourceIndex),type:"button",onClick:()=>{if(u.current){u.current=!1;return}if("grapheme"===l)return void o({type:"toggleSelect",graphemeId:s.id});c&&f&&o({type:"connect",graphemeGroupId:c,phonemeGroupId:s.id})},onPointerDown:t=>{v&&(t.currentTarget.setPointerCapture(t.pointerId),n({groupId:s.id,kind:l,pointerId:t.pointerId,startClientX:t.clientX,tileIndex:e.tileIndex,currentClientX:t.clientX}))},onPointerMove:r=>{(null==t?void 0:t.kind)===l&&t.groupId===s.id&&t.pointerId===r.pointerId&&t.tileIndex===e.tileIndex&&n({...t,currentClientX:r.clientX})},onPointerCancel:r=>{(null==t?void 0:t.kind)===l&&t.groupId===s.id&&t.pointerId===r.pointerId&&t.tileIndex===e.tileIndex&&(r.currentTarget.releasePointerCapture(r.pointerId),n(null))},onPointerUp:r=>{(null==t?void 0:t.kind)===l&&t.groupId===s.id&&t.pointerId===r.pointerId&&t.tileIndex===e.tileIndex&&(r.currentTarget.releasePointerCapture(r.pointerId),n(null),Math.abs(b)>5&&(u.current=!0,o({type:"commitDrag",delta:b,groupId:s.id,kind:l,tileIndex:e.tileIndex})))},css:{position:"absolute",top:0,width:44,height:42,color:z.r.colors.n80,fontSize:18,fontWeight:700,touchAction:"none"},style:{left:e.left+b,borderRadius:I,border:"2px solid ".concat(g?z.r.colors.blue100:z.r.colors.n30),background:g?z.r.colors.blue10:z.r.colors.n0,cursor:v?y?"grabbing":"grab":"pointer",opacity:x?.45:1,boxShadow:y?"0 8px 16px rgba(0, 0, 0, 0.14)":g?"0 0 0 3px ".concat(z.r.colors.blue20):void 0,transform:y?"translateY(-2px)":void 0,zIndex:y?2:1,transition:y?"none":"left 0.14s ease-out, box-shadow 0.14s ease-out, transform 0.14s ease-out, background 0.14s ease-out, border-color 0.14s ease-out"},children:d.text},d.id)})})},E=e=>{let{id:t,identifier:n,classification:o,active:i,wordOffset:l,phonemeOffset:a,graphemePosition:s,phonemePosition:d,dispatch:c}=e,p=R[o],u=l+s.center,h=a+d.center,m=(u+h)/2,f=157,x="M".concat(u," ").concat(125," C").concat(u," ").concat(f," ").concat(h," ").concat(f," ").concat(h," ").concat(189);return(0,r.BX)("g",{css:{"&:hover .connection-remove":{opacity:1,pointerEvents:"auto"}},children:[(0,r.tZ)("path",{d:x,fill:"none",stroke:"transparent",strokeLinecap:"round",strokeWidth:18,pointerEvents:"stroke",onClick:()=>{c({type:"select",graphemeId:t})}
1,css:{cursor:"pointer"}}),(0,r.tZ)("path",{d:x,fill:"none",stroke:p.accent,strokeLinecap:"round",strokeWidth:i?5:3,pointerEvents:"none"}),(0,r.tZ)("foreignObject",{x:m-12,y:f-12,width:24,height:24,children:(0,r.tZ)(g.i,{"aria-label":"Disconnect ".concat(n),onClick:e=>{e.stopPropagation(),c({type:"removeConnection",graphemeGroupId:t})},onMouseDown:e=>{e.stopPropagation()},css:{borderRadius:24,background:p.accent,color:z.r.colors.n0,transition:"opacity 0.12s ease-out",opacity:+!!i,pointerEvents:i?"auto":"none"},className:"connection-remove",children:(0,r.tZ)(W.xb,{width:24,height:24,title:"Disconnect ".concat(n),css:{padding:4}})})})]})},A=e=>{let{bottom:t,children:n,top:o}=e;return(0,r.tZ)("div",{css:{...z.r.titleS,position:"absolute",left:"50%",transform:"translateX(-50%)",textAlign:"center",top:o,bottom:t,color:z.r.colors.n50,pointerEvents:"none"},children:n})},L=e=>({alignment:e,selectedGraphemeId:null,nextId:e.graphemeGroups.length+e.phonemeGroups.length}),$=(e,t)=>{switch(t.type){case"replace":return L(t.alignment);case"select":return{...e,selectedGraphemeId:t.graphemeId};case"toggleSelect":return{...e,selectedGraphemeId:e.selectedGraphemeId===t.graphemeId?null:t.graphemeId};case"connect":return Y(e,M({graphemeGroupId:t.graphemeGroupId,phonemeGroupId:t.phonemeGroupId,alignment:e.alignment}),null);case"removeConnection":return Y(e,M({graphemeGroupId:t.graphemeGroupId,phonemeGroupId:null,alignment:e.alignment}),t.graphemeGroupId);case"commitDrag":return O(e,t)}},O=(e,t)=>{if(10>Math.abs(t.delta))return e;let n="grapheme"===t.kind?e.alignment.graphemeGroups:e.alignment.phonemeGroups,r=n.findIndex(e=>e.id===t.groupId),o=n[r];if(!o)return e;if(1===o.tiles.length){let i=t.delta<0?r-1:r+1,l=n[i];if(!l)return e;let a=i<r?l.id:o.id,s=i<r?o.id:l.id;return Y(e,"grapheme"===t.kind?(e=>{var t;let{leftGroupId:n,rightGroupId:r,alignment:o}=e;if(!G(o.graphemeGroups,n,r))return null;let i=I(o),l=Math.min(w(i.graphemeGroups,n),w(i.graphemeGroups,r)),a=l+1,s=i.graphemeGroups[l],d=i.graphemeGroups[a],c=null!=(t=s.phonemeGroupId)?t:d.phonemeGroupId;if(s.phonemeGroupId&&d.phonemeGroupId){let e=w(i.phonemeGroups,s.phonemeGroupId),t=w(i.phonemeGroups,d.phonemeGroupId);if(e<0||t<0||1!==Math.abs(e-t))return null;let n=Math.min(e,t),r=n+1;if(i.phonemeGroups[n].tiles.length+i.phonemeGroups[r].tiles.length>2)return null;let{mergedId:o,removedId:l}=C({leftIndex:n,phonemeGroups:i.phonemeGroups,rightIndex:r});i.graphemeGroups=i.graphemeGroups.map(e=>({...e,phonemeGroupId:e.phonemeGroupId===l?o:e.phonemeGroupId})),c=o}return k({phonemeGroupId:null!=c?c:null,graphemeGroups:i.graphemeGroups,leftIndex:l,rightIndex:a}),i})({leftGroupId:a,rightGroupId:s,alignment:e.alignment}):(e=>{let{leftGroupId:t,rightGroupId:n,alignment:r}=e;if(!G(r.phonemeGroups,t,n))return null;let o=I(r),i=Math.min(w(o.phonemeGroups,t),w(o.phonemeGroups,n)),l=i+1;if(o.phonemeGroups[i].tiles.length+o.phonemeGroups[l].tiles.length>2)return null;let a=o.phonemeGroups[i].id,s=o.phonemeGroups[l].id,d=_(o,a),c=_(o,s);if(d>=0&&c>=0&&1!==Math.abs(d-c))return null;let{mergedId:p,removedId:u}=C({leftIndex:i,phonemeGroups:o.phonemeGroups,rightIndex:l});return o.graphemeGroups=o.graphemeGroups.map(e=>({...e,phonemeGroupId:e.phonemeGroupId===u?p:e.phonemeGroupId})),d>=0&&c>=0&&k({phonemeGroupId:p,graphemeGroups:o.graphemeGroups,leftIndex:Math.min(d,c),rightIndex:Math.min(d,c)+1}),o})({leftGroupId:a,rightGroupId:s,alignment:e.alignment}),e.selectedGraphemeId)}let i=0===t.tileIndex&&t.delta<0?"left":t.tileIndex===o.tiles.length-1&&t.delta>0?"right":null;if(null==i)return e;let l=e.nextId+1,a="".concat(t.kind,"-group-generated-").concat(l);return Y({...e,nextId:l},"grapheme"===t.kind?(e=>{let{direction:t,groupId:n,newGroupId:r,alignment:o}=e,i=I(o),l=w(i.graphemeGroups,n);if(l<0)return null;let a=i.graphemeGroups[l];if(a.tiles.length<=1)return null;let s="left"===t?[a.tiles[0]]:[a.tiles.at(-1)],d="left"===t?a.tiles.slice(1):a.tiles.slice(0,-1);return i.graphemeGroups[l]={...a,tiles:d},i.graphemeGroups.splice("left"===t?l:l+1,0,{phonemeGroupId:null,id:r,silentType:"plain",tiles:s}),i})({direction:i,groupId:t.groupId,newGroupId:a,alignment:e.alignment}):(e=>{let{direction:t,groupId:n,newGroupId:r,alignment:o}=e,i=I(o),l=w(i.phonemeGroups,n);if(l<0)return null;let a=i.phonemeGroups[l];if(a.tiles.length<=1)return null;let s="left"===t?[a.tiles[0]]:[a.tiles.at(-1)],d="left"===t?a.tiles.slice(1):a.tiles.slice(0,-1);return i.phonemeGroups[l]={...a,tiles:d}
1,i.phonemeGroups.splice("left"===t?l:l+1,0,{id:r,tiles:s}),i})({direction:i,groupId:t.groupId,newGroupId:a,alignment:e.alignment}),"grapheme"===t.kind?null:e.selectedGraphemeId)},Y=(e,t,n)=>t?{...e,alignment:t,selectedGraphemeId:t.graphemeGroups.some(e=>e.id===n)?n:null}:e;var q=n(5396),U=n(31756);let H=(0,U.Rt)({description:"preview the irregular mapping",request:{method:"get",path:"/api/playground/irregular-words?action=mapWord"}}),V=e=>{let{word:t,initialPhonemes:n,phonemes:o,onApplied:i}=e,[l,p]=(0,a.useState)(o.join(" ")),u=(0,U.qG)({action:H,prepareInput:()=>{if(!l.trim())return U.nG;let e=F(l);return e.ok?{word:t,phonemes:e.phonemes.join(" ")}:(h.Am.error(e.error),U.nG)},onSuccess:e=>{let{phonemes:t,initialGpcs:n}=e;i({phonemes:t,initialGpcs:n})}});return(0,r.BX)("div",{children:[(0,r.BX)("details",{css:{marginBottom:16},children:[(0,r.tZ)("summary",{css:{...z.r.titleS,color:z.r.colors.n50,cursor:"pointer"},children:"Valid SAPI phonemes"}),(0,r.BX)("div",{css:{marginTop:12,borderRadius:8,display:"grid",gridTemplateColumns:"minmax(0, 3fr) minmax(0, 4fr)",gap:25,[z.r.mobile]:{gridTemplateColumns:"1fr"}},children:[(0,r.tZ)(ee,{phonemes:K,title:"Vowels"}),(0,r.tZ)(ee,{phonemes:Q,title:"Consonants"})]})]}),(0,r.BX)("form",{onSubmit:u.onSubmit,children:[(0,r.tZ)(d.yt,{identifier:"irregular-phoneme-input",label:"Phonemes",hint:(0,r.BX)(r.HY,{children:["Space-separated SAPI phonemes. Press Enter or Apply to rerun the heuristic. Changed sequences are saved to"," ",(0,r.tZ)("code",{children:"unmapped_words"})," on save. ",(0,r.tZ)("br",{})," 'Restore' restores the initial, loaded phonemes."]}),children:(0,r.tZ)(c.o,{id:"irregular-phoneme-input",name:"irregular-phoneme-input",placeholder:"k y uh r",value:l,disabled:u.loading,onChange:e=>{p(e.target.value)}})}),(0,r.BX)(s.W4,{align:"end",css:{marginTop:24},children:[(0,r.tZ)(s.zx,{type:"button",level:"secondary",disabled:!l.trim()||u.loading,onClick:()=>{p(n.join(" "))},children:"Restore"}),(0,r.tZ)(s.zx,{type:"submit",level:"primary",loading:u.loading,loadingLabel:"Applying phonemes",disabled:!l.trim(),children:"Apply"})]})]})]})},F=e=>{let t=(0,v.pU)(e.trim());try{let e=v.jD.array().min(1).parse(t);return{ok:!0,phonemes:e}}catch(e){if(e instanceof q.j){for(let n of e.issues)if("invalid_value"===n.code){let e=t[Number(n.path[0])];return{ok:!1,error:'Invalid phoneme: "'.concat(String(e),'"')}}}return{ok:!1,error:"Please enter a valid phoneme sequence."}}},K=v.jD.options.filter(e=>/[aeiou]/.test(e)),J=new Set(K),Q=v.jD.options.filter(e=>!J.has(e)),ee=e=>{let{phonemes:t,title:n}=e;return(0,r.BX)("div",{css:{...z.r.label,color:z.r.colors.n70,marginBottom:0},children:[n,(0,r.tZ)("div",{css:{display:"flex",flexWrap:"wrap",gap:8,marginTop:"4px"},children:t.map(e=>(0,r.tZ)("code",{css:{fontFamily:z.r.fonts.mono,fontSize:13,fontWeight:500,lineHeight:1.2,padding:"1px 0",margin:"0px 2px",color:z.r.colors.n70,borderBottom:"2px solid ".concat(z.r.colors.n30)},children:e},e))})]})};var et=n(27196);let en=(0,U.Rt)({description:"load a word",request:{method:"get",path:"/api/playground/irregular-words?action=fetchWord"}}),er=(0,U.Rt)({description:"save this mapping",request:{method:"post",path:"/api/playground/irregular-words"}}),eo=e=>{let{word:t,phonemes:n,initialGpcs:o,source:i,gpcIdentifiers:l,loadWord:d,initialPhonemes:c,applyPhonemeOverride:g}=e,f=(0,a.useMemo)(()=>null==o?null:(e=>{let{identifiers:t,phonemes:n,word:r}=e,o=b(r),i=y(n),l=[],a=[],s=0,d=0;for(let[e,n]of t.entries()){let t=n.indexOf("_");if(t<=0)return null;let r=n.slice(0,t),c=n.slice(t+1),p=Array.from(r).length,u=o.slice(s,s+p);if(u.map(e=>e.text).join("")!==r)return null;if(""===c||"∅"===c){l.push({id:"grapheme-group-".concat(e),phonemeGroupId:null,silentType:"plain",tiles:u}),s+=p;continue}if("ɇ"===c){l.push({phonemeGroupId:null,id:"grapheme-group-".concat(e),silentType:"silent_e",tiles:u}),s+=p;continue}let h=c.split("\xb7"),m=i.slice(d,d+h.length);if(m.map(e=>e.text).join("\xb7")!==c)return null;let g="phoneme-group-".concat(a.length);a.push({id:g,tiles:m}),l.push({phonemeGroupId:g,id:"grapheme-group-".concat(e),silentType:"plain",tiles:u}),s+=p,d+=h.length}return s!==o.length||d!==i.length?null:{graphemeGroups:l,phonemeGroups:a}})({identifiers:o,phonemes:n,word:t}),[o,n,t]),[x,I]=(0,a.useReducer)($,null!=f?f:S({phonemes:n,word:t}),L);(0,et.G)("Escape",()=>{I({type:"select",graphemeId:null})});let w=(e=>{let{gpcIdentifiers:t,alignment:n}=e,r=new Map(n.phonemeGroups.map(e=>[e.id,e]));return n.graphemeGroups.map(e=>{var n;let o=e.tiles.map(e=>e.text).join(""),i=e.phonemeGroupId&&null!=(n=r.get(e.phonemeGroupId))?n:null,l=null==i?"e"===o&&"silent_e"===e.silentType?"e_ɇ":"".concat(o,"_").concat("∅"):"".concat(o,"_").concat(Z(i));return{...e,classification:(e=>{var t,n,r;let{gpcIdentifiers:o,grapheme:i,phonemeGroup:l,silentType:a}=e;if(!l)return"e"===i&&"silent_e"===a&&o.has("e_ɇ")?"exact":"silent";let s="".concat(i,"_").concat(Z(l));return o.has(s)?"exact":1===l.tiles.length&&v.jD.safeParse(null==(t=l.tiles[0])?void 0:t.text).success?"single":2===l.tiles.length&&v.rW.safeParse([null==(n=l.tiles[0])?void 0:n.text,null==(r=l.tiles[1])?void 0:r.text]).success?"sequence":"invalid"})({gpcIdentifiers:t,grapheme:o,phonemeGroup:i,silentType:e.silentType}),grapheme:o,identifier:l,phonemeGroup:i}})})({gpcIdentifiers:l,alignment:x.alignment}),G=(e=>{let t=new Set(e.graphemeGroups.map(e=>e.phonemeGroupId).filter(e=>null!=e));return e.phonemeGroups.filter(e=>!t.has(e.id)).map(e=>e.id)})(x.alignment),k=(0,U.lM)(er,{prepareInput:()=>{if(G.length>0)return h.Am.error("Please assign all phonemes before saving"),U.nG;let e=w.map(e=>e.identifier),r="unmapped"===i&&(0,u.vZ)(e,o);return{body:{gpcIdentifiers:e,mapSource:r?"heuristic_v1":"manual",word:t,phonemes:"gpc_words"===i||(0,u.vZ)(n,c)?void 0:n}}},onResult:async e=>{e.success&&await d.execute()}});return(0,r.BX)(p.Z,{pad:!0,css:{marginTop:16},max:1200,children:[(0,r.BX)("div",{css:{display:"flex",justifyContent:"space-between",gap:8,alignItems:"flex-start",flexWrap:"wrap",marginBottom:16},children:[(0,r.BX)("div",{children:[(0,r.tZ)("h2",{css:z.r.titleL,children:t}),(0,r.BX)("div",{css:{display:"flex",alignItems:"center",gap:8,color:z.r.colors.n50,marginTop:4},children:[n.join(" \xb7 "),(0,r.tZ)(s.zx,{size:"S",level:"secondary",color:"coral",disabled:d.loading||k.loading,onClick:()=>{(0,m.vC)({title:'Override phonemes for "'.concat(t,'"'),name:"irregular-phoneme-override",content:(0,r.tZ)(V,{word:t,initialPhonemes:c,phonemes:n,onApplied:e=>{g(e),(0,m.Wr)()}})})},children:"Override Phonemes"})]})]}),(0,r.BX)(s.W4,{align:"end",children:[(0,r.tZ)(s.zx,{"data-testid":"next-random-button",size:"L",level:"secondary",disabled:k.loading,loading:d.loading,loadingLabel:"Loading next word",onClick:()=>{d.dispatch()},children:"Skip"}),(0,r.tZ)(s.zx,{"data-testid":"save-mapping-button",size:"L",loading:k.loading,loadingLabel:"Saving mapping",disabled:G.length>0||d.loading,onClick:()=>{k.dispatch()},children:"Save mapping"})]})]}),(0,r.tZ)(j,{state:x,dispatch:I,derivedGroups:w,restoreDisabled:!f||k.loading,resetDisabled:k.loading,onReset:()=>{I({type:"replace",alignment:S({phonemes:n,word:t})})},onRestore:()=>{f&&I({type:"replace",alignment:f})}})]})};var ei=n(97451);let el=e=>{let{loadWordAction:t}=e,[n,o]=(0,a.useState)("");return(0,r.tZ)(p.Z,{title:"Irregular Word Mapping Playground",pad:!0,css:{marginTop:0},max:1200,children:(0,r.tZ)("form",{onSubmit:e=>{e.preventDefault();let r=n.trim().toLowerCase();t.dispatch(r?{word:r}:void 0)},children:(0,r.BX)("div",{css:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto auto",gap:12,alignItems:"end",[z.r.mobile]:{gridTemplateColumns:"1fr"}},children:[(0,r.tZ)(d.yt,{identifier:"irregular-word-input",label:"Word",css:{marginBlock:0},children:(0,r.tZ)(c.o,{"data-testid":"manual-word-input",id:"irregular-word-input",n
1ame:"irregular-word-input",pattern:v.UZ,value:n,onChange:e=>{o(e.target.value)}})}),(0,r.BX)(s.zx,{"data-testid":"load-word-button",type:"submit",level:"primary",size:"L",loading:t.loading,loadingLabel:"Loading word",children:["Load ",n.trim()?"":"random ","word"]})]})})})};var ea=!0;let es=(0,o.j5)(e=>{let{gpcIdentifiers:t}=e,[n,o]=(0,a.useState)(null),i=(0,a.useCallback)(e=>{if(e.success){let{success:t,...n}=e;o({...n,initialPhonemes:n.phonemes})}},[]),s=(0,U.lM)(en,{onResult:i}),d=(0,a.useCallback)(e=>{let{phonemes:t,initialGpcs:n}=e;o(e=>e?{...e,phonemes:t,initialGpcs:n}:e)},[]);return(0,r.BX)(r.HY,{children:[(0,r.tZ)(ei.d,{title:"Irregular Words Playground \xb7 Playground",noIndex:!0}),(0,r.tZ)("div",{css:{maxWidth:1200,margin:"50px auto 8px"},children:(0,r.BX)(l(),{href:"/dev/playground",css:{transition:"transform 0.2s ease-out",":hover":{transform:"translateY(-1px)"}},children:["← ",(0,r.tZ)("small",{children:"Back to the playground"})]})}),(0,r.tZ)(el,{loadWordAction:s}),n&&(0,r.tZ)(eo,{...n,gpcIdentifiers:t,loadWord:s,applyPhonemeOverride:d},n.word+" "+n.phonemes.join(" "))]})})},76271:function(e,t,n){"use strict";n.d(t,{Mj:()=>d,UZ:()=>s,jD:()=>o,pU:()=>a,rW:()=>l});var r=n(49677);let o=r.Km(["aa","ae","ah","ao","aw","ax","ay","b","ch","d","dh","eh","er","ey","f","g","h","ih","iy","jh","k","l","m","n","ng","ow","oy","p","r","s","sh","t","th","uh","uw","v","w","y","z","zh"]),i=["aa\xb7r","ao\xb7r","ax\xb7l","ax\xb7m","ax\xb7r","eh\xb7r","er\xb7r","g\xb7z","iy\xb7r","k\xb7s","k\xb7w","ng\xb7g","uh\xb7r","y\xb7ax","y\xb7uw"].map(e=>(e=>{let[t,n]=e.split("\xb7");return r.bc([r.i0(t),r.i0(n)])})(e)),l=r.G0(i);r.Z_().regex(/^(?:e_ɇ|[a-z]{1,4}_(?:[a-z](?:[a-z]|·[a-z]{1,2})?|[a-z]{2}·[a-z]))$/,"Invalid GPC identifier"),l.or(r.bc([o])).or(r.bc([r.i0("ɇ")])),r.Z_().trim().regex(/^[a-z]{1,2}( [a-z]{1,2})*$/).refine(e=>e.split(" ").every(e=>o.options.includes(e)),"contains an invalid phoneme");let a=e=>e.split(" "),s="['A-Za-z]+",d=r.Z_().trim().regex(/^['A-Za-z]+$/,"can only be one word with non-accented letters").min(1).max(34).toLowerCase()},24829:function(e,t,n){"use strict";n.d(t,{CN:()=>a,KM:()=>i,cN:()=>p,dJ:()=>c,sm:()=>u,x4:()=>o});var r=n(49677);let o=r.Ry({_key:r.Z_(),_type:r.Z_()}),i=e=>void 0,l=r.IX(r.Ry({_type:r.Z_()})),a=r.PG(e=>l.parse(e));r.Z_().regex(/^file(?:-[\da-z]+){2}$/);let s=r.Z_().regex(/^image-[\da-z]+-\d+x\d+-[\da-z]+$/),d=r.Ry({asset:r.Ry({_id:s}).or(r.Ry({_ref:s})),crop:r.Ry({bottom:r.Rx(),left:r.Rx(),right:r.Rx(),top:r.Rx()}).optional(),hotspot:r.Ry({x:r.Rx(),y:r.Rx()}).optional()}),c=d.transform(e=>{let{asset:t,...n}=e;return{...n,id:"_id"in t?t._id:t._ref}}),p=d.extend({altText:r.Z_().default("")}).transform(e=>{let{asset:t,altText:n,...r}=e;return{alt:n,...r,id:"_id"in t?t._id:t._ref}}),u=r.Ry({text:r.Z_(),url:r.Z_(),newTab:r.O7().default(!0)})},12122:function(e,t,n){"use strict";n.d(t,{ZA:()=>l,fY:()=>a,kB:()=>s});var r=/^image-([\da-f]+)-(\d+x\d+)-(\w+)$/,o=e=>{let t=r.exec(e),[,n,o,i]=t??[];if(!t||!n||!o||!i)throw Error(`Could not parse image ID "${e}"`);let[l,a]=o.split("x").map(e=>Number.parseInt(e,10));if(Number.isNaN(l)||Number.isNaN(a)||!l||!a)throw Error(`Invalid dimensions "${o}"`);return{assetId:n,dimensions:{height:a,width:l,aspectRatio:l/a},format:i}},i=e=>{let t=e.lastIndexOf("-");return e.slice(6,t)+"."+e.slice(t+1)},l=({baseUrl:e,...t})=>{let{metadata:n,...r}=c({...t,options:{includeMetadata:!0}});if(!n)throw Error("Missing image output metadata");return{src:`${e}${i(t.id)}?${g(r)}`,width:n.outputDimensions.width,height:n.outputDimensions.height}},a=({id:e,mode:t="contain",width:n,height:r,hotspot:o,crop:l,baseUrl:a,...s})=>{let{w:p,h:u}=c({id:e,mode:t,width:n,height:r,hotspot:o,crop:l}),h=`${a}${i(e)}`;return Array.from(new Set(d(p).map(n=>{let r=Math.round(p*n),i=u&&Math.round(u*n);if(n<1&&r<50)return null;let a=c({id:e,mode:t,width:r,height:i,hotspot:o,crop:l,...s});return`${h}?${g(a)} ${a.w}w`}).filter(e=>!!e)))},s=({id:e,baseUrl:t})=>{let{assetId:n,dimensions:r,format:i}=o(e);return{src:`${t}${n}-${r.width}x${r.height}.${i}`,width:r.width,height:r.height}},d=e=>e<160?[.5,1,2]:e<750?[.5,1,1.5,2]:e<1400?[.25,.5,.75,1,1.5,2]:[.25,.5,.75,1,1.25,1.5,1.75,2],c=({id:e,mode:t="contain",width:n,height:r,hotspot:i,crop:l,queryParams:a,options:{includeMetadata:s=!1}={}})=>{let d=o(e).dimensions,{width:c,height:g,aspectRatio:f}=l?h(d,l):d;if(n||(r?(n=Math.round(r*f),r=void 0):n=Math.round(c/2)),"cover"!==t||n&&r&&n/r!==f?"contain"===t&&r&&(n=Math.min(n,Math.round(r*f)),r=void 0):t="contain",n>c||r&&r>g){let e=r?n/r:f;e>=f?(n=c,r=r&&Math.round(n/e)):n=Math.round((r=g)*e)}let x={w:n,q:75,fit:"max",...a};if(x.fm||(x.auto="format"),l&&(x.rect=m(d,l)),"cover"===t)if(x.fit="crop",r&&(x.h=r),i){let e=l?(i.x-l.left)/(1-l.left-l.right):i.x,t=l?(i.y-l.top)/(1-l.top-l.bottom):i.y;x["fp-x"]=u(p(e,0,1),3),x["fp-y"]=u(p(t,0,1),3)}else x.crop="entropy";if(s){let e=r??Math.round(n/f);x.metadata={sourceDimensions:d,outputDimensions:{width:n,height:e,aspectRatio:n/e}}}return x},p=(e,t,n)=>Math.max(t,Math.min(n,e)),u=(e,t)=>
1Math.round(e*Math.pow(10,t))/Math.pow(10,t),h=(e,t)=>{if(t.left+t.right>=1||t.top+t.bottom>=1)throw Error(`Invalid crop: ${JSON.stringify(t)}; crop values must be less than 1`);let n=Math.round(e.width*(1-t.left-t.right)),r=Math.round(e.height*(1-t.top-t.bottom));return{width:n,height:r,aspectRatio:n/r}},m=(e,t)=>{let{width:n,height:r}=h(e,t);return[Math.round(t.left*e.width),Math.round(t.top*e.height),n,r].join(",")},g=e=>new URLSearchParams(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,String(t)])).toString().replace(/%2C/g,",")},40006:function(e,t,n){"use strict";n.d(t,{j5:()=>a,wZ:()=>l});var r=n(74380),o=n(66040),i=n(78694);function l(e,t=[]){return async function(...n){let r=await e(...n),o=t.map(e=>{let t=r[e];return delete r[e],t}),{json:l,meta:a}=i.ZP.serialize(r);return a&&(l._superjson=a),t.forEach((e,t)=>{let n=o[t];void 0!==n&&(l[e]=n)}),{...r,...l}}}function a(e){function t(t){return(0,r.jsx)(e,{...function(e){let{_superjson:t,...n}=e;return i.ZP.deserialize({json:n,meta:t})}(t)})}return o(t,e),t}}},function(e){e.O(0,["2203","344","6909","8280","8808","9174"],function(){return e(e.s=37789)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.