@coxwave/tap-sdk 0.0.9 → 0.0.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/index.css CHANGED
@@ -1,2 +1,2 @@
1
- @keyframes _1mlv4me0{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes _1mlv4me1{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(30px);display:none}}._1mlv4me2{opacity:0;transform:translateY(30px);transition:opacity .4s ease,transform .4s ease;pointer-events:none;display:none}._1mlv4me3{animation:_1mlv4me0 .4s ease forwards;pointer-events:auto}._1mlv4me4{animation:_1mlv4me1 .4s ease forwards;pointer-events:none}._1mlv4me5{border:none!important}@keyframes wtjce00{0%{opacity:1;pointer-events:auto}50%{opacity:1}to{opacity:0}}.wtjce01{pointer-events:none;opacity:0;display:flex;position:absolute;width:max-content;top:calc(100% + 5px);right:0;flex-direction:column;justify-content:center;align-items:flex-end;padding-top:2px;cursor:pointer;z-index:999;transition:opacity .3s ease}.wtjce02{pointer-events:auto;animation:wtjce00 18s forwards}.wtjce03{opacity:0;pointer-events:none;animation:none}.wtjce04{display:flex;justify-content:flex-end;border-radius:var(--Radius-radiusSM, 8px);width:max-content;gap:5px}.wtjce05{display:flex;padding:8px 12px 6px;justify-content:flex-end;align-items:center;border-radius:var(--Radius-radiusSM, 8px);max-width:340px}.wtjce06{background-color:#171b1f}.wtjce07{background-color:#fa6b4b}.wtjce08{color:#fff;text-align:right;font-family:Pretendard;font-size:14px;font-style:normal;font-weight:400;line-height:20px;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word}.wtjce09{display:flex;padding:0 23px;align-items:flex-start;gap:10px}.wtjce0a{width:15px}.wtjce0b{color:#171b1f}.wtjce0c{color:#fa6b4b}.wtjce0d{cursor:pointer;justify-content:center;align-items:center;width:20px;height:20px;border-radius:100px;z-index:999;transition:all .2s ease}.wtjce0d:hover{width:63px;left:-72px}.wtjce04:hover .wtjce0d{display:flex}.wtjce0e,.wtjce0f{display:none;background-color:#171b1f}.wtjce0g{color:#fff}.wtjce0d:hover .wtjce0g{display:none}.wtjce0h{color:#fff;text-align:center;font-family:Pretendard;font-size:12px;font-style:normal;font-weight:400;line-height:20px;display:none}.wtjce0d:hover .wtjce0h{display:block}.wu2gm60{width:100%;min-width:max-content;table-layout:auto;border-collapse:separate;border-spacing:0;border:.4px solid rgba(118,118,128,.12);border-radius:8px;overflow:auto;background-color:#fff;cursor:pointer}.wu2gm61{border:.4px solid rgba(118,118,128,.12);padding:10px;background-color:#f2f2f2;text-align:left;font-family:Pretendard;color:#090909;font-size:12px;font-weight:500;white-space:normal;overflow-wrap:break-word;word-break:break-word}.wu2gm62{border:.4px solid rgba(118,118,128,.12);padding:10px;color:#090909;font-family:Pretendard;font-size:12px;font-weight:400;width:fit-content;max-width:400px;white-space:normal;overflow-wrap:break-word;word-break:break-word}.wu2gm63{position:relative;background-color:#fafafa;border-radius:8px;padding:8px;overflow-y:auto}.wu2gm64{display:flex;align-items:center;justify-content:space-between;padding-bottom:4px}.wu2gm65{color:#4a5568;padding:2px 6px;font-size:12px;border-radius:4px;z-index:10;font-family:Pretendard}.wu2gm66{z-index:10;cursor:pointer;display:flex;align-items:center;width:max-content;color:#4a5568;padding:2px 6px;font-size:12px;border:none;font-family:Pretendard}.wu2gm67{white-space:nowrap}.wu2gm68{display:flex;width:12px;height:12px;margin-bottom:4px;color:#4a5568;flex-shrink:0}
1
+ @keyframes _16e62km0{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes _16e62km1{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(30px);display:none}}._16e62km2{opacity:0;transform:translateY(30px);transition:opacity .4s ease,transform .4s ease;pointer-events:none;display:none}._16e62km3{animation:_16e62km0 .4s ease forwards;pointer-events:auto}._16e62km4{animation:_16e62km1 .4s ease forwards;pointer-events:none}._16e62km5{border:none!important}@keyframes wtjce00{0%{opacity:1;pointer-events:auto}50%{opacity:1}to{opacity:0}}.wtjce01{pointer-events:none;opacity:0;display:flex;position:absolute;width:max-content;top:calc(100% + 5px);right:0;flex-direction:column;justify-content:center;align-items:flex-end;padding-top:2px;cursor:pointer;z-index:999;transition:opacity .3s ease}.wtjce02{pointer-events:auto;animation:wtjce00 18s forwards}.wtjce03{opacity:0;pointer-events:none;animation:none}.wtjce04{display:flex;justify-content:flex-end;border-radius:var(--Radius-radiusSM, 8px);width:max-content;gap:5px}.wtjce05{display:flex;padding:8px 12px 6px;justify-content:flex-end;align-items:center;border-radius:var(--Radius-radiusSM, 8px);max-width:340px}.wtjce06{background-color:#171b1f}.wtjce07{background-color:#fa6b4b}.wtjce08{color:#fff;text-align:right;font-family:Pretendard;font-size:14px;font-style:normal;font-weight:400;line-height:20px;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word}.wtjce09{display:flex;padding:0 23px;align-items:flex-start;gap:10px}.wtjce0a{width:15px}.wtjce0b{color:#171b1f}.wtjce0c{color:#fa6b4b}.wtjce0d{cursor:pointer;justify-content:center;align-items:center;width:20px;height:20px;border-radius:100px;z-index:999;transition:all .2s ease}.wtjce0d:hover{width:63px;left:-72px}.wtjce04:hover .wtjce0d{display:flex}.wtjce0e,.wtjce0f{display:none;background-color:#171b1f}.wtjce0g{color:#fff}.wtjce0d:hover .wtjce0g{display:none}.wtjce0h{color:#fff;text-align:center;font-family:Pretendard;font-size:12px;font-style:normal;font-weight:400;line-height:20px;display:none}.wtjce0d:hover .wtjce0h{display:block}._1mnmljf0{width:100%;min-width:max-content;table-layout:auto;border-collapse:separate;border-spacing:0;border:.4px solid rgba(118,118,128,.12);border-radius:8px;overflow:auto;background-color:#fff;cursor:pointer}._1mnmljf1{border:.4px solid rgba(118,118,128,.12);padding:10px;background-color:#f2f2f2;text-align:left;font-family:Pretendard;color:#090909;font-size:12px;font-weight:500;white-space:normal;overflow-wrap:break-word;word-break:break-word}._1mnmljf2{border:.4px solid rgba(118,118,128,.12);padding:10px;color:#090909;font-family:Pretendard;font-size:12px;font-weight:400;width:fit-content;max-width:400px;white-space:normal;overflow-wrap:break-word;word-break:break-word}._1mnmljf3{position:relative;background-color:#fafafa;border-radius:8px;padding:8px;overflow-y:auto}._1mnmljf4{display:flex;align-items:center;justify-content:space-between;padding-bottom:4px}._1mnmljf5{color:#4a5568;padding:2px 6px;font-size:12px;border-radius:4px;z-index:10;font-family:Pretendard}._1mnmljf6{z-index:10;cursor:pointer;display:flex;align-items:center;width:max-content;color:#4a5568;padding:2px 6px;font-size:12px;border:none;font-family:Pretendard}._1mnmljf7{white-space:nowrap}._1mnmljf8{display:flex;width:12px;height:12px;margin-bottom:4px;color:#4a5568;flex-shrink:0}._1mnmljf9{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0006;z-index:10000002}._1mnmljfa{position:fixed;display:flex;flex-direction:column;width:max-content;max-width:calc(100vw - 100px);overflow:auto;background:#fff;padding:20px;border:1px solid #ccc;box-shadow:0 4px 20px #0003;z-index:10000003;border-radius:8px}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["vanilla-extract-css-ns:chatBody/chatBody.css.ts.vanilla.css?source=QGtleWZyYW1lcyBfMW1sdjRtZTAgewogIGZyb20gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9Cn0KQGtleWZyYW1lcyBfMW1sdjRtZTEgewogIGZyb20gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICAgIGRpc3BsYXk6IG5vbmU7CiAgfQp9Ci5fMW1sdjRtZTIgewogIG9wYWNpdHk6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yUGAAA="],"sourcesContent":["@keyframes _1mlv4me0 {\n from {\n opacity: 0;\n transform: translateY(30px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n@keyframes _1mlv4me1 {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(30px);\n display: none;\n }\n}\n._1mlv4me2 {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.4s ease, transform 0.4s ease;\n pointer-events: none;\n display: none;\n}\n._1mlv4me3 {\n animation: _1mlv4me0 0.4s ease forwards;\n pointer-events: auto;\n}\n._1mlv4me4 {\n animation: _1mlv4me1 0.4s ease forwards;\n pointer-events: none;\n}\n._1mlv4me5 {\n border: none !important;\n}","@keyframes wtjce00 {\n 0% {\n opacity: 1;\n pointer-events: auto;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n.wtjce01 {\n pointer-events: none;\n opacity: 0;\n display: flex;\n position: absolute;\n width: max-content;\n top: calc(100% + 5px);\n right: 0;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n padding-top: 2px;\n cursor: pointer;\n z-index: 999;\n transition: opacity 0.3s ease;\n}\n.wtjce02 {\n pointer-events: auto;\n animation: wtjce00 18s forwards;\n}\n.wtjce03 {\n opacity: 0;\n pointer-events: none;\n animation: none;\n}\n.wtjce04 {\n display: flex;\n justify-content: flex-end;\n border-radius: var(--Radius-radiusSM, 8px);\n width: max-content;\n gap: 5px;\n}\n.wtjce05 {\n display: flex;\n padding: 8px 12px 6px 12px;\n justify-content: flex-end;\n align-items: center;\n border-radius: var(--Radius-radiusSM, 8px);\n max-width: 340px;\n}\n.wtjce06 {\n background-color: #171B1F;\n}\n.wtjce07 {\n background-color: #FA6B4B;\n}\n.wtjce08 {\n color: #fff;\n text-align: right;\n font-family: Pretendard;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n white-space: pre-wrap;\n word-break: keep-all;\n overflow-wrap: break-word;\n}\n.wtjce09 {\n display: flex;\n padding: 0px 23px;\n align-items: flex-start;\n gap: 10px;\n}\n.wtjce0a {\n width: 15px;\n}\n.wtjce0b {\n color: #171B1F;\n}\n.wtjce0c {\n color: #FA6B4B;\n}\n.wtjce0d {\n cursor: pointer;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100px;\n z-index: 999;\n transition: all 0.2s ease;\n}\n.wtjce0d:hover {\n width: 63px;\n left: -72px;\n}\n.wtjce04:hover .wtjce0d {\n display: flex;\n}\n.wtjce0e {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0f {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0g {\n color: white;\n}\n.wtjce0d:hover .wtjce0g {\n display: none;\n}\n.wtjce0h {\n color: #fff;\n text-align: center;\n font-family: Pretendard;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n display: none;\n}\n.wtjce0d:hover .wtjce0h {\n display: block;\n}",".wu2gm60 {\n width: 100%;\n min-width: max-content;\n table-layout: auto;\n border-collapse: separate;\n border-spacing: 0;\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n border-radius: 8px;\n overflow: auto;\n background-color: #fff;\n cursor: pointer;\n}\n.wu2gm61 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n background-color: #f2f2f2;\n text-align: left;\n font-family: Pretendard;\n color: #090909;\n font-size: 12px;\n font-weight: 500;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n.wu2gm62 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n color: #090909;\n font-family: Pretendard;\n font-size: 12px;\n font-weight: 400;\n width: fit-content;\n max-width: 400px;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n.wu2gm63 {\n position: relative;\n background-color: rgb(250, 250, 250);\n border-radius: 8px;\n padding: 8px;\n overflow-y: auto;\n}\n.wu2gm64 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 4px;\n}\n.wu2gm65 {\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border-radius: 4px;\n z-index: 10;\n font-family: Pretendard;\n}\n.wu2gm66 {\n z-index: 10;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: max-content;\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border: none;\n font-family: Pretendard;\n}\n.wu2gm67 {\n white-space: nowrap;\n}\n.wu2gm68 {\n display: flex;\n width: 12px;\n height: 12px;\n margin-bottom: 4px;\n color: #4a5568;\n flex-shrink: 0;\n}"],"mappings":"AAAA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,KACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACF,CACA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,MACtB,QAAS,IACX,CACF,CACA,CAAC,UACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,QAAQ,IAAK,IAAI,CAAE,UAAU,IAAK,KAC9C,eAAgB,KAChB,QAAS,IACX,CACA,CAAC,UACC,UAAW,UAAU,IAAK,KAAK,SAC/B,eAAgB,IAClB,CACA,CAAC,UACC,UAAW,UAAU,IAAK,KAAK,SAC/B,eAAgB,IAClB,CACA,CAAC,UACC,OAAQ,cACV,CCtCA,WAAW,QACT,GACE,QAAS,EACT,eAAgB,IAClB,CACA,IACE,QAAS,CACX,CACA,GACE,QAAS,CACX,CACF,CACA,CAAC,QACC,eAAgB,KAChB,QAAS,EACT,QAAS,KACT,SAAU,SACV,MAAO,YACP,IAAK,KAAK,KAAK,EAAE,KACjB,MAAO,EACP,eAAgB,OAChB,gBAAiB,OACjB,YAAa,SACb,YAAa,IACb,OAAQ,QACR,QAAS,IACT,WAAY,QAAQ,IAAK,IAC3B,CACA,CAAC,QACC,eAAgB,KAChB,UAAW,QAAQ,IAAI,QACzB,CACA,CAAC,QACC,QAAS,EACT,eAAgB,KAChB,UAAW,IAC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,KAClB,OAAQ,OACV,CACA,CAAC,QACC,OAAQ,KAAM,MAAM,KAAK,GAAG,CAAE,GAAG,CAAE,GAAG,CAAE,KAb1C,QAcW,KACT,iBAAkB,QAClB,WAAY,KACZ,YAAa,WACb,MAAO,QACP,UAAW,KACX,YAAa,IACb,YAAa,OACb,cAAe,WACf,WAAY,UACd,CACA,CAAC,QACC,OAAQ,KAAM,MAAM,KAAK,GAAG,CAAE,GAAG,CAAE,GAAG,CAAE,KA1B1C,QA2BW,KACT,MAAO,QACP,YAAa,WACb,UAAW,KACX,YAAa,IACb,MAAO,YACP,UAAW,MACX,YAAa,OACb,cAAe,WACf,WAAY,UACd,CACA,CAAC,QACC,SAAU,SACV,iBAAkB,QAxCpB,cAyCiB,IAzCjB,QA0CW,IACT,WAAY,IACd,CACA,CAAC,QACC,QAAS,KACT,YAAa,OACb,gBAAiB,cACjB,eAAgB,GAClB,CACA,CAAC,QACC,MAAO,QApDT,QAqDW,IAAI,IACb,UAAW,KAtDb,cAuDiB,IACf,QAAS,GACT,YAAa,UACf,CACA,CAAC,QACC,QAAS,GACT,OAAQ,QACR,QAAS,KACT,YAAa,OACb,MAAO,YACP,MAAO,QAjET,QAkEW,IAAI,IACb,UAAW,KACX,OAAQ,KACR,YAAa,UACf,CACA,CAAC,QACC,YAAa,MACf,CACA,CAAC,QACC,QAAS,KACT,MAAO,KACP,OAAQ,KACR,cAAe,IACf,MAAO,QACP,YAAa,CACf","names":[]}
1
+ {"version":3,"sources":["vanilla-extract-css-ns:ui/container/container.css.ts.vanilla.css?source=QGtleWZyYW1lcyBfMTZlNjJrbTAgewogIGZyb20gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9Cn0KQGtleWZyYW1lcyBfMTZlNjJrbTEgewogIGZyb20gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICAgIGRpc3BsYXk6IG5vbmU7CiAgfQp9Ci5fMTZlNjJrbTIgewogIG9wYWNpdHk6IDA7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVZKDMwcHgpOwogIHRyYW5zaXRpb246IG9wYWNpdHkgMC40cyBlYXNlLCB0cmFuc2Zvcm0gMC40cyBlYXNlOwogIHBvaW50ZXItZXZlbnRzOiBub25lOwogIGRpc3BsYXk6IG5vbmU7Cn0KLl8xNmU2MmttMyB7CiAgYW5pbWF0aW9uOiBfMTZlNjJrbTAgMC40cyBlYXNlIGZvcndhcmRzOwogIHBvaW50ZXItZXZlbnRzOiBhdXRvOwp9Ci5fMTZlNjJrbTQgewogIGFuaW1hdGlvbjogXzE2ZTYya20xIDAuNHMgZWFzZSBmb3J3YXJkczsKICBwb2ludGVyLWV2ZW50czogbm9uZTsKfQouXzE2ZTYya201IHsKICBib3JkZXI6IG5vbmUgIWltcG9ydGFudDsKfQ==","vanilla-extract-css-ns:ui/button/alarm/styles/alarm.css.ts.vanilla.css?source=#H4sIAAAAAAAAE61UwW7bMAy95ysIDAM6rCpsJ00b5bL10NuAYfsCxaJjNbJkSHLtdOi/D5LtxI6TtRt2SsxHUo/vUfqyw31mWIEWaveUYhTBrxlA9DH8AOiSpcLtKcTr8F1qoRwags+onKXAKqc98joDuL1Q5bE4moJRC77Obtqj45BweoLSCn3iuIwLW0q2p5BJbNahzAontKLANlbLyoWiWnCXUyhYQ1KtHCrno06XFFIm06tA6zPcls0nDxixzV13gm9MuDCYtm1TLatCeeSpsk5k+74jhRQ9Yw8xKbaKCIeFbakRVDzQY5wLtSXh6KQMlNPKWG1oP7EPvRChODYUVqtVYGqY6ufqBIDoZm4BmcX1UbrkrHS9OUyJgrVNepPjewuZNjUz3A76zEO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YlBIDGuC6IhwWNUMMuzlD/DU1E4Up5EyBoEWkqJrEdUkOEm1c7pikHgMk3jbEG+saMK3291+Bjo2HewmdZuX8iLjpLe+EKFy7LxiPlTHBMcu4LhY+O7Af52Z5eb3l3l6vSn8akrf+8Y8l6tX52zWfrngYz8f4h+G0zK+V9yWQs2rupSe347UByvUc+jbk8APF4IvRIfhsDhthh7ve9zw93y/HNsZIEqPh/kZYX07oWsYvpvk7kIV4RPP4PBrcN5RE3LKhcWsn5lp2VTqetEnTSTjMrsNOQDxMEx399kldL5+zlKhc1FEb330Jsuy3uNZ57nfkvrqhDUjL2Fs4kVS7q/1kdffyFbefPEHAAA="],"sourcesContent":["@keyframes _16e62km0 {\n from {\n opacity: 0;\n transform: translateY(30px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n@keyframes _16e62km1 {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(30px);\n display: none;\n }\n}\n._16e62km2 {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.4s ease, transform 0.4s ease;\n pointer-events: none;\n display: none;\n}\n._16e62km3 {\n animation: _16e62km0 0.4s ease forwards;\n pointer-events: auto;\n}\n._16e62km4 {\n animation: _16e62km1 0.4s ease forwards;\n pointer-events: none;\n}\n._16e62km5 {\n border: none !important;\n}","@keyframes wtjce00 {\n 0% {\n opacity: 1;\n pointer-events: auto;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n.wtjce01 {\n pointer-events: none;\n opacity: 0;\n display: flex;\n position: absolute;\n width: max-content;\n top: calc(100% + 5px);\n right: 0;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n padding-top: 2px;\n cursor: pointer;\n z-index: 999;\n transition: opacity 0.3s ease;\n}\n.wtjce02 {\n pointer-events: auto;\n animation: wtjce00 18s forwards;\n}\n.wtjce03 {\n opacity: 0;\n pointer-events: none;\n animation: none;\n}\n.wtjce04 {\n display: flex;\n justify-content: flex-end;\n border-radius: var(--Radius-radiusSM, 8px);\n width: max-content;\n gap: 5px;\n}\n.wtjce05 {\n display: flex;\n padding: 8px 12px 6px 12px;\n justify-content: flex-end;\n align-items: center;\n border-radius: var(--Radius-radiusSM, 8px);\n max-width: 340px;\n}\n.wtjce06 {\n background-color: #171B1F;\n}\n.wtjce07 {\n background-color: #FA6B4B;\n}\n.wtjce08 {\n color: #fff;\n text-align: right;\n font-family: Pretendard;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n white-space: pre-wrap;\n word-break: keep-all;\n overflow-wrap: break-word;\n}\n.wtjce09 {\n display: flex;\n padding: 0px 23px;\n align-items: flex-start;\n gap: 10px;\n}\n.wtjce0a {\n width: 15px;\n}\n.wtjce0b {\n color: #171B1F;\n}\n.wtjce0c {\n color: #FA6B4B;\n}\n.wtjce0d {\n cursor: pointer;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100px;\n z-index: 999;\n transition: all 0.2s ease;\n}\n.wtjce0d:hover {\n width: 63px;\n left: -72px;\n}\n.wtjce04:hover .wtjce0d {\n display: flex;\n}\n.wtjce0e {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0f {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0g {\n color: white;\n}\n.wtjce0d:hover .wtjce0g {\n display: none;\n}\n.wtjce0h {\n color: #fff;\n text-align: center;\n font-family: Pretendard;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n display: none;\n}\n.wtjce0d:hover .wtjce0h {\n display: block;\n}","._1mnmljf0 {\n width: 100%;\n min-width: max-content;\n table-layout: auto;\n border-collapse: separate;\n border-spacing: 0;\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n border-radius: 8px;\n overflow: auto;\n background-color: #fff;\n cursor: pointer;\n}\n._1mnmljf1 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n background-color: #f2f2f2;\n text-align: left;\n font-family: Pretendard;\n color: #090909;\n font-size: 12px;\n font-weight: 500;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n._1mnmljf2 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n color: #090909;\n font-family: Pretendard;\n font-size: 12px;\n font-weight: 400;\n width: fit-content;\n max-width: 400px;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n._1mnmljf3 {\n position: relative;\n background-color: rgb(250, 250, 250);\n border-radius: 8px;\n padding: 8px;\n overflow-y: auto;\n}\n._1mnmljf4 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 4px;\n}\n._1mnmljf5 {\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border-radius: 4px;\n z-index: 10;\n font-family: Pretendard;\n}\n._1mnmljf6 {\n z-index: 10;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: max-content;\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border: none;\n font-family: Pretendard;\n}\n._1mnmljf7 {\n white-space: nowrap;\n}\n._1mnmljf8 {\n display: flex;\n width: 12px;\n height: 12px;\n margin-bottom: 4px;\n color: #4a5568;\n flex-shrink: 0;\n}\n._1mnmljf9 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: rgba(0, 0, 0, 0.4);\n z-index: 10000002;\n}\n._1mnmljfa {\n position: fixed;\n display: flex;\n flex-direction: column;\n width: max-content;\n max-width: calc(100vw - 100px);\n overflow: auto;\n background: #fff;\n padding: 20px;\n border: 1px solid #ccc;\n box-shadow: 0 4px 20px rgba(0,0,0,0.2);\n z-index: 10000003;\n border-radius: 8px;\n}"],"mappings":"AAAA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,KACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACF,CACA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,MACtB,QAAS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AAgB,GAClB,CACA,CAAC,UACC,MAAO,QApDT,QAqDW,IAAI,IACb,UAAW,KAtDb,cAuDiB,IACf,QAAS,GACT,YAAa,UACf,CACA,CAAC,UACC,QAAS,GACT,OAAQ,QACR,QAAS,KACT,YAAa,OACb,MAAO,YACP,MAAO,QAjET,QAkEW,IAAI,IACb,UAAW,KACX,OAAQ,KACR,YAAa,UACf,CACA,CAAC,UACC,YAAa,MACf,CACA,CAAC,UACC,QAAS,KACT,MAAO,KACP,OAAQ,KACR,cAAe,IACf,MAAO,QACP,YAAa,CACf,CACA,CAAC,UACC,SAAU,MACV,IAAK,EACL,KAAM,EACN,MAAO,MACP,OAAQ,MACR,WAAY,MACZ,QAAS,QACX,CACA,CAAC,UACC,SAAU,MACV,QAAS,KACT,eAAgB,OAChB,MAAO,YACP,UAAW,KAAK,MAAM,EAAE,OACxB,SAAU,KACV,WAAY,KAlGd,QAmGW,KACT,OAAQ,IAAI,MAAM,KAClB,WAAY,EAAE,IAAI,KAAK,MACvB,QAAS,SAtGX,cAuGiB,GACjB","names":[]}
package/dist/index.d.cts CHANGED
@@ -45,12 +45,43 @@ declare class EventLogger {
45
45
  logSDKInitialization(success: boolean, startTime: number, error?: string): void;
46
46
  }
47
47
 
48
+ type TapSDKConfig = {
49
+ apiKey: string;
50
+ };
51
+ type TapSDKInitParams = {
52
+ buttonId: string;
53
+ course: Course;
54
+ container?: ContainerStyle;
55
+ };
56
+ type Course = {
57
+ userId: string;
58
+ courseId: string;
59
+ clipId: string;
60
+ clipPlayHead?: number;
61
+ };
62
+ type ContainerStyle = {
63
+ position?: PositionType;
64
+ width?: string;
65
+ height?: string;
66
+ borderRadius?: string;
67
+ };
68
+ type PositionType = {
69
+ top?: string;
70
+ left?: string;
71
+ right?: string;
72
+ bottom?: string;
73
+ };
74
+
75
+ type SeekTimelineParamsType = {
76
+ clipId: string;
77
+ clipPlayHead: number;
78
+ };
79
+
48
80
  type ToTapMessage = ChatInitMessage | ChatOpenMessage | ChatCloseMessage | TimelineSeekMessage | AlarmClickMessage | PopUpCloseMessage | PdfEnlargedMessage | PdfShrinkedMessage;
49
81
  type FromTapMessage = ChatInitiatedMessage | ChatOpenedMessage | ChatClosedMessage | AlarmFadeInMessage | PopUpOpenMessage | PdfOpenMessage | PdfCloseMessage | TimelineSeekMessage;
50
82
  interface ChatInitConfig {
51
- chatApiParams: any;
52
- customStyles?: any;
53
- apiUrl?: string | undefined;
83
+ course: Course;
84
+ container?: ContainerStyle;
54
85
  }
55
86
  declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
56
87
  #private;
@@ -92,35 +123,6 @@ declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
92
123
  static defaultHandshakeOptions: HandshakeOptions;
93
124
  }
94
125
 
95
- type TapSDKConfig = {
96
- apiKey: string;
97
- };
98
- type Course = {
99
- userId: string;
100
- courseId: string | null;
101
- clipId: string | null;
102
- };
103
- type CustomStyles = {
104
- chatBody?: ChatBodyStyle;
105
- };
106
- type ChatBodyStyle = {
107
- position?: PositionType;
108
- width?: string;
109
- height?: string;
110
- borderRadius?: string;
111
- };
112
- type PositionType = {
113
- top?: string;
114
- left?: string;
115
- right?: string;
116
- bottom?: string;
117
- };
118
-
119
- type SeekTimelineParamsType = {
120
- clipId: string;
121
- clipPlayHead: number;
122
- };
123
-
124
126
  declare class EventManager {
125
127
  private iframeBridge;
126
128
  constructor(iframeBridge: TapIframeBridge);
@@ -149,16 +151,14 @@ declare class EventManager {
149
151
  * ```
150
152
  */
151
153
  declare class TapSDK {
152
- #private;
153
154
  private apiKey;
154
155
  private iframeBridge;
155
156
  events: EventManager;
156
157
  private eventLogger;
157
- private chatBody;
158
- private chatBodyMaker;
158
+ private container;
159
159
  private button;
160
160
  private alarm;
161
- private chatBodyVisible;
161
+ private containerVisible;
162
162
  private isPdfOpen;
163
163
  private _isInitialized;
164
164
  /**
@@ -169,37 +169,44 @@ declare class TapSDK {
169
169
  get isOpen(): boolean;
170
170
  get isInitialized(): boolean;
171
171
  /**
172
- * Initializes the TapSDK with course data and optional custom styles
172
+ * Initializes the TapSDK with course data and optional container styles
173
173
  * @param params - Initialization parameters
174
174
  * @param params.course - Course information for chat context
175
- * @param params.customStyles - Optional UI customization styles
175
+ * @param params.container - Optional container styling options
176
176
  * @throws {Error} When initialization fails
177
177
  */
178
- init({ buttonId, course, customStyles, }: {
179
- buttonId: string;
180
- course: Course;
181
- customStyles?: CustomStyles;
182
- }): Promise<void>;
178
+ init({ buttonId, course, container }: TapSDKInitParams): Promise<void>;
183
179
  /**
184
180
  * Destroys the SDK instance and cleans up all resources
185
181
  */
186
182
  destroy(): void;
187
- private isClient;
188
- private setChatBodyVisible;
189
- private setIsPdfOpen;
183
+ private setupEventLogger;
190
184
  private toggleChatOpen;
191
185
  private validateEnvironment;
192
- private setupChatBody;
186
+ private setupContainer;
187
+ private updateContainerStyles;
193
188
  private setupButton;
194
189
  private setupEventListeners;
190
+ /**
191
+ * Update container styles dynamically
192
+ */
193
+ updateStyles(container: ContainerStyle): void;
194
+ /**
195
+ * POC: Dynamically set container size
196
+ */
197
+ setContainerSize(width: string, height: string): void;
198
+ /**
199
+ * POC: Animate container resize
200
+ */
201
+ animateContainerResize(width: string, height: string, duration?: number): void;
202
+ /**
203
+ * POC: Set responsive mode
204
+ */
205
+ setResponsiveMode(mode: "compact" | "normal" | "expanded"): void;
195
206
  /**
196
207
  * @deprecated Use `init` method instead. Will be removed in v1.0.0
197
208
  */
198
- initChat(params: {
199
- course: Course;
200
- customStyles?: CustomStyles;
201
- buttonId: string;
202
- }): Promise<void>;
209
+ initChat(params: TapSDKInitParams): Promise<void>;
203
210
  /**
204
211
  * @deprecated Use `events.seekTimeline` method instead. Will be removed in v1.0.0
205
212
  */
package/dist/index.d.ts CHANGED
@@ -45,12 +45,43 @@ declare class EventLogger {
45
45
  logSDKInitialization(success: boolean, startTime: number, error?: string): void;
46
46
  }
47
47
 
48
+ type TapSDKConfig = {
49
+ apiKey: string;
50
+ };
51
+ type TapSDKInitParams = {
52
+ buttonId: string;
53
+ course: Course;
54
+ container?: ContainerStyle;
55
+ };
56
+ type Course = {
57
+ userId: string;
58
+ courseId: string;
59
+ clipId: string;
60
+ clipPlayHead?: number;
61
+ };
62
+ type ContainerStyle = {
63
+ position?: PositionType;
64
+ width?: string;
65
+ height?: string;
66
+ borderRadius?: string;
67
+ };
68
+ type PositionType = {
69
+ top?: string;
70
+ left?: string;
71
+ right?: string;
72
+ bottom?: string;
73
+ };
74
+
75
+ type SeekTimelineParamsType = {
76
+ clipId: string;
77
+ clipPlayHead: number;
78
+ };
79
+
48
80
  type ToTapMessage = ChatInitMessage | ChatOpenMessage | ChatCloseMessage | TimelineSeekMessage | AlarmClickMessage | PopUpCloseMessage | PdfEnlargedMessage | PdfShrinkedMessage;
49
81
  type FromTapMessage = ChatInitiatedMessage | ChatOpenedMessage | ChatClosedMessage | AlarmFadeInMessage | PopUpOpenMessage | PdfOpenMessage | PdfCloseMessage | TimelineSeekMessage;
50
82
  interface ChatInitConfig {
51
- chatApiParams: any;
52
- customStyles?: any;
53
- apiUrl?: string | undefined;
83
+ course: Course;
84
+ container?: ContainerStyle;
54
85
  }
55
86
  declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
56
87
  #private;
@@ -92,35 +123,6 @@ declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
92
123
  static defaultHandshakeOptions: HandshakeOptions;
93
124
  }
94
125
 
95
- type TapSDKConfig = {
96
- apiKey: string;
97
- };
98
- type Course = {
99
- userId: string;
100
- courseId: string | null;
101
- clipId: string | null;
102
- };
103
- type CustomStyles = {
104
- chatBody?: ChatBodyStyle;
105
- };
106
- type ChatBodyStyle = {
107
- position?: PositionType;
108
- width?: string;
109
- height?: string;
110
- borderRadius?: string;
111
- };
112
- type PositionType = {
113
- top?: string;
114
- left?: string;
115
- right?: string;
116
- bottom?: string;
117
- };
118
-
119
- type SeekTimelineParamsType = {
120
- clipId: string;
121
- clipPlayHead: number;
122
- };
123
-
124
126
  declare class EventManager {
125
127
  private iframeBridge;
126
128
  constructor(iframeBridge: TapIframeBridge);
@@ -149,16 +151,14 @@ declare class EventManager {
149
151
  * ```
150
152
  */
151
153
  declare class TapSDK {
152
- #private;
153
154
  private apiKey;
154
155
  private iframeBridge;
155
156
  events: EventManager;
156
157
  private eventLogger;
157
- private chatBody;
158
- private chatBodyMaker;
158
+ private container;
159
159
  private button;
160
160
  private alarm;
161
- private chatBodyVisible;
161
+ private containerVisible;
162
162
  private isPdfOpen;
163
163
  private _isInitialized;
164
164
  /**
@@ -169,37 +169,44 @@ declare class TapSDK {
169
169
  get isOpen(): boolean;
170
170
  get isInitialized(): boolean;
171
171
  /**
172
- * Initializes the TapSDK with course data and optional custom styles
172
+ * Initializes the TapSDK with course data and optional container styles
173
173
  * @param params - Initialization parameters
174
174
  * @param params.course - Course information for chat context
175
- * @param params.customStyles - Optional UI customization styles
175
+ * @param params.container - Optional container styling options
176
176
  * @throws {Error} When initialization fails
177
177
  */
178
- init({ buttonId, course, customStyles, }: {
179
- buttonId: string;
180
- course: Course;
181
- customStyles?: CustomStyles;
182
- }): Promise<void>;
178
+ init({ buttonId, course, container }: TapSDKInitParams): Promise<void>;
183
179
  /**
184
180
  * Destroys the SDK instance and cleans up all resources
185
181
  */
186
182
  destroy(): void;
187
- private isClient;
188
- private setChatBodyVisible;
189
- private setIsPdfOpen;
183
+ private setupEventLogger;
190
184
  private toggleChatOpen;
191
185
  private validateEnvironment;
192
- private setupChatBody;
186
+ private setupContainer;
187
+ private updateContainerStyles;
193
188
  private setupButton;
194
189
  private setupEventListeners;
190
+ /**
191
+ * Update container styles dynamically
192
+ */
193
+ updateStyles(container: ContainerStyle): void;
194
+ /**
195
+ * POC: Dynamically set container size
196
+ */
197
+ setContainerSize(width: string, height: string): void;
198
+ /**
199
+ * POC: Animate container resize
200
+ */
201
+ animateContainerResize(width: string, height: string, duration?: number): void;
202
+ /**
203
+ * POC: Set responsive mode
204
+ */
205
+ setResponsiveMode(mode: "compact" | "normal" | "expanded"): void;
195
206
  /**
196
207
  * @deprecated Use `init` method instead. Will be removed in v1.0.0
197
208
  */
198
- initChat(params: {
199
- course: Course;
200
- customStyles?: CustomStyles;
201
- buttonId: string;
202
- }): Promise<void>;
209
+ initChat(params: TapSDKInitParams): Promise<void>;
203
210
  /**
204
211
  * @deprecated Use `events.seekTimeline` method instead. Will be removed in v1.0.0
205
212
  */
@@ -4,21 +4,21 @@
4
4
  if (typeof document !== 'undefined') {
5
5
  const style = document.createElement('style');
6
6
  style.id = 'tap-sdk-styles';
7
- style.textContent = "@keyframes _1mlv4me0{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes _1mlv4me1{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(30px);display:none}}._1mlv4me2{opacity:0;transform:translateY(30px);transition:opacity .4s ease,transform .4s ease;pointer-events:none;display:none}._1mlv4me3{animation:_1mlv4me0 .4s ease forwards;pointer-events:auto}._1mlv4me4{animation:_1mlv4me1 .4s ease forwards;pointer-events:none}._1mlv4me5{border:none!important}@keyframes wtjce00{0%{opacity:1;pointer-events:auto}50%{opacity:1}to{opacity:0}}.wtjce01{pointer-events:none;opacity:0;display:flex;position:absolute;width:max-content;top:calc(100% + 5px);right:0;flex-direction:column;justify-content:center;align-items:flex-end;padding-top:2px;cursor:pointer;z-index:999;transition:opacity .3s ease}.wtjce02{pointer-events:auto;animation:wtjce00 18s forwards}.wtjce03{opacity:0;pointer-events:none;animation:none}.wtjce04{display:flex;justify-content:flex-end;border-radius:var(--Radius-radiusSM, 8px);width:max-content;gap:5px}.wtjce05{display:flex;padding:8px 12px 6px;justify-content:flex-end;align-items:center;border-radius:var(--Radius-radiusSM, 8px);max-width:340px}.wtjce06{background-color:#171b1f}.wtjce07{background-color:#fa6b4b}.wtjce08{color:#fff;text-align:right;font-family:Pretendard;font-size:14px;font-style:normal;font-weight:400;line-height:20px;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word}.wtjce09{display:flex;padding:0 23px;align-items:flex-start;gap:10px}.wtjce0a{width:15px}.wtjce0b{color:#171b1f}.wtjce0c{color:#fa6b4b}.wtjce0d{cursor:pointer;justify-content:center;align-items:center;width:20px;height:20px;border-radius:100px;z-index:999;transition:all .2s ease}.wtjce0d:hover{width:63px;left:-72px}.wtjce04:hover .wtjce0d{display:flex}.wtjce0e,.wtjce0f{display:none;background-color:#171b1f}.wtjce0g{color:#fff}.wtjce0d:hover .wtjce0g{display:none}.wtjce0h{color:#fff;text-align:center;font-family:Pretendard;font-size:12px;font-style:normal;font-weight:400;line-height:20px;display:none}.wtjce0d:hover .wtjce0h{display:block}.wu2gm60{width:100%;min-width:max-content;table-layout:auto;border-collapse:separate;border-spacing:0;border:.4px solid rgba(118,118,128,.12);border-radius:8px;overflow:auto;background-color:#fff;cursor:pointer}.wu2gm61{border:.4px solid rgba(118,118,128,.12);padding:10px;background-color:#f2f2f2;text-align:left;font-family:Pretendard;color:#090909;font-size:12px;font-weight:500;white-space:normal;overflow-wrap:break-word;word-break:break-word}.wu2gm62{border:.4px solid rgba(118,118,128,.12);padding:10px;color:#090909;font-family:Pretendard;font-size:12px;font-weight:400;width:fit-content;max-width:400px;white-space:normal;overflow-wrap:break-word;word-break:break-word}.wu2gm63{position:relative;background-color:#fafafa;border-radius:8px;padding:8px;overflow-y:auto}.wu2gm64{display:flex;align-items:center;justify-content:space-between;padding-bottom:4px}.wu2gm65{color:#4a5568;padding:2px 6px;font-size:12px;border-radius:4px;z-index:10;font-family:Pretendard}.wu2gm66{z-index:10;cursor:pointer;display:flex;align-items:center;width:max-content;color:#4a5568;padding:2px 6px;font-size:12px;border:none;font-family:Pretendard}.wu2gm67{white-space:nowrap}.wu2gm68{display:flex;width:12px;height:12px;margin-bottom:4px;color:#4a5568;flex-shrink:0}\n/*# sourceMappingURL=index.css.map */";
7
+ style.textContent = "@keyframes _16e62km0{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes _16e62km1{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(30px);display:none}}._16e62km2{opacity:0;transform:translateY(30px);transition:opacity .4s ease,transform .4s ease;pointer-events:none;display:none}._16e62km3{animation:_16e62km0 .4s ease forwards;pointer-events:auto}._16e62km4{animation:_16e62km1 .4s ease forwards;pointer-events:none}._16e62km5{border:none!important}@keyframes wtjce00{0%{opacity:1;pointer-events:auto}50%{opacity:1}to{opacity:0}}.wtjce01{pointer-events:none;opacity:0;display:flex;position:absolute;width:max-content;top:calc(100% + 5px);right:0;flex-direction:column;justify-content:center;align-items:flex-end;padding-top:2px;cursor:pointer;z-index:999;transition:opacity .3s ease}.wtjce02{pointer-events:auto;animation:wtjce00 18s forwards}.wtjce03{opacity:0;pointer-events:none;animation:none}.wtjce04{display:flex;justify-content:flex-end;border-radius:var(--Radius-radiusSM, 8px);width:max-content;gap:5px}.wtjce05{display:flex;padding:8px 12px 6px;justify-content:flex-end;align-items:center;border-radius:var(--Radius-radiusSM, 8px);max-width:340px}.wtjce06{background-color:#171b1f}.wtjce07{background-color:#fa6b4b}.wtjce08{color:#fff;text-align:right;font-family:Pretendard;font-size:14px;font-style:normal;font-weight:400;line-height:20px;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word}.wtjce09{display:flex;padding:0 23px;align-items:flex-start;gap:10px}.wtjce0a{width:15px}.wtjce0b{color:#171b1f}.wtjce0c{color:#fa6b4b}.wtjce0d{cursor:pointer;justify-content:center;align-items:center;width:20px;height:20px;border-radius:100px;z-index:999;transition:all .2s ease}.wtjce0d:hover{width:63px;left:-72px}.wtjce04:hover .wtjce0d{display:flex}.wtjce0e,.wtjce0f{display:none;background-color:#171b1f}.wtjce0g{color:#fff}.wtjce0d:hover .wtjce0g{display:none}.wtjce0h{color:#fff;text-align:center;font-family:Pretendard;font-size:12px;font-style:normal;font-weight:400;line-height:20px;display:none}.wtjce0d:hover .wtjce0h{display:block}._1mnmljf0{width:100%;min-width:max-content;table-layout:auto;border-collapse:separate;border-spacing:0;border:.4px solid rgba(118,118,128,.12);border-radius:8px;overflow:auto;background-color:#fff;cursor:pointer}._1mnmljf1{border:.4px solid rgba(118,118,128,.12);padding:10px;background-color:#f2f2f2;text-align:left;font-family:Pretendard;color:#090909;font-size:12px;font-weight:500;white-space:normal;overflow-wrap:break-word;word-break:break-word}._1mnmljf2{border:.4px solid rgba(118,118,128,.12);padding:10px;color:#090909;font-family:Pretendard;font-size:12px;font-weight:400;width:fit-content;max-width:400px;white-space:normal;overflow-wrap:break-word;word-break:break-word}._1mnmljf3{position:relative;background-color:#fafafa;border-radius:8px;padding:8px;overflow-y:auto}._1mnmljf4{display:flex;align-items:center;justify-content:space-between;padding-bottom:4px}._1mnmljf5{color:#4a5568;padding:2px 6px;font-size:12px;border-radius:4px;z-index:10;font-family:Pretendard}._1mnmljf6{z-index:10;cursor:pointer;display:flex;align-items:center;width:max-content;color:#4a5568;padding:2px 6px;font-size:12px;border:none;font-family:Pretendard}._1mnmljf7{white-space:nowrap}._1mnmljf8{display:flex;width:12px;height:12px;margin-bottom:4px;color:#4a5568;flex-shrink:0}._1mnmljf9{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0006;z-index:10000002}._1mnmljfa{position:fixed;display:flex;flex-direction:column;width:max-content;max-width:calc(100vw - 100px);overflow:auto;background:#fff;padding:20px;border:1px solid #ccc;box-shadow:0 4px 20px #0003;z-index:10000003;border-radius:8px}\n/*# sourceMappingURL=index.css.map */";
8
8
  if (!document.getElementById('tap-sdk-styles')) {
9
9
  document.head.appendChild(style);
10
10
  }
11
11
  }
12
12
  })();
13
13
 
14
- var TapSDK=(function(){'use strict';var $e=Object.defineProperty;var Z=r=>{throw TypeError(r)};var je=(r,e,t)=>e in r?$e(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var o=(r,e,t)=>je(r,typeof e!="symbol"?e+"":e,t),Y=(r,e,t)=>e.has(r)||Z("Cannot "+t);var Q=(r,e,t)=>(Y(r,e,"read from private field"),t?t.call(r):e.get(r)),v=(r,e,t)=>e.has(r)?Z("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t);var m=(r,e,t)=>(Y(r,e,"access private method"),t);var ee="_1mlv4me2",E="_1mlv4me4";var S="_1mlv4me3";var N=class{constructor(){o(this,"chatBody",null);this.chatBody=null;}createChatBody({customChatBody:e}){return this.chatBody?this.chatBody:(this.chatBody=document.createElement("div"),this.chatBody.id="cw-chat-body",this.chatBody.className=ee,this.chatBody.style.setProperty("z-index","10000001","important"),this.chatBody.style.setProperty("position","fixed","important"),Object.assign(this.chatBody.style,{top:e?.position?.top??"50px",right:e?.position?.right??"24px",left:e?.position?.left??"unset",bottom:e?.position?.bottom??"unset",width:e?.width??"340px",height:e?.height??"calc(100% - 116px)",overflow:"hidden",backgroundColor:"transparent",borderRadius:e?.borderRadius??"16px",boxShadow:`
14
+ var TapSDK=(function(){'use strict';var je=Object.defineProperty;var Y=i=>{throw TypeError(i)};var De=(i,e,t)=>e in i?je(i,e,{enumerable:true,configurable:true,writable:true,value:t}):i[e]=t;var o=(i,e,t)=>De(i,typeof e!="symbol"?e+"":e,t),Oe=(i,e,t)=>e.has(i)||Y("Cannot "+t);var w=(i,e,t)=>e.has(i)?Y("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t);var m=(i,e,t)=>(Oe(i,e,"access private method"),t);var Q="_16e62km2",E="_16e62km4";var L="_16e62km3";var d=class d{constructor(){o(this,"$container",null);o(this,"containerIdCounter",0);if(d.instance)return d.instance;this.$container=null,d.instance=this;}static resetInstance(){d.instance&&(d.instance.forceRemove(),d.instance=null);}get element(){return this.$container??void 0}createContainer({customContainer:e}){this.forceRemove(),this.containerIdCounter++;let t=`cw-tap-container-${this.containerIdCounter}-${Date.now()}`;return this.$container=document.createElement("div"),this.$container.id=t,this.$container.className=Q,this.updateStyles(e),document.body.appendChild(this.$container),this.$container}forceRemove(){this.$container&&(this.$container.remove(),this.$container=null),document.querySelectorAll("[id^='cw-tap-container']").forEach(t=>{t.remove();});}updateStyles(e){if(!this.$container){e?this.createContainer({customContainer:e}):this.createContainer({});return}let t={top:e?.position?.top??"50px",right:e?.position?.right??"24px",left:e?.position?.left??"unset",bottom:e?.position?.bottom??"unset",width:e?.width??"340px",height:e?.height??"calc(100% - 116px)",overflow:"hidden",backgroundColor:"transparent",borderRadius:e?.borderRadius??"16px",boxShadow:`
15
15
  rgba(255, 255, 255, 0.12) 0px 0px 2px 0px inset,
16
16
  rgba(0, 0, 0, 0.05) 0px 0px 2px 1px,
17
17
  rgba(0, 0, 0, 0.3) 0px 12px 60px
18
- `,willChange:"transform, opacity, width, max-height, max-width"}),document.body.appendChild(this.chatBody),this.chatBody)}toggleVisibility(e){if(!this.chatBody)return;this.chatBody.classList.remove(S,E),this.chatBody.style.display="block";let t=()=>{this.chatBody&&(this.chatBody.classList.contains(E)&&(this.chatBody.style.display="none"),this.chatBody.removeEventListener("animationend",t));};this.chatBody.addEventListener("animationend",t),requestAnimationFrame(()=>{this.chatBody?.classList.add(e?S:E);});}removeChatBody(){this.chatBody&&(this.chatBody.remove(),this.chatBody=null);}resizeChatBody(e,t){if(!this.chatBody)return;let n=t?.width??"340px",i=parseInt(n,10),s=i/3*10-i,u=e?`${i+s}px`:`${i}px`;this.chatBody.style.width=u;}},te=N;var _,z=class{constructor(){o(this,"buttonElement");v(this,_,(e,t)=>e.key===t?true:e.code.startsWith("Key")?e.code.slice(3).toLowerCase()===t:false);}create(e){let t=document.getElementById(e);if(!t)throw new Error(`Element with id '${e}' not found`);return t.style.setProperty("position","relative","important"),t.style.setProperty("z-index","10000001","important"),this.buttonElement=t,this.buttonElement}onClick(e){if(!this.buttonElement)throw new Error("not initialized");this.buttonElement.addEventListener("click",e);}onKeyboardShortcut({openChatShortcutKey:e,callback:t}){if(!this.buttonElement)throw new Error("not initialized");window.addEventListener("keydown",n=>{Q(this,_).call(this,n,e.key)&&(!e.modifier||n[e.modifier])&&t();});}getButtonElement(){return this.buttonElement}};_=new WeakMap;var ne=z;var re="wtjce01",q={default:"wtjce0b wtjce0a","call-to-action":"wtjce0c wtjce0a"},ie="wtjce0a",se="wtjce09",R={default:"wtjce0e wtjce0d","call-to-action":"wtjce0f wtjce0d"},ue="wtjce0d",oe="wtjce0h",ae="wtjce0g",H="wtjce03",le="wtjce08",G={default:"wtjce06 wtjce05","call-to-action":"wtjce07 wtjce05"},ce="wtjce05",F="wtjce02",pe="wtjce04";var h,fe,ye,he,me,de,V=class{constructor(){v(this,h);o(this,"container");o(this,"alarmTimeout");o(this,"alarmCornerSVG");o(this,"textContainer");o(this,"circleElement");o(this,"textInTextContainer");o(this,"messageInfo");}render({rootElement:e}){this.container=document.createElement("div"),this.container.id="alarm-container",this.container.className=re,this.container.addEventListener("click",n=>{n.stopPropagation();}),e.appendChild(this.container),m(this,h,fe).call(this,this.container);let t=m(this,h,ye).call(this,this.container);m(this,h,me).call(this,t),m(this,h,he).call(this,t);}fadeIn(e){e.type==="default"||e.type==="hourSpent"?(this.textContainer.className=G.default,this.alarmCornerSVG.setAttribute("class",q.default),this.circleElement.className=R.default):(this.textContainer.className=G["call-to-action"],this.alarmCornerSVG.setAttribute("class",q["call-to-action"]),this.circleElement.className=R["call-to-action"]),this.messageInfo=e,this.textInTextContainer.textContent=e.message,this.toggleVisibility(true),this.alarmTimeout=setTimeout(()=>{this.toggleVisibility(false);},18*1e3);}onAlarmClick(e){this.container.addEventListener("click",()=>{this.toggleVisibility(false),e(this.messageInfo);});}toggleVisibility(e){this.container.classList.remove(F,H),requestAnimationFrame(()=>{this.container?.classList.add(e?F:H);});}remove(){this.container&&this.toggleVisibility(false),this.alarmTimeout&&clearTimeout(this.alarmTimeout);}};h=new WeakSet,fe=function(e){let t=document.createElement("div");t.className=se,e.appendChild(t);let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","11"),n.setAttribute("height","8"),n.setAttribute("viewBox","0 0 11 8"),n.setAttribute("fill","currentColor"),n.setAttribute("class",ie);let i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M5.5 0L11.1292 8.25H-0.129165L5.5 0Z"),i.setAttribute("fill","currentColor"),n.appendChild(i),this.alarmCornerSVG=n,t.appendChild(n);},ye=function(e){let t=document.createElement("div");return t.className=pe,e.appendChild(t),t},he=function(e){this.textContainer=document.createElement("div"),this.textContainer.className=ce,e.appendChild(this.textContainer),this.textInTextContainer=document.createElement("span"),this.textInTextContainer.className=le,this.textContainer.appendChild(this.textInTextContainer);},me=function(e){let t=document.createElement("div");t.className=ue,e.appendChild(t),t.addEventListener("click",i=>{i.stopPropagation(),this.remove();});let n=document.createElement("span");n.className=oe,t.appendChild(n),n.textContent="\uC54C\uB9BC \uB044\uAE30",m(this,h,de).call(this,t),this.circleElement=t;},de=function(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("width","10"),t.setAttribute("height","10"),t.setAttribute("viewBox","0 0 14 14"),t.setAttribute("fill","none"),t.setAttribute("class",ae);let n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M1 1L13 13M13 1L1 13"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-linecap","round"),t.appendChild(n),e.appendChild(t);};var ve=V;var U;function ge(r){return {lang:r?.lang??U?.lang,message:r?.message,abortEarly:r?.abortEarly??U?.abortEarly,abortPipeEarly:r?.abortPipeEarly??U?.abortPipeEarly}}var Le;function Se(r){return Le?.get(r)}var Ne;function ze(r){return Ne?.get(r)}var qe;function Re(r,e){return qe?.get(r)?.get(e)}function be(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function x(r,e,t,n,i){let s=i&&"input"in i?i.input:t.value,u=i?.expected??r.expects??null,a=i?.received??be(s),l={kind:r.kind,type:r.type,input:s,expected:u,received:a,message:`Invalid ${e}: ${u?`Expected ${u} but r`:"R"}eceived ${a}`,requirement:r.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},p=r.kind==="schema",c=i?.message??r.message??Re(r.reference,l.lang)??(p?ze(l.lang):null)??n.message??Se(l.lang);c!==void 0&&(l.message=typeof c=="function"?c(l):c),p&&(t.typed=false),t.issues?t.issues.push(l):t.issues=[l];}function w(r){return {version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},ge())}}}function He(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ge(r,e,t){return typeof r.fallback=="function"?r.fallback(e,t):r.fallback}function Fe(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}function W(){return {kind:"schema",type:"any",reference:W,expects:"any",async:false,get"~standard"(){return w(this)},"~run"(r){return r.typed=true,r}}}function I(r,e){return {kind:"schema",type:"literal",reference:I,expects:be(r),async:false,literal:r,message:e,get"~standard"(){return w(this)},"~run"(t,n){return t.value===this.literal?t.typed=true:x(this,"type",t,n),t}}}function T(r,e){return {kind:"schema",type:"object",reference:T,expects:"Object",async:false,entries:r,message:e,get"~standard"(){return w(this)},"~run"(t,n){let i=t.value;if(i&&typeof i=="object"){t.typed=true,t.value={};for(let s in this.entries){let u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){let a=s in i?i[s]:Fe(u),l=u["~run"]({value:a},n);if(l.issues){let p={type:"object",origin:"value",input:i,key:s,value:a};for(let c of l.issues)c.path?c.path.unshift(p):c.path=[p],t.issues?.push(c);if(t.issues||(t.issues=l.issues),n.abortEarly){t.typed=false;break}}l.typed||(t.typed=false),t.value[s]=l.value;}else if(u.fallback!==void 0)t.value[s]=Ge(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(x(this,"key",t,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else x(this,"type",t,n);return t}}}function X(r,e,t){return {kind:"schema",type:"record",reference:X,expects:"Object",async:false,key:r,value:e,message:t,get"~standard"(){return w(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=true,n.value={};for(let u in s)if(He(s,u)){let a=s[u],l=this.key["~run"]({value:u},i);if(l.issues){let c={type:"object",origin:"key",input:s,key:u,value:a};for(let f of l.issues)f.path=[c],n.issues?.push(f);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=false;break}}let p=this.value["~run"]({value:a},i);if(p.issues){let c={type:"object",origin:"value",input:s,key:u,value:a};for(let f of p.issues)f.path?f.path.unshift(c):f.path=[c],n.issues?.push(f);if(n.issues||(n.issues=p.issues),i.abortEarly){n.typed=false;break}}(!l.typed||!p.typed)&&(n.typed=false),l.typed&&(n.value[l.value]=p.value);}}else x(this,"type",n,i);return n}}}function C(r){return {kind:"schema",type:"string",reference:C,expects:"string",async:false,message:r,get"~standard"(){return w(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=true:x(this,"type",e,t),e}}}function ke(r,e,t){let n=r["~run"]({value:e},ge(t));return {typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var we="chat:init",Ve="chat:initiated";var Ee=T({type:I(Ve),gaId:C()});T({type:I("GA_EVENT"),payload:X(C(),W())});var A=class{constructor(){o(this,"listeners",new Map);o(this,"unifiedMessageHandler",null);}on(e,t){let n=s=>{if(this.isValidOrigin(s))try{let u=s.data,a=typeof u=="string"?JSON.parse(u):u,{type:l}=a;l===e&&t(a);}catch(u){console.warn("Messenger: Failed to parse message data",u);}},i=this.listeners.get(e)||[];return i.push(n),this.listeners.set(e,i),this.unifiedMessageHandler||(this.unifiedMessageHandler=s=>{this.listeners.forEach(u=>u.forEach(a=>a(s)));},window.addEventListener("message",this.unifiedMessageHandler)),()=>{this.unifiedMessageHandler&&(window.removeEventListener("message",this.unifiedMessageHandler),this.unifiedMessageHandler=null);}}removeListener(e){this.listeners.delete(e);}removeAllListeners(){this.listeners.clear(),this.unifiedMessageHandler&&(window.removeEventListener("message",this.unifiedMessageHandler),this.unifiedMessageHandler=null);}postMessage(e){try{let t=this.getMessageTarget();return t?(t.postMessage(e,this.getTargetOrigin()),!0):(console.warn("Messenger: Message target not available"),!1)}catch(t){return console.error("Messenger: postMessage failed",t),false}}};var g=class extends Error{constructor(t,n,i){super(`Handshake failed: ${t}${n?` - ${n}`:""}`);this.reason=t;this.details=n;this.originalError=i;this.name="HandshakeError";}},M=class{constructor(e,t,n){this.getTargetWindow=e;this.getTargetOrigin=t;this.isValidOrigin=n;o(this,"abortController",null);o(this,"messageListener",null);}async execute(e,t={}){let{timeout:n=1e4,maxRetries:i=10,retryInterval:s=500}=t;return this.cancel(),this.abortController=new AbortController,new Promise((u,a)=>{let l=0,p,c=()=>{p&&clearTimeout(p),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null);},f=()=>{c(),a(new g("TIMEOUT","Handshake was cancelled"));};this.abortController?.signal.addEventListener("abort",f),this.messageListener=y=>{if(this.isValidOrigin(y))try{let b=y.data,Oe=typeof b=="string"?JSON.parse(b):b,J=ke(Ee,Oe);if(J.success){c(),this.abortController=null,u(J.output);return}}catch{}},window.addEventListener("message",this.messageListener),p=setTimeout(()=>{c(),this.abortController=null,a(new g("TIMEOUT",`No valid response received within ${n}ms`));},n);let d=()=>{if(!this.abortController?.signal.aborted)try{let y=this.getTargetWindow(),b=this.getTargetOrigin();if(!y)throw new g("NO_TARGET_WINDOW","Target iframe window is not available");y.postMessage(e,b),l++,l<i&&setTimeout(()=>{this.abortController?.signal.aborted||d();},s);}catch(y){c(),this.abortController=null,y instanceof g?a(y):a(new g("MESSAGE_SEND_FAILED","Failed to send handshake message",y));}};d();})}cancel(){this.abortController&&(this.abortController.abort(),this.abortController=null),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null);}isActive(){return this.abortController!==null&&!this.abortController.signal.aborted}};var k,_e,Ie,O=class O extends A{constructor({hostOrigin:t,apiKey:n,eventLogger:i}){super();v(this,k);o(this,"hostOrigin");o(this,"apiKey");o(this,"iframe");o(this,"eventLogger");o(this,"postToTap",t=>{if(!this.iframe)return console.error("TapIframeBridge: iframe not found - ensure createIframeChat() was called first"),console.error("Failed to send message:",t),(t.type==="chat:open"||t.type==="chat:close")&&console.error("Chat cannot be opened/closed - iframe is not initialized"),this.eventLogger?.log({action:"iframe_message_failed",category:"error",label:t.type,customParams:{reason:"iframe_not_initialized"}}),false;let n=super.postMessage(t);return this.eventLogger?.log({action:"iframe_message_sent",category:"communication",label:t.type,customParams:{success:n}}),n});o(this,"listenToTap",super.on);this.hostOrigin=t,this.apiKey=n,this.eventLogger=i;}isValidOrigin(t){return true}getMessageTarget(){return this.iframe?.contentWindow||null}getTargetOrigin(){if(!this.iframe?.src)return "*";try{return new URL(this.iframe.src).origin}catch{return "*"}}renderIframe(t){return new Promise(n=>{this.iframe&&(this.iframe.remove(),this.iframe=null),this.iframe=document.createElement("iframe"),this.iframe.style.setProperty("display","flex","important"),this.iframe.style.setProperty("border","none","important"),this.iframe.src=m(this,k,_e).call(this),this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.onload=()=>{n(this.iframe);},t?.appendChild(this.iframe);})}hasIframe(){return this.iframe!==null&&this.iframe!==void 0}async ensureIframe(t){return this.hasIframe()?this.iframe:this.renderIframe(t)}removeIframe(){this.iframe?.remove(),this.iframe=null,this.removeAllListeners();}async performHandshake(t,n=O.defaultHandshakeOptions){if(!this.iframe)throw new Error("TapIframeBridge: iframe not available for handshake");this.eventLogger?.log({action:"handshake_started",category:"communication",customParams:{iframeSrc:this.iframe.src,targetOrigin:this.getTargetOrigin(),messageTargetAvailable:!!this.getMessageTarget()}});let i=new M(()=>this.getMessageTarget(),()=>this.getTargetOrigin(),a=>this.isValidOrigin(a)),s={type:we,hostOrigin:this.hostOrigin,apiKey:this.apiKey,chatApiParams:t.chatApiParams,apiUrl:t?.apiUrl??(m(this,k,Ie).call(this)||"")};this.eventLogger?.log({action:"handshake_message_sending",category:"communication",customParams:{messageType:s.type,hostOrigin:s.hostOrigin,hasApiKey:!!s.apiKey,apiUrl:s.apiUrl,chatApiParams:s.chatApiParams}});let u=Date.now();try{let a=await i.execute(s,n);return this.eventLogger?.log({action:"iframe_handshake",category:"system",label:"success",value:Date.now()-u,customParams:{apiUrl:s.apiUrl,targetOrigin:this.getTargetOrigin()}}),a}catch(a){throw console.error("[TapIframeBridge] Handshake failed:",a),this.eventLogger?.log({action:"iframe_handshake",category:"error",label:"failed",value:Date.now()-u,customParams:{error:a instanceof Error?a.message:"Unknown error",apiUrl:s.apiUrl}}),a instanceof Error?new Error(`TapIframeBridge handshake failed: ${a.message}`):a}}};k=new WeakSet,_e=function(){if(typeof window>"u"||typeof localStorage>"u")throw new Error("TapIframeBridge: window or localStorage is not defined");try{let t=localStorage.getItem("tap-url-storage");if(t){let n=JSON.parse(t);this.eventLogger?.log({action:"custom_tap_url_found",category:"configuration",customParams:{stored:n}});let i=n?.state?.tapUrl;if(i)return this.eventLogger?.log({action:"custom_tap_url_used",category:"configuration",customParams:{customTapUrl:i}}),`${i}/chat`}}catch{}return "https://edutap-ai.vercel.app/chat"},Ie=function(){if(!(typeof window>"u"||typeof localStorage>"u"))try{let t=localStorage.getItem("tap-api-url-storage");return t?JSON.parse(t)?.state?.apiUrl:void 0}catch{return}},o(O,"defaultHandshakeOptions",{retryInterval:500,maxRetries:3,timeout:3e4});var D=O;var $=class{constructor(e){this.iframeBridge=e;}seekTimeline({clipId:e,clipPlayHead:t}){this.iframeBridge.postToTap({type:"timeline:seek",clipId:e,clipPlayHead:t});}onTimelineSeek(e){this.iframeBridge.listenToTap("timeline:seek",t=>e(t.clipPlayHead,t.clipId));}onChatOpened(e){this.iframeBridge.listenToTap("chat:opened",e);}onChatClosed(e){this.iframeBridge.listenToTap("chat:closed",e);}onChatInitiated(e){this.iframeBridge.listenToTap("chat:initiated",e);}onAlarmFadeIn(e){this.iframeBridge.listenToTap("alarm:fadeIn",t=>{e(t.messageInfo);});}onPopUpOpen(e){this.iframeBridge.listenToTap("popUp:open",t=>{e(t.popUpInfo);});}onPdfOpen(e){this.iframeBridge.listenToTap("pdf:open",e);}onPdfClose(e){this.iframeBridge.listenToTap("pdf:close",e);}};var Ue="G-27C0E436HL",j=class{constructor(e=Ue){this.gaId=e;this.gaId&&typeof window<"u"&&this.initializeGA(this.gaId);}initializeGA(e){if(document.querySelector(`script[src*="googletagmanager.com/gtag/js?id=${e}"]`))return;let t=document.createElement("script");if(t.async=true,t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(t),typeof window.gtag!="function"){let n=document.createElement("script");n.innerHTML=`
18
+ `,willChange:"transform, opacity, width, max-height, max-width"};this.$container.style.cssText="",this.$container.style.setProperty("position","fixed","important"),this.$container.style.setProperty("z-index","10000001","important"),this.$container.style.setProperty("top",t.top,"important"),this.$container.style.setProperty("right",t.right,"important"),this.$container.style.setProperty("left",t.left,"important"),this.$container.style.setProperty("bottom",t.bottom,"important"),this.$container.style.setProperty("width",t.width,"important"),this.$container.style.setProperty("height",t.height,"important"),this.$container.style.setProperty("overflow",t.overflow,"important"),this.$container.style.setProperty("background-color",t.backgroundColor,"important"),this.$container.style.setProperty("border-radius",t.borderRadius,"important"),this.$container.style.setProperty("box-shadow",t.boxShadow,"important"),this.$container.style.setProperty("will-change",t.willChange,"important"),this.$container.offsetHeight;}getBoundingClientRect(){return this.$container?this.$container.getBoundingClientRect():null}getComputedStyles(){if(!this.$container)return null;let e=window.getComputedStyle(this.$container);console.log("[Container] Raw computed styles:",{width:e.width,height:e.height,borderRadius:e.borderRadius,top:e.top,right:e.right,left:e.left,bottom:e.bottom});let t=(r,s)=>r&&r!=="auto"?r:s,n={width:t(e.width,"340px"),height:"calc(100vh - 116px)",borderRadius:t(e.borderRadius,"16px"),position:{top:t(e.top,"50px"),right:t(e.right,"24px"),left:e.left==="auto"?"unset":e.left,bottom:e.bottom==="auto"?"unset":e.bottom}};return console.log("[Container] Processed computed styles:",n),n}toggleVisibility(e){if(!this.$container)return;this.$container.classList.remove(L,E),this.$container.style.display="block";let t=()=>{this.$container&&(this.$container.classList.contains(E)&&(this.$container.style.display="none"),this.$container.removeEventListener("animationend",t));};this.$container.addEventListener("animationend",t),requestAnimationFrame(()=>{this.$container?.classList.add(e?L:E);});}removeContainer(){this.forceRemove();}resizeContainer(e,t){if(!this.$container)return;let n=t?.width??"340px",r=parseInt(n,10),s=r/3*10-r,u=e?`${r+s}px`:`${r}px`;this.$container.style.width=u;}setDynamicSize(e,t){this.$container&&(this.$container.style.transition="width 0.3s ease, height 0.3s ease",this.$container.style.width=e,this.$container.style.height=t);}animateResize(e,t,n=300){this.$container&&(this.$container.style.transition=`width ${n}ms ease, height ${n}ms ease`,this.$container.style.width=e,this.$container.style.height=t);}setResponsiveMode(e){if(!this.$container)return;let t={compact:{width:"280px",height:"calc(100% - 200px)"},normal:{width:"340px",height:"calc(100% - 116px)"},expanded:{width:"480px",height:"calc(100% - 80px)"}},{width:n,height:r}=t[e];this.animateResize(n,r,400);}};o(d,"instance",null);var z=d,N=z;var R=class{constructor(){o(this,"buttonElement");}create(e){let t=document.getElementById(e);if(!t)throw new Error(`Element with id '${e}' not found`);return t.style.setProperty("position","relative","important"),t.style.setProperty("z-index","10000001","important"),this.buttonElement=t,this.buttonElement}onClick(e){if(!this.buttonElement)throw new Error("not initialized");this.buttonElement.addEventListener("click",e);}},ee=R;var te="wtjce01",q={default:"wtjce0b wtjce0a","call-to-action":"wtjce0c wtjce0a"},ne="wtjce0a",re="wtjce09",B={default:"wtjce0e wtjce0d","call-to-action":"wtjce0f wtjce0d"},ie="wtjce0d",se="wtjce0h",ue="wtjce0g",H="wtjce03",oe="wtjce08",G={default:"wtjce06 wtjce05","call-to-action":"wtjce07 wtjce05"},ae="wtjce05",F="wtjce02",le="wtjce04";var f,ce,pe,fe,he,ye,V=class{constructor(){w(this,f);o(this,"container");o(this,"alarmTimeout");o(this,"alarmCornerSVG");o(this,"textContainer");o(this,"circleElement");o(this,"textInTextContainer");o(this,"messageInfo");}render({rootElement:e}){this.container=document.createElement("div"),this.container.id="alarm-container",this.container.className=te,this.container.addEventListener("click",n=>{n.stopPropagation();}),e.appendChild(this.container),m(this,f,ce).call(this,this.container);let t=m(this,f,pe).call(this,this.container);m(this,f,he).call(this,t),m(this,f,fe).call(this,t);}fadeIn(e){e.type==="default"||e.type==="hourSpent"?(this.textContainer.className=G.default,this.alarmCornerSVG.setAttribute("class",q.default),this.circleElement.className=B.default):(this.textContainer.className=G["call-to-action"],this.alarmCornerSVG.setAttribute("class",q["call-to-action"]),this.circleElement.className=B["call-to-action"]),this.messageInfo=e,this.textInTextContainer.textContent=e.message,this.toggleVisibility(true),this.alarmTimeout=setTimeout(()=>{this.toggleVisibility(false);},18*1e3);}onAlarmClick(e){this.container.addEventListener("click",()=>{this.toggleVisibility(false),e(this.messageInfo);});}toggleVisibility(e){this.container.classList.remove(F,H),requestAnimationFrame(()=>{this.container?.classList.add(e?F:H);});}remove(){this.container&&this.toggleVisibility(false),this.alarmTimeout&&clearTimeout(this.alarmTimeout);}};f=new WeakSet,ce=function(e){let t=document.createElement("div");t.className=re,e.appendChild(t);let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","11"),n.setAttribute("height","8"),n.setAttribute("viewBox","0 0 11 8"),n.setAttribute("fill","currentColor"),n.setAttribute("class",ne);let r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d","M5.5 0L11.1292 8.25H-0.129165L5.5 0Z"),r.setAttribute("fill","currentColor"),n.appendChild(r),this.alarmCornerSVG=n,t.appendChild(n);},pe=function(e){let t=document.createElement("div");return t.className=le,e.appendChild(t),t},fe=function(e){this.textContainer=document.createElement("div"),this.textContainer.className=ae,e.appendChild(this.textContainer),this.textInTextContainer=document.createElement("span"),this.textInTextContainer.className=oe,this.textContainer.appendChild(this.textInTextContainer);},he=function(e){let t=document.createElement("div");t.className=ie,e.appendChild(t),t.addEventListener("click",r=>{r.stopPropagation(),this.remove();});let n=document.createElement("span");n.className=se,t.appendChild(n),n.textContent="\uC54C\uB9BC \uB044\uAE30",m(this,f,ye).call(this,t),this.circleElement=t;},ye=function(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("width","10"),t.setAttribute("height","10"),t.setAttribute("viewBox","0 0 14 14"),t.setAttribute("fill","none"),t.setAttribute("class",ue);let n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M1 1L13 13M13 1L1 13"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-linecap","round"),t.appendChild(n),e.appendChild(t);};var me=V;var U;function de(i){return {lang:i?.lang??U?.lang,message:i?.message,abortEarly:i?.abortEarly??U?.abortEarly,abortPipeEarly:i?.abortPipeEarly??U?.abortPipeEarly}}var Le;function ze(i){return Le?.get(i)}var Ne;function Re(i){return Ne?.get(i)}var qe;function Be(i,e){return qe?.get(i)?.get(e)}function ve(i){let e=typeof i;return e==="string"?`"${i}"`:e==="number"||e==="bigint"||e==="boolean"?`${i}`:e==="object"||e==="function"?(i&&Object.getPrototypeOf(i)?.constructor?.name)??"null":e}function k(i,e,t,n,r){let s=r&&"input"in r?r.input:t.value,u=r?.expected??i.expects??null,a=r?.received??ve(s),l={kind:i.kind,type:i.type,input:s,expected:u,received:a,message:`Invalid ${e}: ${u?`Expected ${u} but r`:"R"}eceived ${a}`,requirement:i.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},p=i.kind==="schema",c=r?.message??i.message??Be(i.reference,l.lang)??(p?Re(l.lang):null)??n.message??ze(l.lang);c!==void 0&&(l.message=typeof c=="function"?c(l):c),p&&(t.typed=false),t.issues?t.issues.push(l):t.issues=[l];}function x(i){return {version:1,vendor:"valibot",validate(e){return i["~run"]({value:e},de())}}}function He(i,e){return Object.hasOwn(i,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ge(i,e,t){return typeof i.fallback=="function"?i.fallback(e,t):i.fallback}function Fe(i,e,t){return typeof i.default=="function"?i.default(e,t):i.default}function X(){return {kind:"schema",type:"any",reference:X,expects:"any",async:false,get"~standard"(){return x(this)},"~run"(i){return i.typed=true,i}}}function _(i,e){return {kind:"schema",type:"literal",reference:_,expects:ve(i),async:false,literal:i,message:e,get"~standard"(){return x(this)},"~run"(t,n){return t.value===this.literal?t.typed=true:k(this,"type",t,n),t}}}function I(i,e){return {kind:"schema",type:"object",reference:I,expects:"Object",async:false,entries:i,message:e,get"~standard"(){return x(this)},"~run"(t,n){let r=t.value;if(r&&typeof r=="object"){t.typed=true,t.value={};for(let s in this.entries){let u=this.entries[s];if(s in r||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){let a=s in r?r[s]:Fe(u),l=u["~run"]({value:a},n);if(l.issues){let p={type:"object",origin:"value",input:r,key:s,value:a};for(let c of l.issues)c.path?c.path.unshift(p):c.path=[p],t.issues?.push(c);if(t.issues||(t.issues=l.issues),n.abortEarly){t.typed=false;break}}l.typed||(t.typed=false),t.value[s]=l.value;}else if(u.fallback!==void 0)t.value[s]=Ge(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(k(this,"key",t,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:r,key:s,value:r[s]}]}),n.abortEarly))break}}else k(this,"type",t,n);return t}}}function W(i,e,t){return {kind:"schema",type:"record",reference:W,expects:"Object",async:false,key:i,value:e,message:t,get"~standard"(){return x(this)},"~run"(n,r){let s=n.value;if(s&&typeof s=="object"){n.typed=true,n.value={};for(let u in s)if(He(s,u)){let a=s[u],l=this.key["~run"]({value:u},r);if(l.issues){let c={type:"object",origin:"key",input:s,key:u,value:a};for(let h of l.issues)h.path=[c],n.issues?.push(h);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=false;break}}let p=this.value["~run"]({value:a},r);if(p.issues){let c={type:"object",origin:"value",input:s,key:u,value:a};for(let h of p.issues)h.path?h.path.unshift(c):h.path=[c],n.issues?.push(h);if(n.issues||(n.issues=p.issues),r.abortEarly){n.typed=false;break}}(!l.typed||!p.typed)&&(n.typed=false),l.typed&&(n.value[l.value]=p.value);}}else k(this,"type",n,r);return n}}}function C(i){return {kind:"schema",type:"string",reference:C,expects:"string",async:false,message:i,get"~standard"(){return x(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=true:k(this,"type",e,t),e}}}function ge(i,e,t){let n=i["~run"]({value:e},de(t));return {typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var ke="chat:init",Ve="chat:initiated";var xe=I({type:_(Ve),gaId:C()});I({type:_("GA_EVENT"),payload:W(C(),X())});var T=class{constructor(){o(this,"listeners",new Map);o(this,"unifiedMessageHandler",null);}on(e,t){let n=s=>{if(this.isValidOrigin(s))try{let u=s.data,a=typeof u=="string"?JSON.parse(u):u,{type:l}=a;l===e&&t(a);}catch(u){console.warn("Messenger: Failed to parse message data",u);}},r=this.listeners.get(e)||[];return r.push(n),this.listeners.set(e,r),this.unifiedMessageHandler||(this.unifiedMessageHandler=s=>{this.listeners.forEach(u=>u.forEach(a=>a(s)));},window.addEventListener("message",this.unifiedMessageHandler)),()=>{this.unifiedMessageHandler&&(window.removeEventListener("message",this.unifiedMessageHandler),this.unifiedMessageHandler=null);}}removeListener(e){this.listeners.delete(e);}removeAllListeners(){this.listeners.clear(),this.unifiedMessageHandler&&(window.removeEventListener("message",this.unifiedMessageHandler),this.unifiedMessageHandler=null);}postMessage(e){try{let t=this.getMessageTarget();return t?(t.postMessage(e,this.getTargetOrigin()),!0):(console.warn("Messenger: Message target not available"),!1)}catch(t){return console.error("Messenger: postMessage failed",t),false}}};var v=class extends Error{constructor(t,n,r){super(`Handshake failed: ${t}${n?` - ${n}`:""}`);this.reason=t;this.details=n;this.originalError=r;this.name="HandshakeError";}},$=class{constructor(e,t,n){this.getTargetWindow=e;this.getTargetOrigin=t;this.isValidOrigin=n;o(this,"abortController",null);o(this,"messageListener",null);}async execute(e,t={}){let{timeout:n=1e4,maxRetries:r=10,retryInterval:s=500}=t;return this.cancel(),this.abortController=new AbortController,new Promise((u,a)=>{let l=0,p,c=()=>{p&&clearTimeout(p),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null);},h=()=>{c(),a(new v("TIMEOUT","Handshake was cancelled"));};this.abortController?.signal.addEventListener("abort",h),this.messageListener=y=>{if(this.isValidOrigin(y))try{let g=y.data,Me=typeof g=="string"?JSON.parse(g):g,Z=ge(xe,Me);if(Z.success){c(),this.abortController=null,u(Z.output);return}}catch{}},window.addEventListener("message",this.messageListener),p=setTimeout(()=>{c(),this.abortController=null,a(new v("TIMEOUT",`No valid response received within ${n}ms`));},n);let J=()=>{if(!this.abortController?.signal.aborted)try{let y=this.getTargetWindow(),g=this.getTargetOrigin();if(!y)throw new v("NO_TARGET_WINDOW","Target iframe window is not available");y.postMessage(e,g),l++,l<r&&setTimeout(()=>{this.abortController?.signal.aborted||J();},s);}catch(y){c(),this.abortController=null,y instanceof v?a(y):a(new v("MESSAGE_SEND_FAILED","Failed to send handshake message",y));}};J();})}cancel(){this.abortController&&(this.abortController.abort(),this.abortController=null),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null);}isActive(){return this.abortController!==null&&!this.abortController.signal.aborted}};var b,we,Ee,M=class M extends T{constructor({hostOrigin:t,apiKey:n,eventLogger:r}){super();w(this,b);o(this,"hostOrigin");o(this,"apiKey");o(this,"iframe");o(this,"eventLogger");o(this,"postToTap",t=>{if(!this.iframe)return console.error("TapIframeBridge: iframe not found - ensure createIframeChat() was called first"),console.error("Failed to send message:",t),(t.type==="chat:open"||t.type==="chat:close")&&console.error("Chat cannot be opened/closed - iframe is not initialized"),this.eventLogger?.log({action:"iframe_message_failed",category:"error",label:t.type,customParams:{reason:"iframe_not_initialized"}}),false;let n=super.postMessage(t);return this.eventLogger?.log({action:"iframe_message_sent",category:"communication",label:t.type,customParams:{success:n}}),n});o(this,"listenToTap",super.on);this.hostOrigin=t,this.apiKey=n,this.eventLogger=r;}isValidOrigin(t){return true}getMessageTarget(){return this.iframe?.contentWindow||null}getTargetOrigin(){if(!this.iframe?.src)return "*";try{return new URL(this.iframe.src).origin}catch{return "*"}}renderIframe(t){return new Promise(n=>{this.iframe&&(this.iframe.remove(),this.iframe=null),this.iframe=document.createElement("iframe"),this.iframe.style.setProperty("display","flex","important"),this.iframe.style.setProperty("border","none","important"),this.iframe.src=m(this,b,we).call(this),this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.onload=()=>{n(this.iframe);},t?.appendChild(this.iframe);})}hasIframe(){return this.iframe!==null&&this.iframe!==void 0}async ensureIframe(t){return this.hasIframe()?this.iframe:this.renderIframe(t)}removeIframe(){this.iframe?.remove(),this.iframe=null,this.removeAllListeners();}async performHandshake(t,n=M.defaultHandshakeOptions){if(!this.iframe)throw new Error("TapIframeBridge: iframe not available for handshake");this.eventLogger?.log({action:"handshake_started",category:"communication",customParams:{iframeSrc:this.iframe.src,targetOrigin:this.getTargetOrigin(),messageTargetAvailable:!!this.getMessageTarget()}});let r=new $(()=>this.getMessageTarget(),()=>this.getTargetOrigin(),a=>this.isValidOrigin(a)),s={type:ke,hostOrigin:this.hostOrigin,apiKey:this.apiKey,chatApiParams:{...t.course,clipPlayHead:t.course.clipPlayHead??0},apiUrl:m(this,b,Ee).call(this)||""};this.eventLogger?.log({action:"handshake_message_sending",category:"communication",customParams:{messageType:s.type,hostOrigin:s.hostOrigin,hasApiKey:!!s.apiKey,apiUrl:s.apiUrl,chatApiParams:s.chatApiParams}});let u=Date.now();try{let a=await r.execute(s,n);return this.eventLogger?.log({action:"iframe_handshake",category:"system",label:"success",value:Date.now()-u,customParams:{apiUrl:s.apiUrl,targetOrigin:this.getTargetOrigin()}}),a}catch(a){throw console.error("[TapIframeBridge] Handshake failed:",a),this.eventLogger?.log({action:"iframe_handshake",category:"error",label:"failed",value:Date.now()-u,customParams:{error:a instanceof Error?a.message:"Unknown error",apiUrl:s.apiUrl}}),a instanceof Error?new Error(`TapIframeBridge handshake failed: ${a.message}`):a}}};b=new WeakSet,we=function(){if(typeof window>"u"||typeof localStorage>"u")throw new Error("TapIframeBridge: window or localStorage is not defined");try{let t=localStorage.getItem("tap-url-storage");if(t){let n=JSON.parse(t);this.eventLogger?.log({action:"custom_tap_url_found",category:"configuration",customParams:{stored:n}});let r=n?.state?.tapUrl;if(r)return this.eventLogger?.log({action:"custom_tap_url_used",category:"configuration",customParams:{customTapUrl:r}}),`${r}/chat`}}catch{}return "https://edutap-ai.vercel.app/chat"},Ee=function(){if(!(typeof window>"u"||typeof localStorage>"u"))try{let t=localStorage.getItem("tap-api-url-storage");return t?JSON.parse(t)?.state?.apiUrl:void 0}catch{return}},o(M,"defaultHandshakeOptions",{retryInterval:500,maxRetries:3,timeout:3e4});var A=M;var j=class{constructor(e){this.iframeBridge=e;}seekTimeline({clipId:e,clipPlayHead:t}){this.iframeBridge.postToTap({type:"timeline:seek",clipId:e,clipPlayHead:t});}onTimelineSeek(e){this.iframeBridge.listenToTap("timeline:seek",t=>e(t.clipPlayHead,t.clipId));}onChatOpened(e){this.iframeBridge.listenToTap("chat:opened",e);}onChatClosed(e){this.iframeBridge.listenToTap("chat:closed",e);}onChatInitiated(e){this.iframeBridge.listenToTap("chat:initiated",e);}onAlarmFadeIn(e){this.iframeBridge.listenToTap("alarm:fadeIn",t=>{e(t.messageInfo);});}onPopUpOpen(e){this.iframeBridge.listenToTap("popUp:open",t=>{e(t.popUpInfo);});}onPdfOpen(e){this.iframeBridge.listenToTap("pdf:open",e);}onPdfClose(e){this.iframeBridge.listenToTap("pdf:close",e);}};var Ue="G-27C0E436HL",D=class{constructor(e=Ue){this.gaId=e;this.gaId&&typeof window<"u"&&this.initializeGA(this.gaId);}initializeGA(e){if(document.querySelector(`script[src*="googletagmanager.com/gtag/js?id=${e}"]`))return;let t=document.createElement("script");if(t.async=true,t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(t),typeof window.gtag!="function"){let n=document.createElement("script");n.innerHTML=`
19
19
  window.dataLayer = window.dataLayer || [];
20
20
  function gtag(){dataLayer.push(arguments);}
21
21
  gtag('js', new Date());
22
22
  gtag('config', '${e}');
23
- `,document.head.appendChild(n);}}handle(e){typeof window.gtag=="function"?window.gtag("event",e.action,{event_category:e.category,event_label:e.label,value:e.value,...e.customParams}):this.gaId&&console.warn("[GAMiddleware] gtag not available, event queued:",e);}},P=class{constructor(e=false){this.enabled=e;}handle(e){this.enabled&&console.log("[TapSDK Event]",e);}},B=class{constructor(){o(this,"middlewares",[]);}addMiddleware(e){this.middlewares.push(e);}removeMiddleware(e){let t=this.middlewares.indexOf(e);t>-1&&this.middlewares.splice(t,1);}log(e){this.middlewares.forEach(t=>{try{t.handle(e);}catch(n){console.warn("[EventLogger] Middleware error:",n);}});}logChatAction(e,t){this.log({action:`chat_${e}`,category:"engagement",customParams:{timestamp:Date.now(),...t}});}logButtonClick(e,t,n){let i={action:`${e}_button_clicked`,category:"user_interaction",customParams:{timestamp:Date.now(),...n}};t!==void 0&&(i.label=t),this.log(i);}logSDKInitialization(e,t,n){let i=Date.now()-t,s={action:"sdk_initialization",category:"system",label:e?"success":"failure",value:i,customParams:{timestamp:Date.now(),...n&&{error:n}}};this.log(s);}};var Te="wu2gm66",Ce="wu2gm67",Ae="wu2gm68";function Xe({htmlString:r,callback:e,customStyles:t}){let n=document.createElement("div");n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.width="100vw",n.style.height="100vh",n.style.background="rgba(0, 0, 0, 0.4)",n.style.zIndex="10000002";let i=document.createElement("div");i.id="wow",i.style.position="fixed",i.style.display="flex",i.style.flexDirection="column";let u=15;if(t?.width){let d=parseFloat(t.width),y=t.width.match(/[a-zA-Z%]+/)?.[0];!isNaN(d)&&y==="px"&&(u+=d);}else u+=340;if(t?.position?.right){let d=parseFloat(t?.position?.right),y=t?.position?.right.match(/[a-zA-Z%]+/)?.[0];!isNaN(d)&&y==="px"&&(u+=d);}else u=u+24;i.style.top=t?.position?.top??"50px",i.style.right=`${u}px`,i.style.left=t?.position?.left??"unset",i.style.bottom=t?.position?.bottom??"unset",i.style.maxWidth="calc(100vw - 100px)",i.style.maxHeight=t?.height??"calc(100vh - 116px)",i.style.overflow="auto",i.style.background="#fff",i.style.padding="20px",i.style.border="1px solid #ccc",i.style.boxShadow="0 4px 20px rgba(0,0,0,0.2)",i.style.zIndex="10000003",i.style.borderRadius="8px";let a=document.createElement("div");a.innerHTML=r,n.addEventListener("click",()=>{document.body.removeChild(n),document.body.removeChild(i),e();}),i.addEventListener("click",d=>{d.stopPropagation();}),i.appendChild(a),document.body.appendChild(n),document.body.appendChild(i);let l=document.querySelector(`.${Te}`),p=document.querySelector(".cw-plugin-code-block"),c=document.querySelector(`.${Ae}`),f=document.querySelector(`.${Ce}`);l&&p&&c&&f&&l.addEventListener("click",()=>{navigator.clipboard.writeText(p.textContent??""),c.style.display="none",f.textContent="\uBCF5\uC0AC\uB428",setTimeout(()=>{f.textContent="\uBCF5\uC0AC",c.style.display="inline";},1e3);});}var Me=Xe;var L,De,K=class{constructor({apiKey:e}){v(this,L);o(this,"apiKey");o(this,"iframeBridge");o(this,"events");o(this,"eventLogger");o(this,"chatBody");o(this,"chatBodyMaker");o(this,"button");o(this,"alarm");o(this,"chatBodyVisible");o(this,"isPdfOpen");o(this,"_isInitialized",false);this.apiKey=e,this.eventLogger=new B,m(this,L,De).call(this),this.iframeBridge=new D({hostOrigin:window.location.origin,apiKey:this.apiKey,eventLogger:this.eventLogger}),this.events=new $(this.iframeBridge),this.button=new ne,this.alarm=new ve,this.chatBodyMaker=new te,this.chatBodyVisible="closed",this.isPdfOpen=false;}get isOpen(){return this.chatBodyVisible==="open"}get isInitialized(){return this._isInitialized}async init({buttonId:e,course:t,customStyles:n}){if(this._isInitialized){this.eventLogger.log({action:"sdk_already_initialized",category:"warning",customParams:{timestamp:Date.now()}});return}let i=Date.now();try{await this.validateEnvironment(),await this.setupChatBody(n),await Promise.all([this.setupButton(e),this.iframeBridge.ensureIframe(this.chatBody)]),this.setupEventListeners(n),await this.iframeBridge.performHandshake({chatApiParams:t,customStyles:n}),this._isInitialized=!0,this.eventLogger.logSDKInitialization(!0,i);}catch(s){let u=s instanceof Error?s.message:"Unknown error";throw this.eventLogger.logSDKInitialization(false,i,u),s}}destroy(){if(!this._isInitialized){this.eventLogger.log({action:"sdk_destroy_not_initialized",category:"warning",customParams:{timestamp:Date.now()}});return}this.chatBodyMaker.removeChatBody(),this.alarm.remove(),this.iframeBridge.removeIframe(),this.chatBody=void 0,this.chatBodyVisible="closed",this._isInitialized=false;}isClient(){return typeof window<"u"&&typeof document<"u"}setChatBodyVisible(e){this.chatBodyVisible=e;}setIsPdfOpen(e){this.isPdfOpen=e;}toggleChatOpen(){let e=this.chatBodyVisible==="open"?"chat:close":"chat:open";try{this.iframeBridge.postToTap({type:e})||this.eventLogger.log({action:"chat_message_send_failed",category:"error",label:e,customParams:{timestamp:Date.now()}});}catch(t){this.eventLogger.log({action:"chat_message_send_error",category:"error",customParams:{messageType:e,error:t instanceof Error?t.message:"Unknown error",timestamp:Date.now()}});}}async validateEnvironment(){if(!this.isClient())throw new Error("Not running in client environment: window is not defined")}async setupChatBody(e){if(!this.chatBody){let t=this.chatBodyMaker.createChatBody({...e?.chatBody&&{customChatBody:e.chatBody}});if(!t)throw new Error("Failed to create chat body");this.chatBody=t;}}async setupButton(e){let t=this.button.create(e);this.button.onClick(async()=>{await this.iframeBridge.ensureIframe(this.chatBody),this.eventLogger.logButtonClick("toggle",this.chatBodyVisible==="open"?"open":"closed"),this.toggleChatOpen();}),this.alarm.render({rootElement:t}),this.alarm.onAlarmClick(n=>{this.eventLogger.logButtonClick("alarm"),this.iframeBridge.postToTap({type:"chat:open",isAlarm:true}),this.iframeBridge.postToTap({type:"alarm:click",messageInfo:n});});}setupEventListeners(e){this.iframeBridge.listenToTap("chat:opened",()=>{this.setChatBodyVisible("open"),this.chatBodyMaker.toggleVisibility(this.chatBodyVisible==="open"),this.alarm.remove(),this.eventLogger.logChatAction("opened");}),this.iframeBridge.listenToTap("chat:closed",()=>{this.setChatBodyVisible("closed"),this.chatBodyMaker.toggleVisibility(this.chatBodyVisible==="open"),this.eventLogger.logChatAction("closed");}),this.iframeBridge.listenToTap("alarm:fadeIn",t=>{this.chatBodyVisible!=="open"&&this.alarm.fadeIn(t.messageInfo);}),this.iframeBridge.listenToTap("popUp:open",t=>{Me({htmlString:t.popUpInfo.html,callback:()=>this.iframeBridge.postToTap({type:"popUp:close"}),...e?.chatBody&&{customStyles:e.chatBody}});}),this.iframeBridge.listenToTap("pdf:open",()=>{this.setIsPdfOpen(true),this.chatBodyMaker.resizeChatBody(this.isPdfOpen,e?.chatBody);}),this.iframeBridge.listenToTap("pdf:close",()=>{this.setIsPdfOpen(false),this.chatBodyMaker.resizeChatBody(this.isPdfOpen,e?.chatBody);});}async initChat(e){return this.init(e)}postChatInfo({clipId:e,clipPlayHead:t}){this.events.seekTimeline({clipId:e,clipPlayHead:t});}getTimelineInfo({callback:e}){this.events.onTimelineSeek(e);}};L=new WeakSet,De=function(){if(typeof window>"u"||typeof localStorage>"u")return;localStorage.getItem("tap-environment")==="local"&&this.eventLogger.addMiddleware(new P(true)),this.eventLogger.addMiddleware(new j);};var Kt=K;return Kt;})();//# sourceMappingURL=index.global.js.map
23
+ `,document.head.appendChild(n);}}handle(e){typeof window.gtag=="function"?window.gtag("event",e.action,{event_category:e.category,event_label:e.label,value:e.value,...e.customParams}):this.gaId&&console.warn("[GAMiddleware] gtag not available, event queued:",e);}},O=class{constructor(e=false){this.enabled=e;}handle(e){this.enabled&&console.log("[TapSDK Event]",e);}},P=class{constructor(){o(this,"middlewares",[]);}addMiddleware(e){this.middlewares.push(e);}removeMiddleware(e){let t=this.middlewares.indexOf(e);t>-1&&this.middlewares.splice(t,1);}log(e){this.middlewares.forEach(t=>{try{t.handle(e);}catch(n){console.warn("[EventLogger] Middleware error:",n);}});}logChatAction(e,t){this.log({action:`chat_${e}`,category:"engagement",customParams:{timestamp:Date.now(),...t}});}logButtonClick(e,t,n){let r={action:`${e}_button_clicked`,category:"user_interaction",customParams:{timestamp:Date.now(),...n}};t!==void 0&&(r.label=t),this.log(r);}logSDKInitialization(e,t,n){let r=Date.now()-t,s={action:"sdk_initialization",category:"system",label:e?"success":"failure",value:r,customParams:{timestamp:Date.now(),...n&&{error:n}}};this.log(s);}};var _e="_1mnmljf6",Ie="_1mnmljf7",Ce="_1mnmljf8";var Te="_1mnmljf9";var $e="_1mnmljfa";var S=15;function We({htmlString:i,callback:e,containerRect:t}){let n=document.createElement("div");n.className=Te;let r=document.createElement("div");if(r.className=$e,t){let c=t.left-S;r.style.top=`${t.top}px`,r.style.left="unset",r.style.bottom="unset",c<S?(r.style.left=`${t.right+S}px`,r.style.right="unset"):r.style.right=`${window.innerWidth-c}px`;}else r.style.top="50px",r.style.right=`${S+340+24}px`,r.style.left="unset",r.style.bottom="unset";r.style.maxHeight="calc(100vh - 116px)";let s=document.createElement("div");s.innerHTML=i,n.addEventListener("click",()=>{document.body.removeChild(n),document.body.removeChild(r),e();}),r.addEventListener("click",c=>{c.stopPropagation();}),r.appendChild(s),document.body.appendChild(n),document.body.appendChild(r);let u=document.querySelector(`.${_e}`),a=document.querySelector(".cw-plugin-code-block"),l=document.querySelector(`.${Ce}`),p=document.querySelector(`.${Ie}`);u&&a&&l&&p&&u.addEventListener("click",()=>{navigator.clipboard.writeText(a.textContent??""),l.style.display="none",p.textContent="\uBCF5\uC0AC\uB428",setTimeout(()=>{p.textContent="\uBCF5\uC0AC",l.style.display="inline";},1e3);});}var Ae=We;var K=class{constructor({apiKey:e}){o(this,"apiKey");o(this,"iframeBridge");o(this,"events");o(this,"eventLogger");o(this,"container");o(this,"button");o(this,"alarm");o(this,"containerVisible");o(this,"isPdfOpen");o(this,"_isInitialized",false);this.apiKey=e,this.eventLogger=new P,this.setupEventLogger(),this.iframeBridge=new A({hostOrigin:window.location.origin,apiKey:this.apiKey,eventLogger:this.eventLogger}),this.events=new j(this.iframeBridge),this.button=new ee,this.alarm=new me,this.container=new N,this.containerVisible="closed",this.isPdfOpen=false;}get isOpen(){return this.containerVisible==="open"}get isInitialized(){return this._isInitialized}async init({buttonId:e,course:t,container:n}){if(this._isInitialized){this.eventLogger.log({action:"sdk_already_initialized",category:"warning",customParams:{timestamp:Date.now()}});return}let r=Date.now();try{await this.validateEnvironment(),await this.setupContainer(n),await Promise.all([this.setupButton(e),this.iframeBridge.ensureIframe(this.container.element)]),this.setupEventListeners(n),await this.iframeBridge.performHandshake({course:t,...n&&{container:n}}),this._isInitialized=!0,this.eventLogger.logSDKInitialization(!0,r);}catch(s){let u=s instanceof Error?s.message:"Unknown error";throw this.eventLogger.logSDKInitialization(false,r,u),s}}destroy(){if(!this._isInitialized){this.eventLogger.log({action:"sdk_destroy_not_initialized",category:"warning",customParams:{timestamp:Date.now()}});return}N.resetInstance(),this.alarm.remove(),this.iframeBridge.removeIframe(),this.containerVisible="closed",this._isInitialized=false;}setupEventLogger(){if(typeof window>"u"||typeof localStorage>"u")return;localStorage.getItem("tap-environment")==="local"?this.eventLogger.addMiddleware(new O(true)):this.eventLogger.addMiddleware(new D);}toggleChatOpen(){let e=this.containerVisible==="open"?"chat:close":"chat:open";try{this.iframeBridge.postToTap({type:e})||this.eventLogger.log({action:"chat_message_send_failed",category:"error",label:e,customParams:{timestamp:Date.now()}});}catch(t){this.eventLogger.log({action:"chat_message_send_error",category:"error",customParams:{messageType:e,error:t instanceof Error?t.message:"Unknown error",timestamp:Date.now()}});}}async validateEnvironment(){if(typeof window>"u"||typeof document>"u")throw new Error("Not running in client environment: window is not defined")}async setupContainer(e){if(this.container.element)this.updateContainerStyles(e);else if(!this.container.createContainer({...e&&{customContainer:e}}))throw new Error("Failed to create container")}updateContainerStyles(e){e&&this.container.updateStyles(e);}async setupButton(e){let t=this.button.create(e);this.button.onClick(async()=>{await this.iframeBridge.ensureIframe(this.container.element);let n=this.containerVisible==="open"?"open":"closed";this.eventLogger.logButtonClick("toggle",n),this.toggleChatOpen();}),this.alarm.render({rootElement:t}),this.alarm.onAlarmClick(n=>{this.eventLogger.logButtonClick("alarm"),this.iframeBridge.postToTap({type:"chat:open",isAlarm:true}),this.iframeBridge.postToTap({type:"alarm:click",messageInfo:n});});}setupEventListeners(e){this.iframeBridge.listenToTap("chat:opened",()=>{this.containerVisible="open",this.container.toggleVisibility(this.containerVisible==="open"),this.alarm.remove(),this.eventLogger.logChatAction("opened");}),this.iframeBridge.listenToTap("chat:closed",()=>{this.containerVisible="closed",this.container.toggleVisibility(false),this.eventLogger.logChatAction("closed");}),this.iframeBridge.listenToTap("alarm:fadeIn",t=>{this.containerVisible!=="open"&&this.alarm.fadeIn(t.messageInfo);}),this.iframeBridge.listenToTap("popUp:open",t=>{let n=this.container.getBoundingClientRect();Ae({htmlString:t.popUpInfo.html,callback:()=>this.iframeBridge.postToTap({type:"popUp:close"}),containerRect:n});}),this.iframeBridge.listenToTap("pdf:open",()=>{this.isPdfOpen=true,this.container.resizeContainer(this.isPdfOpen,e);}),this.iframeBridge.listenToTap("pdf:close",()=>{this.isPdfOpen=false,this.container.resizeContainer(this.isPdfOpen,e);});}updateStyles(e){if(!this._isInitialized){console.warn("SDK not initialized. Call init() first.");return}this.updateContainerStyles(e);}setContainerSize(e,t){if(!this._isInitialized){console.warn("SDK not initialized. Call init() first.");return}this.container.setDynamicSize(e,t);}animateContainerResize(e,t,n){if(!this._isInitialized){console.warn("SDK not initialized. Call init() first.");return}this.container.animateResize(e,t,n);}setResponsiveMode(e){if(!this._isInitialized){console.warn("SDK not initialized. Call init() first.");return}this.container.setResponsiveMode(e);}async initChat(e){return this.init(e)}postChatInfo({clipId:e,clipPlayHead:t}){this.events.seekTimeline({clipId:e,clipPlayHead:t});}getTimelineInfo({callback:e}){this.events.onTimelineSeek(e);}},Kt=K;return Kt;})();//# sourceMappingURL=index.global.js.map
24
24
  //# sourceMappingURL=index.global.js.map