lido-player 0.0.2-beta-22-dev → 0.0.2-beta-23-dev
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/dist/cjs/{decode-Cr5DANqc.js → decode-BDs2S8om.js} +1 -1
- package/dist/cjs/{index-0BvcfeCt.js → index-D5olYRJo.js} +130 -21
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +38 -18
- package/dist/collection/components/flashCard/lido-flash-card.js +30 -3
- package/dist/collection/components/trace/lido-trace.js +6 -13
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +2 -2
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +129 -20
- package/dist/components/index.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-root.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/p-D0cGjo5e.js +1 -0
- package/dist/components/{p-CkxAm8rY.js → p-Ds-d6wd0.js} +2 -2
- package/dist/components/p-Lg85waqZ.js +1 -0
- package/dist/esm/{decode-DkSXjv7K.js → decode-CAwfe7ub.js} +1 -1
- package/dist/esm/{index-D9-TTsdZ.js → index-bo7729YG.js} +130 -21
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +38 -18
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-35fa0b8b.entry.js → p-461a3d23.entry.js} +2 -2
- package/dist/lido-player/{p-Dc8j8Hxw.js → p-D4kAEWCU.js} +1 -1
- package/dist/lido-player/p-VRJMO_sg.js +1 -0
- package/dist/types/components/flashCard/lido-flash-card.d.ts +4 -0
- package/package.json +1 -1
- package/dist/components/p-BUfCIPRa.js +0 -1
- package/dist/components/p-u3czV7QM.js +0 -1
- package/dist/lido-player/p-D2iINRNN.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as i,H as e,B as s,getAssetPath as n,c as o,k as r,E as a,F as h,s as l,f as c,w as d,g as u,j as f,a as w,h as g,b as m}from"./index.js";const v=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.audioUrls=[],this.currentSvgIndex=0,this.moving=!1,this.value="",this.height="auto",this.width="auto",this.audio="",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=s.ShowFlow,this.fingerHintUrl=n("assets/Tracing-hand.svg"),this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.disableSpeak=!1,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.activeTraceState=null,this.freeTraceUpdateCounter=0,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){this.cleanupTraceState(this.activeTraceState);let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:60,freeTraceProximityThreshold:350,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null,dragOffset:null,isCompletingPath:!1,touchProximityThreshold:null,pointerTransform:null,pointerRect:null};this.activeTraceState=t;const i=this.svgUrls[this.currentSvgIndex];i&&""!==i.trim()?(await this.fetchSVG(o(i)),await this.loadAnotherSVG(t,!0)):console.error("No SVG URL provided or index out of bounds.")}componentDidLoad(){r(this.el,this.delayVisible)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),this.currentSvgIndex=0,this.showSpeakIcon&&(a(this.el),this.el.append(a(this.el))),this.initializeSVG()}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad),this.cleanupTraceState(this.activeTraceState),this.activeTraceState=null}cleanupTraceState(t){var i;t&&(null===(i=t.cleanup)||void 0===i||i.call(t),t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=null,t.pointerMoveEvent=null,t.pathSamples=[],t.paths=[],t.svg=null,null!==this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.hideFingerHint())}resetIdleTimer(t){null!==this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout((()=>{this.showFingerHint(t)}),3e3)}showFingerHint(t){var i;if(this.fingerImg)return;const e=t.paths[t.currentPathIndex];if(!e)return;const s=document.createElementNS("http://www.w3.org/2000/svg","image"),n=new Image;n.onload=()=>{s.setAttributeNS("http://www.w3.org/1999/xlink","href",o(this.fingerHintUrl))},n.onerror=()=>{s.setAttributeNS("http://www.w3.org/1999/xlink","href",o(h))},n.src=o(this.fingerHintUrl||h),s.setAttribute("width","40"),s.setAttribute("height","40"),s.setAttribute("id","lido-finger-hint"),s.style.pointerEvents="none",s.style.opacity="0.8",s.setAttribute("x","0"),s.setAttribute("y","0");const r=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");r.setAttribute("dur","2s"),r.setAttribute("repeatCount","indefinite");const a=document.createElementNS("http://www.w3.org/2000/svg","mpath");a.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${e.id}`),r.appendChild(a),s.appendChild(r),null===(i=t.svg)||void 0===i||i.appendChild(s),this.fingerImg=s}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(t){const i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch SVG (${t}): ${i.statusText}`);return await i.text()}calculateBoundingBox(t,i=22){let e=1/0,s=1/0,n=-1/0,o=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let r=0;r<=100;r++){const a=t.getPointAtLength(r/100*i);a.x<e&&(e=a.x),a.y<s&&(s=a.y),a.x>n&&(n=a.x),a.y>o&&(o=a.y)}})),e-=i,s-=i,n+=i,o+=i,{minX:e,minY:s,maxX:n,maxY:o}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const e=i.querySelector("svg");e.classList.add("lido-trace-svg"),e.removeAttribute("width"),e.removeAttribute("height");const s=e.querySelectorAll("path, line"),n=this.calculateBoundingBox(Array.from(s));e.setAttribute("viewBox",`${n.minX} ${n.minY} ${n.maxX-n.minX} ${n.maxY-n.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t){var i;if(!t)return;const e=t.ownerSVGElement;if(!e)return;const s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t.getAttribute("d")||""),s.setAttribute("stroke","blue"),s.setAttribute("stroke-width","2"),s.setAttribute("stroke-dasharray","6,6"),s.setAttribute("fill","none"),s.setAttribute("class","lido-flow-indicator"),null===(i=t.parentNode)||void 0===i||i.appendChild(s);let n=e.querySelector("defs#lido-flow-defs");n||(n=document.createElementNS("http://www.w3.org/2000/svg","defs"),n.setAttribute("id","lido-flow-defs"),e.insertBefore(n,e.firstChild));const o=`arrow-${Math.random().toString(36)}`,r=document.createElementNS("http://www.w3.org/2000/svg","marker");r.setAttribute("id",o),r.setAttribute("markerWidth","10"),r.setAttribute("markerHeight","10"),r.setAttribute("refX","5"),r.setAttribute("refY","5"),r.setAttribute("orient","auto"),r.setAttribute("markerUnits","strokeWidth");const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d","M0,0 L10,5 L0,10 L2,5 Z"),a.setAttribute("fill","blue"),r.appendChild(a),n.appendChild(r),s.setAttribute("marker-end",`url(#${o})`),s}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===s.NoFlow?i.style.display="none":t.mode===s.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,e)=>{const n=i.getTotalLength();i._lidoTraceLength=n,i._lidoTraceStart=i.getPointAtLength(0),i._lidoTraceEnd=i.getPointAtLength(n),i._lidoTraceIsClosed=this.getDistanceSquared(i._lidoTraceStart,i._lidoTraceEnd)<200;const o=n/192||1,r=[];for(let t=0;t<=192;t++){const e=Math.min(n,t*o),s=i.getPointAtLength(e);r.push({x:s.x,y:s.y,length:e})}i._lidoTraceSamples=r,i._lidoTraceSampleStep=o,i.setAttribute("id","lido-path-"+e);const a=i.cloneNode();a.style.opacity="100",a.style["stroke-opacity"]="100";const h=i.style["stroke-width"]||i.getAttribute("stroke-width");a.setAttribute("stroke-width",h),a.setAttribute("stroke-dasharray",n.toString()),a.setAttribute("stroke-dashoffset",n.toString()),i.parentNode.appendChild(a,i),i.setAttribute("class","lido-trace-path"),a.setAttribute("class","lido-trace-path-green"),i.greenPath=a,i.classList.add(t.mode),t.mode===s.BlindTracing||t.mode===s.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",h),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",n.toString()),i.setAttribute("stroke-dashoffset","0")),e===t.currentPathIndex&&t.mode===s.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex]._lidoTraceLength}setupDraggableCircle(t){var i;const e=t.paths[0].getPointAtLength(0),s=document.createElementNS("http://www.w3.org/2000/svg","circle");t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width"),s.setAttribute("id","lido-draggableCircle"),s.setAttribute("cx",e.x.toString()),s.setAttribute("cy",e.y.toString()),s.setAttribute("r","20"),s.setAttribute("fill","#CF1565"),null===(i=t.svg)||void 0===i||i.appendChild(s),t.circle=s,this.resetIdleTimer(t)}addEventListeners(t){var i,e,s,n;if(!t.circle||!t.paths||0===t.paths.length)return;t.svg.style.touchAction="none",t.circle.style.touchAction="none";const o=i=>{i.preventDefault(),t.pointerRect=t.svg.getBoundingClientRect(),t.pointerTransform=this.getSvgViewBoxTransform(t.svg,t.pointerRect);const e=this.getPointerPosition(i,t.svg,t.pointerTransform,t.pointerRect),s={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},n=this.getDistanceSquared(e,s),o=this.getProximityThresholdForEvent(t,i);if(n<=o*o||"touch"===i.pointerType){t.isDragging=!0,t.activePointerId=i.pointerId,t.dragOffset={x:e.x-s.x,y:e.y-s.y};try{t.circle.setPointerCapture(i.pointerId)}catch(t){}t.lastPointerPos=s}this.hideFingerHint(),this.resetIdleTimer(t)},r=i=>{t.isDragging&&i.pointerId===t.activePointerId&&(i.preventDefault(),t.pointerMoveEvent=i,t.rafId||(t.rafId=requestAnimationFrame((()=>{this.handlePointerMove(t),t.rafId=null}))))},a=i=>{i.pointerId===t.activePointerId&&(t.isDragging=!1,t.activePointerId=null,t.lastPointerPos=null,t.dragOffset=null,this.hideFingerHint(),this.resetIdleTimer(t))};null===(i=t.svg)||void 0===i||i.addEventListener("pointerup",a),null===(e=t.svg)||void 0===e||e.addEventListener("pointercancel",a);const h=t=>{t.preventDefault()};t.circle.addEventListener("pointerdown",o,{passive:!1}),null===(s=t.svg)||void 0===s||s.addEventListener("pointermove",r),null===(n=t.svg)||void 0===n||n.addEventListener("contextmenu",h),t.cleanup=()=>{var i,e,s,n,l;null===(i=t.circle)||void 0===i||i.removeEventListener("pointerdown",o),null===(e=t.svg)||void 0===e||e.removeEventListener("pointermove",r),null===(s=t.svg)||void 0===s||s.removeEventListener("pointerup",a),null===(n=t.svg)||void 0===n||n.removeEventListener("pointercancel",a),null===(l=t.svg)||void 0===l||l.removeEventListener("contextmenu",h),t.isDragging=!1,t.activePointerId=null}}async handlePointerMove(t){var i,e,n,o,r;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;if(t.isCompletingPath)return;this.hideFingerHint();const a=t.pointerMoveEvent,h=this.getPointerPosition(a,t.svg,t.pointerTransform,t.pointerRect),l=t.dragOffset?{x:h.x-t.dragOffset.x,y:h.y-t.dragOffset.y}:h,c={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};let d=1/0;if(t.lastPointerPos){const i=l.x-t.lastPointerPos.x,e=l.y-t.lastPointerPos.y;if(d=i*i+e*e,d<1)return}const u=t.paths[t.currentPathIndex];if(!u)return void console.error("No valid path found at the current index");const f=this.getProximityThresholdForEvent(t,a),w=f*f;if(this.getDistanceSquared(l,c)>w)return;const g=t.mode===s.FreeTrace||t.mode===s.BlindFreeTrace,m=this.getClosestPointOnPath(u,l,g?void 0:t.lastLength);if(this.getDistanceSquared(l,m)>w)return;if(g){if(this.freeTraceUpdateCounter=(this.freeTraceUpdateCounter||0)+1,this.freeTraceUpdateCounter%2!=0)return;if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const e=document.createElementNS("http://www.w3.org/2000/svg","polyline"),s=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("stroke-width",s),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke","lightgreen"),e.setAttribute("points",`${l.x},${l.y}`),null===(i=t.svg)||void 0===i||i.appendChild(e),t.currentFreePath[t.currentPathIndex]=e,t.currentFreePolylinePoints=t.currentFreePolylinePoints||[],t.currentFreePolylinePoints[t.currentPathIndex]=[{x:l.x,y:l.y}],t.lastPointerPos=l,t.freeTracePointsCount=1}const s=5;if(t.freeTracePointsCount=(t.freeTracePointsCount||1)+1,t.freeTracePointsCount>s)return;t.currentFreePolylinePoints=t.currentFreePolylinePoints||[];let n=t.currentFreePolylinePoints[t.currentPathIndex]||[];n.push({x:l.x,y:l.y}),t.currentFreePolylinePoints[t.currentPathIndex]=n;const o=n.map((t=>`${t.x},${t.y}`)).join(" ");return t.currentFreePath[t.currentPathIndex].setAttribute("points",o),t.circle.setAttribute("cx",l.x.toString()),t.circle.setAttribute("cy",l.y.toString()),t.circle.parentNode!==t.svg&&(null===(e=t.svg)||void 0===e||e.appendChild(t.circle)),t.lastPointerPos=l,void(n.length>=s&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null,t.currentFreePolylinePoints[t.currentPathIndex]=[],t.freeTracePointsCount=0))}const v=Math.min(320,Math.max(160,.45*t.totalPathLength)),p=Math.min(60,Math.max(24,.12*t.totalPathLength));let x=m,y=x.length>=t.lastLength-20&&x.length-t.lastLength<=80;if(!y){const i=this.getClosestPointOnPath(u,l),e=this.getDistanceSquared(l,i);d>=64&&e<=w&&i.length>=t.lastLength-20&&i.length-t.lastLength<=v&&i.length<t.totalPathLength-p&&(x=i,y=!0)}if(t.isDragging&&y)if(t.lastLength=Math.max(t.lastLength,x.length),t.lastPointerPos=l,(Math.abs(x.x-c.x)>1||Math.abs(x.y-c.y)>1)&&(t.circle.setAttribute("cx",x.x.toString()),t.circle.setAttribute("cy",x.y.toString())),t.circle.parentNode!==t.svg&&(null===(n=t.svg)||void 0===n||n.appendChild(t.circle)),null===(o=u.greenPath)||void 0===o||o.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString()),null!==(r=u._lidoTraceIsClosed)&&void 0!==r&&r&&t.totalPathLength>50){if(t.lastLength/t.totalPathLength>=.95){if(t.isCompletingPath)return;t.isCompletingPath=!0,await this.animatePathToEnd(t,u),t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer()}}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextPath(t)}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextContainer()}}animatePathToEnd(t,i,e=300){if(!i||!t.svg)return Promise.resolve();if(t._animatingToEnd)return Promise.resolve();t._animatingToEnd=!0;const s=t.lastLength||0,n=i.getTotalLength(),o=performance.now(),r=i.greenPath||i.parentNode&&i.parentNode.querySelector(".lido-trace-path-green");return new Promise((a=>{const h=l=>{const c=Math.min(1,(l-o)/e),d=s+(n-s)*c;t.lastLength=d;const u=i.getPointAtLength(d);if(t.circle&&(t.circle.setAttribute("cx",u.x.toString()),t.circle.setAttribute("cy",u.y.toString())),r&&r.setAttribute("stroke-dashoffset",(t.totalPathLength-d).toString()),c<1)requestAnimationFrame(h);else{if(t.lastLength=n,t.circle){const e=i.getPointAtLength(n);t.circle.setAttribute("cx",e.x.toString()),t.circle.setAttribute("cy",e.y.toString())}r&&r.setAttribute("stroke-dashoffset","0"),t._animatingToEnd=!1,a()}};requestAnimationFrame(h)}))}async moveToNextContainer(){if(this.isDragging=!1,this.moving)return;if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),l(!0),this.currentSvgIndex<this.svgUrls.length-1)return await new Promise((t=>setTimeout(t,1e3))),this.currentSvgIndex++,await this.initializeSVG(),document.getElementById("lido-svgContainer").style.visibility="visible",this.moving=!1,void(this.el&&this.onCorrect&&await c(this.onCorrect,this.el));const t=document.querySelector(d),i=t.getAttribute("onCorrect");t&&i&&(await new Promise((t=>setTimeout(t,1e3))),await c(i,this.el)),u(),f()}getPointerPosition(t,i,e,s){var n;const o=this.getPointerPositionFromViewBox(t,i,e,s);if(o)return o;const r=i.createSVGPoint();r.x=t.clientX,r.y=t.clientY;const a=null===(n=i.getScreenCTM())||void 0===n?void 0:n.inverse();return a?r.matrixTransform(a):{x:t.clientX,y:t.clientY}}getPointerPositionFromViewBox(t,i,e,s){const n=s||i.getBoundingClientRect(),o=i.viewBox.baseVal;if(!(n.width&&n.height&&o.width&&o.height))return null;const{offsetX:r,offsetY:a,scaleX:h,scaleY:l}=e||this.getSvgViewBoxTransform(i,n);return{x:o.x+(t.clientX-n.left-r)/h,y:o.y+(t.clientY-n.top-a)/l}}getSvgViewBoxTransform(t,i=t.getBoundingClientRect()){const e=t.viewBox.baseVal,s=t.preserveAspectRatio.baseVal,n=i.width/e.width,o=i.height/e.height;if(1===s.align)return{offsetX:0,offsetY:0,scaleX:n,scaleY:o};const r=2===s.meetOrSlice?Math.max(n,o):Math.min(n,o),a=e.width*r,h=e.height*r;let l=0,c=0;const d=s.align;return 3===d||6===d||9===d?l=(i.width-a)/2:4!==d&&7!==d&&10!==d||(l=i.width-a),5===d||6===d||7===d?c=(i.height-h)/2:8!==d&&9!==d&&10!==d||(c=i.height-h),{offsetX:l,offsetY:c,scaleX:r,scaleY:r}}getProximityThresholdForEvent(t,i){const e=t.mode===s.FreeTrace||t.mode===s.BlindFreeTrace?t.freeTraceProximityThreshold:t.proximityThreshold;if("touch"!==(null==i?void 0:i.pointerType)||!t.svg)return e;const n=t.svg.getBoundingClientRect(),o=t.svg.viewBox.baseVal;if(!(n.width&&n.height&&o.width&&o.height))return e;const{scaleX:r,scaleY:a}=this.getSvgViewBoxTransform(t.svg,n),h=44*Math.max(1/r,1/a);return Math.max(e,h)}getDistanceSquared(t,i){const e=t.x-i.x,s=t.y-i.y;return e*e+s*s}getClosestPointOnPath(t,i,e){var s;const n=null!==(s=t._lidoTraceLength)&&void 0!==s?s:t.getTotalLength(),o=t._lidoTraceSamples,r=t._lidoTraceSampleStep;if((null==o?void 0:o.length)&&r){const s=void 0===e?n:150,a=void 0===e?0:Math.max(0,e-s),h=void 0===e?n:Math.min(n,e+s);let l=o[Math.max(0,Math.min(o.length-1,Math.round((e||0)/r)))],c=1/0;for(const t of o){if(t.length<a||t.length>h)continue;const e=this.getDistanceSquared(i,t);e<c&&(c=e,l=t)}const d=6,u=Math.max(a,l.length-r),f=Math.min(h,l.length+r);let w=Object.assign({},l),g=c;for(let e=u;e<=f;e+=d){const s=t.getPointAtLength(e),n=this.getDistanceSquared(i,s);n<g&&(g=n,w={x:s.x,y:s.y,length:e})}return w}let a={x:0,y:0,length:0},h=1/0,l=0,c=n;void 0!==e&&(l=Math.max(0,e-150),c=Math.min(n,e+150));let d={length:l};for(let e=l;e<=c;e+=40){const s=t.getPointAtLength(e),n=this.getDistanceSquared(i,s);n<h&&(h=n,d={x:s.x,y:s.y,length:e})}const u=Math.max(0,d.length-40),f=Math.min(n,d.length+40);h=1/0;for(let e=u;e<=f;e+=6){const s=t.getPointAtLength(e),n=this.getDistanceSquared(i,s);n<h&&(h=n,a={x:s.x,y:s.y,length:e})}return a}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(o(this.svgSource.split(";").map((t=>t.trim()))[this.currentSvgIndex]));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==s.BlindTracing&&this.mode!==s.BlindFreeTrace||t.svg.querySelectorAll("image").forEach((t=>{t.style.display="none"})),t.paths=this.getPaths(t.svg),this.setupDrawingPath(t),this.setupDraggableCircle(t),this.addEventListeners(t)}catch(t){console.error(`Error loading SVG (${this.svgSource}):`,t)}}cleanupPreviousSVG(t){var i,e;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(e=t.svg)||void 0===e?void 0:e.querySelectorAll(".lido-flow-indicator")).forEach((t=>{t.remove()})),t.currentPathIndex=0,t.lastLength=0,t.totalPathLength=t.paths[0].getTotalLength(),this.hideFingerHint(),this.resetIdleTimer(t)}async moveToNextPath(t){var i,e;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,t.isCompletingPath=!1,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const n=t.paths[t.currentPathIndex];if(!n)return void console.error("No valid path found at the next index");t.totalPathLength=n.getTotalLength();const o=n.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",o.x.toString()),null===(e=t.circle)||void 0===e||e.setAttribute("cy",o.y.toString()),t.mode===s.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(n)),this.resetIdleTimer(t)}async playTraceAnimation(){const t=document.getElementById(this.id);t&&(t.classList.add("trace-animate"),await new Promise((t=>setTimeout(t,500))),t.classList.remove("trace-animate"))}async highlightLetter(t){if(!document.getElementById(d))return;const i=this.el;if(!i)return;const e=this.highlightTextId;if(!e)return;const s=document.getElementById(e);if(!s)return;const n=this.audio;if(!n)return;this.audioUrls=n.split(";").map((t=>t.trim()));const r=s.getAttribute("span-type");if(!r)return;const a=s.querySelector(".lido-text-content");if(a){if("letters"===r){const e=a.querySelectorAll(".text-letters");if(t<0||t>=e.length)return;const n=e[t];if(n){const t=i.querySelector("#lido-svgContainer");if(await c("this.alignMatch='true';",s,t),t.style.animation="trace-animation 0.4s forwards",t.style.setProperty("--trace-width",n.offsetWidth-5+"px"),t.style.setProperty("--trace-height",n.offsetHeight-5+"px"),await c("this.alignMatch='true';",n,t),setTimeout((()=>{n.classList.add("letter-highlight"),t.style.transform="",t.style.animation="",t.style.visibility="hidden"}),500),this.audioUrls[this.currentSvgIndex]){const t=new Audio(o(this.audioUrls[this.currentSvgIndex]));await t.play()}}}if("words"===r){const i=a.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const e=i[t];if(e&&(e.classList.add("word-highlight"),this.audioUrls[this.currentSvgIndex])){const t=new Audio(o(this.audioUrls[this.currentSvgIndex]));await t.play()}}}}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:w(this.height,t),width:w(this.width,t),top:w(this.y,t),left:w(this.x,t),zIndex:this.z}}render(){return g(m,{key:"07506adee10b4f0348ba7b7c4d0f338d7e61cfd9",class:"lido-trace",id:this.id,audio:this.audio,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,tabindex:this.tabIndex,"disable-speak":this.disableSpeak},g("div",{key:"9b3c311582a7246cded868234a47293ae78a3932",style:this.style,id:"lido-svgContainer"}))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{svgSource:[{initializeSVG:0}],mode:[{initializeSVG:0}]}}static get style(){return":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}.lido-trace-svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}"}},[0,"lido-trace",{showSpeakIcon:[4,"show-speak-icon"],id:[1],svgSource:[1,"svg-source"],value:[1],height:[1],width:[1],audio:[1],x:[1],y:[1],z:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],tabIndex:[2,"tab-index"],mode:[1],fingerHintUrl:[1,"finger-hint-url"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],highlightTextId:[1,"highlight-text-id"],animationTrace:[4,"animation-trace"],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],svgUrls:[32],audioUrls:[32],currentSvgIndex:[32],moving:[32],style:[32],fileIndex:[32],isDragging:[32],activePointerId:[32],idleTimer:[32],fingerImg:[32]},void 0,{svgSource:[{initializeSVG:0}],mode:[{initializeSVG:0}]}]);function p(){"undefined"!=typeof customElements&&["lido-trace"].forEach((i=>{"lido-trace"===i&&(customElements.get(t(i))||customElements.define(t(i),v))}))}p();export{v as L,p as d}
|
|
@@ -451,6 +451,19 @@ function enableDraggingWithScaling(element) {
|
|
|
451
451
|
let clone = null;
|
|
452
452
|
let duplicateElement = null;
|
|
453
453
|
let mutationFlag = false;
|
|
454
|
+
let pendingMoveFrame = null;
|
|
455
|
+
let latestClientX = 0;
|
|
456
|
+
let latestClientY = 0;
|
|
457
|
+
let hasPendingMove = false;
|
|
458
|
+
let touchTransformUpdated = false;
|
|
459
|
+
let touchDragScale = 1;
|
|
460
|
+
let touchDragScaleY = 1;
|
|
461
|
+
let touchOffsetX = 0;
|
|
462
|
+
let touchOffsetY = 0;
|
|
463
|
+
let touchStartElementLeft = 0;
|
|
464
|
+
let touchStartElementTop = 0;
|
|
465
|
+
let touchStartRect = null;
|
|
466
|
+
let isTouchDragging = false;
|
|
454
467
|
// Fetch the container element
|
|
455
468
|
const container = document.getElementById(LidoContainer);
|
|
456
469
|
if (!container) {
|
|
@@ -461,6 +474,33 @@ function enableDraggingWithScaling(element) {
|
|
|
461
474
|
return;
|
|
462
475
|
handlingElementFlexibleWidth(element, 'drag');
|
|
463
476
|
let dragingElementTransform;
|
|
477
|
+
const getContainerScale = () => {
|
|
478
|
+
const transform = window.getComputedStyle(container).transform;
|
|
479
|
+
const matrix3dMatch = transform.match(/matrix3d\(([^)]+)\)/);
|
|
480
|
+
const matrixMatch = transform.match(/matrix\(([^)]+)\)/);
|
|
481
|
+
if (matrix3dMatch) {
|
|
482
|
+
const values = matrix3dMatch[1].split(',').map(value => parseFloat(value.trim()));
|
|
483
|
+
return {
|
|
484
|
+
scaleX: Math.sqrt(values[0] ** 2 + values[1] ** 2) || 1,
|
|
485
|
+
scaleY: Math.sqrt(values[4] ** 2 + values[5] ** 2) || 1,
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
if (matrixMatch) {
|
|
489
|
+
const values = matrixMatch[1].split(',').map(value => parseFloat(value.trim()));
|
|
490
|
+
return {
|
|
491
|
+
scaleX: Math.sqrt(values[0] ** 2 + values[1] ** 2) || 1,
|
|
492
|
+
scaleY: Math.sqrt(values[2] ** 2 + values[3] ** 2) || 1,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
return { scaleX: 1, scaleY: 1 };
|
|
496
|
+
};
|
|
497
|
+
const updateTouchDragScale = () => {
|
|
498
|
+
if (isTouchDragging) {
|
|
499
|
+
const { scaleX, scaleY } = getContainerScale();
|
|
500
|
+
touchDragScale = scaleX;
|
|
501
|
+
touchDragScaleY = scaleY;
|
|
502
|
+
}
|
|
503
|
+
};
|
|
464
504
|
const onStart = (event) => {
|
|
465
505
|
var _a, _b;
|
|
466
506
|
if (container && container.getAttribute("game-completed") === "true")
|
|
@@ -477,17 +517,29 @@ function enableDraggingWithScaling(element) {
|
|
|
477
517
|
if (event instanceof MouseEvent) {
|
|
478
518
|
startX = event.clientX;
|
|
479
519
|
startY = event.clientY;
|
|
520
|
+
touchStartRect = null;
|
|
480
521
|
}
|
|
481
522
|
else {
|
|
482
523
|
startX = event.touches[0].clientX;
|
|
483
524
|
startY = event.touches[0].clientY;
|
|
525
|
+
isTouchDragging = true;
|
|
526
|
+
touchStartRect = element.getBoundingClientRect();
|
|
527
|
+
touchOffsetX = startX - touchStartRect.left;
|
|
528
|
+
touchOffsetY = startY - touchStartRect.top;
|
|
529
|
+
touchStartElementLeft = touchStartRect.left;
|
|
530
|
+
touchStartElementTop = touchStartRect.top;
|
|
531
|
+
const { scaleX, scaleY } = getContainerScale();
|
|
532
|
+
touchDragScale = scaleX;
|
|
533
|
+
touchDragScaleY = scaleY;
|
|
534
|
+
element.style.willChange = 'transform';
|
|
535
|
+
window.addEventListener('resize', updateTouchDragScale);
|
|
484
536
|
}
|
|
485
537
|
// Apply dragging styles to the element
|
|
486
538
|
element.style.opacity = '1';
|
|
487
539
|
element.style.cursor = 'grabbing';
|
|
488
540
|
if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
|
|
489
541
|
const computedStyle = window.getComputedStyle(element);
|
|
490
|
-
const rect = element.getBoundingClientRect();
|
|
542
|
+
const rect = touchStartRect || element.getBoundingClientRect();
|
|
491
543
|
if (!clone) {
|
|
492
544
|
clone = element.cloneNode(true);
|
|
493
545
|
clone.style.left = `${rect.left}px`;
|
|
@@ -506,7 +558,7 @@ function enableDraggingWithScaling(element) {
|
|
|
506
558
|
const imgElement = element.querySelector('img');
|
|
507
559
|
const src = imgElement === null || imgElement === void 0 ? void 0 : imgElement.getAttribute('src');
|
|
508
560
|
const computedStyle = window.getComputedStyle(element);
|
|
509
|
-
const rect = element.getBoundingClientRect();
|
|
561
|
+
const rect = touchStartRect || element.getBoundingClientRect();
|
|
510
562
|
if (!duplicateElement) {
|
|
511
563
|
duplicateElement = element.cloneNode(false);
|
|
512
564
|
duplicateElement.setAttribute('src', src);
|
|
@@ -579,31 +631,31 @@ function enableDraggingWithScaling(element) {
|
|
|
579
631
|
target.style.opacity = value;
|
|
580
632
|
}
|
|
581
633
|
};
|
|
582
|
-
const
|
|
583
|
-
|
|
634
|
+
const processMove = () => {
|
|
635
|
+
pendingMoveFrame = null;
|
|
636
|
+
if (!isDragging || !hasPendingMove)
|
|
584
637
|
return;
|
|
638
|
+
hasPendingMove = false;
|
|
639
|
+
const deferTouchDropValidation = touchTransformUpdated;
|
|
585
640
|
if (isDraggingDisabled) {
|
|
586
641
|
isDragging = false;
|
|
642
|
+
touchTransformUpdated = false;
|
|
587
643
|
return;
|
|
588
644
|
}
|
|
589
|
-
isClicked = false;
|
|
590
645
|
element.style.transition = 'none';
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const newTop = initialY + dy;
|
|
605
|
-
// Apply transform with translation without boundaries
|
|
606
|
-
element.style.transform = `translate(${newLeft}px, ${newTop}px)`;
|
|
646
|
+
if (!touchTransformUpdated) {
|
|
647
|
+
const containerScale = calculateScale();
|
|
648
|
+
const dx = (latestClientX - startX) / containerScale;
|
|
649
|
+
const dy = (latestClientY - startY) / containerScale;
|
|
650
|
+
// Calculate the new position considering scaling
|
|
651
|
+
const newLeft = initialX + dx;
|
|
652
|
+
const newTop = initialY + dy;
|
|
653
|
+
// Apply transform with translation without boundaries
|
|
654
|
+
element.style.transform = `translate(${newLeft}px, ${newTop}px)`;
|
|
655
|
+
}
|
|
656
|
+
touchTransformUpdated = false;
|
|
657
|
+
if (deferTouchDropValidation)
|
|
658
|
+
return;
|
|
607
659
|
// Check for overlaps and highlight only the most overlapping element
|
|
608
660
|
let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
|
|
609
661
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -642,6 +694,44 @@ function enableDraggingWithScaling(element) {
|
|
|
642
694
|
}
|
|
643
695
|
}
|
|
644
696
|
};
|
|
697
|
+
const onMove = (event) => {
|
|
698
|
+
if (!isDragging)
|
|
699
|
+
return;
|
|
700
|
+
if (isDraggingDisabled) {
|
|
701
|
+
isDragging = false;
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
if (event instanceof MouseEvent) {
|
|
705
|
+
touchTransformUpdated = false;
|
|
706
|
+
latestClientX = event.clientX;
|
|
707
|
+
latestClientY = event.clientY;
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
const touch = event.touches[0];
|
|
711
|
+
if (!touch)
|
|
712
|
+
return;
|
|
713
|
+
latestClientX = touch.clientX;
|
|
714
|
+
latestClientY = touch.clientY;
|
|
715
|
+
}
|
|
716
|
+
if (!(event instanceof MouseEvent)) {
|
|
717
|
+
element.style.transition = 'none';
|
|
718
|
+
const desiredLeft = latestClientX - touchOffsetX;
|
|
719
|
+
const desiredTop = latestClientY - touchOffsetY;
|
|
720
|
+
const dx = (desiredLeft - touchStartElementLeft) / touchDragScale;
|
|
721
|
+
const dy = (desiredTop - touchStartElementTop) / touchDragScaleY;
|
|
722
|
+
const newLeft = initialX + dx;
|
|
723
|
+
const newTop = initialY + dy;
|
|
724
|
+
element.style.transform = `translate3d(${newLeft}px, ${newTop}px, 0)`;
|
|
725
|
+
touchTransformUpdated = true;
|
|
726
|
+
}
|
|
727
|
+
isClicked = false;
|
|
728
|
+
if (event instanceof MouseEvent) {
|
|
729
|
+
hasPendingMove = true;
|
|
730
|
+
if (pendingMoveFrame === null) {
|
|
731
|
+
pendingMoveFrame = requestAnimationFrame(processMove);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
};
|
|
645
735
|
let lastOverlappedElement = null;
|
|
646
736
|
const removeDocumentDragListeners = () => {
|
|
647
737
|
document.removeEventListener('mousemove', onMove);
|
|
@@ -649,9 +739,19 @@ function enableDraggingWithScaling(element) {
|
|
|
649
739
|
document.removeEventListener('touchmove', onMove);
|
|
650
740
|
document.removeEventListener('touchend', onEnd);
|
|
651
741
|
};
|
|
742
|
+
const flushPendingMove = () => {
|
|
743
|
+
if (pendingMoveFrame === null)
|
|
744
|
+
return;
|
|
745
|
+
cancelAnimationFrame(pendingMoveFrame);
|
|
746
|
+
processMove();
|
|
747
|
+
};
|
|
652
748
|
const onEnd = (endEv) => {
|
|
653
749
|
var _a, _b, _c;
|
|
750
|
+
flushPendingMove();
|
|
654
751
|
isDragging = false;
|
|
752
|
+
isTouchDragging = false;
|
|
753
|
+
element.style.willChange = '';
|
|
754
|
+
window.removeEventListener('resize', updateTouchDragScale);
|
|
655
755
|
removeDocumentDragListeners();
|
|
656
756
|
if (isClicked) {
|
|
657
757
|
if (clone) {
|
|
@@ -757,6 +857,15 @@ function enableDraggingWithScaling(element) {
|
|
|
757
857
|
};
|
|
758
858
|
const cleanup = () => {
|
|
759
859
|
isDragging = false;
|
|
860
|
+
isTouchDragging = false;
|
|
861
|
+
element.style.willChange = '';
|
|
862
|
+
window.removeEventListener('resize', updateTouchDragScale);
|
|
863
|
+
if (pendingMoveFrame !== null) {
|
|
864
|
+
cancelAnimationFrame(pendingMoveFrame);
|
|
865
|
+
pendingMoveFrame = null;
|
|
866
|
+
}
|
|
867
|
+
hasPendingMove = false;
|
|
868
|
+
touchTransformUpdated = false;
|
|
760
869
|
observer.disconnect();
|
|
761
870
|
removeDocumentDragListeners();
|
|
762
871
|
element.removeEventListener('mousedown', onStart);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { $ as format } from './index-
|
|
1
|
+
export { $ as format } from './index-bo7729YG.js';
|
|
2
2
|
import './index-Dvjbti-h.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, a as getElement, c as getAssetPath, d as createEvent } from './index-Dvjbti-h.js';
|
|
2
|
-
import { R as RiveService, s as setVisibilityWithDelay, i as initEventsForElement, c as convertUrlToRelative, p as parseProp, e as equationCheck, S as SelectedValuesKey, a as storingEachActivityScore, A as AudioPlayer, b as executeActions, d as calculateScore, t as triggerNextContainer, C as CalculatorOk, h as handlingChildElements, f as attachSpeakIcon, L as LIDO_INTERACTION_CLEANUP_EVENT, T as TemplateID, j as calculateScale, k as highlightElement, l as Timer, r as resetFloatState, m as handleFloatElementPosition, n as handleElementClick, o as commonjsGlobal, g as getDefaultExportFromCjs, q as generateUUIDFallback, u as ActivityScoreKey, v as dispatchActivityChangeEvent, G as GameScore, w as dispatchGameExitEvent, x as speakUrl, y as nextUrl, z as prevUrl, B as exitUrl, N as NextContainerKey, P as PrevContainerKey, D as LIDO_COMMON_AUDIO_PATH, E as LidoContainer$1, F as getCancelBtnPopup, H as matchStringPattern, I as triggerPrevcontainer, J as setActiveZipAssets, K as clearActiveZipAssets, M as setCancelBtnPopup, O as tinycolor, Q as stopHighlightForSpeakingElement, U as DropAction, V as validateObjectiveStatus, W as fraction, X as LIDO_COMMON_AUDIO_READY_EVENT, Y as TraceMode, Z as speakIcon, _ as fingerUrl } from './index-
|
|
2
|
+
import { R as RiveService, s as setVisibilityWithDelay, i as initEventsForElement, c as convertUrlToRelative, p as parseProp, e as equationCheck, S as SelectedValuesKey, a as storingEachActivityScore, A as AudioPlayer, b as executeActions, d as calculateScore, t as triggerNextContainer, C as CalculatorOk, h as handlingChildElements, f as attachSpeakIcon, L as LIDO_INTERACTION_CLEANUP_EVENT, T as TemplateID, j as calculateScale, k as highlightElement, l as Timer, r as resetFloatState, m as handleFloatElementPosition, n as handleElementClick, o as commonjsGlobal, g as getDefaultExportFromCjs, q as generateUUIDFallback, u as ActivityScoreKey, v as dispatchActivityChangeEvent, G as GameScore, w as dispatchGameExitEvent, x as speakUrl, y as nextUrl, z as prevUrl, B as exitUrl, N as NextContainerKey, P as PrevContainerKey, D as LIDO_COMMON_AUDIO_PATH, E as LidoContainer$1, F as getCancelBtnPopup, H as matchStringPattern, I as triggerPrevcontainer, J as setActiveZipAssets, K as clearActiveZipAssets, M as setCancelBtnPopup, O as tinycolor, Q as stopHighlightForSpeakingElement, U as DropAction, V as validateObjectiveStatus, W as fraction, X as LIDO_COMMON_AUDIO_READY_EVENT, Y as TraceMode, Z as speakIcon, _ as fingerUrl } from './index-bo7729YG.js';
|
|
3
3
|
|
|
4
4
|
var rive$1 = {exports: {}};
|
|
5
5
|
|
|
@@ -12463,6 +12463,13 @@ const LidoFlash = class {
|
|
|
12463
12463
|
this.flipped = false;
|
|
12464
12464
|
this.autoFlipAfter = 4500;
|
|
12465
12465
|
this.instructionDone = false;
|
|
12466
|
+
this.instructionStarted = false;
|
|
12467
|
+
this.onAudioStarted = (event) => {
|
|
12468
|
+
var _a;
|
|
12469
|
+
const target = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.target;
|
|
12470
|
+
if (target === this.instructionText())
|
|
12471
|
+
this.instructionStarted = true;
|
|
12472
|
+
};
|
|
12466
12473
|
this.onAudioEnded = (event) => {
|
|
12467
12474
|
var _a;
|
|
12468
12475
|
const target = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.target;
|
|
@@ -12471,7 +12478,7 @@ const LidoFlash = class {
|
|
|
12471
12478
|
return;
|
|
12472
12479
|
if (target === this.instructionText()) {
|
|
12473
12480
|
this.instructionDone = true;
|
|
12474
|
-
window.setTimeout(() => {
|
|
12481
|
+
this.frontStartTimer = window.setTimeout(() => {
|
|
12475
12482
|
this.speakFront();
|
|
12476
12483
|
}, 1200);
|
|
12477
12484
|
}
|
|
@@ -12543,7 +12550,11 @@ const LidoFlash = class {
|
|
|
12543
12550
|
this.speakFront();
|
|
12544
12551
|
}
|
|
12545
12552
|
};
|
|
12546
|
-
this.instructionText = () => {
|
|
12553
|
+
this.instructionText = () => {
|
|
12554
|
+
const container = this.el.closest('lido-container');
|
|
12555
|
+
const id = container === null || container === void 0 ? void 0 : container.getAttribute('template-id');
|
|
12556
|
+
return id ? container === null || container === void 0 ? void 0 : container.querySelector(`[id="${id}"]`) : null;
|
|
12557
|
+
};
|
|
12547
12558
|
this.frontText = () => this.el.querySelector('.card-front lido-text');
|
|
12548
12559
|
this.backText = () => this.el.querySelector('.card-back lido-text');
|
|
12549
12560
|
this.speakFront = () => {
|
|
@@ -12611,19 +12622,35 @@ const LidoFlash = class {
|
|
|
12611
12622
|
componentDidLoad() {
|
|
12612
12623
|
setVisibilityWithDelay(this.el, this.delayVisible);
|
|
12613
12624
|
initEventsForElement(this.el, this.type);
|
|
12625
|
+
window.addEventListener('lidoAudioStarted', this.onAudioStarted);
|
|
12614
12626
|
window.addEventListener('lidoAudioEnded', this.onAudioEnded);
|
|
12627
|
+
const container = this.el.closest('lido-container');
|
|
12628
|
+
if ((container === null || container === void 0 ? void 0 : container.getAttribute('template-id')) === 'flashcardtemplate') {
|
|
12629
|
+
this.instructionStartTimer = window.setTimeout(() => {
|
|
12630
|
+
if (!this.instructionStarted && !this.instructionDone) {
|
|
12631
|
+
const instruction = this.instructionText();
|
|
12632
|
+
if (instruction)
|
|
12633
|
+
executeActions("this.speak='true';", instruction);
|
|
12634
|
+
}
|
|
12635
|
+
}, 150);
|
|
12636
|
+
}
|
|
12615
12637
|
// handlingChildElements(this.el, this.minLength, this.maxLength, this.childElementsLength, 'inline-block');
|
|
12616
12638
|
}
|
|
12617
12639
|
disconnectedCallback() {
|
|
12618
12640
|
window.removeEventListener('lidoAudioEnded', this.onAudioEnded);
|
|
12641
|
+
window.removeEventListener('lidoAudioStarted', this.onAudioStarted);
|
|
12619
12642
|
if (this.autoFlipTimer)
|
|
12620
12643
|
window.clearTimeout(this.autoFlipTimer);
|
|
12644
|
+
if (this.instructionStartTimer)
|
|
12645
|
+
window.clearTimeout(this.instructionStartTimer);
|
|
12646
|
+
if (this.frontStartTimer)
|
|
12647
|
+
window.clearTimeout(this.frontStartTimer);
|
|
12621
12648
|
window.removeEventListener('resize', this.updateStyles);
|
|
12622
12649
|
window.removeEventListener('load', this.updateStyles);
|
|
12623
12650
|
}
|
|
12624
12651
|
/* ---------- Render ---------- */
|
|
12625
12652
|
render() {
|
|
12626
|
-
return (h(Host, { key: '
|
|
12653
|
+
return (h(Host, { key: '6650cc9f75b42c06eacbad9c56112fd343b8d02c', value: this.value, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, type: this.type, onClick: this.handleFlip, "disable-speak": this.disableSpeak }, h("div", { key: 'e680750d80c7b7b44149d11940059114a4293b3d', class: `card ${this.flipped ? 'flipped' : ''}` }, h("div", { key: '0ab8261e7aa931809add9cf1677f8cb594f990d6', class: "card-face card-front" }, this.front != null ? this.front : h("slot", { name: "front" })), h("div", { key: '3cf08684c987fcca398f1f491f254f80c7cff518', class: "card-face card-back" }, this.back != null ? this.back : h("slot", { name: "back" })))));
|
|
12627
12654
|
}
|
|
12628
12655
|
get el() { return getElement(this); }
|
|
12629
12656
|
static get watchers() { return {
|
|
@@ -13070,7 +13097,7 @@ const LidoHome = class {
|
|
|
13070
13097
|
}
|
|
13071
13098
|
// Pure-JS fallback (no wasm asset required)
|
|
13072
13099
|
try {
|
|
13073
|
-
const brotliDecodeModule = await import('./decode-
|
|
13100
|
+
const brotliDecodeModule = await import('./decode-CAwfe7ub.js').then(function (n) { return n.d; });
|
|
13074
13101
|
const brotliDecompressBuffer = brotliDecodeModule.BrotliDecompressBuffer || ((_a = brotliDecodeModule.default) === null || _a === void 0 ? void 0 : _a.BrotliDecompressBuffer);
|
|
13075
13102
|
if (typeof brotliDecompressBuffer !== 'function') {
|
|
13076
13103
|
throw new Error('BrotliDecompressBuffer function not found in brotli/dec/decode');
|
|
@@ -18774,16 +18801,9 @@ const LidoTrace = class {
|
|
|
18774
18801
|
const proximitySquared = proximityThreshold * proximityThreshold;
|
|
18775
18802
|
// Calculate the distance between the pointer and the draggable circle
|
|
18776
18803
|
const distanceSquared = this.getDistanceSquared(pointerPos, circlePos);
|
|
18777
|
-
//
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
// remains on the trace. This prevents long, narrow curves from becoming
|
|
18781
|
-
// stuck halfway through a stroke.
|
|
18782
|
-
const pointerLeadThreshold = evt.pointerType === 'touch'
|
|
18783
|
-
? Math.max(proximityThreshold * 4, 180)
|
|
18784
|
-
: Math.max(proximityThreshold * 2, 120);
|
|
18785
|
-
if (distanceSquared > pointerLeadThreshold * pointerLeadThreshold) {
|
|
18786
|
-
return;
|
|
18804
|
+
// If the pointer is outside the proximity threshold, do not proceed with drawing or moving
|
|
18805
|
+
if (distanceSquared > proximitySquared) {
|
|
18806
|
+
return; // Skip any further actions
|
|
18787
18807
|
}
|
|
18788
18808
|
const isFreeTraceMode = state.mode === TraceMode.FreeTrace || state.mode === TraceMode.BlindFreeTrace;
|
|
18789
18809
|
const closestPoint = this.getClosestPointOnPath(currentPath, pointerPos, isFreeTraceMode ? undefined : state.lastLength);
|
|
@@ -18823,7 +18843,7 @@ const LidoTrace = class {
|
|
|
18823
18843
|
state.freeTracePointsCount = 1;
|
|
18824
18844
|
}
|
|
18825
18845
|
// Limit the number of points in the free trace path for performance
|
|
18826
|
-
const MAX_FREE_TRACE_POINTS =
|
|
18846
|
+
const MAX_FREE_TRACE_POINTS = 5;
|
|
18827
18847
|
state.freeTracePointsCount = (state.freeTracePointsCount || 1) + 1;
|
|
18828
18848
|
if (state.freeTracePointsCount > MAX_FREE_TRACE_POINTS) {
|
|
18829
18849
|
// If limit reached, skip adding more points
|
|
@@ -18859,7 +18879,7 @@ const LidoTrace = class {
|
|
|
18859
18879
|
// In normal modes, allow movement and drawing only within the general proximity threshold
|
|
18860
18880
|
const BACKWARD_TOLERANCE = 20; // allow slight backward movement
|
|
18861
18881
|
const MAX_FORWARD_JUMP = 80; // prevent jumping to wrong segment
|
|
18862
|
-
const RECOVERY_FORWARD_JUMP = Math.min(
|
|
18882
|
+
const RECOVERY_FORWARD_JUMP = Math.min(320, Math.max(160, state.totalPathLength * 0.45)); // recover on long strokes without skipping short paths
|
|
18863
18883
|
const RECOVERY_END_BUFFER = Math.min(60, Math.max(24, state.totalPathLength * 0.12)); // don't let recovery auto-finish the last part
|
|
18864
18884
|
const RECOVERY_POINTER_MOVE_THRESHOLD = 8; // only recover after a meaningful drag, not during slow tracing
|
|
18865
18885
|
let guidedClosestPoint = closestPoint;
|
|
@@ -19316,7 +19336,7 @@ const LidoTrace = class {
|
|
|
19316
19336
|
};
|
|
19317
19337
|
}
|
|
19318
19338
|
render() {
|
|
19319
|
-
return (h(Host, { key: '
|
|
19339
|
+
return (h(Host, { key: '07506adee10b4f0348ba7b7c4d0f338d7e61cfd9', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '9b3c311582a7246cded868234a47293ae78a3932', style: this.style, id: "lido-svgContainer" })));
|
|
19320
19340
|
}
|
|
19321
19341
|
static get assetsDirs() { return ["assets"]; }
|
|
19322
19342
|
get el() { return getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{$ as format}from"./p-
|
|
1
|
+
export{$ as format}from"./p-VRJMO_sg.js";import"./p-Dvjbti-h.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as o,b as i}from"./p-Dvjbti-h.js";export{s as setNonce}from"./p-Dvjbti-h.js";(()=>{const o=import.meta.url,i={};return""!==o&&(i.resourcesUrl=new URL(".",o).href),e(i)})().then((async e=>(await o(),i(JSON.parse('[["p-35fa0b8b",[[0,"lido-root",{"Lang":[1,"lang"],"xmlPath":[1,"xml-path"],"initialIndex":[2,"initial-index"],"margin":[1],"canplay":[4],"baseUrl":[1,"base-url"],"zipUrl":[1,"zip-url"],"exitButtonUrl":[1,"exit-button-url"],"prevButtonUrl":[1,"prev-button-url"],"nextButtonUrl":[1,"next-button-url"],"speakerButtonUrl":[1,"speaker-button-url"],"xmlData":[32]},null,{"Lang":[{"onLangChange":0}]}],[0,"lido-home",{"commonAudioPath":[1,"common-audio-path"],"showNav":[4,"show-nav"],"activeContainerIndexes":[16],"Lang":[1,"lang"],"xmlData":[1,"xml-data"],"initialIndex":[2,"initial-index"],"canplay":[4],"baseUrl":[1,"base-url"],"height":[1],"exitButtonUrl":[1,"exit-button-url"],"prevButtonUrl":[1,"prev-button-url"],"nextButtonUrl":[1,"next-button-url"],"speakerButtonUrl":[1,"speaker-button-url"],"avatarUrl":[1,"avatar-url"],"uuid":[1],"zipUrl":[513,"zip-url"],"navBarIcons":[32],"currentContainerIndex":[32],"resizeTrigger":[32],"exitFlag":[32],"containers":[32],"templateData":[32],"showDotsandbtn":[32]},null,{"commonAudioPath":[{"onCommonAudioPathChange":0}],"xmlData":[{"onXmlDataChange":0}]}],[0,"lido-calculator",{"width":[1],"visible":[8],"height":[1],"objective":[1],"onEntry":[1,"on-entry"],"x":[1],"y":[1],"bgColor":[1,"bg-color"],"penIcon":[1,"pen-icon"],"displayValue":[32],"style":[32]}],[260,"lido-container",{"Lang":[1,"lang"],"showDropBorder":[4,"show-drop-border"],"appendToDropOnCompletion":[4,"append-to-drop-on-completion"],"id":[1],"objective":[1],"customStyle":[1,"custom-style"],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"bgImage":[1,"bg-image"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"canplay":[4],"showCheck":[4,"show-check"],"isContinueOnCorrect":[4,"is-continue-on-correct"],"isAllowOnlyCorrect":[4,"is-allow-only-correct"],"baseUrl":[1,"base-url"],"margin":[1],"exitButtonUrl":[1,"exit-button-url"],"prevButtonUrl":[1,"prev-button-url"],"nextButtonUrl":[1,"next-button-url"],"speakerButtonUrl":[1,"speaker-button-url"],"showPrevButton":[1,"show-prev-button"],"showNextButton":[1,"show-next-button"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"templateId":[1,"template-id"],"highlightWordByWord":[4,"highlight-word-by-word"],"instructName":[32],"speakFlag":[32]},null,{"Lang":[{"languageChanged":0}]}],[0,"lido-keyboard",{"keys":[1],"width":[1],"height":[1],"fontSize":[1,"font-size"],"fontColor":[1,"font-color"],"fontFamily":[1,"font-family"],"gap":[1],"bgColor":[1,"bg-color"],"borderRadius":[1,"border-radius"],"y":[1],"x":[1],"z":[1],"margin":[1],"padding":[1],"visible":[1],"onEntry":[1,"on-entry"],"type":[1],"keyboardInput":[4,"keyboard-input"],"columns":[1],"letterLength":[2,"letter-length"],"disableSpeak":[4,"disable-speak"],"numberOfClick":[32],"inputString":[32],"style":[32]}],[0,"lido-avatar",{"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"src":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"delayVisible":[1,"delay-visible"]}],[0,"lido-balance",{"pivotimage":[1],"scaleimage":[1],"handlerimage":[1],"fill":[1],"tilt":[2],"maxTilt":[2,"max-tilt"],"onEntry":[1,"on-entry"],"height":[1],"width":[1],"x":[1],"y":[1],"z":[1],"visible":[8],"margin":[1],"padding":[1],"balanceSymbol":[1537,"balance-symbol"],"showSymbol":[1540,"show-symbol"],"operation":[1],"pivotSvg":[32],"scaleSvg":[32],"handlerSvg":[32],"style":[32],"tiltf":[32],"leftVal":[32],"rightVal":[32],"feedbackColor":[32],"revealSymbol":[64],"hideSymbol":[64],"setFeedbackColor":[64],"updateTilt":[64]},null,{"tilt":[{"tiltChanged":0}]}],[1,"lido-canvas",{"bgImage":[1,"bg-image"],"width":[1],"height":[1],"visible":[8],"z":[1],"x":[1],"y":[1],"onEntry":[1,"on-entry"],"style":[32]}],[260,"lido-col",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"direction":[1],"borderImage":[1,"border-image"],"boxShadow":[1,"box-shadow"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"style":[32]}],[260,"lido-flash-card",{"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"direction":[1],"display":[1],"front":[8],"back":[8],"flipped":[1540],"autoFlipAfter":[2,"auto-flip-after"],"margin":[1],"disableSpeak":[4,"disable-speak"],"delayVisible":[1,"delay-visible"],"style":[32]},null,{"flipped":[{"handleFlippedChange":0}]}],[260,"lido-float",{"id":[1],"value":[1],"z":[1],"tabIndex":[2,"tab-index"],"visible":[4],"onEntry":[1,"on-entry"],"width":[1],"height":[1],"bgColor":[1,"bg-color"],"type":[1],"delayVisible":[1,"delay-visible"],"floatDirection":[1,"float-direction"],"style":[32]}],[0,"lido-image",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[8],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"src":[1],"isSlice":[1,"is-slice"],"sliceWidth":[1,"slice-width"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"padding":[1],"filter":[1],"borderRadius":[1,"border-radius"],"transform":[1],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-math-matrix",{"rows":[1],"cols":[1],"defualtFill":[1538,"defualt-fill"],"leftIndex":[4,"left-index"],"topIndex":[4,"top-index"],"bottomIndex":[4,"bottom-index"],"clickable":[4],"activeOnlyVisible":[4,"active-only-visible"],"matrixImage":[1,"matrix-image"],"activeBgColor":[1537,"active-bg-color"],"deactiveBgColor":[1537,"deactive-bg-color"],"border":[1537],"height":[1537],"width":[1537],"borderRadius":[1,"border-radius"],"z":[1],"margin":[1],"padding":[1],"visible":[1],"text":[1],"type":[1],"value":[1],"tabIndex":[2,"tab-index"],"x":[1],"y":[1],"fontColor":[1,"font-color"],"onCorrect":[1,"on-correct"],"onInCorrect":[1,"on-in-correct"],"onEntry":[1,"on-entry"],"previousFilledSlot":[32],"previousFilledSlotElement":[32],"style":[32]}],[260,"lido-pos",{"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[8],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"style":[32]}],[260,"lido-random",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1]}],[260,"lido-row",{"showSpeakIcon":[4,"show-speak-icon"],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"direction":[1],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"display":[1],"margin":[1],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-shape",{"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"shapeType":[1,"shape-type"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-slide-fill",{"id":[1],"width":[1],"height":[1],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"visible":[8],"margin":[1],"padding":[1],"borderRadius":[1,"border-radius"],"fill":[1],"numberType":[1,"number-type"],"min":[2],"division":[2],"max":[2],"slider":[4],"src":[1],"fillDirection":[1,"fill-direction"],"type":[1],"onEntry":[1,"on-entry"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"svgContent":[32],"style":[32]},null,{"src":[{"onSrcChange":0}],"fill":[{"onPropChange":0}],"division":[{"onPropChange":0}],"fillDirection":[{"onPropChange":0}],"numberType":[{"onPropChange":0}],"min":[{"onPropChange":0}],"max":[{"onPropChange":0}]}],[0,"lido-trace",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"svgSource":[1,"svg-source"],"value":[1],"height":[1],"width":[1],"audio":[1],"x":[1],"y":[1],"z":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"tabIndex":[2,"tab-index"],"mode":[1],"fingerHintUrl":[1,"finger-hint-url"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"highlightTextId":[1,"highlight-text-id"],"animationTrace":[4,"animation-trace"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"svgUrls":[32],"audioUrls":[32],"currentSvgIndex":[32],"moving":[32],"style":[32],"fileIndex":[32],"isDragging":[32],"activePointerId":[32],"idleTimer":[32],"fingerImg":[32]},null,{"svgSource":[{"initializeSVG":0}],"mode":[{"initializeSVG":0}]}],[260,"lido-wrap",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"flex":[1],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"disableSpeak":[4,"disable-speak"],"style":[32]}],[260,"lido-cell",{"showSpeakIcon":[4,"show-speak-icon"],"scrollbarWidth":[1,"scrollbar-width"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"gap":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[1],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"layout":[1],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"padding":[1],"alignItems":[1,"align-items"],"borderRadius":[1,"border-radius"],"flexDirection":[1,"flex-direction"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-text",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"requiredDrops":[1,"required-drops"],"string":[1],"fontFamily":[1,"font-family"],"fontSize":[1,"font-size"],"fontColor":[1,"font-color"],"highlightWhileSpeaking":[4,"highlight-while-speaking"],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"move":[1],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"borderImage":[1,"border-image"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[8],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"onEntry":[1,"on-entry"],"margin":[1],"padding":[1],"borderRadius":[1,"border-radius"],"spanType":[1,"span-type"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}]]]]'),e))));
|
|
1
|
+
import{p as e,g as o,b as i}from"./p-Dvjbti-h.js";export{s as setNonce}from"./p-Dvjbti-h.js";(()=>{const o=import.meta.url,i={};return""!==o&&(i.resourcesUrl=new URL(".",o).href),e(i)})().then((async e=>(await o(),i(JSON.parse('[["p-461a3d23",[[0,"lido-root",{"Lang":[1,"lang"],"xmlPath":[1,"xml-path"],"initialIndex":[2,"initial-index"],"margin":[1],"canplay":[4],"baseUrl":[1,"base-url"],"zipUrl":[1,"zip-url"],"exitButtonUrl":[1,"exit-button-url"],"prevButtonUrl":[1,"prev-button-url"],"nextButtonUrl":[1,"next-button-url"],"speakerButtonUrl":[1,"speaker-button-url"],"xmlData":[32]},null,{"Lang":[{"onLangChange":0}]}],[0,"lido-home",{"commonAudioPath":[1,"common-audio-path"],"showNav":[4,"show-nav"],"activeContainerIndexes":[16],"Lang":[1,"lang"],"xmlData":[1,"xml-data"],"initialIndex":[2,"initial-index"],"canplay":[4],"baseUrl":[1,"base-url"],"height":[1],"exitButtonUrl":[1,"exit-button-url"],"prevButtonUrl":[1,"prev-button-url"],"nextButtonUrl":[1,"next-button-url"],"speakerButtonUrl":[1,"speaker-button-url"],"avatarUrl":[1,"avatar-url"],"uuid":[1],"zipUrl":[513,"zip-url"],"navBarIcons":[32],"currentContainerIndex":[32],"resizeTrigger":[32],"exitFlag":[32],"containers":[32],"templateData":[32],"showDotsandbtn":[32]},null,{"commonAudioPath":[{"onCommonAudioPathChange":0}],"xmlData":[{"onXmlDataChange":0}]}],[0,"lido-calculator",{"width":[1],"visible":[8],"height":[1],"objective":[1],"onEntry":[1,"on-entry"],"x":[1],"y":[1],"bgColor":[1,"bg-color"],"penIcon":[1,"pen-icon"],"displayValue":[32],"style":[32]}],[260,"lido-container",{"Lang":[1,"lang"],"showDropBorder":[4,"show-drop-border"],"appendToDropOnCompletion":[4,"append-to-drop-on-completion"],"id":[1],"objective":[1],"customStyle":[1,"custom-style"],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"bgImage":[1,"bg-image"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"canplay":[4],"showCheck":[4,"show-check"],"isContinueOnCorrect":[4,"is-continue-on-correct"],"isAllowOnlyCorrect":[4,"is-allow-only-correct"],"baseUrl":[1,"base-url"],"margin":[1],"exitButtonUrl":[1,"exit-button-url"],"prevButtonUrl":[1,"prev-button-url"],"nextButtonUrl":[1,"next-button-url"],"speakerButtonUrl":[1,"speaker-button-url"],"showPrevButton":[1,"show-prev-button"],"showNextButton":[1,"show-next-button"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"templateId":[1,"template-id"],"highlightWordByWord":[4,"highlight-word-by-word"],"instructName":[32],"speakFlag":[32]},null,{"Lang":[{"languageChanged":0}]}],[0,"lido-keyboard",{"keys":[1],"width":[1],"height":[1],"fontSize":[1,"font-size"],"fontColor":[1,"font-color"],"fontFamily":[1,"font-family"],"gap":[1],"bgColor":[1,"bg-color"],"borderRadius":[1,"border-radius"],"y":[1],"x":[1],"z":[1],"margin":[1],"padding":[1],"visible":[1],"onEntry":[1,"on-entry"],"type":[1],"keyboardInput":[4,"keyboard-input"],"columns":[1],"letterLength":[2,"letter-length"],"disableSpeak":[4,"disable-speak"],"numberOfClick":[32],"inputString":[32],"style":[32]}],[0,"lido-avatar",{"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"src":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"delayVisible":[1,"delay-visible"]}],[0,"lido-balance",{"pivotimage":[1],"scaleimage":[1],"handlerimage":[1],"fill":[1],"tilt":[2],"maxTilt":[2,"max-tilt"],"onEntry":[1,"on-entry"],"height":[1],"width":[1],"x":[1],"y":[1],"z":[1],"visible":[8],"margin":[1],"padding":[1],"balanceSymbol":[1537,"balance-symbol"],"showSymbol":[1540,"show-symbol"],"operation":[1],"pivotSvg":[32],"scaleSvg":[32],"handlerSvg":[32],"style":[32],"tiltf":[32],"leftVal":[32],"rightVal":[32],"feedbackColor":[32],"revealSymbol":[64],"hideSymbol":[64],"setFeedbackColor":[64],"updateTilt":[64]},null,{"tilt":[{"tiltChanged":0}]}],[1,"lido-canvas",{"bgImage":[1,"bg-image"],"width":[1],"height":[1],"visible":[8],"z":[1],"x":[1],"y":[1],"onEntry":[1,"on-entry"],"style":[32]}],[260,"lido-col",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"direction":[1],"borderImage":[1,"border-image"],"boxShadow":[1,"box-shadow"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"style":[32]}],[260,"lido-flash-card",{"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"direction":[1],"display":[1],"front":[8],"back":[8],"flipped":[1540],"autoFlipAfter":[2,"auto-flip-after"],"margin":[1],"disableSpeak":[4,"disable-speak"],"delayVisible":[1,"delay-visible"],"style":[32]},null,{"flipped":[{"handleFlippedChange":0}]}],[260,"lido-float",{"id":[1],"value":[1],"z":[1],"tabIndex":[2,"tab-index"],"visible":[4],"onEntry":[1,"on-entry"],"width":[1],"height":[1],"bgColor":[1,"bg-color"],"type":[1],"delayVisible":[1,"delay-visible"],"floatDirection":[1,"float-direction"],"style":[32]}],[0,"lido-image",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[8],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"src":[1],"isSlice":[1,"is-slice"],"sliceWidth":[1,"slice-width"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"padding":[1],"filter":[1],"borderRadius":[1,"border-radius"],"transform":[1],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-math-matrix",{"rows":[1],"cols":[1],"defualtFill":[1538,"defualt-fill"],"leftIndex":[4,"left-index"],"topIndex":[4,"top-index"],"bottomIndex":[4,"bottom-index"],"clickable":[4],"activeOnlyVisible":[4,"active-only-visible"],"matrixImage":[1,"matrix-image"],"activeBgColor":[1537,"active-bg-color"],"deactiveBgColor":[1537,"deactive-bg-color"],"border":[1537],"height":[1537],"width":[1537],"borderRadius":[1,"border-radius"],"z":[1],"margin":[1],"padding":[1],"visible":[1],"text":[1],"type":[1],"value":[1],"tabIndex":[2,"tab-index"],"x":[1],"y":[1],"fontColor":[1,"font-color"],"onCorrect":[1,"on-correct"],"onInCorrect":[1,"on-in-correct"],"onEntry":[1,"on-entry"],"previousFilledSlot":[32],"previousFilledSlotElement":[32],"style":[32]}],[260,"lido-pos",{"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[8],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"style":[32]}],[260,"lido-random",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1]}],[260,"lido-row",{"showSpeakIcon":[4,"show-speak-icon"],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"direction":[1],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"display":[1],"margin":[1],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-shape",{"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"shapeType":[1,"shape-type"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-slide-fill",{"id":[1],"width":[1],"height":[1],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"visible":[8],"margin":[1],"padding":[1],"borderRadius":[1,"border-radius"],"fill":[1],"numberType":[1,"number-type"],"min":[2],"division":[2],"max":[2],"slider":[4],"src":[1],"fillDirection":[1,"fill-direction"],"type":[1],"onEntry":[1,"on-entry"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"svgContent":[32],"style":[32]},null,{"src":[{"onSrcChange":0}],"fill":[{"onPropChange":0}],"division":[{"onPropChange":0}],"fillDirection":[{"onPropChange":0}],"numberType":[{"onPropChange":0}],"min":[{"onPropChange":0}],"max":[{"onPropChange":0}]}],[0,"lido-trace",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"svgSource":[1,"svg-source"],"value":[1],"height":[1],"width":[1],"audio":[1],"x":[1],"y":[1],"z":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"tabIndex":[2,"tab-index"],"mode":[1],"fingerHintUrl":[1,"finger-hint-url"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"highlightTextId":[1,"highlight-text-id"],"animationTrace":[4,"animation-trace"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"svgUrls":[32],"audioUrls":[32],"currentSvgIndex":[32],"moving":[32],"style":[32],"fileIndex":[32],"isDragging":[32],"activePointerId":[32],"idleTimer":[32],"fingerImg":[32]},null,{"svgSource":[{"initializeSVG":0}],"mode":[{"initializeSVG":0}]}],[260,"lido-wrap",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[4],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"flex":[1],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"disableSpeak":[4,"disable-speak"],"style":[32]}],[260,"lido-cell",{"showSpeakIcon":[4,"show-speak-icon"],"scrollbarWidth":[1,"scrollbar-width"],"id":[1],"value":[1],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"x":[1],"y":[1],"z":[1],"gap":[1],"bgColor":[1,"bg-color"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[1],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"onEntry":[1,"on-entry"],"childElementsLength":[2,"child-elements-length"],"minLength":[2,"min-length"],"maxLength":[2,"max-length"],"layout":[1],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"margin":[1],"padding":[1],"alignItems":[1,"align-items"],"borderRadius":[1,"border-radius"],"flexDirection":[1,"flex-direction"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}],[0,"lido-text",{"showSpeakIcon":[4,"show-speak-icon"],"id":[1],"value":[1],"requiredDrops":[1,"required-drops"],"string":[1],"fontFamily":[1,"font-family"],"fontSize":[1,"font-size"],"fontColor":[1,"font-color"],"highlightWhileSpeaking":[4,"highlight-while-speaking"],"height":[1],"width":[1],"ariaLabel":[1,"aria-label"],"ariaHidden":[1,"aria-hidden"],"move":[1],"x":[1],"y":[1],"z":[1],"bgColor":[1,"bg-color"],"borderImage":[1,"border-image"],"type":[1],"tabIndex":[2,"tab-index"],"visible":[8],"audio":[1],"onTouch":[1,"on-touch"],"onInCorrect":[1,"on-in-correct"],"onCorrect":[1,"on-correct"],"minDrops":[2,"min-drops"],"maxDrops":[2,"max-drops"],"onEntry":[1,"on-entry"],"margin":[1],"padding":[1],"borderRadius":[1,"border-radius"],"spanType":[1,"span-type"],"delayVisible":[1,"delay-visible"],"disableSpeak":[4,"disable-speak"],"style":[32]}]]]]'),e))));
|