@pie-element/placement-ordering 14.1.2-next.0 → 14.1.2-next.10
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/author/choice-editor.js +16 -17
- package/dist/author/choice-tile.js +3 -2
- package/dist/author/design.js +50 -51
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +25 -22
- package/dist/author/utils.js +1 -1
- package/dist/browser/author/index.js +23612 -21053
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-Bd36Xf5z.js +376 -0
- package/dist/browser/browser-Bd36Xf5z.js.map +1 -0
- package/dist/browser/controller/index.js +87 -164
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +476 -336
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-BTHiIs74.js → dist-DiGNNRzu.js} +354 -538
- package/dist/browser/dist-DiGNNRzu.js.map +1 -0
- package/dist/browser/{drag-provider-DaPxkh4j.js → drag-provider-B5wazJHM.js} +3284 -3615
- package/dist/browser/drag-provider-B5wazJHM.js.map +1 -0
- package/dist/controller/index.js +44 -49
- package/dist/controller/scoring.js +2 -4
- package/dist/delivery/index.js +12 -12
- package/dist/delivery/keyboard-coordinates.d.ts +47 -0
- package/dist/delivery/keyboard-coordinates.js +51 -0
- package/dist/delivery/main.js +1 -1
- package/dist/delivery/ordering.js +4 -6
- package/dist/delivery/placement-ordering.d.ts +11 -0
- package/dist/delivery/placement-ordering.js +175 -105
- package/dist/delivery/tile.d.ts +3 -0
- package/dist/delivery/tile.js +66 -57
- package/dist/delivery/tiler.d.ts +6 -0
- package/dist/delivery/tiler.js +6 -3
- package/dist/index.iife.js +35 -35
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +22 -18
- package/dist/browser/browser-CvJkn_Ec.js +0 -1019
- package/dist/browser/browser-CvJkn_Ec.js.map +0 -1
- package/dist/browser/dist-BTHiIs74.js.map +0 -1
- package/dist/browser/drag-provider-DaPxkh4j.js.map +0 -1
- package/dist/browser/last-D7N4Qfx4.js +0 -9
- package/dist/browser/last-D7N4Qfx4.js.map +0 -1
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseShuffle.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shuffleSelf.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js","../../../../../shared/player-events/dist/index.js","../../../../../lib-react/icons/dist/correct-response-icon.js","../../../../../lib-react/correct-answer-toggle/dist/expander.js","../../../../../lib-react/correct-answer-toggle/dist/index.js","../../../../../lib-react/drag/dist/placeholder.js","../../../src/delivery/tile.tsx","../../../src/delivery/tiler.tsx","../../../src/delivery/ordering.ts","../../../src/delivery/utils.ts","../../../src/delivery/placement-ordering.tsx","../../../src/delivery/main.tsx","../../../src/delivery/index.ts"],"sourcesContent":["import assignValue from './_assignValue.js';\nimport copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport isArrayLike from './isArrayLike.js';\nimport isPrototype from './_isPrototype.js';\nimport keys from './keys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nexport default assign;\n","import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n});\n\nexport default difference;\n","import toString from './toString.js';\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nexport default uniqueId;\n","//#region src/index.ts\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","import \"react\";\nimport e from \"prop-types\";\nimport { jsx as t, jsxs as n } from \"react/jsx-runtime\";\nimport { styled as r } from \"@mui/material/styles\";\n//#region src/correct-response-icon.tsx\nvar i = ({ bgFill: e, fgFill: r }) => /* @__PURE__ */ n(\"svg\", {\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-283 359 34 35\",\n\tstyle: { enableBackground: \"new -283 359 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-266\",\n\t\t\tcy: \"375.9\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\ni.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired\n};\nvar a = ({ bgFill: e, fgFill: r, borderFill: i }) => /* @__PURE__ */ n(\"svg\", {\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-129.5 127 34 35\",\n\tstyle: { enableBackground: \"new -129.5 127 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#D0CAC5\",\n\t\t\t\tstroke: \"#E6E3E0\",\n\t\t\t\tstrokeWidth: .75,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\\n C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#B3ABA4\",\n\t\t\t\tstroke: \"#CDC7C2\",\n\t\t\t\tstrokeWidth: .5,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-114.2\",\n\t\t\tcy: \"143.5\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\",\n\t\t\tfill: i\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\na.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired,\n\tborderFill: e.string.isRequired\n};\nvar o = r(\"div\")(({ size: e }) => ({\n\twidth: e || \"25px\",\n\theight: e || \"25px\"\n})), s = ({ open: e, size: n }) => /* @__PURE__ */ t(o, {\n\tsize: n,\n\tchildren: e ? /* @__PURE__ */ t(i, {\n\t\tbgFill: \"#bce2ff\",\n\t\tfgFill: \"#1a9cff\"\n\t}) : /* @__PURE__ */ t(a, {\n\t\tbgFill: \"white\",\n\t\tfgFill: \"#1a9cff\",\n\t\tborderFill: \"#bce2ff\"\n\t})\n});\ns.propTypes = {\n\topen: e.bool,\n\tsize: e.string\n}, s.defaultProps = { open: !1 };\n//#endregion\nexport { s as default };\n","import { styled as e } from \"@mui/material/styles\";\nimport { CSSTransition as t } from \"react-transition-group\";\nimport { jsx as n } from \"react/jsx-runtime\";\nimport { useRef as r } from \"react\";\nimport i from \"prop-types\";\n//#region src/expander.tsx\nvar a = \"height ease-in 300ms, opacity ease-in 300ms\", o = e(\"div\")(() => ({\n\tposition: \"relative\",\n\theight: 0,\n\toverflow: \"hidden\",\n\tdisplay: \"flex\",\n\tvisibility: \"hidden\",\n\twidth: 0,\n\t\"&.enter\": {\n\t\ttransition: a,\n\t\topacity: 1,\n\t\theight: \"auto\",\n\t\twidth: \"auto\",\n\t\tvisibility: \"visible\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.enter-done\": {\n\t\theight: \"auto\",\n\t\tvisibility: \"visible\",\n\t\twidth: \"auto\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.exit\": {\n\t\ttransition: a,\n\t\topacity: 0,\n\t\theight: 0,\n\t\tvisibility: \"visible\",\n\t\twidth: 0\n\t},\n\t\"&.exit-done\": {\n\t\topacity: 0,\n\t\tvisibility: \"hidden\",\n\t\theight: 0,\n\t\twidth: 0\n\t}\n})), s = (e) => {\n\tlet { show: i, children: a, className: s } = e, c = r(null);\n\treturn /* @__PURE__ */ n(t, {\n\t\tnodeRef: c,\n\t\tin: i,\n\t\tappear: !0,\n\t\tmountOnEnter: !1,\n\t\ttimeout: 300,\n\t\tclassNames: {\n\t\t\tenter: \"enter\",\n\t\t\tenterDone: \"enter-done\",\n\t\t\texit: \"exit\",\n\t\t\texitDone: \"exit-done\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ n(o, {\n\t\t\tref: c,\n\t\t\tclassName: s,\n\t\t\tchildren: a\n\t\t})\n\t});\n};\ns.propTypes = {\n\tshow: i.bool.isRequired,\n\tclassName: i.string,\n\tchildren: i.oneOfType([i.arrayOf(i.node), i.node]).isRequired\n};\n//#endregion\nexport { s as default };\n","import e from \"./expander.js\";\nimport { styled as t } from \"@mui/material/styles\";\nimport { CSSTransition as n } from \"react-transition-group\";\nimport { CorrectResponse as r } from \"@pie-lib/icons\";\nimport * as i from \"@pie-lib/render-ui\";\nimport { Readable as a, color as o } from \"@pie-lib/render-ui\";\nimport { jsx as s, jsxs as c } from \"react/jsx-runtime\";\nimport l from \"react\";\nimport u from \"prop-types\";\nimport d from \"@pie-lib/translator\";\n//#region src/index.tsx\nfunction f(e) {\n\treturn typeof e == \"function\" || typeof e == \"object\" && !!e && typeof e.$$typeof == \"symbol\";\n}\nfunction p(e, t) {\n\treturn !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;\n}\nvar m = p(a, \"Readable\") || p(_.Readable, \"Readable\"), h = i, g = h.default, _ = g && typeof g == \"object\" ? g : h, { translator: v } = d, y = {\n\tWebkitTouchCallout: \"none\",\n\tWebkitUserSelect: \"none\",\n\tKhtmlUserSelect: \"none\",\n\tMozUserSelect: \"none\",\n\tmsUserSelect: \"none\",\n\tuserSelect: \"none\"\n}, b = t(\"div\")(() => ({\n\twidth: \"100%\",\n\tcursor: \"pointer\"\n})), x = t(\"div\")(() => ({\n\tmargin: \"0 auto\",\n\ttextAlign: \"center\",\n\tdisplay: \"flex\"\n})), S = t(\"div\")(() => ({\n\twidth: \"fit-content\",\n\tminWidth: \"140px\",\n\talignSelf: \"center\",\n\tverticalAlign: \"middle\",\n\tcolor: `var(--correct-answer-toggle-label-color, ${o.text()})`,\n\tfontWeight: \"normal\",\n\t...y\n})), C = t(\"div\")(() => ({\n\tposition: \"absolute\",\n\twidth: \"25px\",\n\t\"&.enter\": { opacity: \"0\" },\n\t\"&.enter-active\": {\n\t\topacity: \"1\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t},\n\t\"&.exit\": { opacity: \"1\" },\n\t\"&.exit-active\": {\n\t\topacity: \"0\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t}\n})), w = t(\"div\")(() => ({\n\twidth: \"25px\",\n\tmarginRight: \"5px\",\n\tdisplay: \"flex\",\n\talignItems: \"center\"\n})), T = class t extends l.Component {\n\tstatic propTypes = {\n\t\tonToggle: u.func,\n\t\ttoggled: u.bool,\n\t\tshow: u.bool,\n\t\thideMessage: u.string,\n\t\tshowMessage: u.string,\n\t\tclassName: u.string,\n\t\tlanguage: u.string\n\t};\n\tstatic defaultProps = {\n\t\tshowMessage: \"Show correct answer\",\n\t\thideMessage: \"Hide correct answer\",\n\t\tshow: !1,\n\t\ttoggled: !1\n\t};\n\tconstructor(e) {\n\t\tsuper(e), this.state = { show: e.show }, this.openIconRef = l.createRef(), this.closedIconRef = l.createRef(), t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t};\n\t}\n\tonClick() {\n\t\tthis.props.onToggle(!this.props.toggled);\n\t}\n\tonTouch(e) {\n\t\te.preventDefault(), this.props.onToggle(!this.props.toggled);\n\t}\n\tUNSAFE_componentWillReceiveProps(e) {\n\t\tthis.setState({ show: e.show }), e.language !== this.props?.language && (t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t});\n\t}\n\trender() {\n\t\tlet { className: t, toggled: i, hideMessage: a, showMessage: o } = this.props;\n\t\treturn /* @__PURE__ */ s(b, {\n\t\t\tclassName: t,\n\t\t\tchildren: /* @__PURE__ */ s(e, {\n\t\t\t\tshow: this.state.show,\n\t\t\t\tchildren: /* @__PURE__ */ c(x, {\n\t\t\t\t\tonClick: this.onClick.bind(this),\n\t\t\t\t\tonTouchEnd: this.onTouch.bind(this),\n\t\t\t\t\tchildren: [/* @__PURE__ */ c(w, { children: [/* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.openIconRef,\n\t\t\t\t\t\ttimeout: 400,\n\t\t\t\t\t\tin: i,\n\t\t\t\t\t\texit: !i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.openIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-open\")\n\t\t\t\t\t\t})\n\t\t\t\t\t}), /* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.closedIconRef,\n\t\t\t\t\t\ttimeout: 5e3,\n\t\t\t\t\t\tin: !i,\n\t\t\t\t\t\texit: i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.closedIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-closed\")\n\t\t\t\t\t\t})\n\t\t\t\t\t})] }), /* @__PURE__ */ s(m, {\n\t\t\t\t\t\tfalse: !0,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(S, {\n\t\t\t\t\t\t\t\"aria-hidden\": !this.state.show,\n\t\t\t\t\t\t\tchildren: i ? a : o\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n};\n//#endregion\nexport { T as CorrectAnswerToggle, T as default };\n","import \"react\";\nimport { styled as e } from \"@mui/material/styles\";\nimport t from \"classnames\";\nimport n from \"prop-types\";\nimport { color as r } from \"@pie-lib/render-ui\";\nimport { grey as i } from \"@mui/material/colors\";\nimport { jsx as a } from \"react/jsx-runtime\";\n//#region src/placeholder.tsx\nvar o = e(\"div\")(({ theme: e }) => ({\n\t\"&.placeholder\": {\n\t\tWebkitTouchCallout: \"none\",\n\t\tWebkitUserSelect: \"none\",\n\t\tKhtmlUserSelect: \"none\",\n\t\tMozUserSelect: \"none\",\n\t\tMsUserSelect: \"none\",\n\t\tuserSelect: \"none\",\n\t\twidth: \"100%\",\n\t\theight: \"100%\",\n\t\tbackground: r.white(),\n\t\ttransition: \"background-color 200ms linear, border-color 200ms linear\",\n\t\tboxSizing: \"border-box\",\n\t\tdisplay: \"grid\",\n\t\tgridRowGap: e.spacing(1),\n\t\tgridColumnGap: e.spacing(1),\n\t\tpadding: e.spacing(1),\n\t\tborder: `2px dashed ${r.black()}`\n\t},\n\t\"&.disabled\": {\n\t\tboxShadow: \"none\",\n\t\tbackground: e.palette.background.paper\n\t},\n\t\"&.over\": {\n\t\tborder: `1px solid ${i[500]}`,\n\t\tbackgroundColor: `${i[300]}`\n\t},\n\t\"&.board\": {\n\t\tpadding: e.spacing(1),\n\t\tdisplay: \"flex\",\n\t\tflexWrap: \"wrap\",\n\t\talignItems: \"center\",\n\t\tminHeight: \"100px\",\n\t\tjustifyContent: \"center\",\n\t\toverflow: \"hidden\",\n\t\ttouchAction: \"none\",\n\t\tbackgroundColor: r.backgroundDark()\n\t},\n\t\"&.categorizeBoard\": {\n\t\tpadding: e.spacing(.5),\n\t\tdisplay: \"flex\",\n\t\tflexWrap: \"wrap\",\n\t\talignItems: \"center\",\n\t\tminHeight: \"100px\",\n\t\tjustifyContent: \"center\",\n\t\toverflow: \"hidden\",\n\t\ttouchAction: \"none\",\n\t\tbackgroundColor: r.backgroundDark()\n\t},\n\t\"&.verticalPool\": {\n\t\tdisplay: \"flex\",\n\t\tflexFlow: \"column wrap\"\n\t}\n})), s = (e) => {\n\tlet { children: n, className: i, isOver: s, type: c, grid: l, disabled: u, choiceBoard: d, isCategorize: f, isVerticalPool: p, minHeight: m, extraStyles: h } = e, g = t(\"placeholder\", u && \"disabled\", s && \"over\", c, i), _ = {};\n\tif (l && l.columns && (_.gridTemplateColumns = `repeat(${l.columns}, 1fr)`), l && l.rows) {\n\t\tlet e = l.rowsRepeatValue || \"1fr\";\n\t\t_.gridTemplateRows = `repeat(${l.rows}, ${e})`;\n\t}\n\tc === \"choice\" && (_.border = `1px solid ${r.borderLight()}`, _.background = r.backgroundDark());\n\tlet v = f ? \"categorizeBoard\" : \"board\";\n\treturn /* @__PURE__ */ a(o, {\n\t\tstyle: {\n\t\t\t..._,\n\t\t\tminHeight: m,\n\t\t\t...h\n\t\t},\n\t\tclassName: t(d ? v : g, p && \"verticalPool\"),\n\t\tchildren: n\n\t});\n};\ns.propTypes = {\n\tchoiceBoard: n.bool,\n\tgrid: n.shape({\n\t\tcolumns: n.number,\n\t\trows: n.number,\n\t\trowsRepeatValue: n.string\n\t}),\n\tchildren: n.oneOfType([n.arrayOf(n.node), n.node]).isRequired,\n\tclassName: n.string,\n\tisOver: n.bool,\n\tindex: n.number,\n\ttype: n.string,\n\tdisabled: n.bool,\n\tisCategorize: n.bool,\n\tisVerticalPool: n.bool,\n\tminHeight: n.number\n};\n//#endregion\nexport { s as default };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/tile.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\n\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('pie-elements:placement-ordering:tile');\n\nconst StyledNumberContainer: any = styled('div')(({ theme }) => ({\n width: '100%',\n fontSize: theme.typography.fontSize + 4,\n textAlign: 'center',\n color: `rgba(${theme.palette.common.black}, 0.6)`,\n}));\n\nconst Holder = ({ type, index, isOver, disabled }) => (\n <PlaceHolder type={type} isOver={isOver} disabled={disabled}>\n {type === 'target' && index !== undefined && <StyledNumberContainer>{index}</StyledNumberContainer>}\n </PlaceHolder>\n);\n\nHolder.propTypes = {\n type: PropTypes.string,\n index: PropTypes.number,\n isOver: PropTypes.bool,\n disabled: PropTypes.bool,\n};\n\nconst StyledTileContent: any = styled('div')(({ theme, isDragging, isOver, disabled, outcome, label, type }) => ({\n cursor: disabled ? 'not-allowed' : 'grab',\n width: '100%',\n height: '100%',\n padding: '10px',\n boxSizing: 'border-box',\n overflow: 'hidden',\n border: (type === 'choice' || type === 'target') ? `1px solid ${theme.palette.grey[400]}` : '1px solid transparent',\n backgroundColor: (type === 'choice' || type === 'target') ? color.background() : 'transparent',\n transition: (type === 'choice' || type === 'target') ? 'background-color 150ms ease, border-color 150ms ease, opacity 150ms ease' : 'none',\n pointerEvents: 'none',\n userSelect: 'none',\n\n ...((type === 'choice' || type === 'target') && {\n '&:hover': {\n backgroundColor: disabled ? color.background() : color.secondary(),\n borderColor: disabled ? theme.palette.grey[400] : theme.palette.primary.main,\n transform: disabled ? 'none' : 'scale(1.02)',\n },\n }),\n\n // Apply conditional styles based on props (only if not empty spacing tile)\n ...((type === 'choice' || type === 'target') && isOver && !disabled && {\n opacity: 0.4,\n backgroundColor: color.primaryLight(),\n borderColor: theme.palette.primary.main,\n borderStyle: 'dashed',\n transform: 'scale(1.05)',\n }),\n\n ...((type === 'choice' || type === 'target') && isDragging && !disabled && {\n opacity: 0.6,\n backgroundColor: color.secondaryLight(),\n transform: 'scale(1.05) rotate(2deg)',\n boxShadow: '0 8px 16px rgba(0,0,0,0.2)',\n cursor: 'grabbing',\n }),\n\n ...((type === 'choice' || type === 'target') && disabled && {\n cursor: 'not-allowed',\n '&:hover': {\n backgroundColor: color.background(),\n transform: 'none',\n },\n }),\n\n ...((type === 'choice' || type === 'target') && outcome === 'incorrect' && {\n border: `1px solid ${color.incorrect()}`,\n }),\n\n ...((type === 'choice' || type === 'target') && outcome === 'correct' && {\n border: `1px solid ${color.correct()}`,\n }),\n\n ...(!label && {\n border: 'none',\n '&:hover': {\n backgroundColor: 'unset',\n },\n }),\n}));\n\nconst TileContent = (props) => {\n const { type, isDragging, empty, isOver, label, disabled, outcome, guideIndex } = props;\n\n if (empty) {\n return <Holder type={type} index={guideIndex} isOver={isOver} disabled={disabled} />;\n } else {\n return (\n <StyledTileContent\n type={type}\n isDragging={isDragging}\n isOver={isOver}\n disabled={disabled}\n outcome={outcome}\n label={label}\n dangerouslySetInnerHTML={{ __html: label }}\n />\n );\n }\n};\n\nexport const Tile = (props) => {\n const {\n label,\n type,\n id,\n empty,\n disabled,\n outcome,\n index,\n guideIndex,\n instanceId,\n draggable,\n tileIndex,\n } = props;\n\n // Use type + tileIndex in the IDs to guarantee uniqueness in all modes.\n // In includeTargets mode, a choice (id:'c1', type:'choice') and a target (id:'c1', type:'target')\n // can coexist — the type differentiates them.\n // tileIndex (array position from tiler) ensures empty placeholders are also unique.\n const dragId = `tile-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n const dropId = `drop-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n isDragging,\n } = useDraggable({\n id: dragId,\n data: {\n id,\n type,\n instanceId,\n value: label,\n index\n },\n disabled: !draggable || disabled,\n });\n\n const {\n setNodeRef: setDropRef,\n isOver: dropIsOver,\n } = useDroppable({\n id: dropId,\n data: {\n id,\n type,\n instanceId,\n value: label,\n index\n },\n // Disable droppable on the tile currently being dragged so closestCenter\n // cannot pick it as the drop target (prevents self-collision and wrong matches).\n disabled: isDragging,\n });\n\n const ref = React.useRef(null);\n\n React.useEffect(() => {\n const currentRef = ref.current;\n\n const handleTouchStart = (e) => {\n e.preventDefault(); // Prevent the default touch event behavior\n };\n\n if (currentRef) {\n currentRef.addEventListener('touchstart', handleTouchStart, { passive: false });\n }\n\n return () => {\n if (currentRef) {\n currentRef.removeEventListener('touchstart', handleTouchStart);\n }\n };\n }, []);\n\n const setRefs = (element) => {\n ref.current = element;\n setDragRef(element);\n setDropRef(element);\n };\n\n log('[render], props: ', props);\n\n const style = {\n transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined,\n boxSizing: 'border-box',\n overflow: 'visible',\n padding: 0,\n margin: 0,\n textAlign: 'center',\n pointerEvents: 'auto',\n cursor: disabled ? 'not-allowed' : (isDragging ? 'grabbing' : 'grab'),\n zIndex: isDragging ? 1000 : 'auto',\n willChange: isDragging ? 'transform' : 'auto',\n };\n\n return (\n <div\n ref={setRefs}\n style={style}\n {...(draggable && !disabled ? { ...listeners, ...attributes } : {})}\n >\n <TileContent\n label={label}\n id={id}\n empty={empty}\n index={index}\n guideIndex={guideIndex}\n isOver={dropIsOver}\n isDragging={isDragging}\n disabled={disabled}\n outcome={outcome}\n type={type}\n />\n </div>\n );\n};\n\nTile.propTypes = {\n id: PropTypes.any,\n label: PropTypes.string,\n isOver: PropTypes.bool,\n type: PropTypes.string,\n empty: PropTypes.bool,\n disabled: PropTypes.bool,\n outcome: PropTypes.string,\n index: PropTypes.number,\n guideIndex: PropTypes.number,\n instanceId: PropTypes.any,\n draggable: PropTypes.bool,\n tileIndex: PropTypes.number,\n};\n\nexport default Tile;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/tiler.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\n\nimport Tile from './tile.js';\n\nconst types = {\n choiceLabel: PropTypes.string,\n targetLabel: PropTypes.string,\n disabled: PropTypes.bool,\n tiles: PropTypes.array.isRequired,\n tileSize: PropTypes.string,\n addGuide: PropTypes.bool,\n};\n\nconst defaults = {\n tileSize: '1fr',\n disabled: false,\n addGuide: false,\n};\n\nconst buildTiles = (props) => {\n const T = (tile, index) => {\n tile.instanceId = props.instanceId;\n tile.disabled = props.disabled;\n tile.guideIndex = props.addGuide ? tile.index + 1 : undefined;\n // unique key for dnd-kit IDs\n tile.tileIndex = index;\n\n if (props.includeTargets) {\n return <Tile {...tile} key={index} />;\n } else {\n return tile.type === 'choice' ? <Tile {...tile} key={index} /> : <Tile {...tile} label=\"\" key={index} />;\n }\n };\n\n T.propTypes = { ...types };\n return T;\n};\n\nconst StyledHTilerContainer: any = styled('div')(({ theme, includeTargets }) => ({\n display: 'grid',\n paddingBottom: theme.spacing(2),\n ...(includeTargets && {\n gridGap: '10px',\n }),\n}));\n\nconst StyledChoiceLabel: any = styled('div')({\n textAlign: 'center',\n});\n\nconst StyledTargetLabel: any = styled('div')({\n textAlign: 'center',\n gridRow: '3/4',\n});\n\nconst StyledVTilerContainer: any = styled('div')(({ includeTargets }) => ({\n gridAutoFlow: 'column',\n display: 'grid',\n ...(includeTargets && {\n gridGap: '10px',\n }),\n}));\n\nconst StyledVChoiceLabel: any = styled('div')({\n gridColumn: '1/2',\n textAlign: 'center',\n});\n\nconst StyledVTargetLabel: any = styled('div')({\n gridColumn: '2/3',\n textAlign: 'center',\n});\n\nexport class HorizontalTiler extends React.Component {\n static propTypes = { ...types };\n static defaultProps = { ...defaults };\n render() {\n const { includeTargets, choiceLabelEnabled, choiceLabel, targetLabel, tiles, tileSize } = this.props;\n\n const rows = includeTargets ? `auto ${tileSize} auto ${tileSize}` : `auto ${tileSize} auto`;\n const columns = includeTargets ? tiles.length / 2 : tiles.length;\n\n const style = {\n gridTemplateColumns: includeTargets\n ? `repeat(${columns}, ${tileSize})`\n : `auto repeat(${Math.floor(columns / 2) - 1}, ${tileSize} 10px) ${tileSize} auto`,\n gridTemplateRows: rows,\n };\n\n const labelStyle = {\n gridColumn: `1/${columns + 1}`,\n };\n\n return (\n <StyledHTilerContainer includeTargets={includeTargets} style={style}>\n <StyledChoiceLabel\n style={labelStyle}\n dangerouslySetInnerHTML={{ __html: choiceLabelEnabled ? choiceLabel : '' }}\n />\n {includeTargets && (\n <StyledTargetLabel style={labelStyle} dangerouslySetInnerHTML={{ __html: targetLabel }} />\n )}\n {tiles.map(buildTiles(this.props))}\n </StyledHTilerContainer>\n );\n }\n}\n\nexport class VerticalTiler extends React.Component {\n static propTypes = { ...types };\n static defaultProps = { ...defaults };\n render() {\n const { includeTargets, choiceLabelEnabled, choiceLabel, targetLabel, tiles, tileSize } = this.props;\n\n const columns = includeTargets ? 2 : 1;\n const rows = includeTargets ? tiles.length / 2 : tiles.length;\n\n const style = {\n gridTemplateColumns: `repeat(${columns}, ${tileSize})`,\n gridTemplateRows: includeTargets\n ? `auto repeat(${rows}, ${tileSize})`\n : `auto auto repeat(${Math.floor(rows / 2) - 1}, ${tileSize} 10px) ${tileSize} auto`,\n };\n\n return (\n <StyledVTilerContainer includeTargets={includeTargets} style={style}>\n <StyledVChoiceLabel\n dangerouslySetInnerHTML={{ __html: choiceLabelEnabled ? choiceLabel : '' }}\n />\n\n {includeTargets && <StyledVTargetLabel dangerouslySetInnerHTML={{ __html: targetLabel }} />}\n {tiles.map(buildTiles(this.props))}\n </StyledVTilerContainer>\n );\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/ordering.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { assign, cloneDeep, isEmpty, map } from 'lodash-es';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:ordering');\n\nexport const push = (arr, fromIndex, toIndex) => {\n const movedItem = arr.find((item, index) => index === fromIndex);\n const remainingItems = arr.filter((item, index) => index !== fromIndex);\n\n return [...remainingItems.slice(0, toIndex), movedItem, ...remainingItems.slice(toIndex)];\n};\n\nexport const swap = (arr, fromIndex, toIndex) => {\n log('[swap]', arr, fromIndex, toIndex);\n if (!arr || arr.length <= 1 || fromIndex === undefined || toIndex === undefined) {\n throw new Error(`swap requires a non-empty array, fromIndex, toIndex: ${arr}, ${fromIndex} ${toIndex}`);\n }\n const update = cloneDeep(arr);\n const tmp = arr[toIndex];\n update[toIndex] = update[fromIndex];\n update[fromIndex] = tmp;\n return update;\n};\n\nfunction removeResponse(state, targetTile) {\n const update = cloneDeep(state.response);\n\n if (update[targetTile.index] === targetTile.id) {\n update[targetTile.index] = undefined;\n } else {\n throw new Error(\n `Tried to remove from index: ${targetTile.index}, but the id doesn't match: array: ${update}, target: ${targetTile.id}`,\n );\n }\n return update;\n}\n\nfunction updateResponse(state, from, to) {\n const { response, opts } = state;\n const update = cloneDeep(response);\n if (opts.includeTargets) {\n if (from.type === 'choice' && to.type === 'target') {\n update[to.index] = from.id;\n return update;\n } else if (from.type === 'target' && to.type === 'choice') {\n update[from.index] = undefined;\n return update;\n } else if (from.type === 'target' && to.type === 'target') {\n return swap(response, from.index, to.index);\n } else {\n log('do nothing to the response');\n return response;\n }\n } else {\n const fromIndex = state.response.findIndex((r) => r !== undefined && r === from.id);\n const toIndex = state.response.findIndex((r) => r !== undefined && r === to.id);\n log('fromIndex: ', fromIndex, 'toIndex:', toIndex);\n return push(state.response, fromIndex, toIndex);\n }\n}\n\nfunction buildTiles(choices, response, outcomes, opts) {\n if (opts.includeTargets) {\n const targets = [];\n for (let i = 0; i < response.length; i++) {\n const r = response[i];\n\n const choice = choices.find((c) => r !== undefined && r !== null && c.id === r);\n //TODO: index needs to match too!!\n const outcome = outcomes[i];\n\n const out = Object.assign({ type: 'target', index: i, empty: choice === undefined }, choice, outcome, {\n draggable: choice !== undefined,\n });\n\n targets.push(out);\n }\n\n const processedChoices = choices.map((m) => {\n if (response.indexOf(m.id) !== -1 && !opts.allowSameChoiceInTargets) {\n return {\n type: 'choice',\n empty: true,\n droppable: true,\n draggable: false,\n };\n } else {\n return Object.assign({}, m, {\n type: 'choice',\n droppable: false,\n draggable: true,\n });\n }\n });\n\n return processedChoices.concat(targets);\n } else {\n return response.reduce((acc, id, index) => {\n const emptyTile = Object.assign(\n { type: 'empty', draggable: false, droppable: true },\n choices.find((m) => m.id === id),\n outcomes[index],\n );\n const choiceTile = Object.assign(\n { type: 'choice', draggable: true, droppable: true },\n choices.find((m) => m.id === id),\n outcomes[index],\n );\n\n if (index === 0) {\n acc.push(emptyTile);\n }\n\n acc.push(choiceTile, emptyTile);\n\n return acc;\n }, []);\n }\n}\n\nexport function buildState(choices, response, outcomes, opts) {\n opts = assign({ includeTargets: true }, opts);\n\n outcomes = outcomes || [];\n response =\n !response || isEmpty(response)\n ? opts.includeTargets\n ? new Array(choices.length)\n : map(choices, (c) => c.id)\n : response;\n return {\n choices,\n response,\n opts,\n outcomes,\n tiles: buildTiles(choices, response, outcomes, opts),\n };\n}\n\nexport function reducer(action, state) {\n switch (action.type) {\n case 'move': {\n const { from, to } = action;\n const response = updateResponse(state, from, to);\n const tiles = buildTiles(state.choices, response, state.outcomes, state.opts);\n return Object.assign({}, state, { response, tiles });\n }\n case 'remove': {\n const { target } = action;\n const response = removeResponse(state, target);\n const tiles = buildTiles(state.choices, response, state.outcomes, state.opts);\n return Object.assign({}, state, { response, tiles });\n }\n }\n return state;\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport const haveSameValuesButDifferentOrder = (arr1, arr2) => {\n if (!Array.isArray(arr1) || !Array.isArray(arr2)) return false;\n if (arr1.length !== arr2.length) return false;\n\n const toSortedJson = (arr) =>\n arr\n .map((item) => JSON.stringify(item))\n .sort();\n\n const sortedArr1 = toSortedJson(arr1);\n const sortedArr2 = toSortedJson(arr2);\n\n const hasSameValues = sortedArr1.every((val, i) => val === sortedArr2[i]);\n const hasSameOrder = arr1.every((item, i) =>\n JSON.stringify(item) === JSON.stringify(arr2[i])\n );\n\n return hasSameValues && !hasSameOrder;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/placement-ordering.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { difference, isEqual, uniqueId } from 'lodash-es';\nimport { styled } from '@mui/material/styles';\nimport { closestCenter } from '@dnd-kit/core';\n\nimport { Collapsible as CollapsibleImport, color, Feedback as FeedbackImport, hasMedia, hasText, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport Translator from '@pie-lib/translator';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { DragProvider } from '@pie-lib/drag';\n\nimport { HorizontalTiler, VerticalTiler } from './tiler.js';\nimport { buildState, reducer } from './ordering.js';\nimport { haveSameValuesButDifferentOrder } from './utils.js';\n\nconst { translator } = Translator;\n\nconst log = debug('pie-elements:placement-ordering');\n\nconst PlacementOrderingContainer: any = styled('div')({\n color: color.text(),\n backgroundColor: color.background(),\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n boxSizing: 'border-box',\n});\n\nconst StyledPrompt: any = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(1),\n}));\n\nconst StyledNote: any = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(2),\n}));\n\nconst StyledToggle: any = styled(CorrectAnswerToggle)(({ theme }) => ({\n paddingBottom: theme.spacing(1),\n}));\n\nconst StyledCollapsible: any = styled(Collapsible)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n alignSelf: 'flex-start',\n}));\n\nconst OrderingTiler = (props) => {\n const { tiler: Comp, ordering, onDropChoice, onRemoveChoice, ...compProps } = props;\n\n return (\n <Comp\n {...compProps}\n tiles={ordering.tiles}\n onDropChoice={(t, s) => onDropChoice(t, s, ordering)}\n onRemoveChoice={(t) => onRemoveChoice(t, ordering)}\n />\n );\n};\n\nOrderingTiler.propTypes = {\n tiler: PropTypes.func,\n ordering: PropTypes.any,\n onDropChoice: PropTypes.func,\n onRemoveChoice: PropTypes.func,\n};\n\nexport class PlacementOrdering extends React.Component {\n static propTypes = {\n onSessionChange: PropTypes.func.isRequired,\n model: PropTypes.object.isRequired,\n session: PropTypes.oneOfType([PropTypes.array.isRequired, PropTypes.object.isRequired]),\n };\n\n constructor(props) {\n super(props);\n\n this.instanceId = uniqueId();\n\n const { value, needsReset } = this.validateSession(props);\n\n this.state = {\n showingCorrect: false,\n };\n\n const { model } = props || {};\n const { env } = model || {};\n const { mode } = env || {};\n\n if (needsReset && mode === 'gather') {\n this.props.onSessionChange({\n ...props.session,\n value,\n });\n }\n }\n\n toggleCorrect = (showingCorrect) => this.setState({ showingCorrect });\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n validateSession: any = ({ model, session }, areChoicesShuffled = false) => {\n const { config, choices } = model || {};\n const { includeTargets } = config || {};\n const choicesIds = choices.map((c) => c.id);\n\n let { value } = session || {};\n let needsReset;\n\n if (!includeTargets) {\n // Use all choice IDs if choices were shuffled or session is missing/invalid\n const sessionMissing = !value || !value.length;\n if (sessionMissing || areChoicesShuffled) {\n // if there's no value on session in No Targets Mode, we need to set an initial session\n value = choicesIds;\n } else {\n // in No Targets Mode, all choice ids need to be used\n const missingChoiceIds = difference(choicesIds, value);\n // this is the case that handles extra choice ids in session\n const extraChoiceIds = difference(value, choicesIds);\n\n if (missingChoiceIds.length || extraChoiceIds.length) {\n value = choicesIds;\n }\n }\n\n needsReset = !isEqual(session.value, value);\n } else {\n // in Targets Area selected, it's important to check the length of session\n const sessionIsMismatched = value && value.length !== choicesIds.length;\n if (sessionIsMismatched) {\n needsReset = true;\n\n // if choices were added, add value in session\n if (value.length < choicesIds.length) {\n value = value.concat(new Array(choicesIds.length - value.length));\n } else {\n // if choices were removed, make sure to remove from session as well\n value = value.filter((cId) => choicesIds.includes(cId));\n }\n }\n }\n\n if (needsReset) {\n // eslint-disable-next-line no-console\n console.warn('This session is not valid anymore. It will be reset.');\n }\n\n return { value, needsReset };\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { model: nextModel = {} } = nextProps || {};\n const { model: currentModel = {} } = this.props || {};\n const { correctResponse, config, choices: nextChoices = [], env } = nextModel;\n const { includeTargets } = config || {};\n\n const newState = {};\n\n const isLanguageChanged = currentModel.language && currentModel.language !== nextModel.language;\n const isDefaultNote =\n currentModel.note &&\n currentModel.note === translator.t('common:commonCorrectAnswerWithAlternates', { lng: currentModel.language });\n\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (isLanguageChanged && isDefaultNote) {\n currentModel.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: nextModel.language });\n }\n\n if (!correctResponse) {\n newState.showingCorrect = false;\n }\n\n //PD-4924\n // show student choices same order as in model when teacher changes student choices order\n // for cases when student view and instructor view are on same page\n const areChoicesShuffled = haveSameValuesButDifferentOrder(nextChoices, currentModel.choices);\n\n const validatedSession = this.validateSession(nextProps, areChoicesShuffled);\n let { value, needsReset } = validatedSession;\n\n const newSession = {\n ...nextProps.session,\n value,\n };\n const includeTargetsChanged = currentModel.config?.includeTargets !== includeTargets;\n\n if (includeTargets && includeTargetsChanged) {\n needsReset = true;\n\n delete newSession.value;\n }\n\n this.setState(newState, () => {\n const { mode } = env || {};\n\n if (needsReset && mode === 'gather') {\n this.props.onSessionChange(newSession);\n }\n });\n }\n\n onDropChoice: any = (target, source, ordering) => {\n const { onSessionChange, session } = this.props;\n const from = ordering.tiles.find((t) => t.id === source.id && t.type === source.type && t.index === source.index);\n const to = target;\n log('[onDropChoice] ', from, to);\n const update = reducer({ type: 'move', from, to }, ordering);\n const sessionUpdate = Object.assign({}, session, {\n value: update.response,\n });\n\n onSessionChange(sessionUpdate);\n };\n\n onRemoveChoice: any = (target, ordering) => {\n const { onSessionChange, session } = this.props;\n log('[onRemoveChoice]', target);\n const update = reducer({ type: 'remove', target }, ordering);\n const sessionUpdate = Object.assign({}, session, {\n value: update.response,\n });\n onSessionChange(sessionUpdate);\n };\n\n createOrdering: any = () => {\n const { model, session } = this.props;\n const { showingCorrect } = this.state;\n const config = model.config || {\n orientation: 'vertical',\n includeTargets: true,\n };\n const { includeTargets } = config;\n\n return showingCorrect\n ? buildState(\n model.choices,\n model.correctResponse,\n model.correctResponse.map((id) => ({ id, outcome: 'correct' })),\n {\n includeTargets,\n allowSameChoiceInTargets: model.config.allowSameChoiceInTargets,\n },\n )\n : buildState(model.choices, session.value, model.outcomes, {\n includeTargets,\n allowSameChoiceInTargets: model.config.allowSameChoiceInTargets,\n });\n };\n\n onDragEnd: any = (event) => {\n const { over, active } = event;\n const ordering = this.createOrdering();\n\n if (over && active) {\n const draggedItem = active.data.current;\n const droppedOnItem = over.data.current;\n\n if (draggedItem && droppedOnItem && droppedOnItem.type === 'target') {\n this.onDropChoice(droppedOnItem, draggedItem, ordering);\n return;\n }\n\n if (draggedItem && droppedOnItem) {\n this.onDropChoice(droppedOnItem, draggedItem, ordering);\n }\n } else if (!over && active) {\n const draggedItem = active.data.current;\n if (draggedItem && draggedItem.type === 'target') {\n this.onRemoveChoice(draggedItem, ordering);\n }\n }\n };\n\n render() {\n const { model } = this.props;\n const {\n correctResponse,\n correctness,\n extraCSSRules,\n prompt,\n rationale,\n feedback,\n config: configs,\n note,\n showNote,\n env,\n disabled,\n teacherInstructions,\n language,\n } = model;\n const showToggle = correctResponse && correctResponse.length > 0;\n const { showingCorrect } = this.state;\n const config = configs || {\n orientation: 'vertical',\n includeTargets: true,\n };\n const { orientation, includeTargets } = config;\n const vertical = orientation === 'vertical';\n const ordering = this.createOrdering();\n const { mode, role } = env || {};\n\n const Tiler = vertical ? VerticalTiler : HorizontalTiler;\n const displayNote = (showingCorrect || (mode === 'view' && role === 'instructor')) && showNote && note;\n const showRationale = rationale && (hasText(rationale) || hasMedia(rationale));\n const showTeacherInstructions =\n teacherInstructions && (hasText(teacherInstructions) || hasMedia(teacherInstructions));\n\n const containerStyle = {\n color: color.text(),\n backgroundColor: color.background(),\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n boxSizing: 'border-box',\n };\n\n return (\n <DragProvider onDragStart={() => { }} onDragEnd={this.onDragEnd} collisionDetection={closestCenter}>\n <PlacementOrderingContainer>\n <UiLayout extraCSSRules={extraCSSRules} style={containerStyle}>\n {showTeacherInstructions && (\n <StyledCollapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n className=\"collapsible\"\n >\n <PreviewPrompt prompt={teacherInstructions} />\n </StyledCollapsible>\n )}\n\n <StyledPrompt>\n <PreviewPrompt prompt={prompt} />\n </StyledPrompt>\n\n <StyledToggle\n show={showToggle}\n toggled={showingCorrect}\n onToggle={this.toggleCorrect}\n language={language}\n />\n\n <OrderingTiler\n instanceId={this.instanceId}\n choiceLabel={config.choiceLabel}\n targetLabel={config.targetLabel}\n ordering={ordering}\n tiler={Tiler}\n disabled={disabled}\n addGuide={config.showOrdering}\n tileSize={config.tileSize}\n includeTargets={includeTargets}\n choiceLabelEnabled={model.config && model.config.choiceLabelEnabled}\n />\n\n {displayNote && <StyledNote dangerouslySetInnerHTML={{ __html: note }} />}\n\n {showRationale && (\n <StyledCollapsible\n labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}\n className=\"collapsible\"\n >\n <PreviewPrompt prompt={rationale} />\n </StyledCollapsible>\n )}\n\n {!showingCorrect && <Feedback correctness={correctness} feedback={feedback} />}\n </UiLayout>\n </PlacementOrderingContainer>\n </DragProvider>\n );\n }\n}\n\nexport default PlacementOrdering;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/main.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport PlacementOrdering from './placement-ordering.js';\n\nclass Main extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n session: PropTypes.oneOfType([PropTypes.array.isRequired, PropTypes.object.isRequired]),\n onSessionChange: PropTypes.func.isRequired,\n };\n\n render() {\n const { model, session, onSessionChange } = this.props;\n\n return (\n <PlacementOrdering model={model} session={session} onSessionChange={onSessionChange} />\n );\n }\n}\n\nexport default Main;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { compact } from 'lodash-es';\nimport debug from 'debug';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport { SessionChangedEvent } from '@pie-element/shared-player-events';\nimport Main from './main.js';\n\nconst log = debug('pie-elements:placement-ordering');\n\nexport const isValidSession = ({ model, session }) => {\n const { config } = model;\n\n const compactSessionValues = (session && compact(session.value)) || [];\n const completeSession = compactSessionValues.length === model.choices.length;\n\n // if it includes targets, it doesn't have to contain all the choices selected (eg: only 2 targets were filled)\n // but if it does not include targets, it's a must to have all choices selected\n return config.includeTargets || completeSession;\n};\n\nexport default class Ordering extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n }\n\n _scheduleMathRender: any = () => {\n if (this._mathRenderPending) return;\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n }\n renderMath(this);\n this._mathRenderPending = false;\n setTimeout(() => {\n if (this._mathObserver) {\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n this._mathObserver = new MutationObserver(this._scheduleMathRender);\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n isComplete = (value) => value && compact(value).length === this._model.completeLength;\n\n sessionChange: any = (session) => {\n this._session.value = session.value;\n this.render();\n this.dispatchEvent(\n new SessionChangedEvent(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)),\n );\n };\n\n set model(newModel) {\n this._model = newModel;\n\n this.render();\n this.dispatchEvent(\n new CustomEvent('model-set', {\n bubbles: true,\n detail: {\n complete: false,\n },\n }),\n );\n }\n\n set session(newSession) {\n this._session = newSession;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n render() {\n if (this._model && this._session) {\n log('[render] session: ', this._session.value);\n log('[render] model: ', this._model);\n\n this._initMathObserver();\n\n const element = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onSessionChange: this.sessionChange,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n }\n\n connectedCallback() {\n this._initMathObserver();\n }\n\n disconnectedCallback() {\n this._disconnectMathObserver();\n if (this._root) {\n this._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EAAI,oBAAoB,KAAK,MAAM,GAEnC,KAAK,kBAAkB;GAEvB,IAAM,IAAU,EAAM,cAAc,IAAM;IACxC,OAAO,KAAK;IACZ,SAAS,KAAK;IACd,iBAAiB,KAAK;GACxB,CAAC;GAKD,AAHA,AACE,KAAK,UAAQ,GAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAO;EAC3B;CACF;CAEA,oBAAoB;EAClB,KAAK,kBAAkB;CACzB;CAEA,uBAAuB;EAErB,AADA,KAAK,wBAAwB,GACzB,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/player-events/dist/index.js","../../../../../../node_modules/.bun/@dnd-kit+modifiers@9.0.0+e39cb113295c5721/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js","../../../../../lib-react/icons/dist/correct-response-icon.js","../../../../../lib-react/correct-answer-toggle/dist/expander.js","../../../../../lib-react/correct-answer-toggle/dist/index.js","../../../../../lib-react/drag/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js","../../../../../lib-react/drag/dist/placeholder.js","../../../src/delivery/tile.tsx","../../../src/delivery/tiler.tsx","../../../src/delivery/ordering.ts","../../../src/delivery/utils.ts","../../../src/delivery/keyboard-coordinates.ts","../../../src/delivery/placement-ordering.tsx","../../../src/delivery/main.tsx","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/index.ts\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","import { getEventCoordinates } from '@dnd-kit/utilities';\n\nfunction createSnapModifier(gridSize) {\n return _ref => {\n let {\n transform\n } = _ref;\n return { ...transform,\n x: Math.ceil(transform.x / gridSize) * gridSize,\n y: Math.ceil(transform.y / gridSize) * gridSize\n };\n };\n}\n\nconst restrictToHorizontalAxis = _ref => {\n let {\n transform\n } = _ref;\n return { ...transform,\n y: 0\n };\n};\n\nfunction restrictToBoundingRect(transform, rect, boundingRect) {\n const value = { ...transform\n };\n\n if (rect.top + transform.y <= boundingRect.top) {\n value.y = boundingRect.top - rect.top;\n } else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) {\n value.y = boundingRect.top + boundingRect.height - rect.bottom;\n }\n\n if (rect.left + transform.x <= boundingRect.left) {\n value.x = boundingRect.left - rect.left;\n } else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) {\n value.x = boundingRect.left + boundingRect.width - rect.right;\n }\n\n return value;\n}\n\nconst restrictToParentElement = _ref => {\n let {\n containerNodeRect,\n draggingNodeRect,\n transform\n } = _ref;\n\n if (!draggingNodeRect || !containerNodeRect) {\n return transform;\n }\n\n return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);\n};\n\nconst restrictToFirstScrollableAncestor = _ref => {\n let {\n draggingNodeRect,\n transform,\n scrollableAncestorRects\n } = _ref;\n const firstScrollableAncestorRect = scrollableAncestorRects[0];\n\n if (!draggingNodeRect || !firstScrollableAncestorRect) {\n return transform;\n }\n\n return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect);\n};\n\nconst restrictToVerticalAxis = _ref => {\n let {\n transform\n } = _ref;\n return { ...transform,\n x: 0\n };\n};\n\nconst restrictToWindowEdges = _ref => {\n let {\n transform,\n draggingNodeRect,\n windowRect\n } = _ref;\n\n if (!draggingNodeRect || !windowRect) {\n return transform;\n }\n\n return restrictToBoundingRect(transform, draggingNodeRect, windowRect);\n};\n\nconst snapCenterToCursor = _ref => {\n let {\n activatorEvent,\n draggingNodeRect,\n transform\n } = _ref;\n\n if (draggingNodeRect && activatorEvent) {\n const activatorCoordinates = getEventCoordinates(activatorEvent);\n\n if (!activatorCoordinates) {\n return transform;\n }\n\n const offsetX = activatorCoordinates.x - draggingNodeRect.left;\n const offsetY = activatorCoordinates.y - draggingNodeRect.top;\n return { ...transform,\n x: transform.x + offsetX - draggingNodeRect.width / 2,\n y: transform.y + offsetY - draggingNodeRect.height / 2\n };\n }\n\n return transform;\n};\n\nexport { createSnapModifier, restrictToFirstScrollableAncestor, restrictToHorizontalAxis, restrictToParentElement, restrictToVerticalAxis, restrictToWindowEdges, snapCenterToCursor };\n//# sourceMappingURL=modifiers.esm.js.map\n","import \"react\";\nimport e from \"prop-types\";\nimport { jsx as t, jsxs as n } from \"react/jsx-runtime\";\nimport { styled as r } from \"@mui/material/styles\";\n//#region src/correct-response-icon.tsx\nvar i = ({ bgFill: e, fgFill: r }) => /* @__PURE__ */ n(\"svg\", {\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-283 359 34 35\",\n\tstyle: { enableBackground: \"new -283 359 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-266\",\n\t\t\tcy: \"375.9\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\ni.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired\n};\nvar a = ({ bgFill: e, fgFill: r, borderFill: i }) => /* @__PURE__ */ n(\"svg\", {\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-129.5 127 34 35\",\n\tstyle: { enableBackground: \"new -129.5 127 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#D0CAC5\",\n\t\t\t\tstroke: \"#E6E3E0\",\n\t\t\t\tstrokeWidth: .75,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\\n C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#B3ABA4\",\n\t\t\t\tstroke: \"#CDC7C2\",\n\t\t\t\tstrokeWidth: .5,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-114.2\",\n\t\t\tcy: \"143.5\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\",\n\t\t\tfill: i\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\na.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired,\n\tborderFill: e.string.isRequired\n};\nvar o = r(\"div\")(({ size: e }) => ({\n\twidth: e || \"25px\",\n\theight: e || \"25px\"\n})), s = ({ open: e, size: n }) => /* @__PURE__ */ t(o, {\n\tsize: n,\n\tchildren: e ? /* @__PURE__ */ t(i, {\n\t\tbgFill: \"#bce2ff\",\n\t\tfgFill: \"#1a9cff\"\n\t}) : /* @__PURE__ */ t(a, {\n\t\tbgFill: \"white\",\n\t\tfgFill: \"#1a9cff\",\n\t\tborderFill: \"#bce2ff\"\n\t})\n});\ns.propTypes = {\n\topen: e.bool,\n\tsize: e.string\n}, s.defaultProps = { open: !1 };\n//#endregion\nexport { s as default };\n","import { styled as e } from \"@mui/material/styles\";\nimport { CSSTransition as t } from \"react-transition-group\";\nimport { jsx as n } from \"react/jsx-runtime\";\nimport { useRef as r } from \"react\";\nimport i from \"prop-types\";\n//#region src/expander.tsx\nvar a = \"height ease-in 300ms, opacity ease-in 300ms\", o = e(\"div\")(() => ({\n\tposition: \"relative\",\n\theight: 0,\n\toverflow: \"hidden\",\n\tdisplay: \"flex\",\n\tvisibility: \"hidden\",\n\twidth: 0,\n\t\"&.enter\": {\n\t\ttransition: a,\n\t\topacity: 1,\n\t\theight: \"auto\",\n\t\twidth: \"auto\",\n\t\tvisibility: \"visible\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.enter-done\": {\n\t\theight: \"auto\",\n\t\tvisibility: \"visible\",\n\t\twidth: \"auto\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.exit\": {\n\t\ttransition: a,\n\t\topacity: 0,\n\t\theight: 0,\n\t\tvisibility: \"visible\",\n\t\twidth: 0\n\t},\n\t\"&.exit-done\": {\n\t\topacity: 0,\n\t\tvisibility: \"hidden\",\n\t\theight: 0,\n\t\twidth: 0\n\t}\n})), s = (e) => {\n\tlet { show: i, children: a, className: s } = e, c = r(null);\n\treturn /* @__PURE__ */ n(t, {\n\t\tnodeRef: c,\n\t\tin: i,\n\t\tappear: !0,\n\t\tmountOnEnter: !1,\n\t\ttimeout: 300,\n\t\tclassNames: {\n\t\t\tenter: \"enter\",\n\t\t\tenterDone: \"enter-done\",\n\t\t\texit: \"exit\",\n\t\t\texitDone: \"exit-done\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ n(o, {\n\t\t\tref: c,\n\t\t\tclassName: s,\n\t\t\tchildren: a\n\t\t})\n\t});\n};\ns.propTypes = {\n\tshow: i.bool.isRequired,\n\tclassName: i.string,\n\tchildren: i.oneOfType([i.arrayOf(i.node), i.node]).isRequired\n};\n//#endregion\nexport { s as default };\n","import e from \"./expander.js\";\nimport { styled as t } from \"@mui/material/styles\";\nimport { CSSTransition as n } from \"react-transition-group\";\nimport { CorrectResponse as r } from \"@pie-lib/icons\";\nimport * as i from \"@pie-lib/render-ui\";\nimport { Readable as a, color as o } from \"@pie-lib/render-ui\";\nimport { jsx as s, jsxs as c } from \"react/jsx-runtime\";\nimport l from \"react\";\nimport u from \"prop-types\";\nimport d from \"@pie-lib/translator\";\n//#region src/index.tsx\nfunction f(e) {\n\treturn typeof e == \"function\" || typeof e == \"object\" && !!e && typeof e.$$typeof == \"symbol\";\n}\nfunction p(e, t) {\n\treturn !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;\n}\nvar m = p(a, \"Readable\") || p(_.Readable, \"Readable\"), h = i, g = h.default, _ = g && typeof g == \"object\" ? g : h, { translator: v } = d, y = {\n\tWebkitTouchCallout: \"none\",\n\tWebkitUserSelect: \"none\",\n\tKhtmlUserSelect: \"none\",\n\tMozUserSelect: \"none\",\n\tmsUserSelect: \"none\",\n\tuserSelect: \"none\"\n}, b = t(\"div\")(() => ({\n\twidth: \"100%\",\n\tcursor: \"pointer\"\n})), x = t(\"div\")(() => ({\n\tmargin: \"0 auto\",\n\ttextAlign: \"center\",\n\tdisplay: \"flex\"\n})), S = t(\"div\")(() => ({\n\twidth: \"fit-content\",\n\tminWidth: \"140px\",\n\talignSelf: \"center\",\n\tverticalAlign: \"middle\",\n\tcolor: `var(--correct-answer-toggle-label-color, ${o.text()})`,\n\tfontWeight: \"normal\",\n\t...y\n})), C = t(\"div\")(() => ({\n\tposition: \"absolute\",\n\twidth: \"25px\",\n\t\"&.enter\": { opacity: \"0\" },\n\t\"&.enter-active\": {\n\t\topacity: \"1\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t},\n\t\"&.exit\": { opacity: \"1\" },\n\t\"&.exit-active\": {\n\t\topacity: \"0\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t}\n})), w = t(\"div\")(() => ({\n\twidth: \"25px\",\n\tmarginRight: \"5px\",\n\tdisplay: \"flex\",\n\talignItems: \"center\"\n})), T = class t extends l.Component {\n\tstatic propTypes = {\n\t\tonToggle: u.func,\n\t\ttoggled: u.bool,\n\t\tshow: u.bool,\n\t\thideMessage: u.string,\n\t\tshowMessage: u.string,\n\t\tclassName: u.string,\n\t\tlanguage: u.string\n\t};\n\tstatic defaultProps = {\n\t\tshowMessage: \"Show correct answer\",\n\t\thideMessage: \"Hide correct answer\",\n\t\tshow: !1,\n\t\ttoggled: !1\n\t};\n\tconstructor(e) {\n\t\tsuper(e), this.state = { show: e.show }, this.openIconRef = l.createRef(), this.closedIconRef = l.createRef(), t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t};\n\t}\n\tonClick() {\n\t\tthis.props.onToggle(!this.props.toggled);\n\t}\n\tonTouch(e) {\n\t\te.preventDefault(), this.props.onToggle(!this.props.toggled);\n\t}\n\tUNSAFE_componentWillReceiveProps(e) {\n\t\tthis.setState({ show: e.show }), e.language !== this.props?.language && (t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t});\n\t}\n\trender() {\n\t\tlet { className: t, toggled: i, hideMessage: a, showMessage: o } = this.props;\n\t\treturn /* @__PURE__ */ s(b, {\n\t\t\tclassName: t,\n\t\t\tchildren: /* @__PURE__ */ s(e, {\n\t\t\t\tshow: this.state.show,\n\t\t\t\tchildren: /* @__PURE__ */ c(x, {\n\t\t\t\t\tonClick: this.onClick.bind(this),\n\t\t\t\t\tonTouchEnd: this.onTouch.bind(this),\n\t\t\t\t\tchildren: [/* @__PURE__ */ c(w, { children: [/* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.openIconRef,\n\t\t\t\t\t\ttimeout: 400,\n\t\t\t\t\t\tin: i,\n\t\t\t\t\t\texit: !i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.openIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-open\")\n\t\t\t\t\t\t})\n\t\t\t\t\t}), /* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.closedIconRef,\n\t\t\t\t\t\ttimeout: 5e3,\n\t\t\t\t\t\tin: !i,\n\t\t\t\t\t\texit: i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.closedIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-closed\")\n\t\t\t\t\t\t})\n\t\t\t\t\t})] }), /* @__PURE__ */ s(m, {\n\t\t\t\t\t\tfalse: !0,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(S, {\n\t\t\t\t\t\t\t\"aria-hidden\": !this.state.show,\n\t\t\t\t\t\t\tchildren: i ? a : o\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n};\n//#endregion\nexport { T as CorrectAnswerToggle, T as default };\n","//#region ../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs\nfunction e(t) {\n\tvar n, r, i = \"\";\n\tif (typeof t == \"string\" || typeof t == \"number\") i += t;\n\telse if (typeof t == \"object\") if (Array.isArray(t)) {\n\t\tvar a = t.length;\n\t\tfor (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += \" \"), i += r);\n\t} else for (r in t) t[r] && (i && (i += \" \"), i += r);\n\treturn i;\n}\nfunction t() {\n\tfor (var t, n, r = 0, i = \"\", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += \" \"), i += n);\n\treturn i;\n}\n//#endregion\nexport { t as clsx, t as default };\n","import { clsx as e } from \"./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js\";\nimport \"react\";\nimport { styled as t } from \"@mui/material/styles\";\nimport n from \"prop-types\";\nimport { color as r } from \"@pie-lib/render-ui\";\nimport { jsx as i } from \"react/jsx-runtime\";\n//#region src/placeholder.tsx\nvar a = t(\"div\")(({ theme: e }) => ({\n\t\"&.placeholder\": {\n\t\tWebkitTouchCallout: \"none\",\n\t\tWebkitUserSelect: \"none\",\n\t\tKhtmlUserSelect: \"none\",\n\t\tMozUserSelect: \"none\",\n\t\tMsUserSelect: \"none\",\n\t\tuserSelect: \"none\",\n\t\twidth: \"100%\",\n\t\theight: \"100%\",\n\t\tbackground: r.white(),\n\t\ttransition: \"background-color 200ms linear, border-color 200ms linear\",\n\t\tboxSizing: \"border-box\",\n\t\tdisplay: \"grid\",\n\t\tgridRowGap: e.spacing(1),\n\t\tgridColumnGap: e.spacing(1),\n\t\tpadding: e.spacing(1),\n\t\tborder: `2px dashed ${r.black()}`\n\t},\n\t\"&.placeholderDisabled\": {\n\t\tboxShadow: \"none\",\n\t\tbackground: r.white()\n\t},\n\t\"&.over\": {\n\t\tborder: `1px solid ${r.border()}`,\n\t\tbackgroundColor: r.backgroundDark()\n\t},\n\t\"&.board\": {\n\t\tpadding: e.spacing(1),\n\t\tdisplay: \"flex\",\n\t\tflexWrap: \"wrap\",\n\t\talignItems: \"center\",\n\t\tminHeight: \"100px\",\n\t\tjustifyContent: \"center\",\n\t\toverflow: \"hidden\",\n\t\ttouchAction: \"none\",\n\t\tbackgroundColor: r.surface()\n\t},\n\t\"&.categorizeBoard\": {\n\t\tpadding: e.spacing(.5),\n\t\tdisplay: \"flex\",\n\t\tflexWrap: \"wrap\",\n\t\talignItems: \"center\",\n\t\tminHeight: \"100px\",\n\t\tjustifyContent: \"center\",\n\t\toverflow: \"hidden\",\n\t\ttouchAction: \"none\",\n\t\tbackgroundColor: r.surface()\n\t},\n\t\"&.verticalPool\": {\n\t\tdisplay: \"flex\",\n\t\tflexFlow: \"column wrap\"\n\t}\n})), o = (t) => {\n\tlet { children: n, className: o, isOver: s, type: c, grid: l, disabled: u, choiceBoard: d, isCategorize: f, isVerticalPool: p, minHeight: m, extraStyles: h } = t, g = e(\"placeholder\", u && \"placeholderDisabled\", s && \"over\", c, o), _ = {};\n\tif (l && l.columns && (_.gridTemplateColumns = `repeat(${l.columns}, 1fr)`), l && l.rows) {\n\t\tlet e = l.rowsRepeatValue || \"1fr\";\n\t\t_.gridTemplateRows = `repeat(${l.rows}, ${e})`;\n\t}\n\tc === \"choice\" && (_.border = `1px solid ${r.borderLight()}`, _.background = r.backgroundDark());\n\tlet v = f ? \"categorizeBoard\" : \"board\";\n\treturn /* @__PURE__ */ i(a, {\n\t\tstyle: {\n\t\t\t..._,\n\t\t\tminHeight: m,\n\t\t\t...h\n\t\t},\n\t\tclassName: e(d ? v : g, p && \"verticalPool\"),\n\t\tchildren: n\n\t});\n};\no.propTypes = {\n\tchoiceBoard: n.bool,\n\tgrid: n.shape({\n\t\tcolumns: n.number,\n\t\trows: n.number,\n\t\trowsRepeatValue: n.string\n\t}),\n\tchildren: n.oneOfType([n.arrayOf(n.node), n.node]).isRequired,\n\tclassName: n.string,\n\tisOver: n.bool,\n\tindex: n.number,\n\ttype: n.string,\n\tdisabled: n.bool,\n\tisCategorize: n.bool,\n\tisVerticalPool: n.bool,\n\tminHeight: n.number\n};\n//#endregion\nexport { o as PlaceHolder, o as default };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/tile.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\n\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('pie-elements:placement-ordering:tile');\n\nconst StyledNumberContainer: any = styled('div')(({ theme }) => ({\n width: '100%',\n fontSize: theme.typography.fontSize + 4,\n textAlign: 'center',\n color: `rgba(${theme.palette.common.black}, 0.6)`,\n}));\n\nconst Holder = ({ type, index, isOver, disabled }) => (\n <PlaceHolder type={type} isOver={isOver} disabled={disabled}>\n {type === 'target' && index !== undefined && <StyledNumberContainer>{index}</StyledNumberContainer>}\n </PlaceHolder>\n);\n\nHolder.propTypes = {\n type: PropTypes.string,\n index: PropTypes.number,\n isOver: PropTypes.bool,\n disabled: PropTypes.bool,\n};\n\nconst StyledTileContent: any = styled('div')(\n ({ theme, isDragging, isSelected, isOver, disabled, outcome, label, type }) => ({\n cursor: disabled ? 'not-allowed' : 'grab',\n width: '100%',\n height: '100%',\n padding: '10px',\n boxSizing: 'border-box',\n overflow: 'hidden',\n border: type === 'choice' || type === 'target' ? `1px solid ${color.border()}` : '1px solid transparent',\n backgroundColor: type === 'choice' || type === 'target' ? color.background() : 'transparent',\n transition:\n type === 'choice' || type === 'target'\n ? 'background-color 150ms ease, border-color 150ms ease, opacity 150ms ease'\n : 'none',\n pointerEvents: 'none',\n userSelect: 'none',\n\n ...((type === 'choice' || type === 'target') && {\n '&:hover': {\n backgroundColor: disabled ? color.background() : color.secondary(),\n // The disabled branch says \"disabled\", so it takes the disabled token rather\n // than the neutral stroke the resting state uses.\n borderColor: disabled ? color.disabled() : theme.palette.primary.main,\n transform: disabled ? 'none' : 'scale(1.02)',\n },\n }),\n\n // Apply conditional styles based on props (only if not empty spacing tile)\n ...((type === 'choice' || type === 'target') &&\n isOver &&\n !disabled && {\n opacity: 0.4,\n backgroundColor: color.primaryLight(),\n borderColor: theme.palette.primary.main,\n borderStyle: 'dashed',\n transform: 'scale(1.05)',\n }),\n\n ...((type === 'choice' || type === 'target') &&\n (isDragging || isSelected) &&\n !disabled && {\n opacity: 0.6,\n backgroundColor: color.secondaryLight(),\n transform: 'scale(1.05) rotate(2deg)',\n boxShadow: '0 8px 16px rgba(0,0,0,0.2)',\n cursor: 'grabbing',\n }),\n\n ...((type === 'choice' || type === 'target') &&\n disabled && {\n cursor: 'not-allowed',\n '&:hover': {\n backgroundColor: color.background(),\n transform: 'none',\n },\n }),\n\n ...((type === 'choice' || type === 'target') &&\n outcome === 'incorrect' && {\n border: `1px solid ${color.incorrect()}`,\n }),\n\n ...((type === 'choice' || type === 'target') &&\n outcome === 'correct' && {\n border: `1px solid ${color.correct()}`,\n }),\n\n ...(!label && {\n border: 'none',\n '&:hover': {\n backgroundColor: 'unset',\n },\n }),\n }),\n);\n\nconst TileContent = (props) => {\n const { type, isDragging, isSelected, empty, isOver, label, disabled, outcome, guideIndex } = props;\n\n if (empty) {\n return <Holder type={type} index={guideIndex} isOver={isOver} disabled={disabled} />;\n } else {\n return (\n <StyledTileContent\n type={type}\n isDragging={isDragging}\n isSelected={isSelected}\n isOver={isOver}\n disabled={disabled}\n outcome={outcome}\n label={label}\n dangerouslySetInnerHTML={{ __html: label }}\n />\n );\n }\n};\n\nexport const Tile = (props) => {\n const {\n label,\n type,\n id,\n empty,\n disabled,\n outcome,\n index,\n guideIndex,\n instanceId,\n draggable,\n tileIndex,\n selectedChoice,\n onChoiceClick,\n onPlacementClick,\n } = props;\n\n // Use type + tileIndex in the IDs to guarantee uniqueness in all modes.\n // In includeTargets mode, a choice (id:'c1', type:'choice') and a target (id:'c1', type:'target')\n // can coexist — the type differentiates them.\n // tileIndex (array position from tiler) ensures empty placeholders are also unique.\n const dragId = `tile-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n const dropId = `drop-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n\n // Built once and reused for dnd-kit's own drag/drop data and for the click handlers\n // below, so a click carries exactly the same shape a real drag would.\n const tileData = { id, type, instanceId, value: label, index };\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n isDragging,\n } = useDraggable({\n id: dragId,\n data: tileData,\n disabled: !draggable || disabled,\n });\n\n const { setNodeRef: setDropRef, isOver: dropIsOver } = useDroppable({\n id: dropId,\n data: tileData,\n // Disable droppable on the tile currently being dragged so closestCenter\n // cannot pick it as the drop target (prevents self-collision and wrong matches).\n disabled: isDragging,\n });\n\n const isSelected =\n !!selectedChoice &&\n selectedChoice.type === tileData.type &&\n selectedChoice.id === tileData.id &&\n selectedChoice.index === tileData.index;\n\n // dnd-kit's own isOver (dropIsOver) only reflects real collision detection during an\n // active drag, so it stays false while a placement area is merely a candidate for a\n // pending click-based placement. Track hovering locally and fold it into the same\n // isOver signal the styling below already uses, so hovering a response area while\n // something is selected gets the exact same treatment as hovering it during a real\n // drag — one code path, no duplicated CSS.\n const [isHovered, setIsHovered] = React.useState(false);\n const hasSelection = !!selectedChoice && !disabled;\n const showsHoverEffect = dropIsOver || (type === 'target' && hasSelection && isHovered);\n\n // Click-to-select/click-to-place (both choices and targets are handled by this same\n // component, differentiated by `type`):\n // - Choice tile: selects/switches/deselects it, UNLESS a placed answer (a \"target\")\n // is currently selected, in which case clicking any choice-row tile returns it to\n // the choices column/row (choice -> choice has no placement meaning in the\n // reducer, so there's no ambiguity there).\n // - Target tile: clicking the already-selected placed answer again deselects it;\n // clicking it while something else is selected places that selection here\n // (empty or occupied); clicking a filled target with nothing selected selects\n // that placed answer for moving, the same way Tab+Space/Enter does. An empty\n // target with nothing selected is a no-op.\n const handleClick = () => {\n if (disabled) return;\n\n if (type === 'choice') {\n if (selectedChoice?.type === 'target') {\n onPlacementClick?.(tileData);\n } else if (draggable) {\n onChoiceClick?.(tileData);\n }\n } else if (type === 'target') {\n if (isSelected) {\n onChoiceClick?.(tileData);\n } else if (selectedChoice) {\n onPlacementClick?.(tileData);\n } else if (draggable) {\n onChoiceClick?.(tileData);\n }\n }\n };\n\n // dnd-kit's own draggable attributes (spread below) already make a draggable tile a\n // native Tab stop with its own Space/Enter activation. An empty tile is never\n // draggable, so without this it wouldn't be reachable by Tab at all — needed for\n // \"select a choice, then Tab to a placement area and press Space/Enter\" to work.\n // Gated to non-draggable tiles specifically so it never overrides dnd-kit's own\n // keydown handling (see the conditional spread order below).\n const isNativeTabStop = !(draggable && !disabled) && !disabled;\n\n const handleKeyDown = (e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleClick();\n }\n };\n\n const ref = React.useRef(null);\n\n React.useEffect(() => {\n const currentRef = ref.current;\n\n const handleTouchStart = (e) => {\n e.preventDefault(); // Prevent the default touch event behavior\n };\n\n if (currentRef) {\n currentRef.addEventListener('touchstart', handleTouchStart, { passive: false });\n }\n\n return () => {\n if (currentRef) {\n currentRef.removeEventListener('touchstart', handleTouchStart);\n }\n };\n }, []);\n\n const setRefs = (element) => {\n ref.current = element;\n setDragRef(element);\n setDropRef(element);\n };\n\n log('[render], props: ', props);\n\n const style = {\n transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined,\n boxSizing: 'border-box',\n overflow: 'visible',\n padding: 0,\n margin: 0,\n textAlign: 'center',\n pointerEvents: 'auto',\n cursor: disabled ? 'not-allowed' : type === 'target' && hasSelection ? 'pointer' : isDragging ? 'grabbing' : 'grab',\n zIndex: isDragging ? 1000 : 'auto',\n willChange: isDragging ? 'transform' : 'auto',\n };\n\n return (\n <div\n ref={setRefs}\n style={style}\n role={isNativeTabStop ? 'button' : undefined}\n tabIndex={isNativeTabStop ? 0 : undefined}\n onKeyDown={isNativeTabStop ? handleKeyDown : undefined}\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...(draggable && !disabled ? { ...listeners, ...attributes } : {})}\n >\n <TileContent\n label={label}\n id={id}\n empty={empty}\n index={index}\n guideIndex={guideIndex}\n isOver={showsHoverEffect}\n isDragging={isDragging}\n isSelected={isSelected}\n disabled={disabled}\n outcome={outcome}\n type={type}\n />\n </div>\n );\n};\n\nTile.propTypes = {\n id: PropTypes.any,\n label: PropTypes.string,\n isOver: PropTypes.bool,\n type: PropTypes.string,\n empty: PropTypes.bool,\n disabled: PropTypes.bool,\n outcome: PropTypes.string,\n index: PropTypes.number,\n guideIndex: PropTypes.number,\n instanceId: PropTypes.any,\n draggable: PropTypes.bool,\n tileIndex: PropTypes.number,\n selectedChoice: PropTypes.object,\n onChoiceClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nexport default Tile;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/tiler.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\n\nimport Tile from './tile.js';\n\nconst types = {\n choiceLabel: PropTypes.string,\n targetLabel: PropTypes.string,\n disabled: PropTypes.bool,\n tiles: PropTypes.array.isRequired,\n tileSize: PropTypes.string,\n addGuide: PropTypes.bool,\n selectedChoice: PropTypes.object,\n onChoiceClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nconst defaults = {\n tileSize: '1fr',\n disabled: false,\n addGuide: false,\n};\n\nconst buildTiles = (props) => {\n const T = (tile, index) => {\n tile.instanceId = props.instanceId;\n tile.disabled = props.disabled;\n tile.guideIndex = props.addGuide ? tile.index + 1 : undefined;\n // unique key for dnd-kit IDs\n tile.tileIndex = index;\n tile.selectedChoice = props.selectedChoice;\n tile.onChoiceClick = props.onChoiceClick;\n tile.onPlacementClick = props.onPlacementClick;\n\n if (props.includeTargets) {\n return <Tile {...tile} key={index} />;\n } else {\n return tile.type === 'choice' ? <Tile {...tile} key={index} /> : <Tile {...tile} label=\"\" key={index} />;\n }\n };\n\n T.propTypes = { ...types };\n return T;\n};\n\nconst StyledHTilerContainer: any = styled('div')(({ theme, includeTargets }) => ({\n display: 'grid',\n paddingBottom: theme.spacing(2),\n ...(includeTargets && {\n gridGap: '10px',\n }),\n}));\n\nconst StyledChoiceLabel: any = styled('div')({\n textAlign: 'center',\n});\n\nconst StyledTargetLabel: any = styled('div')({\n textAlign: 'center',\n gridRow: '3/4',\n});\n\nconst StyledVTilerContainer: any = styled('div')(({ includeTargets }) => ({\n gridAutoFlow: 'column',\n display: 'grid',\n ...(includeTargets && {\n gridGap: '10px',\n }),\n}));\n\nconst StyledVChoiceLabel: any = styled('div')({\n gridColumn: '1/2',\n textAlign: 'center',\n});\n\nconst StyledVTargetLabel: any = styled('div')({\n gridColumn: '2/3',\n textAlign: 'center',\n});\n\nexport class HorizontalTiler extends React.Component {\n static propTypes = { ...types };\n static defaultProps = { ...defaults };\n render() {\n const { includeTargets, choiceLabelEnabled, choiceLabel, targetLabel, tiles, tileSize } = this.props;\n\n const rows = includeTargets ? `auto ${tileSize} auto ${tileSize}` : `auto ${tileSize} auto`;\n const columns = includeTargets ? tiles.length / 2 : tiles.length;\n\n const style = {\n gridTemplateColumns: includeTargets\n ? `repeat(${columns}, ${tileSize})`\n : `auto repeat(${Math.floor(columns / 2) - 1}, ${tileSize} 10px) ${tileSize} auto`,\n gridTemplateRows: rows,\n };\n\n const labelStyle = {\n gridColumn: `1/${columns + 1}`,\n };\n\n return (\n <StyledHTilerContainer includeTargets={includeTargets} style={style}>\n <StyledChoiceLabel\n style={labelStyle}\n dangerouslySetInnerHTML={{ __html: choiceLabelEnabled ? choiceLabel : '' }}\n />\n {includeTargets && (\n <StyledTargetLabel style={labelStyle} dangerouslySetInnerHTML={{ __html: targetLabel }} />\n )}\n {tiles.map(buildTiles(this.props))}\n </StyledHTilerContainer>\n );\n }\n}\n\nexport class VerticalTiler extends React.Component {\n static propTypes = { ...types };\n static defaultProps = { ...defaults };\n render() {\n const { includeTargets, choiceLabelEnabled, choiceLabel, targetLabel, tiles, tileSize } = this.props;\n\n const columns = includeTargets ? 2 : 1;\n const rows = includeTargets ? tiles.length / 2 : tiles.length;\n\n const style = {\n gridTemplateColumns: `repeat(${columns}, ${tileSize})`,\n gridTemplateRows: includeTargets\n ? `auto repeat(${rows}, ${tileSize})`\n : `auto auto repeat(${Math.floor(rows / 2) - 1}, ${tileSize} 10px) ${tileSize} auto`,\n };\n\n return (\n <StyledVTilerContainer includeTargets={includeTargets} style={style}>\n <StyledVChoiceLabel\n dangerouslySetInnerHTML={{ __html: choiceLabelEnabled ? choiceLabel : '' }}\n />\n\n {includeTargets && <StyledVTargetLabel dangerouslySetInnerHTML={{ __html: targetLabel }} />}\n {tiles.map(buildTiles(this.props))}\n </StyledVTilerContainer>\n );\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/ordering.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { assign, cloneDeep, isEmpty, map } from '@pie-element/shared-lodash';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:ordering');\n\nexport const push = (arr, fromIndex, toIndex) => {\n const movedItem = arr.find((item, index) => index === fromIndex);\n const remainingItems = arr.filter((item, index) => index !== fromIndex);\n\n return [...remainingItems.slice(0, toIndex), movedItem, ...remainingItems.slice(toIndex)];\n};\n\nexport const swap = (arr, fromIndex, toIndex) => {\n log('[swap]', arr, fromIndex, toIndex);\n if (!arr || arr.length <= 1 || fromIndex === undefined || toIndex === undefined) {\n throw new Error(`swap requires a non-empty array, fromIndex, toIndex: ${arr}, ${fromIndex} ${toIndex}`);\n }\n const update = cloneDeep(arr);\n const tmp = arr[toIndex];\n update[toIndex] = update[fromIndex];\n update[fromIndex] = tmp;\n return update;\n};\n\nfunction removeResponse(state, targetTile) {\n const update = cloneDeep(state.response);\n\n if (update[targetTile.index] === targetTile.id) {\n update[targetTile.index] = undefined;\n } else {\n throw new Error(\n `Tried to remove from index: ${targetTile.index}, but the id doesn't match: array: ${update}, target: ${targetTile.id}`,\n );\n }\n return update;\n}\n\nfunction updateResponse(state, from, to) {\n const { response, opts } = state;\n const update = cloneDeep(response);\n if (opts.includeTargets) {\n if (from.type === 'choice' && to.type === 'target') {\n update[to.index] = from.id;\n return update;\n } else if (from.type === 'target' && to.type === 'choice') {\n update[from.index] = undefined;\n return update;\n } else if (from.type === 'target' && to.type === 'target') {\n return swap(response, from.index, to.index);\n } else {\n log('do nothing to the response');\n return response;\n }\n } else {\n const fromIndex = state.response.findIndex((r) => r !== undefined && r === from.id);\n const toIndex = state.response.findIndex((r) => r !== undefined && r === to.id);\n log('fromIndex: ', fromIndex, 'toIndex:', toIndex);\n return push(state.response, fromIndex, toIndex);\n }\n}\n\nfunction buildTiles(choices, response, outcomes, opts) {\n if (opts.includeTargets) {\n const targets = [];\n for (let i = 0; i < response.length; i++) {\n const r = response[i];\n\n const choice = choices.find((c) => r !== undefined && r !== null && c.id === r);\n //TODO: index needs to match too!!\n const outcome = outcomes[i];\n\n const out = Object.assign({ type: 'target', index: i, empty: choice === undefined }, choice, outcome, {\n draggable: choice !== undefined,\n });\n\n targets.push(out);\n }\n\n const processedChoices = choices.map((m) => {\n if (response.indexOf(m.id) !== -1 && !opts.allowSameChoiceInTargets) {\n return {\n type: 'choice',\n id: m.id, // Keep the original choice's id on its vacated gap\n empty: true,\n droppable: true,\n draggable: false,\n };\n } else {\n return Object.assign({}, m, {\n type: 'choice',\n droppable: false,\n draggable: true,\n });\n }\n });\n\n return processedChoices.concat(targets);\n } else {\n return response.reduce((acc, id, index) => {\n const emptyTile = Object.assign(\n { type: 'empty', draggable: false, droppable: true },\n choices.find((m) => m.id === id),\n outcomes[index],\n );\n const choiceTile = Object.assign(\n { type: 'choice', draggable: true, droppable: true },\n choices.find((m) => m.id === id),\n outcomes[index],\n );\n\n if (index === 0) {\n acc.push(emptyTile);\n }\n\n acc.push(choiceTile, emptyTile);\n\n return acc;\n }, []);\n }\n}\n\nexport function buildState(choices, response, outcomes, opts) {\n opts = assign({ includeTargets: true }, opts);\n\n outcomes = outcomes || [];\n response =\n !response || isEmpty(response)\n ? opts.includeTargets\n ? new Array(choices.length)\n : map(choices, (c) => c.id)\n : response;\n return {\n choices,\n response,\n opts,\n outcomes,\n tiles: buildTiles(choices, response, outcomes, opts),\n };\n}\n\nexport function reducer(action, state) {\n switch (action.type) {\n case 'move': {\n const { from, to } = action;\n const response = updateResponse(state, from, to);\n const tiles = buildTiles(state.choices, response, state.outcomes, state.opts);\n return Object.assign({}, state, { response, tiles });\n }\n case 'remove': {\n const { target } = action;\n const response = removeResponse(state, target);\n const tiles = buildTiles(state.choices, response, state.outcomes, state.opts);\n return Object.assign({}, state, { response, tiles });\n }\n }\n return state;\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport const haveSameValuesButDifferentOrder = (arr1, arr2) => {\n if (!Array.isArray(arr1) || !Array.isArray(arr2)) return false;\n if (arr1.length !== arr2.length) return false;\n\n const toSortedJson = (arr) =>\n arr\n .map((item) => JSON.stringify(item))\n .sort();\n\n const sortedArr1 = toSortedJson(arr1);\n const sortedArr2 = toSortedJson(arr2);\n\n const hasSameValues = sortedArr1.every((val, i) => val === sortedArr2[i]);\n const hasSameOrder = arr1.every((item, i) =>\n JSON.stringify(item) === JSON.stringify(arr2[i])\n );\n\n return hasSameValues && !hasSameOrder;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/keyboard-coordinates.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { defaultKeyboardCoordinateGetter, KeyboardCode } from '@dnd-kit/core';\n\n/**\n * Custom keyboard coordinate getter for placement-ordering's Tab-based placement mode\n * (enabled only when the item is configured with `placementArea` / `includeTargets`).\n *\n * Tab/Shift+Tab cycle the dragged choice through the target column's response areas\n * in on-screen order (first target, then the rest in sequence), followed by exactly\n * one source-column stop as a fixed last step before the cycle wraps back to the first\n * target — so picking up a choice always starts the cycle at the first target,\n * regardless of where that choice's own source-column slot happens to sit on screen.\n *\n * Arrow keys are delegated to dnd-kit's own `defaultKeyboardCoordinateGetter` so the\n * pre-existing free-form arrow-key dragging behavior is left completely unchanged.\n *\n * Whichever slot a drag started from — a target the choice was already placed in, or\n * (see below) the choice's own pool slot — stays reachable by Tab as a no-op \"drop it\n * back where it came from\": tile.tsx disables a droppable for the whole duration of\n * its own drag (a self-collision guard for pointer drags), which would otherwise make\n * that exact slot unreachable; that guard is bypassed here specifically for the one\n * droppable matching the active drag's own id. A target slot picked up this way stays\n * in its normal position in the target sequence (it's just another target); nothing\n * special is needed there beyond the bypass itself.\n *\n * The choices column isn't a place a student can choose to relocate an answer within —\n * there's exactly one meaningful \"source\" stop for whichever choice is currently being\n * dragged: its own fixed slot, whether that's the vacated gap left behind (if the\n * choice is already placed in a target — landing back on it returns the choice to the\n * pool, undoing the placement) or the very tile being dragged (if the choice is still\n * sitting there, unplaced — landing back on it is a no-op that effectively cancels the\n * pick-up; the same disabled-droppable bypass applies here too). Every *other*\n * choice-column tile — filled or an empty gap — is excluded from the cycle:\n * `ordering.ts`'s `updateResponse` has no `choice -> choice` case, so they'd be no-op\n * drop targets anyway. Matching is by id (the vacated gap carries its original choice's\n * id specifically so this comparison works), not by type alone.\n */\nexport const closestDroppableKeyboardCoordinates = (event, { active, context, currentCoordinates }) => {\n const { code } = event;\n const isTab = code === 'Tab';\n const isArrow =\n code === KeyboardCode.Down || code === KeyboardCode.Up || code === KeyboardCode.Left || code === KeyboardCode.Right;\n\n if (!isTab && !isArrow) {\n return undefined;\n }\n\n if (isArrow) {\n return defaultKeyboardCoordinateGetter(event, { context, currentCoordinates });\n }\n\n event.preventDefault();\n\n const { droppableRects, droppableContainers, collisionRect, draggableNodes, active: activeObject } = context;\n\n if (!droppableRects || droppableRects.size === 0) {\n return currentCoordinates;\n }\n\n // `currentCoordinates` is the top-left of the dragged item's collision rect (not its\n // center), so derive the dragged item's center in the same frame before comparing it\n // against droppable centers below.\n const draggedHalfSize = {\n x: (collisionRect?.width || 0) / 2,\n y: (collisionRect?.height || 0) / 2,\n };\n const currentCenter = {\n x: currentCoordinates.x + draggedHalfSize.x,\n y: currentCoordinates.y + draggedHalfSize.y,\n };\n\n // dnd-kit's KeyboardCoordinateGetter passes `active` as just the dragged item's\n // UniqueIdentifier (a string) — NOT the full Active object — so `active.data` is\n // always undefined. The active item's own tileData (id/type) has to be looked up via\n // `draggableNodes` instead; reading `active?.data?.current` directly (as this code\n // used to) silently evaluated to `undefined` on every call, which is why the choices\n // column was never actually excluded from the Tab cycle.\n const activeId = draggableNodes?.get(active)?.data?.current?.id;\n // dnd-kit captures this once, at drag start, and never updates it as the item moves\n // — unlike its own live node, whose rendered position tracks wherever Tab has since\n // moved it. Needed below for the slot the drag started from, whichever column that\n // is: it stays disabled (see isOwnDroppable below) for the whole drag, so its live\n // rect is never measured, and its own DOM node — being the one actually moving — is\n // no substitute either.\n const activeInitialRect = activeObject?.rect?.current?.initial;\n // tile.tsx pairs each draggable with a same-shaped droppable id (`drop-` in place of\n // the leading `tile-`) and disables that one droppable for the whole duration of its\n // own drag (a self-collision guard for pointer drags). That guard would otherwise\n // make \"drop it back in the exact place it was picked up from\" unreachable by Tab —\n // whether that place is a choice's own pool slot (not yet placed) or the target slot\n // it was just picked up from (already placed) — so it's bypassed specifically for\n // this one droppable below.\n const ownDropId = typeof active === 'string' ? active.replace(/^tile-/, 'drop-') : undefined;\n\n const targets = [];\n let ownChoiceSlotTarget;\n\n for (const [id, container] of droppableContainers) {\n const containerData = container?.data?.current;\n const isOwnDroppable = id === ownDropId;\n\n if (container?.disabled && !isOwnDroppable) continue;\n\n // Every choice-column tile other than the one matching this drag's own id is\n // excluded (see the doc comment above) — filled or an empty gap, it's a no-op drop\n // target regardless.\n const isOwnChoiceSlot = containerData?.type === 'choice' && containerData?.id === activeId;\n if (containerData?.type === 'choice' && !isOwnChoiceSlot) continue;\n\n // A disabled droppable is never measured into `droppableRects` at all, and for the\n // bypassed own-droppable case, the live DOM node is no substitute either — that\n // node IS the one being dragged, so a fresh read would reflect wherever Tab has\n // moved it, not its true rest position. dnd-kit's own pre-drag snapshot is the fix.\n const rect = (isOwnDroppable ? activeInitialRect : null) || droppableRects.get(id);\n\n if (!rect) continue;\n\n const center = {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n };\n // Land the dragged item's own left edge at the target's left edge, and vertically\n // CENTER the item on the target's own center — not top-align it there. When the\n // dragged item's rendered height differs from the target's, top-aligning the\n // item's edge to the target's center lets it bleed into a neighboring target, and\n // dnd-kit's own area-based collision detection (rectIntersection) can then flag\n // that neighbor as \"over\" (or make the next containment check land ambiguously\n // between two rows) even though the item visually landed on the intended target.\n const dropPosition = {\n x: rect.left,\n y: rect.top + rect.height / 2 - draggedHalfSize.y,\n };\n\n const target = { id, dropPosition, center };\n\n if (isOwnChoiceSlot) {\n ownChoiceSlotTarget = target;\n } else {\n targets.push(target);\n }\n }\n\n if (targets.length === 0 && !ownChoiceSlotTarget) {\n return currentCoordinates;\n }\n\n const reverse = event.shiftKey;\n\n // Sort the real targets by real on-screen position (top to bottom, then left to\n // right), so this works the same whether the tiler is laid out vertically or\n // horizontally. The one source-column stop is a fixed LAST entry instead of being\n // sorted in by its own on-screen position: the choices column sits right beside the\n // targets column, so sorting it in by position would land it wherever its y/x\n // happens to fall among the targets (in practice, next to whichever target it's\n // level with) rather than at a predictable point in the cycle. Anchoring it last\n // means picking a choice up always starts the cycle at the first target, runs\n // through the rest in order, then reaches the source stop, then wraps — matching how\n // the equivalent \"board is always a fixed last stop\" pattern works in\n // drag-in-the-blank and categorize's keyboard-coordinates.ts.\n targets.sort((a, b) => {\n if (Math.abs(a.center.y - b.center.y) > 10) return a.center.y - b.center.y;\n return a.center.x - b.center.x;\n });\n\n if (ownChoiceSlotTarget) {\n targets.push(ownChoiceSlotTarget);\n }\n\n // Find the current target (closest to current coordinates)\n let currentIndex = 0;\n let minDist = Infinity;\n\n for (let i = 0; i < targets.length; i++) {\n const dist = distance(currentCenter, targets[i].center);\n\n if (dist < minDist) {\n minDist = dist;\n currentIndex = i;\n }\n }\n\n const nextIndex = reverse\n ? (currentIndex - 1 + targets.length) % targets.length\n : (currentIndex + 1) % targets.length;\n\n return targets[nextIndex].dropPosition;\n};\n\nconst distance = (a, b) => Math.sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2);\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/placement-ordering.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { difference, isEqual, uniqueId } from '@pie-element/shared-lodash';\nimport { styled } from '@mui/material/styles';\nimport { rectIntersection } from '@dnd-kit/core';\nimport { restrictToParentElement } from '@dnd-kit/modifiers';\n\nimport { Collapsible as CollapsibleImport, color, Feedback as FeedbackImport, hasMedia, hasText, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport Translator from '@pie-lib/translator';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { DragProvider } from '@pie-lib/drag';\n\nimport { HorizontalTiler, VerticalTiler } from './tiler.js';\nimport { buildState, reducer } from './ordering.js';\nimport { haveSameValuesButDifferentOrder } from './utils.js';\nimport { closestDroppableKeyboardCoordinates } from './keyboard-coordinates.js';\n\n// A click that lands right after a real drag gesture ends must be ignored by the\n// click-to-select/click-to-place handlers below, or it would immediately reopen or\n// re-trigger a selection for a drag that just completed.\nconst CLICK_AFTER_DRAG_GUARD_MS = 250;\n\n// Used by onDragEnd below to tell \"dropped back on the exact slot the drag started\n// from\" apart from \"dropped somewhere with no valid target at all\" — both leave\n// dnd-kit's own `over` null (tile.tsx disables a droppable for the whole duration of\n// its own drag, and dnd-kit excludes disabled droppables from collision detection\n// entirely, so the origin slot can never become `over` again — see\n// `enabledDroppableContainers` in dnd-kit's own DndContext), but only the first should\n// be a no-op rather than a removal.\n//\n// dnd-kit gives no id for \"whatever the item is currently over\" once that candidate is\n// disabled, so there's no droppable id to compare against directly. What IS available\n// is `active.rect.current.initial` — and because the draggable and its paired\n// droppable are the same DOM node (see tile.tsx), that rect IS the origin slot's own\n// bounds; nothing else could ever measure there. So checking whether the item's\n// current center still falls inside its own initial rect is exactly equivalent to\n// asking \"does the slot here still hold the same choice id it was picked up from\" —\n// just resolved geometrically, since that's the only id that rect could ever belong to.\nconst isOverOwnOriginSlot = (initialRect, translatedRect) => {\n if (!initialRect || !translatedRect) return false;\n\n const centerX = translatedRect.left + translatedRect.width / 2;\n const centerY = translatedRect.top + translatedRect.height / 2;\n\n return (\n centerX >= initialRect.left &&\n centerX <= initialRect.right &&\n centerY >= initialRect.top &&\n centerY <= initialRect.bottom\n );\n};\n\nconst getKeyboardDragOptions = (includeTargets) =>\n includeTargets\n ? {\n keyboardCoordinateGetter: closestDroppableKeyboardCoordinates,\n keyboardCodes: {\n start: ['Space', 'Enter'],\n cancel: ['Escape'],\n end: ['Space', 'Enter'],\n },\n accessibility: {\n screenReaderInstructions: {\n draggable:\n 'Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel.',\n },\n },\n }\n : {};\n\nconst { translator } = Translator;\n\nconst log = debug('pie-elements:placement-ordering');\n\nconst PlacementOrderingContainer: any = styled('div')({\n color: color.text(),\n backgroundColor: color.background(),\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n boxSizing: 'border-box',\n});\n\n// The interactive region - the choices and answers columns for a vertical item, or the choices and\n// answers rows for a horizontal one - scrolls horizontally when it does not fit the available width.\nconst InteractiveRegion: any = styled('div')({\n // the ancestors centre their children, which shrink-wraps this box to its content. without a\n // definite width it grows with the tiler and the overflow escapes outwards instead of scrolling.\n alignSelf: 'stretch',\n maxWidth: '100%',\n overflowX: 'auto',\n // tiles are dragged by transform, which counts towards scrollable overflow, so leaving this axis\n // scrollable would pop a vertical scrollbar mid-drag\n overflowY: 'hidden',\n});\n\n// keeps the tiler at its natural width, and centred while it still fits\nconst InteractiveRegionContent: any = styled('div')({\n display: 'flex',\n justifyContent: 'center',\n minWidth: 'min-content',\n});\n\nconst StyledPrompt: any = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(1),\n}));\n\nconst StyledNote: any = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(2),\n}));\n\nconst StyledToggle: any = styled(CorrectAnswerToggle)(({ theme }) => ({\n paddingBottom: theme.spacing(1),\n}));\n\nconst StyledCollapsible: any = styled(Collapsible)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n alignSelf: 'flex-start',\n}));\n\nconst OrderingTiler = (props) => {\n const { tiler: Comp, ordering, onDropChoice, onRemoveChoice, ...compProps } = props;\n\n return (\n <Comp\n {...compProps}\n tiles={ordering.tiles}\n onDropChoice={(t, s) => onDropChoice(t, s, ordering)}\n onRemoveChoice={(t) => onRemoveChoice(t, ordering)}\n />\n );\n};\n\nOrderingTiler.propTypes = {\n tiler: PropTypes.func,\n ordering: PropTypes.any,\n onDropChoice: PropTypes.func,\n onRemoveChoice: PropTypes.func,\n};\n\nexport class PlacementOrdering extends React.Component {\n static propTypes = {\n onSessionChange: PropTypes.func.isRequired,\n model: PropTypes.object.isRequired,\n session: PropTypes.oneOfType([PropTypes.array.isRequired, PropTypes.object.isRequired]),\n };\n\n constructor(props) {\n super(props);\n\n this.instanceId = uniqueId();\n\n const { value, needsReset } = this.validateSession(props);\n\n this.state = {\n showingCorrect: false,\n selectedChoice: null,\n };\n this.lastDragEndAt = 0;\n\n const { model } = props || {};\n const { env } = model || {};\n const { mode } = env || {};\n\n if (needsReset && mode === 'gather') {\n this.props.onSessionChange({\n ...props.session,\n value,\n });\n }\n }\n\n toggleCorrect = (showingCorrect) => this.setState({ showingCorrect });\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n validateSession: any = ({ model, session }, areChoicesShuffled = false) => {\n const { config, choices } = model || {};\n const { includeTargets } = config || {};\n const choicesIds = choices.map((c) => c.id);\n\n let { value } = session || {};\n let needsReset;\n\n if (!includeTargets) {\n // Use all choice IDs if choices were shuffled or session is missing/invalid\n const sessionMissing = !value || !value.length;\n if (sessionMissing || areChoicesShuffled) {\n // if there's no value on session in No Targets Mode, we need to set an initial session\n value = choicesIds;\n } else {\n // in No Targets Mode, all choice ids need to be used\n const missingChoiceIds = difference(choicesIds, value);\n // this is the case that handles extra choice ids in session\n const extraChoiceIds = difference(value, choicesIds);\n\n if (missingChoiceIds.length || extraChoiceIds.length) {\n value = choicesIds;\n }\n }\n\n needsReset = !isEqual(session.value, value);\n } else {\n // in Targets Area selected, it's important to check the length of session\n const sessionIsMismatched = value && value.length !== choicesIds.length;\n if (sessionIsMismatched) {\n needsReset = true;\n\n // if choices were added, add value in session\n if (value.length < choicesIds.length) {\n value = value.concat(new Array(choicesIds.length - value.length));\n } else {\n // if choices were removed, make sure to remove from session as well\n value = value.filter((cId) => choicesIds.includes(cId));\n }\n }\n }\n\n if (needsReset) {\n // eslint-disable-next-line no-console\n console.warn('This session is not valid anymore. It will be reset.');\n }\n\n return { value, needsReset };\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { model: nextModel = {} } = nextProps || {};\n const { model: currentModel = {} } = this.props || {};\n const { correctResponse, config, choices: nextChoices = [], env } = nextModel;\n const { includeTargets } = config || {};\n\n const newState = {};\n\n const isLanguageChanged = currentModel.language && currentModel.language !== nextModel.language;\n const isDefaultNote =\n currentModel.note &&\n currentModel.note === translator.t('common:commonCorrectAnswerWithAlternates', { lng: currentModel.language });\n\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (isLanguageChanged && isDefaultNote) {\n currentModel.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: nextModel.language });\n }\n\n if (!correctResponse) {\n newState.showingCorrect = false;\n }\n\n //PD-4924\n // show student choices same order as in model when teacher changes student choices order\n // for cases when student view and instructor view are on same page\n const areChoicesShuffled = haveSameValuesButDifferentOrder(nextChoices, currentModel.choices);\n\n const validatedSession = this.validateSession(nextProps, areChoicesShuffled);\n let { value, needsReset } = validatedSession;\n\n const newSession = {\n ...nextProps.session,\n value,\n };\n const includeTargetsChanged = currentModel.config?.includeTargets !== includeTargets;\n\n if (includeTargets && includeTargetsChanged) {\n needsReset = true;\n\n delete newSession.value;\n }\n\n this.setState(newState, () => {\n const { mode } = env || {};\n\n if (needsReset && mode === 'gather') {\n this.props.onSessionChange(newSession);\n }\n });\n }\n\n onDropChoice: any = (target, source, ordering) => {\n const { onSessionChange, session } = this.props;\n const from = ordering.tiles.find((t) => t.id === source.id && t.type === source.type && t.index === source.index);\n const to = target;\n log('[onDropChoice] ', from, to);\n const update = reducer({ type: 'move', from, to }, ordering);\n const sessionUpdate = Object.assign({}, session, {\n value: update.response,\n });\n\n onSessionChange(sessionUpdate);\n };\n\n onRemoveChoice: any = (target, ordering) => {\n const { onSessionChange, session } = this.props;\n log('[onRemoveChoice]', target);\n const update = reducer({ type: 'remove', target }, ordering);\n const sessionUpdate = Object.assign({}, session, {\n value: update.response,\n });\n onSessionChange(sessionUpdate);\n };\n\n createOrdering: any = () => {\n const { model, session } = this.props;\n const { showingCorrect } = this.state;\n const config = model.config || {\n orientation: 'vertical',\n includeTargets: true,\n };\n const { includeTargets } = config;\n\n return showingCorrect\n ? buildState(\n model.choices,\n model.correctResponse,\n model.correctResponse.map((id) => ({ id, outcome: 'correct' })),\n {\n includeTargets,\n allowSameChoiceInTargets: model.config.allowSameChoiceInTargets,\n },\n )\n : buildState(model.choices, session.value, model.outcomes, {\n includeTargets,\n allowSameChoiceInTargets: model.config.allowSameChoiceInTargets,\n });\n };\n\n onDragEnd: any = (event) => {\n const { over, active } = event;\n const ordering = this.createOrdering();\n\n // A real drag (pointer or keyboard) just ended — whatever mirrored selection it\n // set on start is now resolved, and any click landing immediately after this must\n // not be misread as a fresh selection/placement\n this.cancelSelection();\n this.lastDragEndAt = Date.now();\n\n if (over && active) {\n const draggedItem = active.data.current;\n const droppedOnItem = over.data.current;\n\n if (draggedItem && droppedOnItem && droppedOnItem.type === 'target') {\n this.onDropChoice(droppedOnItem, draggedItem, ordering);\n return;\n }\n\n if (draggedItem && droppedOnItem) {\n this.onDropChoice(droppedOnItem, draggedItem, ordering);\n }\n } else if (!over && active) {\n const draggedItem = active.data.current;\n const returnedToOwnSlot = isOverOwnOriginSlot(active.rect?.current?.initial, active.rect?.current?.translated);\n\n if (draggedItem && draggedItem.type === 'target' && !returnedToOwnSlot) {\n this.onRemoveChoice(draggedItem, ordering);\n }\n }\n };\n\n onDragStart: any = (event) => {\n const { active } = event;\n\n if (active?.data?.current) {\n // A real drag (pointer or keyboard) is itself a selection — mirror it into the\n // same selectedChoice state that click-to-select uses, so the two interaction\n // models can be freely intermixed\n this.selectChoice(active.data.current);\n }\n };\n\n onDragCancel: any = () => {\n this.cancelSelection();\n this.lastDragEndAt = Date.now();\n };\n\n isSameChoice = (a, b) => !!a && !!b && a.type === b.type && a.id === b.id && a.index === b.index;\n\n selectChoice: any = (data) => {\n this.setState({ selectedChoice: data });\n };\n\n // Click-to-select semantics: selecting the currently-selected choice again clears\n // the selection instead of re-selecting it.\n toggleChoiceSelection: any = (data) => {\n this.setState((state) => ({\n selectedChoice: this.isSameChoice(state.selectedChoice, data) ? null : data,\n }));\n };\n\n cancelSelection: any = () => {\n this.setState({ selectedChoice: null });\n };\n\n // If a real dnd-kit drag (started via keyboard Space/Enter) is still live when a\n // click completes the placement below, it needs to be cleanly ended — otherwise\n // dnd-kit would still think a drag is in progress. Escape is already configured as\n // this sensor's cancel key (see getKeyboardDragOptions), and dispatching it as a real\n // DOM KeyboardEvent is how dnd-kit's own document-level listener is reached from\n // outside its sensor. onDragCancel only resets local UI state, not the session, so\n // this is safe to call unconditionally, including when no drag is actually live\n // (dnd-kit simply has no listener attached in that case, and the dispatch is a\n // no-op).\n endAnyLiveKeyboardDrag: any = () => {\n document.dispatchEvent(new KeyboardEvent('keydown', { code: 'Escape', bubbles: true, cancelable: true }));\n };\n\n placeSelectedChoice: any = (targetTileData) => {\n const { selectedChoice } = this.state;\n\n if (!selectedChoice) {\n return;\n }\n\n const ordering = this.createOrdering();\n\n this.onDropChoice(targetTileData, selectedChoice, ordering);\n this.cancelSelection();\n this.endAnyLiveKeyboardDrag();\n this.lastDragEndAt = Date.now();\n };\n\n isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < CLICK_AFTER_DRAG_GUARD_MS;\n\n onChoiceClick: any = (data) => {\n if (this.isClickSoonAfterDragEnd()) {\n return;\n }\n\n this.toggleChoiceSelection(data);\n };\n\n onPlacementClick: any = (targetTileData) => {\n if (this.isClickSoonAfterDragEnd()) {\n return;\n }\n\n this.placeSelectedChoice(targetTileData);\n };\n\n render() {\n const { model } = this.props;\n const {\n correctResponse,\n correctness,\n extraCSSRules,\n prompt,\n rationale,\n feedback,\n config: configs,\n note,\n showNote,\n env,\n disabled,\n teacherInstructions,\n language,\n } = model;\n const showToggle = correctResponse && correctResponse.length > 0;\n const { showingCorrect } = this.state;\n const config = configs || {\n orientation: 'vertical',\n includeTargets: true,\n };\n const { orientation, includeTargets } = config;\n const vertical = orientation === 'vertical';\n const ordering = this.createOrdering();\n const { mode, role } = env || {};\n\n const Tiler = vertical ? VerticalTiler : HorizontalTiler;\n const displayNote = (showingCorrect || (mode === 'view' && role === 'instructor')) && showNote && note;\n const showRationale = rationale && (hasText(rationale) || hasMedia(rationale));\n const showTeacherInstructions =\n teacherInstructions && (hasText(teacherInstructions) || hasMedia(teacherInstructions));\n\n const containerStyle = {\n color: color.text(),\n backgroundColor: color.background(),\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n boxSizing: 'border-box',\n width: '100%',\n };\n\n const clickPlacementProps = includeTargets\n ? {\n selectedChoice: this.state.selectedChoice,\n onChoiceClick: this.onChoiceClick,\n onPlacementClick: this.onPlacementClick,\n }\n : {};\n\n return (\n <DragProvider\n onDragStart={this.onDragStart}\n onDragEnd={this.onDragEnd}\n onDragCancel={this.onDragCancel}\n collisionDetection={rectIntersection}\n modifiers={[restrictToParentElement]}\n {...getKeyboardDragOptions(includeTargets)}\n >\n <PlacementOrderingContainer>\n <UiLayout extraCSSRules={extraCSSRules} style={containerStyle}>\n {showTeacherInstructions && (\n <StyledCollapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n className=\"collapsible\"\n >\n <PreviewPrompt prompt={teacherInstructions} />\n </StyledCollapsible>\n )}\n\n <StyledPrompt>\n <PreviewPrompt prompt={prompt} />\n </StyledPrompt>\n\n <StyledToggle\n show={showToggle}\n toggled={showingCorrect}\n onToggle={this.toggleCorrect}\n language={language}\n />\n\n <InteractiveRegion>\n <InteractiveRegionContent>\n <OrderingTiler\n instanceId={this.instanceId}\n choiceLabel={config.choiceLabel}\n targetLabel={config.targetLabel}\n ordering={ordering}\n tiler={Tiler}\n disabled={disabled}\n addGuide={config.showOrdering}\n tileSize={config.tileSize}\n includeTargets={includeTargets}\n choiceLabelEnabled={model.config && model.config.choiceLabelEnabled}\n {...clickPlacementProps}\n />\n </InteractiveRegionContent>\n </InteractiveRegion>\n\n {displayNote && <StyledNote dangerouslySetInnerHTML={{ __html: note }} />}\n\n {showRationale && (\n <StyledCollapsible\n labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}\n className=\"collapsible\"\n >\n <PreviewPrompt prompt={rationale} />\n </StyledCollapsible>\n )}\n\n {!showingCorrect && <Feedback correctness={correctness} feedback={feedback} />}\n </UiLayout>\n </PlacementOrderingContainer>\n </DragProvider>\n );\n }\n}\n\nexport default PlacementOrdering;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/main.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport PlacementOrdering from './placement-ordering.js';\n\nclass Main extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n session: PropTypes.oneOfType([PropTypes.array.isRequired, PropTypes.object.isRequired]),\n onSessionChange: PropTypes.func.isRequired,\n };\n\n render() {\n const { model, session, onSessionChange } = this.props;\n\n return (\n <PlacementOrdering model={model} session={session} onSessionChange={onSessionChange} />\n );\n }\n}\n\nexport default Main;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { compact } from '@pie-element/shared-lodash';\nimport debug from 'debug';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport { SessionChangedEvent } from '@pie-element/shared-player-events';\nimport Main from './main.js';\n\nconst log = debug('pie-elements:placement-ordering');\n\nexport const isValidSession = ({ model, session }) => {\n const { config } = model;\n\n const compactSessionValues = (session && compact(session.value)) || [];\n const completeSession = compactSessionValues.length === model.choices.length;\n\n // if it includes targets, it doesn't have to contain all the choices selected (eg: only 2 targets were filled)\n // but if it does not include targets, it's a must to have all choices selected\n return config.includeTargets || completeSession;\n};\n\nexport default class Ordering extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n }\n\n _scheduleMathRender: any = () => {\n if (this._mathRenderPending) return;\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n }\n renderMath(this);\n this._mathRenderPending = false;\n setTimeout(() => {\n if (this._mathObserver) {\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n this._mathObserver = new MutationObserver(this._scheduleMathRender);\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n isComplete = (value) => value && compact(value).length === this._model.completeLength;\n\n sessionChange: any = (session) => {\n this._session.value = session.value;\n this.render();\n this.dispatchEvent(\n new SessionChangedEvent(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)),\n );\n };\n\n set model(newModel) {\n this._model = newModel;\n\n this.render();\n this.dispatchEvent(\n new CustomEvent('model-set', {\n bubbles: true,\n detail: {\n complete: false,\n },\n }),\n );\n }\n\n set session(newSession) {\n this._session = newSession;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n render() {\n if (this._model && this._session) {\n log('[render] session: ', this._session.value);\n log('[render] model: ', this._model);\n\n this._initMathObserver();\n\n const element = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onSessionChange: this.sessionChange,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n }\n\n connectedCallback() {\n this._initMathObserver();\n this.render();\n }\n\n disconnectedCallback() {\n this._disconnectMathObserver();\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"x_google_ignoreList":[1,5],"mappings":";;;;;;;;;CACQ,MAAM,UAAU,YAAY;CACnC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG,GAAG;EACpB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;IACX,UAAU;GACX;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD;IAAG,KAAI,MAAM,UAAU,YAAY;CAClC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG;EACjB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;GACZ;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD;ACPA,SAAS,GAAuB,GAAW,GAAM,GAAc;CAC7D,IAAM,IAAQ,EAAE,GAAG,EACnB;CAcA,OAZI,EA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