@learncard/react 2.7.15 → 2.7.16
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/{VCCard-74b1f6a5.js → VCCard-7cf6e8de.js} +2 -2
- package/dist/cjs/{VCCard-74b1f6a5.js.map → VCCard-7cf6e8de.js.map} +1 -1
- package/dist/cjs/{VCDisplayCard2-4ce49744.js → VCDisplayCard2-caca1aa2.js} +249 -223
- package/dist/cjs/VCDisplayCard2-caca1aa2.js.map +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index13.js +2 -2
- package/dist/cjs/index37.js +3 -3
- package/dist/cjs/index40.js +1 -1
- package/dist/esm/{VCCard-2ec56141.js → VCCard-af6c0f15.js} +2 -2
- package/dist/esm/{VCCard-2ec56141.js.map → VCCard-af6c0f15.js.map} +1 -1
- package/dist/esm/{VCDisplayCard2-8d6cb009.js → VCDisplayCard2-95c022ae.js} +249 -223
- package/dist/esm/VCDisplayCard2-95c022ae.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index13.js +2 -2
- package/dist/esm/index37.js +3 -3
- package/dist/esm/index40.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/VCDisplayCard2-4ce49744.js.map +0 -1
- package/dist/esm/VCDisplayCard2-8d6cb009.js.map +0 -1
|
@@ -463,6 +463,188 @@ const TruncateTextBox = ({
|
|
|
463
463
|
}, "Close"))), children);
|
|
464
464
|
};
|
|
465
465
|
|
|
466
|
+
/*! @license Rematrix v0.2.2
|
|
467
|
+
|
|
468
|
+
Copyright 2018 Fisssion LLC.
|
|
469
|
+
|
|
470
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
471
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
472
|
+
in the Software without restriction, including without limitation the rights
|
|
473
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
474
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
475
|
+
furnished to do so, subject to the following conditions:
|
|
476
|
+
|
|
477
|
+
The above copyright notice and this permission notice shall be included in
|
|
478
|
+
all copies or substantial portions of the Software.
|
|
479
|
+
|
|
480
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
481
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
482
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
483
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
484
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
485
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
486
|
+
THE SOFTWARE.
|
|
487
|
+
*/
|
|
488
|
+
/**
|
|
489
|
+
* @module Rematrix
|
|
490
|
+
*/
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Transformation matrices in the browser come in two flavors:
|
|
494
|
+
*
|
|
495
|
+
* - `matrix` using 6 values (short)
|
|
496
|
+
* - `matrix3d` using 16 values (long)
|
|
497
|
+
*
|
|
498
|
+
* This utility follows this [conversion guide](https://goo.gl/EJlUQ1)
|
|
499
|
+
* to expand short form matrices to their equivalent long form.
|
|
500
|
+
*
|
|
501
|
+
* @param {array} source - Accepts both short and long form matrices.
|
|
502
|
+
* @return {array}
|
|
503
|
+
*/
|
|
504
|
+
function format(source) {
|
|
505
|
+
if (source.constructor !== Array) {
|
|
506
|
+
throw new TypeError('Expected array.')
|
|
507
|
+
}
|
|
508
|
+
if (source.length === 16) {
|
|
509
|
+
return source
|
|
510
|
+
}
|
|
511
|
+
if (source.length === 6) {
|
|
512
|
+
var matrix = identity();
|
|
513
|
+
matrix[0] = source[0];
|
|
514
|
+
matrix[1] = source[1];
|
|
515
|
+
matrix[4] = source[2];
|
|
516
|
+
matrix[5] = source[3];
|
|
517
|
+
matrix[12] = source[4];
|
|
518
|
+
matrix[13] = source[5];
|
|
519
|
+
return matrix
|
|
520
|
+
}
|
|
521
|
+
throw new RangeError('Expected array with either 6 or 16 values.')
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Returns a matrix representing no transformation. The product of any matrix
|
|
526
|
+
* multiplied by the identity matrix will be the original matrix.
|
|
527
|
+
*
|
|
528
|
+
* > **Tip:** Similar to how `5 * 1 === 5`, where `1` is the identity.
|
|
529
|
+
*
|
|
530
|
+
* @return {array}
|
|
531
|
+
*/
|
|
532
|
+
function identity() {
|
|
533
|
+
var matrix = [];
|
|
534
|
+
for (var i = 0; i < 16; i++) {
|
|
535
|
+
i % 5 == 0 ? matrix.push(1) : matrix.push(0);
|
|
536
|
+
}
|
|
537
|
+
return matrix
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Returns a 4x4 matrix describing the combined transformations
|
|
542
|
+
* of both arguments.
|
|
543
|
+
*
|
|
544
|
+
* > **Note:** Order is very important. For example, rotating 45°
|
|
545
|
+
* along the Z-axis, followed by translating 500 pixels along the
|
|
546
|
+
* Y-axis... is not the same as translating 500 pixels along the
|
|
547
|
+
* Y-axis, followed by rotating 45° along on the Z-axis.
|
|
548
|
+
*
|
|
549
|
+
* @param {array} m - Accepts both short and long form matrices.
|
|
550
|
+
* @param {array} x - Accepts both short and long form matrices.
|
|
551
|
+
* @return {array}
|
|
552
|
+
*/
|
|
553
|
+
function multiply(m, x) {
|
|
554
|
+
var fm = format(m);
|
|
555
|
+
var fx = format(x);
|
|
556
|
+
var product = [];
|
|
557
|
+
|
|
558
|
+
for (var i = 0; i < 4; i++) {
|
|
559
|
+
var row = [fm[i], fm[i + 4], fm[i + 8], fm[i + 12]];
|
|
560
|
+
for (var j = 0; j < 4; j++) {
|
|
561
|
+
var k = j * 4;
|
|
562
|
+
var col = [fx[k], fx[k + 1], fx[k + 2], fx[k + 3]];
|
|
563
|
+
var result =
|
|
564
|
+
row[0] * col[0] + row[1] * col[1] + row[2] * col[2] + row[3] * col[3];
|
|
565
|
+
|
|
566
|
+
product[i + k] = result;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return product
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Attempts to return a 4x4 matrix describing the CSS transform
|
|
575
|
+
* matrix passed in, but will return the identity matrix as a
|
|
576
|
+
* fallback.
|
|
577
|
+
*
|
|
578
|
+
* **Tip:** In virtually all cases, this method is used to convert
|
|
579
|
+
* a CSS matrix (retrieved as a `string` from computed styles) to
|
|
580
|
+
* its equivalent array format.
|
|
581
|
+
*
|
|
582
|
+
* @param {string} source - String containing a valid CSS `matrix` or `matrix3d` property.
|
|
583
|
+
* @return {array}
|
|
584
|
+
*/
|
|
585
|
+
function parse(source) {
|
|
586
|
+
if (typeof source === 'string') {
|
|
587
|
+
var match = source.match(/matrix(3d)?\(([^)]+)\)/);
|
|
588
|
+
if (match) {
|
|
589
|
+
var raw = match[2].split(', ').map(parseFloat);
|
|
590
|
+
return format(raw)
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
return identity()
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Returns a 4x4 matrix describing X-axis scaling.
|
|
598
|
+
*
|
|
599
|
+
* @param {number} scalar - Decimal multiplier.
|
|
600
|
+
* @return {array}
|
|
601
|
+
*/
|
|
602
|
+
function scaleX(scalar) {
|
|
603
|
+
var matrix = identity();
|
|
604
|
+
matrix[0] = scalar;
|
|
605
|
+
return matrix
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Returns a 4x4 matrix describing Y-axis scaling.
|
|
610
|
+
*
|
|
611
|
+
* @param {number} scalar - Decimal multiplier.
|
|
612
|
+
* @return {array}
|
|
613
|
+
*/
|
|
614
|
+
function scaleY(scalar) {
|
|
615
|
+
var matrix = identity();
|
|
616
|
+
matrix[5] = scalar;
|
|
617
|
+
return matrix
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Returns a 4x4 matrix describing X-axis translation.
|
|
622
|
+
*
|
|
623
|
+
* @param {number} distance - Measured in pixels.
|
|
624
|
+
* @return {array}
|
|
625
|
+
*/
|
|
626
|
+
function translateX(distance) {
|
|
627
|
+
var matrix = identity();
|
|
628
|
+
matrix[12] = distance;
|
|
629
|
+
return matrix
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Returns a 4x4 matrix describing Y-axis translation.
|
|
634
|
+
*
|
|
635
|
+
* @param {number} distance - Measured in pixels.
|
|
636
|
+
* @return {array}
|
|
637
|
+
*/
|
|
638
|
+
function translateY(distance) {
|
|
639
|
+
var matrix = identity();
|
|
640
|
+
matrix[13] = distance;
|
|
641
|
+
return matrix
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
var e=function(t){return "number"==typeof t},i=function(t){return "function"==typeof t},n=function(t){return "[object Object]"===Object.prototype.toString.call(t)},r=function(t){return Array.prototype.slice.apply(t)},s$1=function(t){var e=t.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(e).filter(function(t){return e[t]>1})};function a(t){return [].slice.call(arguments,1).forEach(function(e){if(e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);}),t}var o,l=function(t,e,i){return t+(e-t)*i},p={__proto__:null,isNumber:e,isFunction:i,isObject:n,toArray:r,getDuplicateValsAsStrings:s$1,assign:a,tweenProp:l},c$1="data-flip-id",u$1="data-inverse-flip-id",d$1="data-portal-key",f$1="data-exit-container",h$1={__proto__:null,DATA_FLIP_ID:c$1,DATA_INVERSE_FLIP_ID:u$1,DATA_FLIP_COMPONENT_ID:"data-flip-component-id",DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:d$1,DATA_EXIT_CONTAINER:f$1},g$1={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},m$1=function(t){return n(t)?t:Object.keys(g$1).indexOf(t)>-1?g$1[t]:{}};"undefined"!=typeof window&&(o=window.requestAnimationFrame);var v$1=o=o||function(t){window.setTimeout(t,1e3/60);},y$1=Date.now(),_="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()-y$1};function S(t,e){var i=t.indexOf(e);-1!==i&&t.splice(i,1);}var E=/*#__PURE__*/function(){function t(){}return t.prototype.run=function(){var t=this;v$1(function(){t.springSystem.loop(_());});},t}(),A=function(){this.position=0,this.velocity=0;},C=0,b=.001,I=/*#__PURE__*/function(){function t(t){this._id="s"+C++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new A,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new A,this._restSpeedThreshold=.001,this._tempState=new A,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={};}var e=t.prototype;return e.getId=function(){return this._id},e.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this);},e.setSpringConfig=function(t){return this._springConfig=t,this},e.getCurrentValue=function(){return this._currentState.position},e.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},e.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e].onSpringEndStateChange;n&&n(this);}return this},e.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},e.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e];n.onSpringUpdate&&n.onSpringUpdate(this);}return this},e.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},e.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},e.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},e.advance=function(t,e){var i=this.isAtRest();if(!i||!this._wasAtRest){var n=e;e>.064&&(n=.064),this._timeAccumulator+=n;for(var r,s,a,o,l,p,c=this._springConfig.tension,u=this._springConfig.friction,d=this._currentState.position,f=this._currentState.velocity,h=this._tempState.position,g=this._tempState.velocity;this._timeAccumulator>=b;)this._timeAccumulator-=b,this._timeAccumulator<b&&(this._previousState.position=d,this._previousState.velocity=f),s=c*(this._endValue-h)-u*f,o=c*(this._endValue-(h=d+(r=f)*b*.5))-u*(g=f+s*b*.5),p=c*(this._endValue-(h=d+(a=g)*b*.5))-u*(g=f+o*b*.5),h=d+(l=g)*b,d+=1/6*(r+2*(a+l)+(g=f+p*b))*b,f+=1/6*(s+2*(o+p)+(c*(this._endValue-h)-u*g))*b;this._tempState.position=h,this._tempState.velocity=g,this._currentState.position=d,this._currentState.velocity=f,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/b),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),i=!0);var m=!1;this._wasAtRest&&(this._wasAtRest=!1,m=!0);var v=!1;i&&(this._wasAtRest=!0,v=!0),this.notifyPositionUpdated(m,v);}},e.notifyPositionUpdated=function(t,e){var i=this;this.listeners.filter(Boolean).forEach(function(n){t&&n.onSpringActivate&&!i._onActivateCalled&&(n.onSpringActivate(i),i._onActivateCalled=!0),n.onSpringUpdate&&n.onSpringUpdate(i),e&&n.onSpringAtRest&&n.onSpringAtRest(i);});},e.systemShouldAdvance=function(){return !this.isAtRest()||!this.wasAtRest()},e.wasAtRest=function(){return this._wasAtRest},e.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||0===this._springConfig.tension)},e._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t);},e.addListener=function(t){return this.listeners.push(t),this},e.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(i){var n;t[i]=(n=t[i],function(){n.apply(void 0,[].slice.call(arguments)),e.removeListener(t);});}),this.listeners.push(t),this},e.removeListener=function(t){return S(this.listeners,t),this},t}(),w=/*#__PURE__*/function(){function t(t){this.looper=t||new E,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={};}var e=t.prototype;return e.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},e.createSpringWithConfig=function(t){var e=new I(this);return this.registerSpring(e),e.setSpringConfig(t),e},e.getIsIdle=function(){return this._isIdle},e.registerSpring=function(t){this._springRegistry[t.getId()]=t;},e.deregisterSpring=function(t){S(this._activeSprings,t),delete this._springRegistry[t.getId()];},e.advance=function(t,e){for(var i=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(n){n.systemShouldAdvance()?n.advance(t/1e3,e/1e3):i._idleSpringIndices.push(i._activeSprings.indexOf(n));});this._idleSpringIndices.length>0;){var n=this._idleSpringIndices.pop();n>=0&&this._activeSprings.splice(n,1);}},e.loop=function(t){var e;-1===this._lastTimeMillis&&(this._lastTimeMillis=t-1);var i=t-this._lastTimeMillis;this._lastTimeMillis=t;var n=0,r=this.listeners.length;for(n=0;n<r;n++)(e=this.listeners[n]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,i),0===this._activeSprings.length&&(this._isIdle=!0,this._lastTimeMillis=-1),n=0;n<r;n++)(e=this.listeners[n]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run();},e.activateSpring=function(t){var e=this._springRegistry[t];-1===this._activeSprings.indexOf(e)&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run());},t}(),O=new w,x=function(t){var e=t.springConfig,i=e.overshootClamping,n=t.getOnUpdateFunc,r=t.onAnimationEnd,s=t.onSpringActivate,a=O.createSpring(e.stiffness,e.damping);a.setOvershootClampingEnabled(!!i);var o={onSpringActivate:s,onSpringAtRest:function(){a.destroy(),r();},onSpringUpdate:n({spring:a,onAnimationEnd:r})};return a.addListener(o),a},U=function(t){var e=x(t);return e.setEndValue(1),e},V=function(t,e){if(void 0===e&&(e={}),t&&t.length){e.reverse&&t.reverse();var i,n="number"!=typeof(i=e.speed)?1.1:1+Math.min(Math.max(5*i,0),5),r=1/Math.max(Math.min(t.length,100),10),s=t.map(function(t,e){var i=t.getOnUpdateFunc;return t.getOnUpdateFunc=function(t){var a=i(t);return function(t){var i=t.getCurrentValue();(i=i<.01?0:i>.99?1:i)>=r&&s[e+1]&&s[e+1](Math.max(Math.min(i*n,1),0)),a(t);}},t}).map(function(t){var e=x(t);if(e)return e.setEndValue.bind(e)}).filter(Boolean);s[0]&&s[0](1);}},F=function(t){return [0,1,4,5,12,13].map(function(e){return t[e]})},P=function(t){return t.top<window.innerHeight&&t.bottom>0&&t.left<window.innerWidth&&t.right>0};function D(t){return JSON.parse(t.dataset.flipConfig||"{}")}var R=function(t,e){var i;return a(t,((i={})[e[0]]=e[1],i))},T=function(t,e){return r(e?document.querySelectorAll("["+d$1+'="'+e+'"]'):t.querySelectorAll("["+c$1+"]"))},M=function(t){return t.map(function(t){return [t,t.getBoundingClientRect()]})},L=function(n){var o=n.cachedOrderedFlipIds,p=void 0===o?[]:o,f=n.inProgressAnimations,h=void 0===f?{}:f,v=n.flippedElementPositionsBeforeUpdate,y=void 0===v?{}:v,_=n.flipCallbacks,S=void 0===_?{}:_,E=n.containerEl,A=n.applyTransformOrigin,C=n.spring,b=n.debug,I=n.portalKey,w=n.staggerConfig,O=void 0===w?{}:w,x=n.decisionData,j=void 0===x?{}:x,B=n.handleEnterUpdateDelete,N=n.onComplete,L=n.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var q,X=M(T((q={element:E,portalKey:I}).element,q.portalKey)).map(function(t){var e=t[0],i=t[1],n=window.getComputedStyle(e);return [e.dataset.flipId,{element:e,rect:i,opacity:parseFloat(n.opacity),transform:n.transform}]}).reduce(R,{}),Y=function(t){var e=t.containerEl,i=t.portalKey;return i?function(t){return function(e){return r(document.querySelectorAll("["+d$1+'="'+t+'"]'+e))}}(i):e?function(t){var e=Math.random().toFixed(5);return t.dataset.flipperId=e,function(i){return r(t.querySelectorAll('[data-flipper-id="'+e+'"] '+i))}}(e):function(){return []}}({containerEl:E,portalKey:I}),W=function(t){return function(e){return t("["+c$1+'="'+e+'"]')[0]}}(Y),K=function(t){return y[t]&&X[t]},H=Object.keys(y).concat(Object.keys(X)).filter(function(t){return !K(t)}),J={flipCallbacks:S,getElement:W,flippedElementPositionsBeforeUpdate:y,flippedElementPositionsAfterUpdate:X,inProgressAnimations:h,decisionData:j},z=function(t){var e,i=t.unflippedIds,n=t.flipCallbacks,r=t.getElement,s=t.flippedElementPositionsBeforeUpdate,a=t.flippedElementPositionsAfterUpdate,o=t.inProgressAnimations,l=t.decisionData,p=i.filter(function(t){return a[t]}).filter(function(t){return n[t]&&n[t].onAppear}),c=i.filter(function(t){return s[t]&&n[t]&&n[t].onExit}),u=new Promise(function(t){e=t;}),d=[],f=0,h=c.map(function(t,i){var r=s[t].domDataForExitAnimations,a=r.element,p=r.parent,c=r.childPosition,u=c.top,h=c.left,g=c.width,m=c.height;"static"===getComputedStyle(p).position&&(p.style.position="relative"),a.style.transform="matrix(1, 0, 0, 1, 0, 0)",a.style.position="absolute",a.style.top=u+"px",a.style.left=h+"px",a.style.height=m+"px",a.style.width=g+"px";var v=d.filter(function(t){return t[0]===p})[0];v||(v=[p,document.createDocumentFragment()],d.push(v)),v[1].appendChild(a),f+=1;var y=function(){try{p.removeChild(a);}catch(t){}finally{0==(f-=1)&&e();}};return o[t]={stop:y},function(){return n[t].onExit(a,i,y,l)}});return d.forEach(function(t){t[0].appendChild(t[1]);}),h.length||e(),{hideEnteringElements:function(){p.forEach(function(t){var e=r(t);e&&(e.style.opacity="0");});},animateEnteringElements:function(){p.forEach(function(t,e){var i=r(t);i&&n[t].onAppear(i,e,l);});},animateExitingElements:function(){return h.forEach(function(t){return t()}),u}}}(a({},J,{unflippedIds:H})),G=z.hideEnteringElements,Q=z.animateEnteringElements,Z=z.animateExitingElements,$=a({},J,{containerEl:E,flippedIds:p.filter(K),applyTransformOrigin:A,spring:C,debug:b,staggerConfig:O,scopedSelector:Y,onComplete:N});L&&L(E,j);var tt=function(n){var o,p=n.flippedIds,c=n.flipCallbacks,d=n.inProgressAnimations,f=n.flippedElementPositionsBeforeUpdate,h=n.flippedElementPositionsAfterUpdate,v=n.applyTransformOrigin,y=n.spring,_=n.getElement,S=n.debug,E=n.staggerConfig,A=void 0===E?{}:E,C=n.decisionData,b=void 0===C?{}:C,I=n.onComplete,w=n.containerEl,O=new Promise(function(t){o=t;});if(I&&O.then(function(){return I(w,b)}),!p.length)return function(){return o([]),O};var x=[],R=_(p[0]),T=R?R.ownerDocument.querySelector("body"):document.querySelector("body");s$1(p);var M=p.map(function(n){var s=f[n].rect,p=h[n].rect,_=f[n].opacity,S=h[n].opacity,E=p.width<1||p.height<1,A=h[n].element;if(!P(s)&&!P(p))return !1;if(!A)return !1;var C,I,w,O=D(A),U=(w=(I=void 0===(C={flipperSpring:y,flippedSpring:O.spring})?{}:C).flippedSpring,a({},g$1.noWobble,m$1(I.flipperSpring),m$1(w))),V=!0===O.stagger?"default":O.stagger,R={element:A,id:n,stagger:V,springConfig:U};if(c[n]&&c[n].shouldFlip&&!c[n].shouldFlip(b.previous,b.current))return !1;var k=Math.abs(s.left-p.left)+Math.abs(s.top-p.top),j=Math.abs(s.width-p.width)+Math.abs(s.height-p.height),B=Math.abs(S-_);if(0===s.height&&0===p.height||0===s.width&&0===p.width||k<.5&&j<.5&&B<.01)return !1;var N=parse(h[n].transform),L={matrix:N},q={matrix:[]},X=[N];O.translate&&(X.push(translateX(s.left-p.left)),X.push(translateY(s.top-p.top))),O.scale&&(X.push(scaleX(Math.max(s.width,1)/Math.max(p.width,1))),X.push(scaleY(Math.max(s.height,1)/Math.max(p.height,1)))),O.opacity&&(q.opacity=_,L.opacity=S);var Y=[];if(!c[n]||!c[n].shouldInvert||c[n].shouldInvert(b.previous,b.current)){var W=function(t,e){return r(t.querySelectorAll("["+u$1+'="'+e+'"]'))}(A,n);Y=W.map(function(t){return [t,D(t)]});}q.matrix=F(X.reduce(multiply)),L.matrix=F(L.matrix);var K,H=function(t){var i=t.element,n=t.invertedChildren,r=t.body;return function(t){var s=t.matrix,a=t.opacity,o=t.forceMinVals;if(e(a)&&(i.style.opacity=a+""),o&&(i.style.minHeight="1px",i.style.minWidth="1px"),s){var l=function(t){return "matrix("+t.join(", ")+")"}(s);i.style.transform=l,n&&function(t){var e=t.matrix,i=t.body;t.invertedChildren.forEach(function(t){var n=t[0],r=t[1];if(i.contains(n)){var s=e[0],a=e[3],o=e[5],l={translateX:0,translateY:0,scaleX:1,scaleY:1},p="";r.translate&&(l.translateX=-e[4]/s,l.translateY=-o/a,p+="translate("+l.translateX+"px, "+l.translateY+"px)"),r.scale&&(l.scaleX=1/s,l.scaleY=1/a,p+=" scale("+l.scaleX+", "+l.scaleY+")"),n.style.transform=p;}});}({invertedChildren:n,matrix:s,body:r});}}}({element:A,invertedChildren:Y,body:T});if(c[n]&&c[n].onComplete){var J=c[n].onComplete;K=function(){return J(A,b)};}var z=e(q.opacity)&&e(L.opacity)&&q.opacity!==L.opacity,G=!1;return a({},R,{stagger:V,springConfig:U,getOnUpdateFunc:function(t){var e=t.spring,i=t.onAnimationEnd;return d[n]={destroy:e.destroy.bind(e),onAnimationEnd:i},function(t){c[n]&&c[n].onSpringUpdate&&c[n].onSpringUpdate(t.getCurrentValue()),G||(G=!0,c[n]&&c[n].onStart&&c[n].onStart(A,b));var e=t.getCurrentValue();if(T.contains(A)){var i={matrix:[]};i.matrix=q.matrix.map(function(t,i){return l(t,L.matrix[i],e)}),z&&(i.opacity=l(q.opacity,L.opacity,e)),H(i);}else t.destroy();}},initializeFlip:function(){H({matrix:q.matrix,opacity:z?q.opacity:void 0,forceMinVals:E}),c[n]&&c[n].onStartImmediate&&c[n].onStartImmediate(A,b),O.transformOrigin?A.style.transformOrigin=O.transformOrigin:v&&(A.style.transformOrigin="0 0"),Y.forEach(function(t){var e=t[0],i=t[1];i.transformOrigin?e.style.transformOrigin=i.transformOrigin:v&&(e.style.transformOrigin="0 0");});},onAnimationEnd:function(t){delete d[n],i(K)&&K(),A.style.transform="",Y.forEach(function(t){t[0].style.transform="";}),E&&A&&(A.style.minHeight="",A.style.minWidth=""),t||(x.push(n),x.length>=M.length&&o(x));},delayUntil:O.delayUntil})}).filter(Boolean);if(M.forEach(function(t){return (0, t.initializeFlip)()}),S)return function(){};var k=M.filter(function(t){return t.delayUntil&&(e=t.delayUntil,M.filter(function(t){return t.id===e}).length);var e;}),j={},B={},N={};k.forEach(function(t){t.stagger?(N[t.stagger]=!0,B[t.delayUntil]?B[t.delayUntil].push(t.stagger):B[t.delayUntil]=[t.stagger]):j[t.delayUntil]?j[t.delayUntil].push(t):j[t.delayUntil]=[t];});var L=M.filter(function(t){return t.stagger}).reduce(function(t,e){return t[e.stagger]?t[e.stagger].push(e):t[e.stagger]=[e],t},{}),q=M.filter(function(t){return -1===k.indexOf(t)});return q.forEach(function(t){t.onSpringActivate=function(){j[t.id]&&j[t.id].forEach(U),B[t.id]&&Object.keys(B[t.id].reduce(function(t,e){var i;return a(t,((i={})[e]=!0,i))},{})).forEach(function(t){V(L[t],A[t]);});};}),function(){return M.length||o([]),q.filter(function(t){return !t.stagger}).forEach(U),Object.keys(L).forEach(function(t){N[t]||V(L[t],A[t]);}),O}}($);B?B({hideEnteringElements:G,animateEnteringElements:Q,animateExitingElements:Z,animateFlippedElements:tt}):(G(),Z().then(Q),tt());}},q=function(t){var e=t.element,i=t.flipCallbacks,n=void 0===i?{}:i,s=t.inProgressAnimations,o=void 0===s?{}:s,l=T(e,t.portalKey),p=r(e.querySelectorAll("["+u$1+"]")),c={},d=[],h={};l.filter(function(t){return n&&n[t.dataset.flipId]&&n[t.dataset.flipId].onExit}).forEach(function(t){var e=t.parentNode;if(t.closest){var i=t.closest("["+f$1+"]");i&&(e=i);}var n=d.findIndex(function(t){return t[0]===e});-1===n&&(d.push([e,e.getBoundingClientRect()]),n=d.length-1),c[t.dataset.flipId]=d[n][1],h[t.dataset.flipId]=e;});var g=M(l),m=g.map(function(t){var e=t[0],i=t[1],r={};if(n&&n[e.dataset.flipId]&&n[e.dataset.flipId].onExit){var s=c[e.dataset.flipId];a(r,{element:e,parent:h[e.dataset.flipId],childPosition:{top:i.top-s.top,left:i.left-s.left,width:i.width,height:i.height}});}return [e.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(e).opacity||"1"),domDataForExitAnimations:r}]}).reduce(R,{});return function(t,e){Object.keys(t).forEach(function(e){t[e].destroy&&t[e].destroy(),t[e].onAnimationEnd&&t[e].onAnimationEnd(!0),delete t[e];}),e.forEach(function(t){t.style.transform="",t.style.opacity="";});}(o,l.concat(p)),{flippedElementPositions:m,cachedOrderedFlipIds:g.map(function(t){return t[0].dataset.flipId})}};new w;
|
|
645
|
+
|
|
646
|
+
function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},s.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function d(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var f=/*#__PURE__*/React.createContext({}),u=/*#__PURE__*/React.createContext("portal"),h=/*#__PURE__*/function(r){var n,o;function p(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return (e=r.call.apply(r,[this].concat(n))||this).inProgressAnimations={},e.flipCallbacks={},e.el=void 0,e}o=r,(n=p).prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o);var l=p.prototype;return l.getSnapshotBeforeUpdate=function(t){return t.flipKey!==this.props.flipKey&&this.el?q({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},l.componentDidUpdate=function(e,r,n){this.props.flipKey!==e.flipKey&&this.el&&L({flippedElementPositionsBeforeUpdate:n.flippedElementPositions,cachedOrderedFlipIds:n.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:e.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart});},l.render=function(){var e=this,t=this.props,r=t.portalKey,n=/*#__PURE__*/React__default["default"].createElement(f.Provider,{value:this.flipCallbacks},/*#__PURE__*/React__default["default"].createElement(t.element,{className:t.className,ref:function(t){return e.el=t}},this.props.children));return r&&(n=/*#__PURE__*/React__default["default"].createElement(u.Provider,{value:r},n)),n},p}(React.Component);h.defaultProps={applyTransformOrigin:!0,element:"div"};var m=["children","flipId","inverseFlipId","portalKey"],y=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],g=function(e){var t,i=e.children,o=e.flipId,p$1=e.inverseFlipId,s=e.portalKey,c=d(e,m),f=i,u=function(e){return "function"==typeof e}(f);if(!u)try{f=React.Children.only(i);}catch(e){throw new Error("Each Flipped component must wrap a single child")}c.scale||c.translate||c.opacity||p.assign(c,{translate:!0,scale:!0,opacity:!0});var h=((t={})[h$1.DATA_FLIP_CONFIG]=JSON.stringify(c),t);return void 0!==o?h[h$1.DATA_FLIP_ID]=String(o):p$1&&(h[h$1.DATA_INVERSE_FLIP_ID]=String(p$1)),void 0!==s&&(h[h$1.DATA_PORTAL_KEY]=s),u?f(h):/*#__PURE__*/React.cloneElement(f,h)},v=function(e){var t=e.children,n=e.flipId,o=e.shouldFlip,p$1=e.shouldInvert,l=e.onAppear,a=e.onStart,c=e.onStartImmediate,h=e.onComplete,m=e.onExit,v=e.onSpringUpdate,I=d(e,y);return t?I.inverseFlipId?/*#__PURE__*/React__default["default"].createElement(g,s({},I),t):/*#__PURE__*/React__default["default"].createElement(u.Consumer,null,function(e){return React__default["default"].createElement(f.Consumer,null,function(d){return p.isObject(d)&&n&&(d[n]={shouldFlip:o,shouldInvert:p$1,onAppear:l,onStart:a,onStartImmediate:c,onComplete:h,onExit:m,onSpringUpdate:v}),/*#__PURE__*/React__default["default"].createElement(g,s({flipId:n},I,{portalKey:e}),t)})}):null};v.displayName="Flipped";
|
|
647
|
+
|
|
466
648
|
const VerificationRow = ({ verification }) => {
|
|
467
649
|
var _a, _b;
|
|
468
650
|
const [showInfo, setShowInfo] = React.useState(false);
|
|
@@ -542,7 +724,9 @@ const VC2BackFace = ({
|
|
|
542
724
|
const criteria = (_a = achievement == null ? void 0 : achievement.criteria) == null ? void 0 : _a.narrative;
|
|
543
725
|
const description = achievement == null ? void 0 : achievement.description;
|
|
544
726
|
const alignment = achievement == null ? void 0 : achievement.alignment;
|
|
545
|
-
return /* @__PURE__ */ React__default["default"].createElement(
|
|
727
|
+
return /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
728
|
+
inverseFlipId: "card"
|
|
729
|
+
}, /* @__PURE__ */ React__default["default"].createElement("section", {
|
|
546
730
|
className: "vc-back-face flex flex-col gap-[20px] w-full px-[15px] pb-[25px]"
|
|
547
731
|
}, showBackButton && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
548
732
|
className: "w-full"
|
|
@@ -586,7 +770,7 @@ const VC2BackFace = ({
|
|
|
586
770
|
style: "boost"
|
|
587
771
|
}), verificationItems && verificationItems.length > 0 && /* @__PURE__ */ React__default["default"].createElement(VerificationsBox, {
|
|
588
772
|
verificationItems
|
|
589
|
-
}));
|
|
773
|
+
})));
|
|
590
774
|
};
|
|
591
775
|
|
|
592
776
|
const VC2FrontFaceInfo = ({
|
|
@@ -632,7 +816,9 @@ const VC2FrontFaceInfo = ({
|
|
|
632
816
|
verifierState = VerifierStateBadgeAndText.VERIFIER_STATES.unknownVerifier;
|
|
633
817
|
}
|
|
634
818
|
}
|
|
635
|
-
return /* @__PURE__ */ React__default["default"].createElement(
|
|
819
|
+
return /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
820
|
+
inverseFlipId: "card"
|
|
821
|
+
}, /* @__PURE__ */ React__default["default"].createElement("section", {
|
|
636
822
|
className: "vc-front-face w-full px-[15px] flex flex-col items-center gap-[15px]"
|
|
637
823
|
}, imageUrl && !customThumbComponent && /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
638
824
|
className: "vc-front-image h-[130px] w-[130px] rounded-[10px]",
|
|
@@ -661,191 +847,9 @@ const VC2FrontFaceInfo = ({
|
|
|
661
847
|
className: "font-[700]"
|
|
662
848
|
}, issuerName))), /* @__PURE__ */ React__default["default"].createElement(VerifierStateBadgeAndText.VerifierStateBadgeAndText, {
|
|
663
849
|
verifierState
|
|
664
|
-
})))));
|
|
850
|
+
}))))));
|
|
665
851
|
};
|
|
666
852
|
|
|
667
|
-
/*! @license Rematrix v0.2.2
|
|
668
|
-
|
|
669
|
-
Copyright 2018 Fisssion LLC.
|
|
670
|
-
|
|
671
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
672
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
673
|
-
in the Software without restriction, including without limitation the rights
|
|
674
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
675
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
676
|
-
furnished to do so, subject to the following conditions:
|
|
677
|
-
|
|
678
|
-
The above copyright notice and this permission notice shall be included in
|
|
679
|
-
all copies or substantial portions of the Software.
|
|
680
|
-
|
|
681
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
682
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
683
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
684
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
685
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
686
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
687
|
-
THE SOFTWARE.
|
|
688
|
-
*/
|
|
689
|
-
/**
|
|
690
|
-
* @module Rematrix
|
|
691
|
-
*/
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* Transformation matrices in the browser come in two flavors:
|
|
695
|
-
*
|
|
696
|
-
* - `matrix` using 6 values (short)
|
|
697
|
-
* - `matrix3d` using 16 values (long)
|
|
698
|
-
*
|
|
699
|
-
* This utility follows this [conversion guide](https://goo.gl/EJlUQ1)
|
|
700
|
-
* to expand short form matrices to their equivalent long form.
|
|
701
|
-
*
|
|
702
|
-
* @param {array} source - Accepts both short and long form matrices.
|
|
703
|
-
* @return {array}
|
|
704
|
-
*/
|
|
705
|
-
function format(source) {
|
|
706
|
-
if (source.constructor !== Array) {
|
|
707
|
-
throw new TypeError('Expected array.')
|
|
708
|
-
}
|
|
709
|
-
if (source.length === 16) {
|
|
710
|
-
return source
|
|
711
|
-
}
|
|
712
|
-
if (source.length === 6) {
|
|
713
|
-
var matrix = identity();
|
|
714
|
-
matrix[0] = source[0];
|
|
715
|
-
matrix[1] = source[1];
|
|
716
|
-
matrix[4] = source[2];
|
|
717
|
-
matrix[5] = source[3];
|
|
718
|
-
matrix[12] = source[4];
|
|
719
|
-
matrix[13] = source[5];
|
|
720
|
-
return matrix
|
|
721
|
-
}
|
|
722
|
-
throw new RangeError('Expected array with either 6 or 16 values.')
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Returns a matrix representing no transformation. The product of any matrix
|
|
727
|
-
* multiplied by the identity matrix will be the original matrix.
|
|
728
|
-
*
|
|
729
|
-
* > **Tip:** Similar to how `5 * 1 === 5`, where `1` is the identity.
|
|
730
|
-
*
|
|
731
|
-
* @return {array}
|
|
732
|
-
*/
|
|
733
|
-
function identity() {
|
|
734
|
-
var matrix = [];
|
|
735
|
-
for (var i = 0; i < 16; i++) {
|
|
736
|
-
i % 5 == 0 ? matrix.push(1) : matrix.push(0);
|
|
737
|
-
}
|
|
738
|
-
return matrix
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* Returns a 4x4 matrix describing the combined transformations
|
|
743
|
-
* of both arguments.
|
|
744
|
-
*
|
|
745
|
-
* > **Note:** Order is very important. For example, rotating 45°
|
|
746
|
-
* along the Z-axis, followed by translating 500 pixels along the
|
|
747
|
-
* Y-axis... is not the same as translating 500 pixels along the
|
|
748
|
-
* Y-axis, followed by rotating 45° along on the Z-axis.
|
|
749
|
-
*
|
|
750
|
-
* @param {array} m - Accepts both short and long form matrices.
|
|
751
|
-
* @param {array} x - Accepts both short and long form matrices.
|
|
752
|
-
* @return {array}
|
|
753
|
-
*/
|
|
754
|
-
function multiply(m, x) {
|
|
755
|
-
var fm = format(m);
|
|
756
|
-
var fx = format(x);
|
|
757
|
-
var product = [];
|
|
758
|
-
|
|
759
|
-
for (var i = 0; i < 4; i++) {
|
|
760
|
-
var row = [fm[i], fm[i + 4], fm[i + 8], fm[i + 12]];
|
|
761
|
-
for (var j = 0; j < 4; j++) {
|
|
762
|
-
var k = j * 4;
|
|
763
|
-
var col = [fx[k], fx[k + 1], fx[k + 2], fx[k + 3]];
|
|
764
|
-
var result =
|
|
765
|
-
row[0] * col[0] + row[1] * col[1] + row[2] * col[2] + row[3] * col[3];
|
|
766
|
-
|
|
767
|
-
product[i + k] = result;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
return product
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Attempts to return a 4x4 matrix describing the CSS transform
|
|
776
|
-
* matrix passed in, but will return the identity matrix as a
|
|
777
|
-
* fallback.
|
|
778
|
-
*
|
|
779
|
-
* **Tip:** In virtually all cases, this method is used to convert
|
|
780
|
-
* a CSS matrix (retrieved as a `string` from computed styles) to
|
|
781
|
-
* its equivalent array format.
|
|
782
|
-
*
|
|
783
|
-
* @param {string} source - String containing a valid CSS `matrix` or `matrix3d` property.
|
|
784
|
-
* @return {array}
|
|
785
|
-
*/
|
|
786
|
-
function parse(source) {
|
|
787
|
-
if (typeof source === 'string') {
|
|
788
|
-
var match = source.match(/matrix(3d)?\(([^)]+)\)/);
|
|
789
|
-
if (match) {
|
|
790
|
-
var raw = match[2].split(', ').map(parseFloat);
|
|
791
|
-
return format(raw)
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
return identity()
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
* Returns a 4x4 matrix describing X-axis scaling.
|
|
799
|
-
*
|
|
800
|
-
* @param {number} scalar - Decimal multiplier.
|
|
801
|
-
* @return {array}
|
|
802
|
-
*/
|
|
803
|
-
function scaleX(scalar) {
|
|
804
|
-
var matrix = identity();
|
|
805
|
-
matrix[0] = scalar;
|
|
806
|
-
return matrix
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* Returns a 4x4 matrix describing Y-axis scaling.
|
|
811
|
-
*
|
|
812
|
-
* @param {number} scalar - Decimal multiplier.
|
|
813
|
-
* @return {array}
|
|
814
|
-
*/
|
|
815
|
-
function scaleY(scalar) {
|
|
816
|
-
var matrix = identity();
|
|
817
|
-
matrix[5] = scalar;
|
|
818
|
-
return matrix
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
/**
|
|
822
|
-
* Returns a 4x4 matrix describing X-axis translation.
|
|
823
|
-
*
|
|
824
|
-
* @param {number} distance - Measured in pixels.
|
|
825
|
-
* @return {array}
|
|
826
|
-
*/
|
|
827
|
-
function translateX(distance) {
|
|
828
|
-
var matrix = identity();
|
|
829
|
-
matrix[12] = distance;
|
|
830
|
-
return matrix
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
/**
|
|
834
|
-
* Returns a 4x4 matrix describing Y-axis translation.
|
|
835
|
-
*
|
|
836
|
-
* @param {number} distance - Measured in pixels.
|
|
837
|
-
* @return {array}
|
|
838
|
-
*/
|
|
839
|
-
function translateY(distance) {
|
|
840
|
-
var matrix = identity();
|
|
841
|
-
matrix[13] = distance;
|
|
842
|
-
return matrix
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
var e=function(t){return "number"==typeof t},i=function(t){return "function"==typeof t},n=function(t){return "[object Object]"===Object.prototype.toString.call(t)},r=function(t){return Array.prototype.slice.apply(t)},s$1=function(t){var e=t.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(e).filter(function(t){return e[t]>1})};function a(t){return [].slice.call(arguments,1).forEach(function(e){if(e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);}),t}var o,l=function(t,e,i){return t+(e-t)*i},p={__proto__:null,isNumber:e,isFunction:i,isObject:n,toArray:r,getDuplicateValsAsStrings:s$1,assign:a,tweenProp:l},c$1="data-flip-id",u$1="data-inverse-flip-id",d$1="data-portal-key",f$1="data-exit-container",h$1={__proto__:null,DATA_FLIP_ID:c$1,DATA_INVERSE_FLIP_ID:u$1,DATA_FLIP_COMPONENT_ID:"data-flip-component-id",DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:d$1,DATA_EXIT_CONTAINER:f$1},g$1={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},m$1=function(t){return n(t)?t:Object.keys(g$1).indexOf(t)>-1?g$1[t]:{}};"undefined"!=typeof window&&(o=window.requestAnimationFrame);var v$1=o=o||function(t){window.setTimeout(t,1e3/60);},y$1=Date.now(),_="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()-y$1};function S(t,e){var i=t.indexOf(e);-1!==i&&t.splice(i,1);}var E=/*#__PURE__*/function(){function t(){}return t.prototype.run=function(){var t=this;v$1(function(){t.springSystem.loop(_());});},t}(),A=function(){this.position=0,this.velocity=0;},C=0,b=.001,I=/*#__PURE__*/function(){function t(t){this._id="s"+C++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new A,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new A,this._restSpeedThreshold=.001,this._tempState=new A,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={};}var e=t.prototype;return e.getId=function(){return this._id},e.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this);},e.setSpringConfig=function(t){return this._springConfig=t,this},e.getCurrentValue=function(){return this._currentState.position},e.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},e.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e].onSpringEndStateChange;n&&n(this);}return this},e.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},e.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e];n.onSpringUpdate&&n.onSpringUpdate(this);}return this},e.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},e.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},e.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},e.advance=function(t,e){var i=this.isAtRest();if(!i||!this._wasAtRest){var n=e;e>.064&&(n=.064),this._timeAccumulator+=n;for(var r,s,a,o,l,p,c=this._springConfig.tension,u=this._springConfig.friction,d=this._currentState.position,f=this._currentState.velocity,h=this._tempState.position,g=this._tempState.velocity;this._timeAccumulator>=b;)this._timeAccumulator-=b,this._timeAccumulator<b&&(this._previousState.position=d,this._previousState.velocity=f),s=c*(this._endValue-h)-u*f,o=c*(this._endValue-(h=d+(r=f)*b*.5))-u*(g=f+s*b*.5),p=c*(this._endValue-(h=d+(a=g)*b*.5))-u*(g=f+o*b*.5),h=d+(l=g)*b,d+=1/6*(r+2*(a+l)+(g=f+p*b))*b,f+=1/6*(s+2*(o+p)+(c*(this._endValue-h)-u*g))*b;this._tempState.position=h,this._tempState.velocity=g,this._currentState.position=d,this._currentState.velocity=f,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/b),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),i=!0);var m=!1;this._wasAtRest&&(this._wasAtRest=!1,m=!0);var v=!1;i&&(this._wasAtRest=!0,v=!0),this.notifyPositionUpdated(m,v);}},e.notifyPositionUpdated=function(t,e){var i=this;this.listeners.filter(Boolean).forEach(function(n){t&&n.onSpringActivate&&!i._onActivateCalled&&(n.onSpringActivate(i),i._onActivateCalled=!0),n.onSpringUpdate&&n.onSpringUpdate(i),e&&n.onSpringAtRest&&n.onSpringAtRest(i);});},e.systemShouldAdvance=function(){return !this.isAtRest()||!this.wasAtRest()},e.wasAtRest=function(){return this._wasAtRest},e.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||0===this._springConfig.tension)},e._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t);},e.addListener=function(t){return this.listeners.push(t),this},e.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(i){var n;t[i]=(n=t[i],function(){n.apply(void 0,[].slice.call(arguments)),e.removeListener(t);});}),this.listeners.push(t),this},e.removeListener=function(t){return S(this.listeners,t),this},t}(),w=/*#__PURE__*/function(){function t(t){this.looper=t||new E,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={};}var e=t.prototype;return e.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},e.createSpringWithConfig=function(t){var e=new I(this);return this.registerSpring(e),e.setSpringConfig(t),e},e.getIsIdle=function(){return this._isIdle},e.registerSpring=function(t){this._springRegistry[t.getId()]=t;},e.deregisterSpring=function(t){S(this._activeSprings,t),delete this._springRegistry[t.getId()];},e.advance=function(t,e){for(var i=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(n){n.systemShouldAdvance()?n.advance(t/1e3,e/1e3):i._idleSpringIndices.push(i._activeSprings.indexOf(n));});this._idleSpringIndices.length>0;){var n=this._idleSpringIndices.pop();n>=0&&this._activeSprings.splice(n,1);}},e.loop=function(t){var e;-1===this._lastTimeMillis&&(this._lastTimeMillis=t-1);var i=t-this._lastTimeMillis;this._lastTimeMillis=t;var n=0,r=this.listeners.length;for(n=0;n<r;n++)(e=this.listeners[n]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,i),0===this._activeSprings.length&&(this._isIdle=!0,this._lastTimeMillis=-1),n=0;n<r;n++)(e=this.listeners[n]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run();},e.activateSpring=function(t){var e=this._springRegistry[t];-1===this._activeSprings.indexOf(e)&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run());},t}(),O=new w,x=function(t){var e=t.springConfig,i=e.overshootClamping,n=t.getOnUpdateFunc,r=t.onAnimationEnd,s=t.onSpringActivate,a=O.createSpring(e.stiffness,e.damping);a.setOvershootClampingEnabled(!!i);var o={onSpringActivate:s,onSpringAtRest:function(){a.destroy(),r();},onSpringUpdate:n({spring:a,onAnimationEnd:r})};return a.addListener(o),a},U=function(t){var e=x(t);return e.setEndValue(1),e},V=function(t,e){if(void 0===e&&(e={}),t&&t.length){e.reverse&&t.reverse();var i,n="number"!=typeof(i=e.speed)?1.1:1+Math.min(Math.max(5*i,0),5),r=1/Math.max(Math.min(t.length,100),10),s=t.map(function(t,e){var i=t.getOnUpdateFunc;return t.getOnUpdateFunc=function(t){var a=i(t);return function(t){var i=t.getCurrentValue();(i=i<.01?0:i>.99?1:i)>=r&&s[e+1]&&s[e+1](Math.max(Math.min(i*n,1),0)),a(t);}},t}).map(function(t){var e=x(t);if(e)return e.setEndValue.bind(e)}).filter(Boolean);s[0]&&s[0](1);}},F=function(t){return [0,1,4,5,12,13].map(function(e){return t[e]})},P=function(t){return t.top<window.innerHeight&&t.bottom>0&&t.left<window.innerWidth&&t.right>0};function D(t){return JSON.parse(t.dataset.flipConfig||"{}")}var R=function(t,e){var i;return a(t,((i={})[e[0]]=e[1],i))},T=function(t,e){return r(e?document.querySelectorAll("["+d$1+'="'+e+'"]'):t.querySelectorAll("["+c$1+"]"))},M=function(t){return t.map(function(t){return [t,t.getBoundingClientRect()]})},L=function(n){var o=n.cachedOrderedFlipIds,p=void 0===o?[]:o,f=n.inProgressAnimations,h=void 0===f?{}:f,v=n.flippedElementPositionsBeforeUpdate,y=void 0===v?{}:v,_=n.flipCallbacks,S=void 0===_?{}:_,E=n.containerEl,A=n.applyTransformOrigin,C=n.spring,b=n.debug,I=n.portalKey,w=n.staggerConfig,O=void 0===w?{}:w,x=n.decisionData,j=void 0===x?{}:x,B=n.handleEnterUpdateDelete,N=n.onComplete,L=n.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var q,X=M(T((q={element:E,portalKey:I}).element,q.portalKey)).map(function(t){var e=t[0],i=t[1],n=window.getComputedStyle(e);return [e.dataset.flipId,{element:e,rect:i,opacity:parseFloat(n.opacity),transform:n.transform}]}).reduce(R,{}),Y=function(t){var e=t.containerEl,i=t.portalKey;return i?function(t){return function(e){return r(document.querySelectorAll("["+d$1+'="'+t+'"]'+e))}}(i):e?function(t){var e=Math.random().toFixed(5);return t.dataset.flipperId=e,function(i){return r(t.querySelectorAll('[data-flipper-id="'+e+'"] '+i))}}(e):function(){return []}}({containerEl:E,portalKey:I}),W=function(t){return function(e){return t("["+c$1+'="'+e+'"]')[0]}}(Y),K=function(t){return y[t]&&X[t]},H=Object.keys(y).concat(Object.keys(X)).filter(function(t){return !K(t)}),J={flipCallbacks:S,getElement:W,flippedElementPositionsBeforeUpdate:y,flippedElementPositionsAfterUpdate:X,inProgressAnimations:h,decisionData:j},z=function(t){var e,i=t.unflippedIds,n=t.flipCallbacks,r=t.getElement,s=t.flippedElementPositionsBeforeUpdate,a=t.flippedElementPositionsAfterUpdate,o=t.inProgressAnimations,l=t.decisionData,p=i.filter(function(t){return a[t]}).filter(function(t){return n[t]&&n[t].onAppear}),c=i.filter(function(t){return s[t]&&n[t]&&n[t].onExit}),u=new Promise(function(t){e=t;}),d=[],f=0,h=c.map(function(t,i){var r=s[t].domDataForExitAnimations,a=r.element,p=r.parent,c=r.childPosition,u=c.top,h=c.left,g=c.width,m=c.height;"static"===getComputedStyle(p).position&&(p.style.position="relative"),a.style.transform="matrix(1, 0, 0, 1, 0, 0)",a.style.position="absolute",a.style.top=u+"px",a.style.left=h+"px",a.style.height=m+"px",a.style.width=g+"px";var v=d.filter(function(t){return t[0]===p})[0];v||(v=[p,document.createDocumentFragment()],d.push(v)),v[1].appendChild(a),f+=1;var y=function(){try{p.removeChild(a);}catch(t){}finally{0==(f-=1)&&e();}};return o[t]={stop:y},function(){return n[t].onExit(a,i,y,l)}});return d.forEach(function(t){t[0].appendChild(t[1]);}),h.length||e(),{hideEnteringElements:function(){p.forEach(function(t){var e=r(t);e&&(e.style.opacity="0");});},animateEnteringElements:function(){p.forEach(function(t,e){var i=r(t);i&&n[t].onAppear(i,e,l);});},animateExitingElements:function(){return h.forEach(function(t){return t()}),u}}}(a({},J,{unflippedIds:H})),G=z.hideEnteringElements,Q=z.animateEnteringElements,Z=z.animateExitingElements,$=a({},J,{containerEl:E,flippedIds:p.filter(K),applyTransformOrigin:A,spring:C,debug:b,staggerConfig:O,scopedSelector:Y,onComplete:N});L&&L(E,j);var tt=function(n){var o,p=n.flippedIds,c=n.flipCallbacks,d=n.inProgressAnimations,f=n.flippedElementPositionsBeforeUpdate,h=n.flippedElementPositionsAfterUpdate,v=n.applyTransformOrigin,y=n.spring,_=n.getElement,S=n.debug,E=n.staggerConfig,A=void 0===E?{}:E,C=n.decisionData,b=void 0===C?{}:C,I=n.onComplete,w=n.containerEl,O=new Promise(function(t){o=t;});if(I&&O.then(function(){return I(w,b)}),!p.length)return function(){return o([]),O};var x=[],R=_(p[0]),T=R?R.ownerDocument.querySelector("body"):document.querySelector("body");s$1(p);var M=p.map(function(n){var s=f[n].rect,p=h[n].rect,_=f[n].opacity,S=h[n].opacity,E=p.width<1||p.height<1,A=h[n].element;if(!P(s)&&!P(p))return !1;if(!A)return !1;var C,I,w,O=D(A),U=(w=(I=void 0===(C={flipperSpring:y,flippedSpring:O.spring})?{}:C).flippedSpring,a({},g$1.noWobble,m$1(I.flipperSpring),m$1(w))),V=!0===O.stagger?"default":O.stagger,R={element:A,id:n,stagger:V,springConfig:U};if(c[n]&&c[n].shouldFlip&&!c[n].shouldFlip(b.previous,b.current))return !1;var k=Math.abs(s.left-p.left)+Math.abs(s.top-p.top),j=Math.abs(s.width-p.width)+Math.abs(s.height-p.height),B=Math.abs(S-_);if(0===s.height&&0===p.height||0===s.width&&0===p.width||k<.5&&j<.5&&B<.01)return !1;var N=parse(h[n].transform),L={matrix:N},q={matrix:[]},X=[N];O.translate&&(X.push(translateX(s.left-p.left)),X.push(translateY(s.top-p.top))),O.scale&&(X.push(scaleX(Math.max(s.width,1)/Math.max(p.width,1))),X.push(scaleY(Math.max(s.height,1)/Math.max(p.height,1)))),O.opacity&&(q.opacity=_,L.opacity=S);var Y=[];if(!c[n]||!c[n].shouldInvert||c[n].shouldInvert(b.previous,b.current)){var W=function(t,e){return r(t.querySelectorAll("["+u$1+'="'+e+'"]'))}(A,n);Y=W.map(function(t){return [t,D(t)]});}q.matrix=F(X.reduce(multiply)),L.matrix=F(L.matrix);var K,H=function(t){var i=t.element,n=t.invertedChildren,r=t.body;return function(t){var s=t.matrix,a=t.opacity,o=t.forceMinVals;if(e(a)&&(i.style.opacity=a+""),o&&(i.style.minHeight="1px",i.style.minWidth="1px"),s){var l=function(t){return "matrix("+t.join(", ")+")"}(s);i.style.transform=l,n&&function(t){var e=t.matrix,i=t.body;t.invertedChildren.forEach(function(t){var n=t[0],r=t[1];if(i.contains(n)){var s=e[0],a=e[3],o=e[5],l={translateX:0,translateY:0,scaleX:1,scaleY:1},p="";r.translate&&(l.translateX=-e[4]/s,l.translateY=-o/a,p+="translate("+l.translateX+"px, "+l.translateY+"px)"),r.scale&&(l.scaleX=1/s,l.scaleY=1/a,p+=" scale("+l.scaleX+", "+l.scaleY+")"),n.style.transform=p;}});}({invertedChildren:n,matrix:s,body:r});}}}({element:A,invertedChildren:Y,body:T});if(c[n]&&c[n].onComplete){var J=c[n].onComplete;K=function(){return J(A,b)};}var z=e(q.opacity)&&e(L.opacity)&&q.opacity!==L.opacity,G=!1;return a({},R,{stagger:V,springConfig:U,getOnUpdateFunc:function(t){var e=t.spring,i=t.onAnimationEnd;return d[n]={destroy:e.destroy.bind(e),onAnimationEnd:i},function(t){c[n]&&c[n].onSpringUpdate&&c[n].onSpringUpdate(t.getCurrentValue()),G||(G=!0,c[n]&&c[n].onStart&&c[n].onStart(A,b));var e=t.getCurrentValue();if(T.contains(A)){var i={matrix:[]};i.matrix=q.matrix.map(function(t,i){return l(t,L.matrix[i],e)}),z&&(i.opacity=l(q.opacity,L.opacity,e)),H(i);}else t.destroy();}},initializeFlip:function(){H({matrix:q.matrix,opacity:z?q.opacity:void 0,forceMinVals:E}),c[n]&&c[n].onStartImmediate&&c[n].onStartImmediate(A,b),O.transformOrigin?A.style.transformOrigin=O.transformOrigin:v&&(A.style.transformOrigin="0 0"),Y.forEach(function(t){var e=t[0],i=t[1];i.transformOrigin?e.style.transformOrigin=i.transformOrigin:v&&(e.style.transformOrigin="0 0");});},onAnimationEnd:function(t){delete d[n],i(K)&&K(),A.style.transform="",Y.forEach(function(t){t[0].style.transform="";}),E&&A&&(A.style.minHeight="",A.style.minWidth=""),t||(x.push(n),x.length>=M.length&&o(x));},delayUntil:O.delayUntil})}).filter(Boolean);if(M.forEach(function(t){return (0, t.initializeFlip)()}),S)return function(){};var k=M.filter(function(t){return t.delayUntil&&(e=t.delayUntil,M.filter(function(t){return t.id===e}).length);var e;}),j={},B={},N={};k.forEach(function(t){t.stagger?(N[t.stagger]=!0,B[t.delayUntil]?B[t.delayUntil].push(t.stagger):B[t.delayUntil]=[t.stagger]):j[t.delayUntil]?j[t.delayUntil].push(t):j[t.delayUntil]=[t];});var L=M.filter(function(t){return t.stagger}).reduce(function(t,e){return t[e.stagger]?t[e.stagger].push(e):t[e.stagger]=[e],t},{}),q=M.filter(function(t){return -1===k.indexOf(t)});return q.forEach(function(t){t.onSpringActivate=function(){j[t.id]&&j[t.id].forEach(U),B[t.id]&&Object.keys(B[t.id].reduce(function(t,e){var i;return a(t,((i={})[e]=!0,i))},{})).forEach(function(t){V(L[t],A[t]);});};}),function(){return M.length||o([]),q.filter(function(t){return !t.stagger}).forEach(U),Object.keys(L).forEach(function(t){N[t]||V(L[t],A[t]);}),O}}($);B?B({hideEnteringElements:G,animateEnteringElements:Q,animateExitingElements:Z,animateFlippedElements:tt}):(G(),Z().then(Q),tt());}},q=function(t){var e=t.element,i=t.flipCallbacks,n=void 0===i?{}:i,s=t.inProgressAnimations,o=void 0===s?{}:s,l=T(e,t.portalKey),p=r(e.querySelectorAll("["+u$1+"]")),c={},d=[],h={};l.filter(function(t){return n&&n[t.dataset.flipId]&&n[t.dataset.flipId].onExit}).forEach(function(t){var e=t.parentNode;if(t.closest){var i=t.closest("["+f$1+"]");i&&(e=i);}var n=d.findIndex(function(t){return t[0]===e});-1===n&&(d.push([e,e.getBoundingClientRect()]),n=d.length-1),c[t.dataset.flipId]=d[n][1],h[t.dataset.flipId]=e;});var g=M(l),m=g.map(function(t){var e=t[0],i=t[1],r={};if(n&&n[e.dataset.flipId]&&n[e.dataset.flipId].onExit){var s=c[e.dataset.flipId];a(r,{element:e,parent:h[e.dataset.flipId],childPosition:{top:i.top-s.top,left:i.left-s.left,width:i.width,height:i.height}});}return [e.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(e).opacity||"1"),domDataForExitAnimations:r}]}).reduce(R,{});return function(t,e){Object.keys(t).forEach(function(e){t[e].destroy&&t[e].destroy(),t[e].onAnimationEnd&&t[e].onAnimationEnd(!0),delete t[e];}),e.forEach(function(t){t.style.transform="",t.style.opacity="";});}(o,l.concat(p)),{flippedElementPositions:m,cachedOrderedFlipIds:g.map(function(t){return t[0].dataset.flipId})}};new w;
|
|
846
|
-
|
|
847
|
-
function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},s.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function d(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var f=/*#__PURE__*/React.createContext({}),u=/*#__PURE__*/React.createContext("portal"),h=/*#__PURE__*/function(r){var n,o;function p(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return (e=r.call.apply(r,[this].concat(n))||this).inProgressAnimations={},e.flipCallbacks={},e.el=void 0,e}o=r,(n=p).prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o);var l=p.prototype;return l.getSnapshotBeforeUpdate=function(t){return t.flipKey!==this.props.flipKey&&this.el?q({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},l.componentDidUpdate=function(e,r,n){this.props.flipKey!==e.flipKey&&this.el&&L({flippedElementPositionsBeforeUpdate:n.flippedElementPositions,cachedOrderedFlipIds:n.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:e.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart});},l.render=function(){var e=this,t=this.props,r=t.portalKey,n=/*#__PURE__*/React__default["default"].createElement(f.Provider,{value:this.flipCallbacks},/*#__PURE__*/React__default["default"].createElement(t.element,{className:t.className,ref:function(t){return e.el=t}},this.props.children));return r&&(n=/*#__PURE__*/React__default["default"].createElement(u.Provider,{value:r},n)),n},p}(React.Component);h.defaultProps={applyTransformOrigin:!0,element:"div"};var m=["children","flipId","inverseFlipId","portalKey"],y=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],g=function(e){var t,i=e.children,o=e.flipId,p$1=e.inverseFlipId,s=e.portalKey,c=d(e,m),f=i,u=function(e){return "function"==typeof e}(f);if(!u)try{f=React.Children.only(i);}catch(e){throw new Error("Each Flipped component must wrap a single child")}c.scale||c.translate||c.opacity||p.assign(c,{translate:!0,scale:!0,opacity:!0});var h=((t={})[h$1.DATA_FLIP_CONFIG]=JSON.stringify(c),t);return void 0!==o?h[h$1.DATA_FLIP_ID]=String(o):p$1&&(h[h$1.DATA_INVERSE_FLIP_ID]=String(p$1)),void 0!==s&&(h[h$1.DATA_PORTAL_KEY]=s),u?f(h):/*#__PURE__*/React.cloneElement(f,h)},v=function(e){var t=e.children,n=e.flipId,o=e.shouldFlip,p$1=e.shouldInvert,l=e.onAppear,a=e.onStart,c=e.onStartImmediate,h=e.onComplete,m=e.onExit,v=e.onSpringUpdate,I=d(e,y);return t?I.inverseFlipId?/*#__PURE__*/React__default["default"].createElement(g,s({},I),t):/*#__PURE__*/React__default["default"].createElement(u.Consumer,null,function(e){return React__default["default"].createElement(f.Consumer,null,function(d){return p.isObject(d)&&n&&(d[n]={shouldFlip:o,shouldInvert:p$1,onAppear:l,onStart:a,onStartImmediate:c,onComplete:h,onExit:m,onSpringUpdate:v}),/*#__PURE__*/React__default["default"].createElement(g,s({flipId:n},I,{portalKey:e}),t)})}):null};v.displayName="Flipped";
|
|
848
|
-
|
|
849
853
|
const VCDisplayCardCategoryType = ({
|
|
850
854
|
categoryType = index.LCCategoryEnum.achievement
|
|
851
855
|
}) => {
|
|
@@ -913,13 +917,24 @@ const VCIDDisplayFrontFace = ({
|
|
|
913
917
|
const isSelfVerified = verifierState === VERIFIER_STATES.selfVerified;
|
|
914
918
|
const achievement = "achievement" in (credential == null ? void 0 : credential.credentialSubject) ? (_a = credential == null ? void 0 : credential.credentialSubject) == null ? void 0 : _a.achievement : void 0;
|
|
915
919
|
const description = achievement == null ? void 0 : achievement.description;
|
|
916
|
-
return /* @__PURE__ */ React__default["default"].createElement(
|
|
920
|
+
return /* @__PURE__ */ React__default["default"].createElement(h, {
|
|
921
|
+
className: "w-full",
|
|
922
|
+
flipKey: isFront
|
|
923
|
+
}, /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
924
|
+
flipId: "face"
|
|
925
|
+
}, /* @__PURE__ */ React__default["default"].createElement("section", {
|
|
917
926
|
className: "vc-front-face w-full flex flex-col items-center gap-[15px]"
|
|
918
|
-
},
|
|
927
|
+
}, /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
928
|
+
inverseFlipId: "face"
|
|
929
|
+
}, customThumbComponent && customThumbComponent), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
930
|
+
inverseFlipId: "face"
|
|
931
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
919
932
|
className: "text-white w-full flex items-center justify-center font-poppins"
|
|
920
933
|
}, /* @__PURE__ */ React__default["default"].createElement(QRCodeIcon.IDIcon, {
|
|
921
934
|
className: "text-white mr-1"
|
|
922
|
-
}), " ID"), /* @__PURE__ */ React__default["default"].createElement(
|
|
935
|
+
}), " ID")), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
936
|
+
inverseFlipId: "face"
|
|
937
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
923
938
|
className: "w-full relative"
|
|
924
939
|
}, !hideQRCode && /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
925
940
|
onClick: (e) => {
|
|
@@ -933,7 +948,9 @@ const VCIDDisplayFrontFace = ({
|
|
|
933
948
|
src: IDSleeve__default["default"],
|
|
934
949
|
alt: "id-sleeve",
|
|
935
950
|
className: "w-full object-cover"
|
|
936
|
-
})), /* @__PURE__ */ React__default["default"].createElement(
|
|
951
|
+
}))), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
952
|
+
inverseFlipId: "face"
|
|
953
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
937
954
|
className: "w-full bg-white relative mt-[-70px] px-6 pb-4 pt-4"
|
|
938
955
|
}, description && !customIDDescription && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(TruncateTextBox, {
|
|
939
956
|
text: description,
|
|
@@ -967,7 +984,7 @@ const VCIDDisplayFrontFace = ({
|
|
|
967
984
|
className: "uppercase font-poppins text-base font-[500] text-red-mastercard flex gap-[3px] items-center"
|
|
968
985
|
}, /* @__PURE__ */ React__default["default"].createElement(VerifierStateBadgeAndText.RedFlag, {
|
|
969
986
|
className: "w-[20px] h-[20px]"
|
|
970
|
-
}), "Untrusted Verifier"))));
|
|
987
|
+
}), "Untrusted Verifier")))))));
|
|
971
988
|
};
|
|
972
989
|
|
|
973
990
|
const VCIDDisplayCard = ({
|
|
@@ -1016,13 +1033,9 @@ const VCIDDisplayCard = ({
|
|
|
1016
1033
|
style: backgroundStyle,
|
|
1017
1034
|
role: "button",
|
|
1018
1035
|
onClick: () => setIsFront(!isFront)
|
|
1019
|
-
}, /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1020
|
-
flipId: "scroll-container"
|
|
1021
1036
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1022
1037
|
className: "vc-card-content-scroll-container w-full min-h-full flex flex-col justify-start items-center rounded-t-[30px] rounded-b-[30px] scrollbar-hide pt-[20px]"
|
|
1023
|
-
}, isFront && /* @__PURE__ */ React__default["default"].createElement(
|
|
1024
|
-
flipId: "face"
|
|
1025
|
-
}, /* @__PURE__ */ React__default["default"].createElement(VCIDDisplayFrontFace, {
|
|
1038
|
+
}, isFront && /* @__PURE__ */ React__default["default"].createElement(VCIDDisplayFrontFace, {
|
|
1026
1039
|
isFront: _isFront,
|
|
1027
1040
|
setIsFront,
|
|
1028
1041
|
showDetailsBtn,
|
|
@@ -1032,9 +1045,7 @@ const VCIDDisplayCard = ({
|
|
|
1032
1045
|
qrCodeOnClick,
|
|
1033
1046
|
hideQRCode,
|
|
1034
1047
|
customIDDescription
|
|
1035
|
-
})
|
|
1036
|
-
flipId: "face"
|
|
1037
|
-
}, /* @__PURE__ */ React__default["default"].createElement(VC2BackFace, {
|
|
1048
|
+
}), !isFront && /* @__PURE__ */ React__default["default"].createElement(VC2BackFace, {
|
|
1038
1049
|
credential,
|
|
1039
1050
|
verificationItems,
|
|
1040
1051
|
issueHistory,
|
|
@@ -1048,7 +1059,7 @@ const VCIDDisplayCard = ({
|
|
|
1048
1059
|
customIssueHistoryComponent,
|
|
1049
1060
|
enableLightbox,
|
|
1050
1061
|
customSkillsComponent
|
|
1051
|
-
}))))))
|
|
1062
|
+
}))))));
|
|
1052
1063
|
};
|
|
1053
1064
|
|
|
1054
1065
|
const VCDisplayCard2 = ({
|
|
@@ -1217,15 +1228,21 @@ const VCDisplayCard2 = ({
|
|
|
1217
1228
|
className: "vc-display-card font-mouse flex flex-col items-center border-solid border-[5px] border-white rounded-[30px] z-10 min-h-[800px] max-w-[400px] relative bg-white shadow-3xl",
|
|
1218
1229
|
role: "button",
|
|
1219
1230
|
onClick: () => setIsFront(!isFront)
|
|
1231
|
+
}, /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1232
|
+
inverseFlipId: "card"
|
|
1220
1233
|
}, /* @__PURE__ */ React__default["default"].createElement(RibbonEnd, {
|
|
1221
1234
|
side: "left",
|
|
1222
1235
|
className: "absolute left-[-30px] top-[50px] z-0",
|
|
1223
1236
|
height: "100"
|
|
1224
|
-
}), /* @__PURE__ */ React__default["default"].createElement(
|
|
1237
|
+
})), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1238
|
+
inverseFlipId: "card"
|
|
1239
|
+
}, /* @__PURE__ */ React__default["default"].createElement(RibbonEnd, {
|
|
1225
1240
|
side: "right",
|
|
1226
1241
|
className: "absolute right-[-30px] top-[50px] z-0",
|
|
1227
1242
|
height: "100"
|
|
1228
|
-
}), /* @__PURE__ */ React__default["default"].createElement(
|
|
1243
|
+
})), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1244
|
+
inverseFlipId: "card"
|
|
1245
|
+
}, /* @__PURE__ */ React__default["default"].createElement("h1", {
|
|
1229
1246
|
ref: headerRef,
|
|
1230
1247
|
className: "vc-card-header px-[20px] pb-[10px] pt-[3px] overflow-visible mt-[40px] absolute text-center bg-white border-y-[5px] border-[#EEF2FF] shadow-bottom w-[calc(100%_+_16px)] rounded-t-[8px] z-50",
|
|
1231
1248
|
style: { wordBreak: "break-word" }
|
|
@@ -1237,19 +1254,22 @@ const VCDisplayCard2 = ({
|
|
|
1237
1254
|
minFontSize: 20,
|
|
1238
1255
|
width: ((headerWidth != null ? headerWidth : 290) - 40).toString(),
|
|
1239
1256
|
className: "vc-card-header-main-title text-[#18224E] leading-[100%] text-shadow text-[32px]"
|
|
1240
|
-
})), isFront && handleXClick && /* @__PURE__ */ React__default["default"].createElement(
|
|
1257
|
+
}))), isFront && handleXClick && /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1258
|
+
inverseFlipId: "card"
|
|
1259
|
+
}, /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
1241
1260
|
className: "vc-card-x-button absolute top-[-25px] bg-white rounded-full h-[50px] w-[50px] flex items-center justify-center z-50",
|
|
1242
1261
|
onClick: handleXClick
|
|
1243
|
-
}, /* @__PURE__ */ React__default["default"].createElement(RoundedX, null)), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1244
|
-
className: "relative pt-[114px] vc-card-content-container flex flex-col items-center grow min-h-0 w-full rounded-t-[30px] bg-[#353E64] rounded-b-[200px]"
|
|
1245
|
-
style: backgroundStyle
|
|
1262
|
+
}, /* @__PURE__ */ React__default["default"].createElement(RoundedX, null))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1263
|
+
className: "relative pt-[114px] vc-card-content-container flex flex-col items-center grow min-h-0 w-full rounded-t-[30px] bg-[#353E64] rounded-b-[200px]"
|
|
1246
1264
|
}, /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1247
|
-
|
|
1265
|
+
inverseFlipId: "card",
|
|
1266
|
+
scale: true
|
|
1248
1267
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1249
|
-
className: "
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1268
|
+
className: "absolute top-0 left-0 w-full h-full rounded-b-[200px] rounded-t-[30px]",
|
|
1269
|
+
style: backgroundStyle
|
|
1270
|
+
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1271
|
+
className: "vc-card-content-scroll-container w-full pt-[20px] min-h-full flex flex-col justify-start items-center rounded-t-[30px] rounded-b-[200px] scrollbar-hide pb-[50px] z-50"
|
|
1272
|
+
}, isFront && /* @__PURE__ */ React__default["default"].createElement(VC2FrontFaceInfo, {
|
|
1253
1273
|
credential,
|
|
1254
1274
|
issuee,
|
|
1255
1275
|
subjectDID,
|
|
@@ -1262,9 +1282,7 @@ const VCDisplayCard2 = ({
|
|
|
1262
1282
|
createdAt: createdAt != null ? createdAt : "",
|
|
1263
1283
|
imageUrl,
|
|
1264
1284
|
trustedAppRegistry
|
|
1265
|
-
})
|
|
1266
|
-
flipId: "face"
|
|
1267
|
-
}, /* @__PURE__ */ React__default["default"].createElement(VC2BackFace, {
|
|
1285
|
+
}), !isFront && /* @__PURE__ */ React__default["default"].createElement(VC2BackFace, {
|
|
1268
1286
|
credential,
|
|
1269
1287
|
verificationItems,
|
|
1270
1288
|
issueHistory,
|
|
@@ -1278,26 +1296,32 @@ const VCDisplayCard2 = ({
|
|
|
1278
1296
|
customIssueHistoryComponent,
|
|
1279
1297
|
enableLightbox,
|
|
1280
1298
|
customSkillsComponent
|
|
1281
|
-
})
|
|
1299
|
+
}), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1300
|
+
inverseFlipId: "card"
|
|
1301
|
+
}, isFront && /* @__PURE__ */ React__default["default"].createElement(VCDisplayCardSkillsCount, {
|
|
1282
1302
|
skills: credential == null ? void 0 : credential.skills,
|
|
1283
1303
|
onClick: () => setIsFront(!isFront)
|
|
1284
|
-
}), (!hideNavButtons || showDetailsBtn) && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, isFront && customFrontButton, (isFront && !customFrontButton || isFront && showDetailsBtn) && /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1285
|
-
|
|
1304
|
+
})), (!hideNavButtons || showDetailsBtn) && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, isFront && customFrontButton, (isFront && !customFrontButton || isFront && showDetailsBtn) && /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1305
|
+
inverseFlipId: "card"
|
|
1286
1306
|
}, /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
1287
1307
|
type: "button",
|
|
1288
1308
|
className: "vc-toggle-side-button text-white shadow-bottom bg-[#00000099] px-[30px] py-[8px] rounded-[40px] text-[28px] tracking-[0.75px] uppercase leading-[28px] mt-[40px] w-fit select-none",
|
|
1289
1309
|
onClick: () => setIsFront(!isFront)
|
|
1290
1310
|
}, "Details")), !isFront && /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1291
|
-
|
|
1311
|
+
inverseFlipId: "card"
|
|
1292
1312
|
}, /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
1293
1313
|
type: "button",
|
|
1294
1314
|
className: "vc-toggle-side-button text-white shadow-bottom bg-[#00000099] px-[30px] py-[8px] rounded-[40px] text-[28px] tracking-[0.75px] uppercase leading-[28px] mt-[40px] w-fit select-none",
|
|
1295
1315
|
onClick: () => setIsFront(!isFront)
|
|
1296
1316
|
}, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
1297
1317
|
className: "flex gap-[10px] items-center"
|
|
1298
|
-
}, /* @__PURE__ */ React__default["default"].createElement(VerifierStateBadgeAndText.LeftArrow, null), "Back"))))))
|
|
1318
|
+
}, /* @__PURE__ */ React__default["default"].createElement(VerifierStateBadgeAndText.LeftArrow, null), "Back")))))), /* @__PURE__ */ React__default["default"].createElement("footer", {
|
|
1299
1319
|
className: "vc-card-footer w-full flex justify-between p-[5px] mt-[5px]"
|
|
1300
|
-
},
|
|
1320
|
+
}, /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1321
|
+
inverseFlipId: "card"
|
|
1322
|
+
}, customFooterComponent && customFooterComponent), /* @__PURE__ */ React__default["default"].createElement(v, {
|
|
1323
|
+
inverseFlipId: "card"
|
|
1324
|
+
}, !customFooterComponent && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, worstVerificationStatus === types_esm.VerificationStatusEnum.Failed ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1301
1325
|
className: "w-[40px]",
|
|
1302
1326
|
role: "presentation"
|
|
1303
1327
|
}) : /* @__PURE__ */ React__default["default"].createElement(VCVerificationCheck.VCVerificationCheckWithSpinner, {
|
|
@@ -1313,11 +1337,13 @@ const VCDisplayCard2 = ({
|
|
|
1313
1337
|
style: { color: statusColor }
|
|
1314
1338
|
}, worstVerificationStatus)), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1315
1339
|
className: "vc-footer-icon rounded-[20px] h-[40px] w-[40px] flex items-center justify-center overflow-hidden",
|
|
1316
|
-
style: {
|
|
1317
|
-
|
|
1340
|
+
style: {
|
|
1341
|
+
backgroundColor: (_f = bottomRightIcon == null ? void 0 : bottomRightIcon.color) != null ? _f : "#6366F1"
|
|
1342
|
+
}
|
|
1343
|
+
}, (_g = bottomRightIcon == null ? void 0 : bottomRightIcon.image) != null ? _g : /* @__PURE__ */ React__default["default"].createElement(QRCodeIcon.AwardRibbon, null))))))));
|
|
1318
1344
|
};
|
|
1319
1345
|
|
|
1320
1346
|
exports.VCDisplayCard2 = VCDisplayCard2;
|
|
1321
1347
|
exports.VCDisplayCardSkillsCount = VCDisplayCardSkillsCount;
|
|
1322
1348
|
exports.VCIDDisplayCard = VCIDDisplayCard;
|
|
1323
|
-
//# sourceMappingURL=VCDisplayCard2-
|
|
1349
|
+
//# sourceMappingURL=VCDisplayCard2-caca1aa2.js.map
|