@designbasekorea/ui-wc 0.1.0
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/README.md +83 -0
- package/dist/chunks/lottie-aaf17dfb.js +1 -0
- package/dist/chunks/prism-10c2500e.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3261 -0
- package/dist/index.esm.js +1 -0
- package/dist/react/chunks/lottie-eed75107.js +1 -0
- package/dist/react/chunks/prism-0e153489.js +1 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +6355 -0
- package/dist/react/index.esm.js +1 -0
- package/package.json +86 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function _mergeNamespaces(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}const ICON_PATHS={"arrow-bar-left":'<path fill="currentColor" d="M20.75 20h-1.5V4h1.5zM11.03 6.53l-4.72 4.72H16v1.5H6.31l4.72 4.72-1.06 1.06L3.44 12l6.53-6.53z"/>',"arrow-bar-right":'<path fill="currentColor" d="M4.75 20h-1.5V4h1.5zm15.81-8-6.53 6.53-1.06-1.06 4.72-4.72H8v-1.5h9.69l-4.72-4.72 1.06-1.06z"/>',award:'<path fill="currentColor" d="M11.753 15.5c-1.8 0-3.5-.7-4.77-1.98a6.74 6.74 0 0 1-1.98-4.77c0-1.8.7-3.5 1.98-4.77A6.74 6.74 0 0 1 11.753 2c1.8 0 3.5.7 4.77 1.98a6.74 6.74 0 0 1 1.98 4.77c0 1.8-.7 3.5-1.98 4.77a6.74 6.74 0 0 1-4.77 1.98m0-12c-1.4 0-2.72.55-3.71 1.54a5.22 5.22 0 0 0-1.54 3.71c0 1.4.55 2.72 1.54 3.71a5.22 5.22 0 0 0 3.71 1.54c1.4 0 2.72-.55 3.71-1.54a5.22 5.22 0 0 0 1.54-3.71c0-1.4-.55-2.72-1.54-3.71a5.22 5.22 0 0 0-3.71-1.54"/><path fill="currentColor" d="M15.313 21.5a.74.74 0 0 1-.64-.37l-3.56-5.96a.751.751 0 1 1 1.29-.77l2.86 4.8 1.06-2.07a.76.76 0 0 1 .72-.41l2.33.17-2.95-4.99a.76.76 0 0 1 .26-1.03c.36-.21.82-.09 1.03.26l3.68 6.22c.14.24.14.54 0 .78s-.4.37-.69.35l-3.27-.23-1.45 2.83c-.12.24-.37.4-.64.41h-.02z"/><path fill="currentColor" d="M8.193 21.5h-.02c-.27 0-.52-.17-.64-.41l-1.45-2.83-3.28.23a.75.75 0 0 1-.69-.35.73.73 0 0 1 0-.78l3.69-6.18c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-2.95 4.95 2.34-.17c.31-.01.58.14.72.41l1.06 2.07 2.86-4.8c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-3.56 5.96c-.14.23-.38.37-.64.37z"/>',apple:'<path fill="currentColor" fill-rule="evenodd" d="M18.644 18.648q-.807 1.15-1.316 1.592-.787.723-1.692.744-.649.001-1.562-.373-.914-.372-1.683-.371-.805-.001-1.73.371-.924.375-1.495.393-.866.038-1.729-.764-.55-.48-1.377-1.648-.885-1.245-1.455-2.891-.61-1.78-.611-3.447 0-1.91.826-3.292a4.86 4.86 0 0 1 1.73-1.751 4.65 4.65 0 0 1 2.34-.662q.69.001 1.81.422t1.436.422q.237 0 1.593-.498 1.279-.46 2.163-.384 2.4.192 3.6 1.895-2.145 1.301-2.123 3.637.02 1.82 1.317 3.023a4.3 4.3 0 0 0 1.315.863q-.159.46-.336.882a10.3 10.3 0 0 1-1.021 1.837M14.959 5.039c-.836.976-1.846 1.541-2.941 1.452a3 3 0 0 1-.021-.36c0-.913.396-1.889 1.103-2.688q.528-.607 1.343-1.009.813-.397 1.536-.435.02.192.019.381-.001 1.426-1.039 2.659" clip-rule="evenodd"/>',"play-store":'<path fill="currentColor" fill-rule="evenodd" d="M15.911 8.659 6.36 3.29c-.633-.342-1.226-.39-1.746-.016l8.34 8.34zm3.578 4.69c.6-.336.929-.812.929-1.34 0-.527-.329-1.004-.928-1.34l-2.783-1.563-3.133 3.132 2.841 2.84zM4 4.659v14.706c0 .38.084.709.236.97l8.097-8.098L4.1 4.002c-.064.197-.1.417-.1.658m.902 16.25q.232.09.495.09.47 0 .968-.275l9.255-5.197-2.666-2.67z" clip-rule="evenodd"/>',"arrow-right":'<path fill="currentColor" d="m20.06 12-7.53 7.53-1.06-1.06 5.72-5.72H4v-1.5h13.19l-5.72-5.72 1.06-1.06z"/>',star:'<path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"star-filled":'<path fill="currentColor" d="M23 9c-.1-.4-.4-.6-.8-.7l-6.4-.9-2.9-5.8c-.3-.7-1.5-.7-1.8 0L8.2 7.4l-6.4.9c-.4 0-.7.3-.8.7s0 .8.3 1l4.6 4.5-1.1 6.4c0 .4 0 .8.4 1 .3.2.7.3 1.1 0l5.7-3 5.7 3c.1 0 .3.1.5.1s.4 0 .6-.2c.3-.2.5-.6.4-1l-1.1-6.4 4.6-4.5c.3-.3.4-.7.3-1z"/>',"trending-up":'<path fill="currentColor" d="M22 11V5h-6"/><path fill="currentColor" fill-rule="evenodd" d="M21.53 6.53 13 15.06l-3-3-6.47 6.47-1.06-1.06L10 9.94l3 3 7.47-7.47z" clip-rule="evenodd"/>',cart:'<path fill="currentColor" d="M3 2.25c.945 0 1.714.75 1.747 1.688L4.94 6.25h16.899l-1.167 10.5h-2.093a2.75 2.75 0 1 1-3.156 0H9.578a2.75 2.75 0 1 1-3.156 0H4.31L3.253 4.063 3.25 4.03V4A.25.25 0 0 0 3 3.75H1v-1.5zm5 15.5a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 8 17.75m9 0a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 17 17.75m-11.31-2.5h13.64l.832-7.5H5.064z"/>',"bell-active":'<path fill="currentColor" fill-rule="evenodd" d="M6.75 10.015V13c0 1.445-.466 2.453-1.06 3.25h12.62c-.594-.797-1.06-1.805-1.06-3.25v-2.985c-.047-1.117-.55-2.449-1.465-3.497C14.879 5.479 13.6 4.75 12 4.75s-2.879.73-3.785 1.768c-.914 1.048-1.418 2.38-1.465 3.497m.335-4.483C8.229 4.221 9.9 3.25 12 3.25s3.771.97 4.915 2.282c1.132 1.298 1.777 2.96 1.834 4.44l.001.028v3c0 1.67.788 2.477 1.78 3.47a.75.75 0 0 1-.53 1.28H4a.75.75 0 0 1-.53-1.28c.992-.992 1.78-1.8 1.78-3.47V9.971c.057-1.48.703-3.141 1.835-4.439" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9 16.25a.75.75 0 0 1 .75.75v1c0 1.286.964 2.25 2.25 2.25s2.25-.964 2.25-2.25v-1a.75.75 0 0 1 1.5 0v1c0 2.114-1.636 3.75-3.75 3.75S8.25 20.114 8.25 18v-1a.75.75 0 0 1 .75-.75M17.424 2.52a.75.75 0 0 1 1.056-.096c1.307 1.089 2.463 2.786 3.19 4.24a.75.75 0 1 1-1.34.671c-.673-1.345-1.717-2.848-2.81-3.759a.75.75 0 0 1-.096-1.056M6.576 2.52a.75.75 0 0 1-.096 1.056c-1.093.911-2.137 2.414-2.81 3.76a.75.75 0 0 1-1.34-.671c.727-1.455 1.883-3.152 3.19-4.241a.75.75 0 0 1 1.056.096M12 1.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75" clip-rule="evenodd"/>',"caret-down-filled":'<path fill="currentColor" d="m12 14.5 5-5H7z"/>',"caret-updown-filled":'<path fill="currentColor" fill-rule="evenodd" d="m7 10 5-5 5 5zM17 14l-5 5-5-5z" clip-rule="evenodd"/>',"chevron-down":'<path fill="currentColor" fill-rule="evenodd" d="m5.47 9.53 1.06-1.06L12 13.94l5.47-5.47 1.06 1.06L12 16.06z" clip-rule="evenodd"/>',"chevron-up":'<path fill="currentColor" fill-rule="evenodd" d="m12 7.94 6.53 6.53-1.06 1.06L12 10.06l-5.47 5.47-1.06-1.06z" clip-rule="evenodd"/>',"chevron-left":'<path fill="currentColor" fill-rule="evenodd" d="m10.06 12 5.47-5.47-1.06-1.06L7.94 12l6.53 6.53 1.06-1.06z" clip-rule="evenodd"/>',"chevron-right":'<path fill="currentColor" fill-rule="evenodd" d="M9.53 5.47 16.06 12l-6.53 6.53-1.06-1.06L13.94 12 8.47 6.53z" clip-rule="evenodd"/>',calendar:'<path fill="currentColor" fill-rule="evenodd" d="M16.25 8V2h1.5v6zM6.25 8V2h1.5v6zM21 11.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75a.25.25 0 0 0-.25.25v14c0 .138.112.25.25.25h16a.25.25 0 0 0 .25-.25V6a.25.25 0 0 0-.25-.25zM2.25 6c0-.966.784-1.75 1.75-1.75h16c.966 0 1.75.784 1.75 1.75v14A1.75 1.75 0 0 1 20 21.75H4A1.75 1.75 0 0 1 2.25 20z" clip-rule="evenodd"/>',clock:'<path fill="currentColor" fill-rule="evenodd" d="M12.75 11.25V6h-1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12" clip-rule="evenodd"/>',bulb:'<path fill="currentColor" d="M15.5 17.5H8v-.75s-.02-1.79-1.06-3.21l-.29-.39C5.88 12.12 5 10.95 5 8.93 5 5.11 8.03 2 11.75 2s6.75 3.11 6.75 6.93c0 2-.87 3.17-1.65 4.2l-.29.39c-1.05 1.45-1.06 3.21-1.06 3.23zM9.44 16h4.62c.11-.81.42-2.16 1.29-3.36l.31-.41c.69-.93 1.35-1.8 1.35-3.31 0-2.99-2.36-5.43-5.25-5.43S6.5 5.93 6.5 8.93c0 1.52.66 2.4 1.35 3.32l.31.41c.86 1.19 1.17 2.53 1.28 3.34M15.75 20h-8v1.5h8z"/>',"circle-checked":'<path fill="currentColor" fill-rule="evenodd" d="m10.32 14.27 6.15-6.134 1.06 1.062-7.22 7.2L6.467 12.5l1.068-1.054z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M1.25 12C1.25 6.086 6.086 1.25 12 1.25S22.75 6.086 22.75 12 17.914 22.75 12 22.75 1.25 17.914 1.25 12M12 2.75c-5.086 0-9.25 4.164-9.25 9.25s4.164 9.25 9.25 9.25 9.25-4.164 9.25-9.25S17.086 2.75 12 2.75" clip-rule="evenodd"/>',"cloud-close":'<path fill="currentColor" fill-rule="evenodd" d="M5.23 9.323A7.75 7.75 0 0 1 12.5 4.25c3.782 0 6.923 2.71 7.606 6.291A4.74 4.74 0 0 1 23.25 15a4.75 4.75 0 0 1-4.75 4.75H6A5.25 5.25 0 0 1 .75 14.5c0-2.64 1.95-4.805 4.48-5.177M12.5 5.75a6.25 6.25 0 0 0-5.993 4.483l-.15.512-.534.025A3.74 3.74 0 0 0 2.25 14.5 3.75 3.75 0 0 0 6 18.25h12.5a3.243 3.243 0 0 0 .763-6.398l-.504-.122-.064-.514A6.25 6.25 0 0 0 12.5 5.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m14.47 15.53-5-5 1.06-1.06 5 5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m9.47 14.47 5-5 1.06 1.06-5 5z" clip-rule="evenodd"/>',close:'<path fill="currentColor" fill-rule="evenodd" d="m5.47 17.47 12-12 1.06 1.06-12 12z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m6.53 5.47 12 12-1.06 1.06-12-12z" clip-rule="evenodd"/>',done:'<path fill="currentColor" fill-rule="evenodd" d="M9.476 15.936 18.97 6.47l1.06 1.062L9.468 18.064l-5.502-5.58 1.068-1.053z" clip-rule="evenodd"/>',"error-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5M8.47 9.53l1.06-1.06L12 10.94l2.47-2.47 1.06 1.06L13.06 12l2.47 2.47-1.06 1.06L12 13.06l-2.47 2.47-1.06-1.06L10.94 12z" clip-rule="evenodd"/>',edit:'<path fill="currentColor" fill-rule="evenodd" d="M15.506 3.322a3.655 3.655 0 0 1 5.172 0 3.655 3.655 0 0 1 0 5.172L7.466 21.75H2.25v-5.215zm2.586.428c-.572 0-1.121.227-1.525.632l-.002.001L3.75 17.157v3.093h3.093L19.618 7.434a2.16 2.16 0 0 0-1.526-3.684" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M17.7 10.453 13.548 6.3l1.06-1.06 4.154 4.154z" clip-rule="evenodd"/>',gallery:'<path fill="currentColor" d="M7.5 11c.8 0 1.5-.7 1.5-1.5S8.3 8 7.5 8 6 8.7 6 9.5 6.7 11 7.5 11"/><path fill="currentColor" fill-rule="evenodd" d="m16.698 9.015 5.787 4.913-.97 1.144-4.813-4.087L5.487 20.57l-.974-1.14z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 4.75c-.69 0-1.25.56-1.25 1.25v12c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V6c0-.69-.56-1.25-1.25-1.25zM1.25 6A2.75 2.75 0 0 1 4 3.25h16A2.75 2.75 0 0 1 22.75 6v12A2.75 2.75 0 0 1 20 20.75H4A2.75 2.75 0 0 1 1.25 18z" clip-rule="evenodd"/>',hide:'<path fill="currentColor" fill-rule="evenodd" d="M8.343 11.2c.056-.27.147-.581.284-.842l1.328.696c-.047.09-.102.252-.145.454-.041.199-.06.381-.06.492A2.27 2.27 0 0 0 12 14.25c.284 0 .685-.056.983-.2l.65 1.352c-.57.274-1.217.348-1.633.348-2.056 0-3.75-1.694-3.75-3.75 0-.238.035-.527.093-.8" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.477-.936 1.58-2.68 3.626-3.843l-.742-1.304c-2.695 1.534-3.975 3.906-4.4 4.835L1.176 12l.143.312c.685 1.5 3.5 6.438 10.682 6.438 1.62 0 3.026-.253 4.242-.667l-.484-1.42c-1.054.36-2.297.587-3.758.587-5.874 0-8.377-3.707-9.167-5.25M12 6.75c-.673 0-1.6.084-2.202.227l-.346-1.46c.746-.177 1.797-.267 2.548-.267 7.182 0 9.997 4.939 10.682 6.438l.143.312-.143.312a11.1 11.1 0 0 1-3.22 4.037l-.923-1.184A9.7 9.7 0 0 0 21.166 12c-.79-1.544-3.292-5.25-9.166-5.25" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m19.763 22.237-18-18 1.06-1.06 18 18z" clip-rule="evenodd"/>',"info-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5m-.75 5h1.5v1.5h-1.5zm0 3h1.5v6.5h-1.5z" clip-rule="evenodd"/>',lock:'<path fill="currentColor" fill-rule="evenodd" d="M5 11.75a.25.25 0 0 0-.25.25v8c0 .138.112.25.25.25h14a.25.25 0 0 0 .25-.25v-8a.25.25 0 0 0-.25-.25zM3.25 12c0-.966.784-1.75 1.75-1.75h14c.966 0 1.75.784 1.75 1.75v8A1.75 1.75 0 0 1 19 21.75H5A1.75 1.75 0 0 1 3.25 20z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A3.26 3.26 0 0 0 8.75 7v4h-1.5V7A4.76 4.76 0 0 1 12 2.25 4.76 4.76 0 0 1 16.75 7v4h-1.5V7A3.26 3.26 0 0 0 12 3.75" clip-rule="evenodd"/>',mail:'<path fill="currentColor" fill-rule="evenodd" d="m1.665 8.67.67-1.34L12 12.161l9.665-4.833.67 1.342L12 13.839z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V7c0-.69-.56-1.25-1.25-1.25zM1.25 7A2.75 2.75 0 0 1 4 4.25h16A2.75 2.75 0 0 1 22.75 7v10A2.75 2.75 0 0 1 20 19.75H4A2.75 2.75 0 0 1 1.25 17z" clip-rule="evenodd"/>',minus:'<path fill="currentColor" fill-rule="evenodd" d="M6 10.75h12v1.5H6z" clip-rule="evenodd"/>',"more-vertical":'<path fill="currentColor" d="M11.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',pause:'<path fill="currentColor" fill-rule="evenodd" d="M8 6.75h2.5v10.5H8zm5.5 0H16v10.5h-2.5z" clip-rule="evenodd"/>',play:'<path fill="currentColor" fill-rule="evenodd" d="M9.5 7.21v9.58l7.5-4.79z" clip-rule="evenodd"/>',plus:'<path fill="currentColor" fill-rule="evenodd" d="M11.25 11.25v-7h1.5v7h7v1.5h-7v7h-1.5v-7h-7v-1.5z" clip-rule="evenodd"/>',copy:'<path fill="currentColor" fill-rule="evenodd" d="M8 3.75a.25.25 0 0 0-.25.25v12c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V4a.25.25 0 0 0-.25-.25zM6.25 4c0-.966.784-1.75 1.75-1.75h12c.966 0 1.75.784 1.75 1.75v12A1.75 1.75 0 0 1 20 17.75H8A1.75 1.75 0 0 1 6.25 16z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M3.75 9v9A2.25 2.25 0 0 0 6 20.25h9v1.5H6A3.75 3.75 0 0 1 2.25 18V9z" clip-rule="evenodd"/>',code:'<path fill="currentColor" fill-rule="evenodd" d="m6.47 7.47 1.06 1.06L4.06 12l3.47 3.47-1.06 1.06L1.94 12zM19.94 12l-3.47-3.47 1.06-1.06L22.06 12l-4.53 4.53-1.06-1.06zM8.31 18.705l6-14 1.38.59-6 14z" clip-rule="evenodd"/>',write:'<path fill="currentColor" fill-rule="evenodd" d="M3.056 6.056A2.75 2.75 0 0 1 5 5.25h3v1.5H5A1.25 1.25 0 0 0 3.75 8v11A1.25 1.25 0 0 0 5 20.25h11A1.25 1.25 0 0 0 17.25 19v-3h1.5v3A2.75 2.75 0 0 1 16 21.75H5A2.75 2.75 0 0 1 2.25 19V8c0-.73.29-1.429.806-1.944" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M16.885 3.084a2.85 2.85 0 0 1 4.03 4.03l-9.604 9.636H7.25v-4.061zm2.015.666a1.35 1.35 0 0 0-.955.395L8.75 13.311v1.939h1.939l9.166-9.195A1.35 1.35 0 0 0 18.9 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m18.47 8.53-3-3 1.06-1.06 3 3z" clip-rule="evenodd"/>',upload:'<path fill="currentColor" d="m12 2.94 5.53 5.53-1.06 1.06-3.72-3.72V17h-1.5V5.81L7.53 9.53 6.47 8.47z"/><path fill="currentColor" d="M2.25 15h1.5v4.25h16.5V15h1.5v5.75H2.25z"/>',video:'<path fill="currentColor" fill-rule="evenodd" d="M21.37 6.347a.75.75 0 0 1 .38.653v10a.75.75 0 0 1-1.136.643l-5-3a.75.75 0 1 1 .772-1.286l3.864 2.318v-7.35l-3.864 2.318a.75.75 0 1 1-.772-1.286l5-3a.75.75 0 0 1 .755-.01" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.25 6A.75.75 0 0 1 3 5.25h13a.75.75 0 0 1 .75.75v12a.75.75 0 0 1-.75.75H3a.75.75 0 0 1-.75-.75zm1.5.75v10.5h11.5V6.75z" clip-rule="evenodd"/>',"volume-up":'<path fill="currentColor" fill-rule="evenodd" d="M12.325 4.324A.75.75 0 0 1 12.75 5v14a.75.75 0 0 1-1.219.586L6.738 15.75H3a.75.75 0 0 1-.75-.75V9A.75.75 0 0 1 3 8.25h3.737l4.794-3.836a.75.75 0 0 1 .794-.09M11.25 6.56 7.469 9.586A.75.75 0 0 1 7 9.75H3.75v4.5H7a.75.75 0 0 1 .469.164l3.781 3.025zM17.57 4.37a.75.75 0 0 1 1.06 0c2.046 2.046 3.12 4.739 3.12 7.63 0 2.908-1.185 5.589-3.105 7.616a.75.75 0 1 1-1.09-1.032c1.68-1.773 2.695-4.092 2.695-6.584 0-2.508-.926-4.815-2.68-6.57a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M14.97 7.97a.75.75 0 0 1 1.06 0c1.025 1.025 1.72 2.51 1.72 4.03 0 1.485-.571 2.998-1.748 4.058a.75.75 0 1 1-1.004-1.115c.823-.741 1.252-1.828 1.252-2.943 0-1.08-.505-2.195-1.28-2.97a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/>',"mute-filled":'<path fill="currentColor" d="M12.3 4.1h.1c-.3-.2-.8 0-1.1.1L6.6 8H3c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h3.6l4.7 3.8c.2.1.4.2.6.2h.4c.3-.2.6-.5.6-.9V5q0-.6-.6-.9M21.9 9.7l-1.4-1.4-2.3 2.3-2.3-2.3-1.4 1.4 2.3 2.3-2.3 2.3 1.4 1.4 2.3-2.3 2.3 2.3 1.4-1.4-2.3-2.3z"/>',repeat:'<path fill="currentColor" fill-rule="evenodd" d="m18.94 6-3.47-3.47 1.06-1.06L21.06 6l-4.53 4.53-1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M5.532 7.433c.587-.488 1.3-.783 1.968-.783h12.4v-1.5H7.5c-1.116 0-2.183.49-2.988 1.18l-.044.038-.037.044C3.757 7.197 3.25 8.164 3.25 9.3V11h1.5V9.3c0-.648.279-1.267.782-1.867M5.06 18l3.47-3.47-1.06-1.06L2.94 18l4.53 4.53 1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M19.25 14.7V13h1.5v1.7c0 1.136-.508 2.103-1.18 2.888l-.038.044-.044.037c-.805.69-1.872 1.181-2.988 1.181H4v-1.5h12.5c.668 0 1.381-.295 1.968-.783.503-.6.782-1.22.782-1.867" clip-rule="evenodd"/>',settings:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0M12 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9.757 1.888a.75.75 0 0 1 .742-.639h3a.75.75 0 0 1 .742.639l.425 2.836q.303.11.594.244l2.304-1.703a.75.75 0 0 1 .976.073l2.121 2.12a.75.75 0 0 1 .073.977l-1.702 2.304q.134.291.244.594l2.835.425a.75.75 0 0 1 .639.742v3a.75.75 0 0 1-.639.742l-2.836.425q-.11.303-.243.594l1.702 2.304a.75.75 0 0 1-.073.976l-2.12 2.121a.75.75 0 0 1-.977.073l-2.304-1.702q-.291.134-.594.244l-.425 2.835a.75.75 0 0 1-.742.639h-3a.75.75 0 0 1-.742-.639l-.425-2.836a8 8 0 0 1-.594-.244l-2.304 1.703a.75.75 0 0 1-.976-.073l-2.121-2.12a.75.75 0 0 1-.073-.977l1.702-2.304a8 8 0 0 1-.244-.594l-2.835-.425a.75.75 0 0 1-.639-.742v-3a.75.75 0 0 1 .639-.742l2.836-.425q.11-.303.244-.594L3.264 6.435a.75.75 0 0 1 .073-.976l2.12-2.121a.75.75 0 0 1 .977-.073l2.304 1.702q.291-.134.594-.244zm1.388.861-.398 2.653a.75.75 0 0 1-.53.608 6 6 0 0 0-1.197.493.75.75 0 0 1-.804-.056L6.062 4.855 4.854 6.063l1.592 2.154a.75.75 0 0 1 .056.804 6.2 6.2 0 0 0-.493 1.2.75.75 0 0 1-.608.527l-2.653.398v1.708l2.653.398a.75.75 0 0 1 .608.53q.188.634.493 1.197a.75.75 0 0 1-.056.804l-1.592 2.154 1.208 1.208 2.154-1.592a.75.75 0 0 1 .804-.056q.562.304 1.2.493a.75.75 0 0 1 .527.608l.398 2.653h1.708l.398-2.653a.75.75 0 0 1 .53-.608q.634-.188 1.197-.493a.75.75 0 0 1 .804.056l2.154 1.592 1.208-1.208-1.592-2.154a.75.75 0 0 1-.056-.804q.304-.562.493-1.2a.75.75 0 0 1 .608-.527l2.653-.398v-1.708l-2.653-.398a.75.75 0 0 1-.608-.53 6 6 0 0 0-.493-1.197.75.75 0 0 1 .056-.804l1.592-2.154-1.208-1.208-2.154 1.592a.75.75 0 0 1-.804.056 6.2 6.2 0 0 0-1.2-.493.75.75 0 0 1-.527-.608l-.398-2.653z" clip-rule="evenodd"/>',refresh:'<path fill="currentColor" fill-rule="evenodd" d="M20.25 8.25V3h1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A8.25 8.25 0 0 0 3.75 12 8.25 8.25 0 0 0 12 20.25 8.25 8.25 0 0 0 20.25 12h1.5A9.75 9.75 0 0 1 12 21.75 9.75 9.75 0 0 1 2.25 12 9.75 9.75 0 0 1 12 2.25a9.75 9.75 0 0 1 8.628 5.205l.094.106.324.361.011.012.462.517a3 3 0 0 1 .098.123c.007.01.03.044.054.09l-1.342.671a.586.586 0 0 0 .068.11l.009.012-.021-.025q-.037-.043-.107-.12l-.335-.373-.013-.015-.494-.554-.05-.065a1 1 0 0 1-.05-.084l-.002-.004A8.25 8.25 0 0 0 12 3.75" clip-rule="evenodd"/>',expand:'<path fill="currentColor" fill-rule="evenodd" d="M17.25 6.75H12v-1.5h6.75V12h-1.5zM6.75 17.25V12h-1.5v6.75H12v-1.5z" clip-rule="evenodd"/>',shrink:'<path fill="currentColor" fill-rule="evenodd" d="M9.25 14.75H4v-1.5h6.75V20h-1.5zM13.75 10.25V5h-1.5v6.75H19v-1.5z" clip-rule="evenodd"/>',search:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 11c0-4.814 3.936-8.75 8.75-8.75s8.75 3.936 8.75 8.75-3.936 8.75-8.75 8.75S2.25 15.814 2.25 11M11 3.75c-3.986 0-7.25 3.264-7.25 7.25s3.264 7.25 7.25 7.25 7.25-3.264 7.25-7.25S14.986 3.75 11 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m17.13 16.07 4.4 4.4-1.06 1.06-4.4-4.4z" clip-rule="evenodd"/>',"share-alt":'<path fill="currentColor" fill-rule="evenodd" d="M13.69 3.317a.75.75 0 0 1 .804.119l8 7a.75.75 0 0 1 0 1.128l-8 7A.75.75 0 0 1 13.25 18v-3.24c-1.925.051-3.579.315-5.062.932-1.659.692-3.157 1.85-4.588 3.758A.75.75 0 0 1 2.25 19c0-4.145 1.147-6.888 3.291-8.698 1.96-1.655 4.655-2.437 7.709-2.943V4a.75.75 0 0 1 .44-.683m1.06 2.336V8a.75.75 0 0 1-.638.742c-3.283.497-5.85 1.225-7.603 2.706-1.359 1.147-2.303 2.812-2.631 5.39 1.153-1.15 2.386-1.969 3.734-2.53 1.928-.804 4.04-1.058 6.388-1.058a.75.75 0 0 1 .75.75v2.347L20.861 11z" clip-rule="evenodd"/>',show:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12c0-2.055 1.695-3.75 3.75-3.75s3.75 1.694 3.75 3.75-1.694 3.75-3.75 3.75S8.25 14.056 8.25 12M12 9.75A2.27 2.27 0 0 0 9.75 12 2.27 2.27 0 0 0 12 14.25 2.27 2.27 0 0 0 14.25 12 2.27 2.27 0 0 0 12 9.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.791 1.543 3.297 5.25 9.167 5.25 5.872 0 8.374-3.704 9.167-5.25-.791-1.543-3.297-5.25-9.167-5.25-5.871 0-8.374 3.704-9.167 5.25m-1.515-.312C2.006 10.183 4.823 5.25 12 5.25s9.997 4.938 10.682 6.438l.143.312-.143.312C21.994 13.817 19.177 18.75 12 18.75s-9.997-4.938-10.682-6.438L1.175 12z" clip-rule="evenodd"/>',sparkle:'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25 14.08 8 19.75 10l-5.67 2L12 17.75 9.92 12 4.25 10l5.67-2zm0 4.4-.9 2.49-2.45.86 2.45.86.9 2.49.9-2.49 2.45-.86-2.45-.86zM18.5 15.25l.88 2.37 2.37.88-2.37.88-.88 2.37-.88-2.37-2.37-.88 2.37-.88z" clip-rule="evenodd"/>',trash:'<path fill="currentColor" fill-rule="evenodd" d="M6.75 6v13c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25V6h1.5v13A2.75 2.75 0 0 1 16 21.75H8A2.75 2.75 0 0 1 5.25 19V6z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M21 6.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M7.25 4c0-.966.784-1.75 1.75-1.75h6c.966 0 1.75.784 1.75 1.75v2h-1.5V4a.25.25 0 0 0-.25-.25H9a.25.25 0 0 0-.25.25v2h-1.5zM9.25 16V9h1.5v7zM13.25 16V9h1.5v7z" clip-rule="evenodd"/>',user:'<path fill="currentColor" fill-rule="evenodd" d="M8.652 3.687C9.52 2.708 10.833 2.25 12 2.25c1.198 0 2.38.478 3.313 1.402.979.868 1.437 2.181 1.437 3.348 0 1.198-.477 2.38-1.402 3.313-.868.979-2.181 1.437-3.348 1.437-1.198 0-2.38-.477-3.313-1.402C7.715 9.488 7.25 8.277 7.25 7c0-1.198.478-2.38 1.402-3.313M12 3.75c-.826 0-1.703.336-2.236.944l-.016.019-.018.017c-.664.664-.98 1.475-.98 2.27 0 .915.329 1.697.944 2.236l.019.016.017.018c.664.664 1.475.98 2.27.98.826 0 1.703-.336 2.236-.944l.016-.019.018-.017c.664-.664.98-1.475.98-2.27 0-.826-.336-1.703-.944-2.236l-.019-.016-.017-.018c-.664-.664-1.475-.98-2.27-.98M8 15.75c-.795 0-1.606.317-2.27.98l-.017.018-.02.016c-.614.539-.943 1.321-.943 2.236v3h-1.5v-3c0-1.277.465-2.487 1.437-3.348.934-.925 2.115-1.402 3.313-1.402h8c1.277 0 2.487.465 3.348 1.437.925.934 1.402 2.115 1.402 3.313v3h-1.5v-3c0-.795-.317-1.606-.98-2.27l-.018-.017-.016-.02c-.539-.614-1.321-.943-2.236-.943z" clip-rule="evenodd"/>',"warning-filled":'<path fill="currentColor" fill-rule="evenodd" d="M10.34 3.78a1.9 1.9 0 0 1 3.32 0l8.06 14.5A1.9 1.9 0 0 1 20.06 21H3.94a1.9 1.9 0 0 1-1.66-2.72zm.91 5.47h1.5v5.5h-1.5zm0 7h1.5v1.5h-1.5z" clip-rule="evenodd"/>'};function getDbComponentIconSize(t){return"s"===t?12:"l"===t?20:16}function createDbIcon(t,e=16){const i=document.createElement("template");return i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="${e}" height="${e}" aria-hidden="true" focusable="false" data-designbase-icon="${t}">${ICON_PATHS[t]}</svg>`,i.content.firstElementChild}const BOOLEAN_ATTRIBUTES=["disabled","loading","icon-only","full-width"],VARIANTS$p=["primary","secondary","tertiary","danger","ghost"],SIZES$D=["s","m","l"],RADIUS_VALUES=["s","m","l","pill"],CIRCULAR_SPINNER_HTML$1='<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>';class DbButton extends HTMLElement{constructor(){super(...arguments),this.handleClick=t=>{if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.click())}}static get observedAttributes(){return["variant","size","radius","type","loading-text","start-icon","end-icon",...BOOLEAN_ATTRIBUTES]}get variant(){return this.getAttribute("variant")||"primary"}set variant(t){this.setAttribute("variant",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get radius(){return this.getAttribute("radius")||""}set radius(t){t?this.setAttribute("radius",t):this.removeAttribute("radius")}get type(){return this.getAttribute("type")||"button"}set type(t){this.setAttribute("type",t)}get loadingText(){return this.getAttribute("loading-text")||""}set loadingText(t){t?this.setAttribute("loading-text",t):this.removeAttribute("loading-text")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}get loading(){return this.hasAttribute("loading")}set loading(t){this.toggleAttribute("loading",t)}get iconOnly(){return this.hasAttribute("icon-only")}set iconOnly(t){this.toggleAttribute("icon-only",t)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(t){this.toggleAttribute("full-width",t)}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.syncAttributes()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(){this.syncAttributes()}syncAttributes(){this.classList.add("designbase-wc-button"),this.setAttribute("role","button"),this.setAttribute("aria-disabled",String(this.disabled||this.loading)),this.disabled||this.loading?this.removeAttribute("tabindex"):this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.syncModifier("variant",this.variant),this.syncModifier("size",this.size),this.syncRadius(),this.syncBooleanModifier("icon-only"),this.syncBooleanModifier("full-width"),this.syncLoadingVisual(),this.loading?(this.querySelector(":scope > .designbase-wc-button__start-icon")?.remove(),this.querySelector(":scope > .designbase-wc-button__end-icon")?.remove()):this.syncIcons()}getIconSize(){return"s"===this.size?16:"l"===this.size?24:20}resolveIconName(t){if(!t)return;return t in{"arrow-bar-left":1,"arrow-bar-right":1,"arrow-right":1,award:1,"bell-active":1,"caret-down-filled":1,"caret-updown-filled":1,"chevron-down":1,"chevron-up":1,"chevron-left":1,"chevron-right":1,bulb:1,"circle-checked":1,"cloud-close":1,close:1,copy:1,done:1,"error-filled":1,edit:1,gallery:1,hide:1,"info-filled":1,lock:1,mail:1,minus:1,"more-vertical":1,pause:1,play:1,plus:1,search:1,"share-alt":1,show:1,sparkle:1,star:1,"star-filled":1,"trending-up":1,cart:1,trash:1,user:1,"warning-filled":1}?t:void 0}isManagedIconNode(t){return t instanceof HTMLElement&&(t.classList.contains("designbase-wc-button__start-icon")||t.classList.contains("designbase-wc-button__end-icon")||t.classList.contains("designbase-wc-button__spinner"))}syncIcons(){const t=this.resolveIconName(this.getAttribute("start-icon")),e=this.resolveIconName(this.getAttribute("end-icon")),i=this.getIconSize();let s=this.querySelector(":scope > .designbase-wc-button__start-icon");if(t){if(!s){s=document.createElement("span"),s.className="designbase-wc-button__start-icon",s.setAttribute("aria-hidden","true");const t=Array.from(this.childNodes).find(t=>!this.isManagedIconNode(t));t?this.insertBefore(s,t):this.append(s)}s.replaceChildren(createDbIcon(t,i))}else s?.remove();let n=this.querySelector(":scope > .designbase-wc-button__end-icon");e?(n||(n=document.createElement("span"),n.className="designbase-wc-button__end-icon",n.setAttribute("aria-hidden","true"),this.append(n)),n.replaceChildren(createDbIcon(e,i))):n?.remove()}getDefaultRadiusClass(){return RADIUS_VALUES.includes(this.radius)?`designbase-wc-button--radius-${this.radius}`:"s"===this.size?"designbase-wc-button--radius-s":"l"===this.size?"designbase-wc-button--radius-l":"designbase-wc-button--radius-m"}syncRadius(){RADIUS_VALUES.forEach(t=>this.classList.remove(`designbase-wc-button--radius-${t}`)),this.classList.add(this.getDefaultRadiusClass())}syncModifier(t,e){if(Array.from(this.classList).filter(e=>e.startsWith(`designbase-wc-button--${t}-`)).forEach(t=>this.classList.remove(t)),"variant"===t||"size"===t){("variant"===t?VARIANTS$p:SIZES$D).forEach(t=>this.classList.remove(`designbase-wc-button--${t}`)),this.classList.add(`designbase-wc-button--${e}`)}}syncBooleanModifier(t){const e=`designbase-wc-button--${t}`;this.classList.toggle(e,this.hasAttribute(t))}getSpinnerSize(){return SIZES$D.includes(this.size)?this.size:"m"}syncLoadingVisual(){this.classList.toggle("designbase-wc-button--loading",this.loading);const t=this.querySelector(":scope > .designbase-wc-button__spinner");if(!this.loading)return void t?.remove();const e=`designbase-wc-button__spinner designbase-wc-spinner designbase-wc-spinner--circular designbase-wc-spinner--${this.getSpinnerSize()}`;if(t)return t.className=e,void t.setAttribute("aria-hidden","true");const i=document.createElement("span");i.className=e,i.setAttribute("aria-hidden","true"),i.innerHTML=CIRCULAR_SPINNER_HTML$1,this.insertBefore(i,this.firstChild)}}customElements.get("db-button")||customElements.define("db-button",DbButton);const STRENGTH_LABELS={weak:"약함",fair:"보통",good:"강함","very-strong":"아주 강함"};function getPasswordStrengthLevel(t,e){return!e||t<=1?"weak":2===t?"fair":3===t?"good":"very-strong"}function getPasswordScore(t){switch(t){case"weak":return 1;case"fair":return 2;case"good":return 3;case"very-strong":return 4;default:return 0}}function getPasswordValidation(t,e=8){const i=[{id:"length",label:`최소 ${e}자 이상`,met:t.length>=e},{id:"lowercase",label:"소문자 포함",met:/[a-z]/.test(t)},{id:"uppercase",label:"대문자 포함",met:/[A-Z]/.test(t)},{id:"number",label:"숫자 포함",met:/\d/.test(t)},{id:"special",label:"특수문자 포함",met:/[!@#$%^&*(),.?":{}|<>]/.test(t)}],s=getPasswordStrengthLevel(i.filter(t=>t.met).length,t.length>0);return{requirements:i,score:getPasswordScore(s),level:s,levelLabel:STRENGTH_LABELS[s],isValid:i.every(t=>t.met),isStrongEnough:"good"===s||"very-strong"===s}}function parseScrubNumericValue(t){const e=t.trim();if(""===e)return 0;const i=Number(e);return Number.isFinite(i)?i:null}function getStepDecimalPlaces(t){const e=String(t),i=e.indexOf(".");return-1===i?0:e.length-i-1}function formatScrubValue(t,e){const i=getStepDecimalPlaces(e);return i>0?t.toFixed(i):String(Math.round(t))}function computeScrubValue(t,e,i,s,n,a,r){const o=s*(n.shiftKey?10:n.altKey?.1:1);let l=t+Math.round(e/i)*o;void 0!==a&&(l=Math.max(a,l)),void 0!==r&&(l=Math.min(r,l));const h=getStepDecimalPlaces(o);return l=h>0?Number(l.toFixed(h)):Math.round(l),l}function readNumericAttribute(t,e){const i=t.getAttribute(e);if(null===i||""===i)return;const s=Number(i);return Number.isFinite(s)?s:void 0}const SCRUB_DRAG_THRESHOLD=3;function attachNumberScrub(t,e){let i=null;const endScrub=()=>{i=null,e.onScrubStateChange?.(!1),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},handlePointerDown=s=>{if(!e.isEnabled()||!e.isInteractive()||0!==s.button)return;const n=parseScrubNumericValue(e.getValue());null!==n&&(i={pointerId:s.pointerId,startX:s.clientX,startValue:n,moved:!1},t.setPointerCapture(s.pointerId))},handlePointerMove=t=>{if(!i||i.pointerId!==t.pointerId)return;const s=t.clientX-i.startX;!i.moved&&Math.abs(s)<SCRUB_DRAG_THRESHOLD||(i.moved||(i.moved=!0,e.onScrubStateChange?.(!0),document.body.style.cursor="ew-resize",document.body.style.userSelect="none"),t.preventDefault(),((t,s)=>{if(!i)return;const n=t-i.startX,a=e.getStep(),r=computeScrubValue(i.startValue,n,e.getSensitivity(),a,s,e.getMin(),e.getMax());e.onValueChange(formatScrubValue(r,a))})(t.clientX,t))},handlePointerEnd=e=>{i&&i.pointerId===e.pointerId&&(i.moved&&e.preventDefault(),t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),endScrub())};return t.addEventListener("pointerdown",handlePointerDown),t.addEventListener("pointermove",handlePointerMove),t.addEventListener("pointerup",handlePointerEnd),t.addEventListener("pointercancel",handlePointerEnd),()=>{endScrub(),t.removeEventListener("pointerdown",handlePointerDown),t.removeEventListener("pointermove",handlePointerMove),t.removeEventListener("pointerup",handlePointerEnd),t.removeEventListener("pointercancel",handlePointerEnd)}}const TYPES$4=["text","email","password","url","search","tel","number"],SIZES$C=["s","m","l"],ICON_NAMES=new Set(["arrow-bar-left","arrow-bar-right","caret-down-filled","chevron-down","chevron-left","chevron-right","circle-checked","close","error-filled","edit","hide","info-filled","lock","mail","plus","search","share-alt","show","sparkle","trash","user","warning-filled"]);class DbInput extends HTMLElement{constructor(){super(...arguments),this.passwordVisible=!1,this.isFocused=!1,this.touched=!1,this.isScrubbing=!1,this.handleInput=t=>{const e=t.target;this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:e.value,nativeEvent:t},bubbles:!0,composed:!0}))},this.handleChange=t=>{const e=t.target;this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e.value,nativeEvent:t},bubbles:!0,composed:!0}))},this.handleFocus=t=>{this.isFocused=!0,this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-focus",{detail:{nativeEvent:t},bubbles:!0,composed:!0}))},this.handleBlur=t=>{this.isFocused=!1,this.touched=!0,this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-blur",{detail:{nativeEvent:t},bubbles:!0,composed:!0}))},this.handlePasswordToggle=()=>{this.passwordVisible=!this.passwordVisible,this.render()},this.handleSearchClear=()=>{this.input&&(this.input.value="",this.setAttribute("value",""),this.input.focus(),this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:"",nativeEvent:null},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-clear",{bubbles:!0,composed:!0})))}}static get observedAttributes(){return["type","label","placeholder","value","default-value","size","disabled","readonly","required","error","error-message","helper-text","full-width","name","start-icon","end-icon","validate","validation-visibility","validate-on-blur","password-min-length","scrubbable","scrub-step","scrub-sensitivity","min","max","step"]}get value(){return this.input?.value??this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.input&&(this.input.value=t),this.updateDynamicUI()}get type(){return this.getAttribute("type")||"text"}set type(t){this.setAttribute("type",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}get readOnly(){return this.hasAttribute("readonly")}set readOnly(t){this.toggleAttribute("readonly",t)}connectedCallback(){this.render()}disconnectedCallback(){this.detachScrub?.(),this.detachScrub=void 0}attributeChangedCallback(t){"value"===t&&this.isScrubbing||this.render()}focus(){this.input?.focus()}get passwordMinLength(){return Number(this.getAttribute("password-min-length")||8)}get validationVisibility(){return this.getAttribute("validation-visibility")||"focus"}get validateOnBlur(){return!this.hasAttribute("validate-on-blur")||"false"!==this.getAttribute("validate-on-blur")}get isValidationEnabled(){return this.hasAttribute("validate")}getIconSize(){return getDbComponentIconSize(this.size)}resolveIconName(t){const e=this.getAttribute(t);if(e&&ICON_NAMES.has(e))return e}resolveStartIcon(){const t=this.resolveIconName("start-icon");return t||("search"===this.type?"search":void 0)}getCurrentValue(){return this.input?.value??this.getAttribute("value")??this.getAttribute("default-value")??""}render(){const t=this.getCurrentValue(),e=TYPES$4.includes(this.type)?this.type:"text",i="search"===e,s="password"===e,n=s&&this.passwordVisible||i?"text":e,a=this.getAttribute("label")||"",r=this.getAttribute("helper-text")||"",o=this.getAttribute("error-message")||"",l=this.hasAttribute("error"),h=this.resolveStartIcon(),d=this.resolveIconName("end-icon");this.classList.add("designbase-wc-input"),SIZES$C.forEach(t=>this.classList.remove(`designbase-wc-input--${t}`)),this.classList.add(`designbase-wc-input--${SIZES$C.includes(this.size)?this.size:"m"}`),this.classList.toggle("designbase-wc-input--error",l),this.classList.toggle("designbase-wc-input--disabled",this.disabled),this.classList.toggle("designbase-wc-input--readonly",this.readOnly),this.classList.toggle("designbase-wc-input--full-width",this.hasAttribute("full-width")),this.classList.toggle("designbase-wc-input--with-start-icon",Boolean(h));const u=i&&t.length>0&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--with-end-icon",Boolean(d&&!s&&!i)||s||u),this.classList.toggle("designbase-wc-input--with-password-toggle",s),this.classList.toggle("designbase-wc-input--with-search-clear",u);const p=this.hasAttribute("scrubbable")&&"number"===e&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--scrubbable",p),this.classList.toggle("designbase-wc-input--scrubbing",this.isScrubbing);const m=this.getAttribute("id")||`db-input-${Math.random().toString(36).slice(2)}`;this.hasAttribute("id")||this.setAttribute("id",m);const g=`${m}-field`,b=`${m}-helper`,f=`${m}-error`,v=`${m}-validation`,y=this.getAttribute("min"),E=this.getAttribute("max"),S=this.getAttribute("step");this.innerHTML=`\n ${a?`<label class="designbase-wc-input__label" for="${g}">${this.escape(a)}${this.hasAttribute("required")?'<span aria-hidden="true"> *</span>':""}</label>`:""}\n <span class="designbase-wc-input__wrapper">\n ${h?'<span class="designbase-wc-input__start-icon" aria-hidden="true"></span>':""}\n <input\n id="${g}"\n class="designbase-wc-input__field"\n type="${n}"\n value="${this.escape(t)}"\n placeholder="${this.escape(this.getAttribute("placeholder")||"")}"\n ${i?'role="searchbox"':""}\n ${this.getAttribute("name")?`name="${this.escape(this.getAttribute("name")||"")}"`:""}\n ${this.disabled?"disabled":""}\n ${this.readOnly?"readonly":""}\n ${this.hasAttribute("required")?"required":""}\n ${null!==y?`min="${this.escape(y)}"`:""}\n ${null!==E?`max="${this.escape(E)}"`:""}\n ${null!==S?`step="${this.escape(S)}"`:""}\n aria-invalid="${String(l)}"\n />\n ${s?`<button type="button" class="designbase-wc-input__password-toggle" ${this.disabled?"disabled":""} aria-label="${this.passwordVisible?"비밀번호 숨기기":"비밀번호 보기"}"></button>`:""}\n ${i?'<button type="button" class="designbase-wc-input__clear-button" hidden aria-label="검색어 지우기"></button>':""}\n ${!d||s||i?"":'<span class="designbase-wc-input__end-icon" aria-hidden="true"></span>'}\n </span>\n <div class="designbase-wc-input__validation-slot" id="${v}"></div>\n ${r&&!l?`<p id="${b}" class="designbase-wc-input__helper-text">${this.escape(r)}</p>`:""}\n ${l&&o?`<p id="${f}" class="designbase-wc-input__error-message">${this.escape(o)}</p>`:""}\n `,this.mountIcons(h,!d||s||i?void 0:d,s),this.input=this.querySelector("input")||void 0,this.input&&(this.input.value=t,this.input.addEventListener("input",this.handleInput),this.input.addEventListener("change",this.handleChange),this.input.addEventListener("focus",this.handleFocus),this.input.addEventListener("blur",this.handleBlur)),this.querySelector(".designbase-wc-input__password-toggle")?.addEventListener("click",this.handlePasswordToggle),this.querySelector(".designbase-wc-input__clear-button")?.addEventListener("click",this.handleSearchClear),this.detachScrub?.(),this.detachScrub=void 0,p&&this.input&&(this.detachScrub=attachNumberScrub(this.input,{isEnabled:()=>this.hasAttribute("scrubbable")&&"number"===this.type,isInteractive:()=>!this.disabled&&!this.readOnly,getValue:()=>this.getCurrentValue(),getStep:()=>readNumericAttribute(this,"scrub-step")??readNumericAttribute(this,"step")??1,getMin:()=>readNumericAttribute(this,"min"),getMax:()=>readNumericAttribute(this,"max"),getSensitivity:()=>readNumericAttribute(this,"scrub-sensitivity")??4,onValueChange:t=>this.applyScrubValue(t),onScrubStateChange:t=>{this.isScrubbing=t,this.classList.toggle("designbase-wc-input--scrubbing",t),!t&&this.input&&this.dispatchEvent(new CustomEvent("db-change",{detail:{value:this.input.value,nativeEvent:null},bubbles:!0,composed:!0}))}})),this.updateDynamicUI()}mountIcons(t,e,i=!1){const s=this.getIconSize();if(t){const e=this.querySelector(".designbase-wc-input__start-icon");e?.replaceChildren(createDbIcon(t,s))}if(e){const t=this.querySelector(".designbase-wc-input__end-icon");t?.replaceChildren(createDbIcon(e,s))}if(i){const t=this.querySelector(".designbase-wc-input__password-toggle");t?.replaceChildren(createDbIcon(this.passwordVisible?"hide":"show",s))}const n=this.querySelector(".designbase-wc-input__clear-button");n?.replaceChildren(createDbIcon("close",s))}shouldShowPasswordValidation(t){return!(!this.isValidationEnabled||"password"!==this.type)&&("never"!==this.validationVisibility&&("always"===this.validationVisibility||(this.isFocused||t.length>0)))}renderValidationMarkup(t){const e=getPasswordValidation(t,this.passwordMinLength),i=Array.from({length:4},(t,i)=>`<span class="designbase-wc-input__password-strength-segment${i<e.score?` designbase-wc-input__password-strength-segment--${e.level}`:""}"></span>`).join(""),s=e.requirements.map(t=>`<li class="designbase-wc-input__password-requirement${t.met?" designbase-wc-input__password-requirement--met":""}">${t.met?'<span class="designbase-wc-input__password-requirement-icon" aria-hidden="true"></span>':'<span class="designbase-wc-input__password-requirement-icon" aria-hidden="true"><span class="designbase-wc-input__password-requirement-dot"></span></span>'}<span class="designbase-wc-input__password-requirement-label">${this.escape(t.label)}</span></li>`).join("");return`\n <div class="designbase-wc-input__validation" aria-live="polite">\n <div class="designbase-wc-input__password-strength">\n <div class="designbase-wc-input__password-strength-bar" role="progressbar" aria-valuemin="0" aria-valuemax="4" aria-valuenow="${e.score}" aria-label="비밀번호 강도">${i}</div>\n <span class="designbase-wc-input__password-strength-label designbase-wc-input__password-strength-label--${e.level}">${e.levelLabel}</span>\n </div>\n <ul class="designbase-wc-input__password-requirements">${s}</ul>\n </div>\n `}updateDynamicUI(){const t=this.getCurrentValue(),e="search"===this.type&&t.length>0&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--with-search-clear",e);const i=this.querySelector(".designbase-wc-input__clear-button");i&&(i.hidden=!e,i.replaceChildren(createDbIcon("close",this.getIconSize())));const s=this.querySelector(".designbase-wc-input__validation-slot");if(s&&(this.shouldShowPasswordValidation(t)?(s.innerHTML=this.renderValidationMarkup(t),s.querySelectorAll(".designbase-wc-input__password-requirement--met .designbase-wc-input__password-requirement-icon").forEach(t=>{t.replaceChildren(createDbIcon("circle-checked",12))})):s.innerHTML=""),this.input){const e=`${this.getAttribute("id")}-helper`,i=`${this.getAttribute("id")}-error`,s=`${this.getAttribute("id")}-validation`,n=this.getAttribute("helper-text")||"",a=this.getAttribute("error-message")||"",r=this.hasAttribute("error"),o=[n&&!r?e:"",this.shouldShowPasswordValidation(t)?s:"",r&&a?i:""].filter(Boolean).join(" ")||void 0;o?this.input.setAttribute("aria-describedby",o):this.input.removeAttribute("aria-describedby")}}applyScrubValue(t){this.input&&(this.input.value=t,this.setAttribute("value",t),this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:t,nativeEvent:null},bubbles:!0,composed:!0})))}escape(t){return t.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[t]||t))}}customElements.get("db-input")||customElements.define("db-input",DbInput);const SIZES$B=["s","m","l"],CHECK_ICON_SIZE=16;class DbCheckbox extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.handleChange=()=>{if(!this.input)return;const t=this.input.checked;this.toggleAttribute("checked",t),this.indeterminate&&(this.removeAttribute("indeterminate"),this.input.indeterminate=!1),this.syncVisual(),this.syncClasses(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:t,selected:t},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","indeterminate","size","disabled","readonly","required","name","value","has-label"]}get checked(){return this.input?.checked??(this.hasAttribute("checked")||this.hasAttribute("selected"))}set checked(t){this.toggleAttribute("checked",t),this.input&&(this.input.checked=t,this.syncVisual(),this.syncClasses())}get indeterminate(){return this.hasAttribute("indeterminate")}set indeterminate(t){this.toggleAttribute("indeterminate",t),this.input&&(this.input.indeterminate=t,this.syncVisual(),this.syncClasses())}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t),this.input&&(this.input.disabled=t),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(t){this.toggleAttribute("readonly",t),this.input&&(this.input.readOnly=t),this.syncClasses()}get required(){return this.hasAttribute("required")}set required(t){this.toggleAttribute("required",t),this.input&&(this.input.required=t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(t){if(this.built)return"checked"===t||"selected"===t?(this.input&&(this.input.checked=this.hasAttribute("checked")||this.hasAttribute("selected")),this.syncVisual(),void this.syncClasses()):void this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){for(this.root=document.createElement("label"),this.root.className="designbase-wc-checkbox",this.input=document.createElement("input"),this.input.type="checkbox",this.input.className="designbase-wc-checkbox__input",this.visual=document.createElement("span"),this.visual.className="designbase-wc-checkbox__visual",this.visual.setAttribute("aria-hidden","true"),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-checkbox__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(this.input,this.visual,this.labelEl),this.appendChild(this.root),this.input.addEventListener("change",this.handleChange),this.built=!0}syncState(){if(!this.root||!this.input||!this.visual)return;const t=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.hasAttribute("checked")&&!this.hasAttribute("selected")&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected")),e=this.hasAttribute("indeterminate");this.input.checked=t,this.input.indeterminate=e,this.input.disabled=this.disabled,this.input.readOnly=this.readOnly,this.input.required=this.required,this.input.name=this.getAttribute("name")||"",this.input.value=this.getAttribute("value")||"",this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncVisual(),this.syncClasses()}syncVisual(){if(this.visual&&this.input){if(this.visual.replaceChildren(),this.input.indeterminate){const t=document.createElement("span");return t.className="designbase-wc-checkbox__indeterminate-icon",t.appendChild(createDbIcon("minus",CHECK_ICON_SIZE)),void this.visual.appendChild(t)}if(this.input.checked){const t=document.createElement("span");t.className="designbase-wc-checkbox__check-icon",t.appendChild(createDbIcon("done",CHECK_ICON_SIZE)),this.visual.appendChild(t)}}}syncClasses(){if(!this.root||!this.input)return;const t=SIZES$B.includes(this.size)?this.size:"m",e=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim());this.root.className=["designbase-wc-checkbox",`designbase-wc-checkbox--${t}`,this.input.checked&&"designbase-wc-checkbox--selected",this.input.indeterminate&&"designbase-wc-checkbox--indeterminate",this.disabled&&"designbase-wc-checkbox--disabled",this.readOnly&&"designbase-wc-checkbox--readonly",!e&&"designbase-wc-checkbox--no-label"].filter(Boolean).join(" ")}}customElements.get("db-checkbox")||customElements.define("db-checkbox",DbCheckbox);const SIZES$A=["s","m","l"];class DbToggle extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.handleClick=()=>{if(this.disabled||this.readOnly)return;const t=!this.checked;this.toggleAttribute("checked",t),this.syncState(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:t,selected:t},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","size","disabled","readonly","has-label"]}get checked(){return this.hasAttribute("checked")||this.hasAttribute("selected")}set checked(t){this.toggleAttribute("checked",t),this.syncClasses()}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t),this.root&&(this.root.disabled=t),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(t){this.toggleAttribute("readonly",t),this.syncClasses()}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(){this.built&&this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){this.root=document.createElement("button"),this.root.type="button",this.root.className="designbase-wc-toggle";const t=document.createElement("span");t.className="designbase-wc-toggle__track",t.setAttribute("aria-hidden","true");const e=document.createElement("span");for(e.className="designbase-wc-toggle__thumb",t.appendChild(e),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-toggle__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(t,this.labelEl),this.appendChild(this.root),this.root.addEventListener("click",this.handleClick),this.built=!0}syncState(){this.root&&(this.root.disabled=this.disabled,this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncClasses())}syncClasses(){if(!this.root)return;const t=SIZES$A.includes(this.size)?this.size:"m",e=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim()),i=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.hasAttribute("checked")&&!this.hasAttribute("selected")&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected"));this.root.className=["designbase-wc-toggle",`designbase-wc-toggle--${t}`,i&&"designbase-wc-toggle--selected",this.disabled&&"designbase-wc-toggle--disabled",this.readOnly&&"designbase-wc-toggle--readonly",!e&&"designbase-wc-toggle--no-label"].filter(Boolean).join(" "),this.root.setAttribute("aria-pressed",String(i))}}customElements.get("db-toggle")||customElements.define("db-toggle",DbToggle);const CLASS$v="designbase-wc-badge",VARIANTS$o=["primary","secondary","info","success","warning","danger"],SIZES$z=["s","m","l"],STYLES$1=["dot","number","text","outlined"];class DbBadge extends HTMLElement{static get observedAttributes(){return["variant","size","badge-style","count","max-count","disabled"]}get variant(){return this.getAttribute("variant")||"primary"}set variant(t){this.setAttribute("variant",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get badgeStyle(){return this.getAttribute("badge-style")||"text"}set badgeStyle(t){this.setAttribute("badge-style",t)}get count(){const t=this.getAttribute("count");return null===t?void 0:Number(t)}set count(t){void 0===t?this.removeAttribute("count"):this.setAttribute("count",String(t))}get maxCount(){return Number(this.getAttribute("max-count")||99)}set maxCount(t){this.setAttribute("max-count",String(t))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}connectedCallback(){this.syncAttributes()}attributeChangedCallback(t,e,i){"count"!==t&&"max-count"!==t&&"badge-style"!==t||this.syncContent(),this.syncAttributes()}syncAttributes(){this.classList.add(CLASS$v),this.setAttribute("aria-disabled",String(this.disabled)),this.syncEnum("variant",this.variant,VARIANTS$o),this.syncEnum("size",this.size,SIZES$z),this.syncEnum("style",this.badgeStyle,STYLES$1),this.classList.toggle(`${CLASS$v}--disabled`,this.disabled),this.syncContent()}syncContent(){"number"!==this.badgeStyle||void 0===this.count?"dot"===this.badgeStyle&&(this.textContent=""):this.textContent=this.count>this.maxCount?`${this.maxCount}+`:String(this.count)}syncEnum(t,e,i){i.forEach(t=>this.classList.remove(`${CLASS$v}--${t}`)),i.includes(e)?this.classList.add(`${CLASS$v}--${e}`):"style"===t&&this.classList.add(`${CLASS$v}--text`)}}customElements.get("db-badge")||customElements.define("db-badge",DbBadge);const BUTTON_VARIANT_MAP={primary:"primary",secondary:"secondary",outline:"tertiary",ghost:"ghost"},BUTTON_SIZE_MAP={s:"s",sm:"s",m:"m",md:"m",l:"l",lg:"l"};class DbBanner extends HTMLElement{static get observedAttributes(){return["title","description","icon","image","image-alt","actions","size","variant","background-image"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}parseActions(){const t=this.getAttribute("actions");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}getIconSize(t){return"s"===t?16:"l"===t?24:20}getActionIconSize(t){return"s"===t?16:"l"===t?20:18}resolveIconName(t){if(t)return t in{close:1,"info-filled":1}?t:void 0}createActionControl(t,e,i,s){const n=this.resolveIconName(t.icon),a=Boolean(t.iconOnly&&n);if(t.href){const e=document.createElement("a");return e.className=`designbase-wc-button designbase-wc-button--${i} designbase-wc-button--${s}`,a&&e.classList.add("designbase-wc-button--icon-only"),e.href=t.href,e.setAttribute("aria-label",t.text),a&&n?e.append(createDbIcon(n,this.getActionIconSize(s))):e.textContent=t.text,t.external&&(e.target="_blank",e.rel="noopener noreferrer"),e}const r=document.createElement("db-button");return r.setAttribute("variant",i),r.setAttribute("size",s),a?(r.setAttribute("icon-only",""),r.setAttribute("aria-label",t.text),n&&r.append(createDbIcon(n,this.getActionIconSize(s)))):r.textContent=t.text,(i=>{i.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:e,action:t}}))})})(r),r}render(){const t=this.getAttribute("title")||"",e=this.getAttribute("description")||"",i=this.getAttribute("icon"),s=this.getAttribute("image"),n=this.getAttribute("image-alt")||t||"Banner image",a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"primary",o=this.getAttribute("background-image"),l=this.parseActions();if(this.className=`designbase-wc-banner designbase-wc-banner--${a} designbase-wc-banner--${r}`,this.replaceChildren(),"image"===r&&o){const t=document.createElement("div");t.className="designbase-wc-banner__background",t.style.backgroundImage=`url(${o})`,t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.backgroundRepeat="no-repeat",this.append(t);const e=document.createElement("div");e.className="designbase-wc-banner__overlay",this.append(e)}const h=document.createElement("div");if(h.className="designbase-wc-banner__container",i){const t=document.createElement("div");t.className="designbase-wc-banner__icon",t.append(createDbIcon(i,this.getIconSize(a))),h.append(t)}if(s){const t=document.createElement("div");t.className="designbase-wc-banner__image";const e=document.createElement("img");e.src=s,e.alt=n,t.append(e),h.append(t)}const d=document.createElement("div");if(d.className="designbase-wc-banner__content",t){const e=document.createElement("h3");e.className="designbase-wc-banner__title",e.textContent=t,d.append(e)}if(e){const t=document.createElement("p");t.className="designbase-wc-banner__description",t.textContent=e,d.append(t)}if(h.append(d),l.length>0){const t=document.createElement("div");t.className="designbase-wc-banner__actions",l.forEach((e,i)=>{const s=BUTTON_VARIANT_MAP[e.variant||"primary"]||"primary",n=BUTTON_SIZE_MAP[e.size||"sm"]||"s";t.append(this.createActionControl(e,i,s,n))}),h.append(t)}this.append(h)}}customElements.get("db-banner")||customElements.define("db-banner",DbBanner);const TYPES$3=["circular","dots","bars","pulse","ripple"],SIZES$y=["xs","s","m","l","xl"];class DbSpinner extends HTMLElement{static get observedAttributes(){return["type","size","color","speed","label","show-label"]}get type(){return this.getAttribute("type")||"circular"}set type(t){this.setAttribute("type",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get color(){return this.getAttribute("color")||""}set color(t){t?this.setAttribute("color",t):this.removeAttribute("color")}get speed(){return Number(this.getAttribute("speed")||1)}set speed(t){this.setAttribute("speed",String(t))}get label(){return this.getAttribute("label")||"로딩 중..."}set label(t){this.setAttribute("label",t)}get showLabel(){return this.hasAttribute("show-label")}set showLabel(t){this.toggleAttribute("show-label",t)}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){this.className=Array.from(this.classList).filter(t=>!t.startsWith("designbase-wc-spinner")).join(" "),this.classList.add("designbase-wc-spinner"),this.classList.add(`designbase-wc-spinner--${TYPES$3.includes(this.type)?this.type:"circular"}`),this.classList.add(`designbase-wc-spinner--${SIZES$y.includes(this.size)?this.size:"m"}`),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-busy","true"),this.showLabel&&this.setAttribute("aria-label",this.label),this.style.setProperty("--spinner-speed",`${this.speed}s`),this.color?this.style.setProperty("--spinner-color",this.color):this.style.removeProperty("--spinner-color"),this.innerHTML=`${this.renderSpinner()}${this.showLabel&&this.label?`<span class="designbase-wc-spinner__label" aria-hidden="true">${this.escape(this.label)}</span>`:""}`}renderSpinner(){switch(this.type){case"dots":return'<span class="designbase-wc-spinner__dots" aria-hidden="true"><span class="designbase-wc-spinner__dot"></span><span class="designbase-wc-spinner__dot"></span><span class="designbase-wc-spinner__dot"></span></span>';case"bars":return'<span class="designbase-wc-spinner__bars" aria-hidden="true"><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span></span>';case"pulse":return'<span class="designbase-wc-spinner__pulse" aria-hidden="true"></span>';case"ripple":return'<span class="designbase-wc-spinner__ripple" aria-hidden="true"><span class="designbase-wc-spinner__ripple-circle"></span><span class="designbase-wc-spinner__ripple-circle"></span></span>';default:return'<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>'}}escape(t){return t.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[t]||t))}}customElements.get("db-spinner")||customElements.define("db-spinner",DbSpinner);const VARIANTS$n=["default","flat"],SIZES$x=["s","m","l"];class DbCard extends HTMLElement{constructor(){super(...arguments),this.selectCheckbox=null,this.imageNode=null,this.handleClick=t=>{if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.clickable&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{!this.clickable||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.click())},this.handleSelect=t=>{if(t?.stopPropagation(),this.disabled||this.loading||!this.selectable)return;const e=!this.selected;this.toggleAttribute("selected",e),this.selectCheckbox&&(e?this.selectCheckbox.setAttribute("checked",""):this.selectCheckbox.removeAttribute("checked")),this.dispatchEvent(new CustomEvent("db-select",{bubbles:!0,composed:!0,detail:{selected:e}}))}}static get observedAttributes(){return["variant","size","full-width","clickable","hoverable","selectable","selected","disabled","loading","image","image-alt"]}get variant(){return this.getAttribute("variant")||"default"}set variant(t){this.setAttribute("variant",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get clickable(){return this.hasAttribute("clickable")}set clickable(t){this.toggleAttribute("clickable",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}get loading(){return this.hasAttribute("loading")}set loading(t){this.toggleAttribute("loading",t)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(t){this.toggleAttribute("full-width",t)}get hoverable(){return this.hasAttribute("hoverable")}set hoverable(t){this.toggleAttribute("hoverable",t)}get selectable(){return this.hasAttribute("selectable")}set selectable(t){this.toggleAttribute("selectable",t)}get selected(){return this.hasAttribute("selected")}set selected(t){this.toggleAttribute("selected",t)}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.sync()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(t){this.isConnected&&(this.sync(),"selected"===t&&this.selectCheckbox&&(this.selected?this.selectCheckbox.setAttribute("checked",""):this.selectCheckbox.removeAttribute("checked")))}hasMediaSection(){return!!this.getAttribute("image")||null!==this.querySelector(':scope > .designbase-wc-card__thumbnail, :scope > .designbase-wc-card__media, :scope > [slot="media"], :scope > [slot="thumbnail"]')}hasFooterSection(){return null!==this.querySelector(':scope > .designbase-wc-card__footer, :scope > [slot="footer"]')}syncImageMedia(){const t=this.getAttribute("image"),e=this.querySelector(':scope > .designbase-wc-card__thumbnail, :scope > .designbase-wc-card__media, :scope > [slot="media"], :scope > [slot="thumbnail"]');if(!t)return void(this.imageNode&&(this.imageNode.remove(),this.imageNode=null));if(e&&e!==this.imageNode)return void(this.imageNode&&(this.imageNode.remove(),this.imageNode=null));if(!this.imageNode){this.imageNode=document.createElement("div"),this.imageNode.className="designbase-wc-card__media designbase-wc-card__thumbnail",this.imageNode.setAttribute("slot","media");const t=document.createElement("img");t.className="designbase-wc-card__thumbnail-image",this.imageNode.append(t);const e=this.querySelector(':scope > .designbase-wc-card__body, :scope > [slot="body"], :scope > .designbase-wc-card__footer, :scope > [slot="footer"]');e?this.insertBefore(this.imageNode,e):this.insertBefore(this.imageNode,this.firstChild)}const i=this.imageNode.querySelector("img");i&&(i.src=t,i.alt=this.getAttribute("image-alt")||"")}sync(){this.syncImageMedia(),this.syncAttributes(),this.syncOverlays()}syncOverlays(){const t=this.querySelector(":scope > .designbase-wc-card__loading-overlay"),e=this.querySelector(":scope > .designbase-wc-card__select-overlay");if(this.loading){if(!t){const t=document.createElement("div");t.className="designbase-wc-card__loading-overlay",t.setAttribute("aria-live","polite"),t.setAttribute("aria-busy","true");const e=document.createElement("div");e.className="designbase-wc-card__loading-spinner",t.append(e),this.append(t)}}else t?.remove();if(this.selectable)if(e)this.selectCheckbox&&(this.selected?this.selectCheckbox.setAttribute("checked",""):this.selectCheckbox.removeAttribute("checked"));else{const t=document.createElement("div");t.className="designbase-wc-card__select-overlay",t.addEventListener("click",t=>this.handleSelect(t));const e=document.createElement("db-checkbox");e.className="designbase-wc-card__select-checkbox",e.setAttribute("size","s"),e.setAttribute("has-label","false"),e.setAttribute("aria-label","카드 선택"),this.selected&&e.setAttribute("checked",""),e.addEventListener("click",t=>t.stopPropagation()),e.addEventListener("db-change",t=>{t.stopPropagation(),this.handleSelect()}),t.append(e),this.append(t),this.selectCheckbox=e}else e?.remove(),this.selectCheckbox=null}syncAttributes(){this.classList.add("designbase-wc-card"),this.setAttribute("aria-disabled",String(this.disabled||this.loading)),!this.clickable||this.disabled||this.loading?(this.removeAttribute("role"),this.removeAttribute("tabindex")):(this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")),VARIANTS$n.forEach(t=>this.classList.remove(`designbase-wc-card--${t}`)),SIZES$x.forEach(t=>this.classList.remove(`designbase-wc-card--${t}`)),this.classList.add(`designbase-wc-card--${VARIANTS$n.includes(this.variant)?this.variant:"default"}`),this.classList.add(`designbase-wc-card--${SIZES$x.includes(this.size)?this.size:"m"}`),this.classList.toggle("designbase-wc-card--full-width",this.hasAttribute("full-width")),this.classList.toggle("designbase-wc-card--clickable",this.clickable),this.classList.toggle("designbase-wc-card--hoverable",this.hasAttribute("hoverable")),this.classList.toggle("designbase-wc-card--selectable",this.hasAttribute("selectable")),this.classList.toggle("designbase-wc-card--selected",this.hasAttribute("selected")),this.classList.toggle("designbase-wc-card--disabled",this.disabled),this.classList.toggle("designbase-wc-card--loading",this.loading),this.classList.toggle("designbase-wc-card--with-media",this.hasMediaSection()),this.classList.toggle("designbase-wc-card--with-thumbnail",this.hasMediaSection()),this.classList.toggle("designbase-wc-card--with-footer",this.hasFooterSection())}}customElements.get("db-card")||customElements.define("db-card",DbCard);const SIZES$w=["s","m","l"],ORIENTATIONS$1=["horizontal","vertical"],VARIANTS$m=["default","pills"];class DbTabs extends HTMLElement{constructor(){super(...arguments),this.tabButtons=[],this.handleListScroll=()=>{if(!this.list)return;const t=this.list.scrollWidth>this.list.clientWidth,e=this.list.scrollLeft+this.list.clientWidth>=this.list.scrollWidth-5;this.list.classList.toggle("designbase-wc-tabs__list--show-gradient",t&&!e&&"horizontal"===this.orientation)}}static get observedAttributes(){return["labels","items","active-index","selected-id","orientation","size","variant","full-width"]}get labels(){const t=this.tabItems.map(t=>t.label);return t.length?t:(this.getAttribute("labels")||"").split(",").map(t=>t.trim()).filter(Boolean)}set labels(t){this.setAttribute("labels",Array.isArray(t)?t.join(","):t)}get tabItems(){try{const t=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}get activeIndex(){const t=this.getAttribute("selected-id");if(t){const e=this.tabItems.findIndex((e,i)=>(e.id||String(i))===t);if(e>=0)return e}return Number(this.getAttribute("active-index")||0)}set activeIndex(t){this.setAttribute("active-index",String(t))}get orientation(){return this.getAttribute("orientation")||"horizontal"}set orientation(t){this.setAttribute("orientation",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get variant(){return this.getAttribute("variant")||"default"}set variant(t){this.setAttribute("variant",t)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(t){this.toggleAttribute("full-width",Boolean(t))}connectedCallback(){this.render(),this.list?.addEventListener("scroll",this.handleListScroll,{passive:!0}),window.addEventListener("resize",this.handleListScroll)}disconnectedCallback(){this.list?.removeEventListener("scroll",this.handleListScroll),window.removeEventListener("resize",this.handleListScroll)}attributeChangedCallback(){this.isConnected&&this.render()}render(){const t=Array.from(this.children).filter(t=>t.hasAttribute("slot")),e=this.labels,i=this.tabItems,s=Math.min(Math.max(this.activeIndex,0),Math.max(e.length-1,0)),n=SIZES$w.includes(this.size)?this.size:"m",a=ORIENTATIONS$1.includes(this.orientation)?this.orientation:"horizontal",r=VARIANTS$m.includes(this.variant)?this.variant:"default",o="default"===r;this.className=["designbase-wc-tabs",`designbase-wc-tabs--${a}`,`designbase-wc-tabs--${n}`,`designbase-wc-tabs--${r}`,this.fullWidth&&"designbase-wc-tabs--full-width"].filter(Boolean).join(" "),Array.from(this.children).forEach(t=>t.remove()),this.list=document.createElement("div"),this.list.className=["designbase-wc-tabs__list",`designbase-wc-tabs__list--${a}`,this.fullWidth&&"designbase-wc-tabs__list--full-width"].filter(Boolean).join(" "),this.list.setAttribute("role","tablist"),this.list.setAttribute("aria-orientation",a),this.list.setAttribute("aria-label","탭 목록"),this.tabButtons=[],e.forEach((t,e)=>{const a=i[e],r=Boolean(a?.disabled),o=e===s,l=document.createElement("button");if(l.type="button",l.className=["designbase-wc-tabs__tab",o&&"designbase-wc-tabs__tab--selected",r&&"designbase-wc-tabs__tab--disabled"].filter(Boolean).join(" "),l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(o)),l.setAttribute("aria-controls",`panel-${e}`),l.id=`tab-${e}`,l.tabIndex=o?0:-1,l.disabled=r,a?.icon){const t=document.createElement("span");t.className="designbase-wc-tabs__tab-icon";const e="s"===n?16:"l"===n?20:18;t.append(createDbIcon(a.icon,e)),l.append(t)}const h=document.createElement("span");h.className="designbase-wc-tabs__tab-label",h.textContent=t,l.append(h),l.addEventListener("click",()=>this.select(e)),l.addEventListener("keydown",t=>this.handleKeyDown(t,e)),this.list?.append(l),this.tabButtons.push(l)}),o?(this.indicator=document.createElement("span"),this.indicator.className="designbase-wc-tabs__indicator designbase-wc-tabs__indicator--no-transition",this.list.append(this.indicator),requestAnimationFrame(()=>this.updateIndicator(!1))):this.indicator=void 0,this.panel=document.createElement("div"),this.panel.className="designbase-wc-tabs__panel",this.panel.setAttribute("role","tabpanel"),this.panel.id=`panel-${s}`,this.panel.setAttribute("aria-labelledby",`tab-${s}`),this.panel.tabIndex=0;const l=document.createElement("slot");l.name=`panel-${s}`,this.panel.append(l),this.append(this.list,this.panel),t.forEach(t=>this.append(t)),requestAnimationFrame(()=>{this.handleListScroll(),o&&this.updateIndicator(!1)})}select(t){const e=this.labels,i=this.tabItems;if(!e[t]||i[t]?.disabled)return;this.activeIndex=t;const s=i[t]?.id||String(t);this.setAttribute("selected-id",s),this.dispatchEvent(new CustomEvent("db-change",{detail:{index:t,label:e[t],id:s},bubbles:!0,composed:!0})),this.render()}handleKeyDown(t,e){const i=this.labels,s=this.tabItems;let n=e;if("ArrowRight"===t.key||"ArrowDown"===t.key)n=(e+1)%i.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)n=(e-1+i.length)%i.length;else if("Home"===t.key)n=0;else{if("End"!==t.key)return"Enter"===t.key||" "===t.key?(t.preventDefault(),void this.select(e)):void 0;n=i.length-1}t.preventDefault();let a=0;for(;s[n]?.disabled&&a<i.length;)n="ArrowLeft"===t.key||"ArrowUp"===t.key?(n-1+i.length)%i.length:(n+1)%i.length,a+=1;this.tabButtons[n]?.focus()}updateIndicator(t=!1){const e=this.list?.querySelector(".designbase-wc-tabs__tab--selected");if(!e||!this.indicator)return;const i="vertical"===this.orientation;this.indicator.classList.toggle("designbase-wc-tabs__indicator--no-transition",!t),this.indicator.classList.add(i?"designbase-wc-tabs__indicator--vertical":"designbase-wc-tabs__indicator--horizontal"),this.indicator.classList.add("designbase-wc-tabs__indicator--ready"),i?(this.indicator.style.width="2px",this.indicator.style.height=`${e.offsetHeight}px`,this.indicator.style.transform=`translate3d(0, ${e.offsetTop}px, 0)`):(this.indicator.style.width=`${e.offsetWidth}px`,this.indicator.style.height="2px",this.indicator.style.transform=`translate3d(${e.offsetLeft}px, 0, 0)`)}}customElements.get("db-tabs")||customElements.define("db-tabs",DbTabs);const SIZES$v=["s","m","l","xl","full"],HEADER_VARIANTS=["default","tabs","segment"],NAV_SIZES=["s","m","l"];class DbModal extends HTMLElement{constructor(){super(...arguments),this.titleId=`db-modal-title-${Math.random().toString(36).slice(2,9)}`,this.isMounted=!1,this.internalTabId="",this.internalSegment="",this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&"false"!==this.getAttribute("close-on-escape")&&(t.preventDefault(),this.close())}}static get observedAttributes(){return["open","title","size","header-variant","tabs","segments","selected-tab-id","default-selected-tab-id","segment-value","default-segment-value","nav-size","segment-full-width","close-on-outside-click","close-on-escape","show-close-button"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open","true"):this.removeAttribute("open")}connectedCallback(){this.classList.add("designbase-wc-modal-host"),document.addEventListener("keydown",this.handleDocumentKeyDown),this.childObserver=new MutationObserver(()=>{this.open&&this.render()}),this.childObserver.observe(this,{childList:!0}),this.syncOpenState()}disconnectedCallback(){this.childObserver?.disconnect(),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.teardown()}attributeChangedCallback(t){if(this.isConnected)if("open"!==t){if("selected-tab-id"===t||"segment-value"===t){const t=this.getClassifiedChildren();return this.renderBodyContent(t.body),void this.renderHeader(t.header)}this.render(),this.isMounted&&this.syncVisibility()}else this.syncOpenState()}resolvedSize(){return SIZES$v.includes(this.size)?this.size:"m"}get size(){return this.getAttribute("size")||"m"}set size(t){t?this.setAttribute("size",t):this.removeAttribute("size")}resolvedHeaderVariant(){const t=this.getAttribute("header-variant")||"default";return HEADER_VARIANTS.includes(t)?t:"default"}parsedTabs(){const t=this.getAttribute("tabs");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}parsedSegments(){const t=this.getAttribute("segments");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}usesIntegratedNav(){const t=this.resolvedHeaderVariant();return"tabs"===t&&this.parsedTabs().length>0||"segment"===t&&this.parsedSegments().length>0}closeIconSize(){const t=this.resolvedSize();return"s"===t?16:"l"===t?20:"xl"===t?24:18}activeTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId||this.getAttribute("default-selected-tab-id")||this.parsedTabs()[0]?.id||""}activeSegmentValue(){return this.getAttribute("segment-value")||this.internalSegment||this.getAttribute("default-segment-value")||this.parsedSegments()[0]?.value||""}collectUserChildren(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-wc-internal"))}classifyChildren(t){const isPart=(t,e,i)=>t.classList.contains(i)||t.getAttribute("data-modal-part")===e,e=t.filter(t=>isPart(t,"header","designbase-wc-modal__header")),i=t.filter(t=>isPart(t,"footer","designbase-wc-modal__footer")||"footer"===t.getAttribute("slot")),s=t.filter(t=>isPart(t,"body","designbase-wc-modal__body")),n=t.filter(t=>!e.includes(t)&&!i.includes(t)&&!s.includes(t));return{header:e,body:[...s,...n],footer:i}}getClassifiedChildren(){const t=this.classifyChildren(this.collectUserChildren());if(t.header.length||t.body.length||t.footer.length)return t;return{header:Array.from(this.headerEl?.children||[]).filter(t=>t!==this.closeButton&&!t.classList.contains("designbase-wc-modal__header-row")&&("header"===t.getAttribute("data-modal-part")||t.classList.contains("designbase-wc-modal__header"))),body:this.collectContentParts("body"),footer:this.collectContentParts("footer")}}isBodyPart(t){return t.classList.contains("designbase-wc-modal__body")||"body"===t.getAttribute("data-modal-part")}isFooterPart(t){return t.classList.contains("designbase-wc-modal__footer")||"footer"===t.getAttribute("data-modal-part")||"footer"===t.getAttribute("slot")}collectContentParts(t){if(!this.contentEl)return[];const e=Array.from(this.contentEl.children).filter(e=>"body"===t?this.isBodyPart(e):this.isFooterPart(e));return e.length>0?e:Array.from(this.children).filter(e=>"body"===t?this.isBodyPart(e):this.isFooterPart(e))}placeContentParts(t,e){this.contentEl&&e.forEach(e=>{if(e.parentElement!==this.contentEl){if("body"===t){const t=this.contentEl.querySelector(':scope > .designbase-wc-modal__footer, :scope > [data-modal-part="footer"]')||null;return void this.contentEl.insertBefore(e,t)}this.contentEl.append(e)}})}restorePartsToHost(){this.contentEl&&Array.from(this.contentEl.children).filter(t=>!t.classList.contains("designbase-wc-modal__integrated-content")&&!t.hasAttribute("data-wc-internal")).forEach(t=>{t.parentElement!==this&&this.append(t)})}bindFooterActions(){if(!this.contentEl||"true"===this.contentEl.dataset.modalActionsBound)return;this.contentEl.dataset.modalActionsBound="true";const handleClose=t=>{const e=t.target?.closest("[data-modal-close]");e&&this.contentEl?.contains(e)&&this.close()};this.contentEl.addEventListener("click",handleClose),this.contentEl.addEventListener("db-click",handleClose)}ensureStructure(){this.root||(this.root=document.createElement("div"),this.root.className="designbase-wc-modal__overlay",this.root.setAttribute("data-wc-internal",""),this.root.addEventListener("click",t=>{t.target===this.root&&"false"!==this.getAttribute("close-on-outside-click")&&this.close()}),this.panel=document.createElement("div"),this.panel.className="designbase-wc-modal",this.panel.setAttribute("role","dialog"),this.panel.setAttribute("aria-modal","true"),this.panel.addEventListener("click",t=>t.stopPropagation()),this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-modal__header",this.headerContentEl=document.createElement("div"),this.headerContentEl.className="designbase-wc-modal__header-content",this.titleEl=document.createElement("h2"),this.titleEl.className="designbase-wc-modal__title",this.titleEl.id=this.titleId,this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.className="designbase-wc-modal__close-button",this.closeButton.setAttribute("aria-label","모달 닫기"),this.closeButton.addEventListener("click",()=>this.close()),this.navEl=document.createElement("div"),this.navEl.className="designbase-wc-modal__header-nav",this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-modal__content",this.panel.append(this.headerEl,this.contentEl),this.root.append(this.panel))}renderCloseButton(){if(!this.closeButton)return;const t=this.closeIconSize();this.closeButton.replaceChildren(createDbIcon("close",t)),this.closeButton.hidden="false"===this.getAttribute("show-close-button")}renderDefaultHeader(t){if(!(this.headerEl&&this.headerContentEl&&this.titleEl&&this.closeButton))return;if(this.headerEl.className="designbase-wc-modal__header",this.headerEl.replaceChildren(),t.length>0)return t.forEach(t=>this.headerEl.append(t)),void("false"!==this.getAttribute("show-close-button")&&this.headerEl.append(this.closeButton));const e=this.getAttribute("title")||"";this.titleEl.textContent=e,this.titleEl.hidden=!e,this.headerContentEl.replaceChildren(),e&&this.headerContentEl.append(this.titleEl),this.renderCloseButton(),this.headerEl.append(this.headerContentEl),"false"!==this.getAttribute("show-close-button")&&this.headerEl.append(this.closeButton),this.panel&&(e?this.panel.setAttribute("aria-labelledby",this.titleId):this.panel.removeAttribute("aria-labelledby"))}renderNavHeader(){if(!(this.headerEl&&this.headerContentEl&&this.titleEl&&this.closeButton&&this.navEl))return;const t=this.resolvedHeaderVariant(),e=this.parsedTabs(),i=this.parsedSegments(),s=NAV_SIZES.includes(this.getAttribute("nav-size")||"s")&&this.getAttribute("nav-size")||"s";this.headerEl.className=["designbase-wc-modal__header","tabs"===t&&"designbase-wc-modal__header--tabs","segment"===t&&"designbase-wc-modal__header--segment"].filter(Boolean).join(" ");const n=this.getAttribute("title")||"";this.titleEl.textContent=n,this.titleEl.hidden=!n,this.headerContentEl.replaceChildren(),n&&this.headerContentEl.append(this.titleEl),this.renderCloseButton();const a=document.createElement("div");if(a.className="designbase-wc-modal__header-row",a.append(this.headerContentEl),"false"!==this.getAttribute("show-close-button")&&a.append(this.closeButton),this.headerEl.replaceChildren(a),this.navEl.replaceChildren(),"tabs"===t&&e.length>0){const t=document.createElement("db-tabs");t.setAttribute("size",s),t.setAttribute("items",JSON.stringify(e.map(t=>({id:t.id,label:t.label,disabled:t.disabled})))),t.setAttribute("selected-id",this.activeTabId()),t.addEventListener("db-change",t=>{const e=t.detail?.id;e&&(this.hasAttribute("selected-tab-id")||(this.internalTabId=e),this.dispatchEvent(new CustomEvent("db-tab-change",{detail:{tabId:e},bubbles:!0,composed:!0})),this.renderBodyContent(this.getClassifiedChildren().body))}),this.tabsEl=t,this.navEl.append(t),this.headerEl.append(this.navEl)}if("segment"===t&&i.length>0){const t=document.createElement("db-segment-control");t.setAttribute("size",s),t.setAttribute("options",JSON.stringify(i.map(t=>({value:t.value,label:t.label,disabled:t.disabled})))),t.setAttribute("value",this.activeSegmentValue()),"false"!==this.getAttribute("segment-full-width")&&t.setAttribute("full-width",""),t.addEventListener("db-change",t=>{const e=t.detail?.value;e&&(this.hasAttribute("segment-value")||(this.internalSegment=e),this.dispatchEvent(new CustomEvent("db-segment-change",{detail:{value:e},bubbles:!0,composed:!0})),this.renderBodyContent(this.getClassifiedChildren().body))}),this.segmentEl=t,this.navEl.append(t),this.headerEl.append(this.navEl)}this.panel&&(n?this.panel.setAttribute("aria-labelledby",this.titleId):this.panel.removeAttribute("aria-labelledby"))}renderHeader(t){if(!this.headerEl)return;if(t.length>0)return this.headerEl.hidden=!1,void this.renderDefaultHeader(t);if(this.usesIntegratedNav())return this.headerEl.hidden=!1,void this.renderNavHeader();this.getAttribute("title")||""?(this.headerEl.hidden=!1,this.renderDefaultHeader([])):this.headerEl.hidden=!0}renderBodyContent(t=[]){if(!this.contentEl)return;let e=this.contentEl.querySelector(":scope > .designbase-wc-modal__integrated-content"),i="";if(this.usesIntegratedNav()){const t=this.resolvedHeaderVariant();if("tabs"===t){const t=this.parsedTabs().find(t=>t.id===this.activeTabId());i=t?.content||""}if("segment"===t){const t=this.parsedSegments().find(t=>t.value===this.activeSegmentValue());i=t?.content||""}}i?(e||(e=document.createElement("div"),e.className="designbase-wc-modal__integrated-content designbase-wc-modal__body",this.contentEl.insertBefore(e,this.contentEl.firstChild)),e.textContent=i):e?.remove();const s=t.filter(t=>this.isBodyPart(t)),n=t.filter(t=>!this.isBodyPart(t)&&!this.isFooterPart(t));this.placeContentParts("body",s.length>0?s:n)}renderFooter(t){if(!this.contentEl)return;const e=t.filter(t=>this.isFooterPart(t)),i=t.filter(t=>!this.isFooterPart(t)&&!this.isBodyPart(t)),s=e.length>0?e:i;this.placeContentParts("footer",s),s.forEach(t=>{t.hidden=!1}),this.bindFooterActions()}render(){this.ensureStructure();const{header:t,body:e,footer:i}=this.getClassifiedChildren();SIZES$v.forEach(t=>this.panel?.classList.remove(`designbase-wc-modal--${t}`)),this.panel?.classList.add(`designbase-wc-modal--${this.resolvedSize()}`),this.renderHeader(t),this.renderBodyContent(e),this.renderFooter(i)}syncVisibility(){if(!this.root||!this.panel)return;const t=this.open?"entered":"exiting";this.root.setAttribute("data-state",t),this.panel.setAttribute("data-state",t)}syncOpenState(){if(this.open)return this.render(),this.root&&!this.root.isConnected&&document.body.append(this.root),document.body.style.overflow="hidden",this.isMounted=!0,void requestAnimationFrame(()=>this.syncVisibility());this.syncVisibility(),document.body.style.overflow="",window.setTimeout(()=>{this.open||this.teardown()},200)}teardown(){this.restorePartsToHost(),this.root?.remove(),this.isMounted=!1,document.body.style.overflow=""}close(){this.open=!1,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}}customElements.get("db-modal")||customElements.define("db-modal",DbModal);const SIZES$u=["s","m","l"],PLACEMENTS$1=["bottom-left","bottom-right","top-left","top-right"],TRIGGER_VARIANTS=["primary","secondary","tertiary","danger","ghost"];class DbDropdown extends HTMLElement{constructor(){super(...arguments),this.focusedIndex=-1,this.onTriggerActivate=null,this.lastTriggerSignature="",this.handleTriggerKeyDown=t=>{if(("Enter"===t.key||" "===t.key||"ArrowDown"===t.key)&&!this.open)return t.preventDefault(),this.open=!0,requestAnimationFrame(()=>this.focusItem(0)),void this.render();"Escape"===t.key&&this.open&&(t.preventDefault(),this.open=!1,this.render())},this.handleDocumentKeyDown=t=>{if(!this.open)return;if("Escape"===t.key)return t.preventDefault(),this.open=!1,this.render(),void this.triggerWrap?.querySelector("[aria-haspopup]")?.focus();const e=this.enabledItems();if(!e.length)return;const i=e.findIndex(t=>this.parsedItems.indexOf(t)===this.focusedIndex);switch(t.key){case"ArrowDown":t.preventDefault(),this.focusItem(i<0?0:this.parsedItems.indexOf(e[(i+1)%e.length]));break;case"ArrowUp":t.preventDefault(),this.focusItem(i<0?0:this.parsedItems.indexOf(e[(i-1+e.length)%e.length]));break;case"Home":t.preventDefault(),this.focusItem(this.parsedItems.indexOf(e[0]));break;case"End":t.preventDefault(),this.focusItem(this.parsedItems.indexOf(e[e.length-1]));break;case"Enter":case" ":{t.preventDefault();const e=this.parsedItems[this.focusedIndex];!e||e.divider||e.disabled||this.selectItem(e);break}}},this.handleDocumentMouseDown=t=>{this.open&&(this.contains(t.target)||(this.open=!1,this.render()))}}static get observedAttributes(){return["options","items","placeholder","label","value","size","placement","full-width","disabled","open","trigger-variant","trigger-icon","icon-only"]}get parsedItems(){const t=this.getAttribute("items");if(t)try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return(this.getAttribute("options")||"").split(",").map(t=>t.trim()).filter(Boolean).map((t,e)=>({id:`option-${e}`,label:t}))}get options(){return this.parsedItems.map(t=>t.label||t.id)}set options(t){this.setAttribute("options",Array.isArray(t)?t.join(","):t)}get items(){return this.parsedItems}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}get value(){return this.getAttribute("value")||""}set value(t){t?this.setAttribute("value",t):this.removeAttribute("value")}get open(){return this.hasAttribute("open")}set open(t){const e=this.open;this.toggleAttribute("open",t),e!==t&&this.dispatchEvent(new CustomEvent("db-open",{detail:{open:t},bubbles:!0,composed:!0}))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get placement(){return this.getAttribute("placement")||"bottom-left"}set placement(t){this.setAttribute("placement",t)}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(t){t?this.setAttribute("placeholder",t):this.removeAttribute("placeholder")}get label(){return this.getAttribute("label")||""}set label(t){t?this.setAttribute("label",t):this.removeAttribute("label")}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(t){this.toggleAttribute("full-width",t)}connectedCallback(){requestAnimationFrame(()=>this.render()),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindTrigger()}attributeChangedCallback(t){this.isConnected&&("open"!==t||this.open||(this.focusedIndex=-1),this.render())}resolvedSize(){return SIZES$u.includes(this.size)?this.size:"m"}resolvedPlacement(){return PLACEMENTS$1.includes(this.placement)?this.placement:"bottom-left"}triggerButtonIconSize(){const t=this.resolvedSize();return"s"===t?16:"l"===t?24:20}menuItemIconSize(){const t=this.resolvedSize();return"s"===t?14:"l"===t?18:16}triggerLabel(){return this.label?this.label:this.placeholder?this.placeholder:this.value?this.value:"메뉴"}enabledItems(){return this.parsedItems.filter(t=>!t.disabled&&!t.divider)}collectTriggerChildren(){const isInternalNode=t=>t.hasAttribute("data-wc-internal")||t===this.triggerWrap||t===this.menu||t===this.defaultTrigger,t=Array.from(this.children).filter(t=>!isInternalNode(t));return t.length>0?t:Array.from(this.triggerWrap?.children||[]).filter(t=>!isInternalNode(t))}hasCustomTrigger(){return this.collectTriggerChildren().length>0}bindTrigger(){this.triggerWrap&&(this.unbindTrigger(),this.onTriggerActivate=t=>{this.disabled||(t.preventDefault(),t.stopPropagation(),this.toggleOpen())},this.triggerWrap.addEventListener("click",this.onTriggerActivate),this.triggerWrap.addEventListener("keydown",this.handleTriggerKeyDown))}unbindTrigger(){this.triggerWrap&&this.onTriggerActivate&&this.triggerWrap.removeEventListener("click",this.onTriggerActivate),this.triggerWrap&&this.triggerWrap.removeEventListener("keydown",this.handleTriggerKeyDown),this.onTriggerActivate=null}toggleOpen(){this.disabled||(this.open=!this.open,this.open&&requestAnimationFrame(()=>this.focusItem(0)),this.render())}triggerSignature(){return[this.resolvedSize(),this.getAttribute("trigger-variant")||"tertiary",this.hasAttribute("icon-only")?"1":"0",this.getAttribute("trigger-icon")||"",this.fullWidth?"1":"0"].join("|")}renderDefaultTrigger(){const t=this.resolvedSize(),e=this.triggerButtonIconSize(),i=this.getAttribute("trigger-variant")||"tertiary",s=TRIGGER_VARIANTS.includes(i)?i:"tertiary",n=this.hasAttribute("icon-only"),a=this.getAttribute("trigger-icon"),r=document.createElement("db-button");if(r.setAttribute("type","button"),r.setAttribute("variant",s),r.setAttribute("size",t),r.className="designbase-wc-dropdown__trigger",r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-label",this.triggerLabel()),this.fullWidth&&r.setAttribute("full-width",""),n&&r.setAttribute("icon-only",""),r.replaceChildren(),n){const t=a||"edit",i=document.createElement("span");i.className="designbase-wc-button__start-icon",i.append(createDbIcon(t,e)),r.append(i)}else{const t=document.createElement("span");t.className="designbase-wc-dropdown__trigger-label",t.textContent=this.triggerLabel(),r.append(t);const i=document.createElement("span");i.className="designbase-wc-button__end-icon",i.append(createDbIcon("chevron-down",e)),r.append(i)}if(!n&&a){const t=document.createElement("span");t.className="designbase-wc-button__start-icon",t.append(createDbIcon(a,e)),r.insertBefore(t,r.firstChild)}return r}syncDefaultTriggerState(t){t.setAttribute("aria-expanded",String(this.open)),t.setAttribute("aria-label",this.triggerLabel()),t.classList.toggle("designbase-wc-dropdown__trigger--open",this.open),this.disabled?t.setAttribute("disabled",""):t.removeAttribute("disabled");const e=t.querySelector(".designbase-wc-dropdown__trigger-label");e&&(e.textContent=this.triggerLabel())}ensureStructure(){this.triggerWrap||(this.triggerWrap=document.createElement("div"),this.triggerWrap.className="designbase-wc-dropdown__trigger-wrap",this.triggerWrap.setAttribute("data-wc-internal","")),this.menu||(this.menu=document.createElement("div"),this.menu.className="designbase-wc-dropdown__menu",this.menu.setAttribute("data-wc-internal",""),this.menu.setAttribute("role","menu")),this.contains(this.triggerWrap)||this.append(this.triggerWrap),this.triggerWrap.contains(this.menu)||this.triggerWrap.append(this.menu),Array.from(this.children).forEach(t=>{t===this.triggerWrap||t.hasAttribute("data-wc-internal")||this.triggerWrap.insertBefore(t,this.menu)})}renderTrigger(){const t=this.collectTriggerChildren();if(t.length>0){this.defaultTrigger?.remove(),this.defaultTrigger=void 0;Array.from(this.triggerWrap.children).filter(t=>t!==this.menu&&t!==this.defaultTrigger).forEach(t=>t.remove()),t.forEach(t=>{t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded",String(this.open)),t.classList.toggle("designbase-wc-dropdown__trigger--open",this.open),this.triggerWrap.insertBefore(t,this.menu||null)})}else{Array.from(this.triggerWrap.children).filter(t=>t!==this.menu&&t!==this.defaultTrigger).forEach(t=>t.remove()),this.defaultTrigger&&this.triggerSignature()===this.lastTriggerSignature?this.syncDefaultTriggerState(this.defaultTrigger):(this.defaultTrigger?.remove(),this.defaultTrigger=this.renderDefaultTrigger(),this.lastTriggerSignature=this.triggerSignature(),this.triggerWrap.insertBefore(this.defaultTrigger,this.menu||null))}this.bindTrigger()}renderMenu(){const t=this.resolvedPlacement();this.menu.className=`designbase-wc-dropdown__menu designbase-wc-dropdown__menu--${t}${this.open?" designbase-wc-dropdown__menu--open":""}`,this.menu.setAttribute("aria-hidden",String(!this.open)),this.menu.setAttribute("aria-label",this.triggerLabel()),this.menu.replaceChildren();const e=this.menuItemIconSize();this.parsedItems.forEach((t,i)=>{if(t.divider){const t=document.createElement("div");return t.className="designbase-wc-dropdown__divider",t.setAttribute("role","separator"),void this.menu?.append(t)}t.id||t.label||String(i);const s=t.label||t.id,n=Boolean(t.disabled||this.disabled),a=this.focusedIndex===i,r=document.createElement("button");if(r.type="button",r.className=["designbase-wc-dropdown__item",n&&"designbase-wc-dropdown__item--disabled",a&&"designbase-wc-dropdown__item--focused"].filter(Boolean).join(" "),r.setAttribute("role","menuitem"),r.disabled=n,r.tabIndex=a?0:-1,r.dataset.index=String(i),t.icon){const i=createDbIcon(t.icon,e);i.classList.add("designbase-wc-dropdown__item-icon"),r.append(i)}const o=document.createElement("span");o.className="designbase-wc-dropdown__item-label",o.textContent=s,r.append(o),r.addEventListener("click",e=>{e.stopPropagation(),this.selectItem(t)}),this.menu?.append(r)})}render(){const t=this.resolvedSize();this.className=["designbase-wc-dropdown",`designbase-wc-dropdown--${t}`,this.open&&"designbase-wc-dropdown--open",this.fullWidth&&"designbase-wc-dropdown--full-width",this.disabled&&"designbase-wc-dropdown--disabled"].filter(Boolean).join(" "),this.ensureStructure(),this.renderTrigger(),this.renderMenu()}selectItem(t){t.disabled||t.divider||(this.open=!1,this.focusedIndex=-1,this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t.label||t.id,id:t.id,item:t},bubbles:!0,composed:!0})),this.render(),this.triggerWrap?.querySelector("[aria-haspopup]")?.focus())}focusItem(t){const e=this.enabledItems();if(!e.length)return;const i=e[Math.max(0,Math.min(t,e.length-1))],s=this.parsedItems.indexOf(i);this.focusedIndex=s;Array.from(this.menu?.querySelectorAll(".designbase-wc-dropdown__item")||[]).forEach(t=>{const e=Number(t.dataset.index)===s;t.classList.toggle("designbase-wc-dropdown__item--focused",e),t.tabIndex=e?0:-1,e&&t.focus()})}}customElements.get("db-dropdown")||customElements.define("db-dropdown",DbDropdown);const POSITIONS$4=["top","bottom","left","right","top-start","top-end","bottom-start","bottom-end","left-start","left-end","right-start","right-end"],SIZES$t=["s","m","l"],VARIANTS$l=["default","primary","success","warning","danger","info"],GAP$1=8,ARW=6,PAD=8,OUT=-10,INSET=2;class DbTooltip extends HTMLElement{constructor(){super(...arguments),this.tooltipId=`db-tooltip-${Math.random().toString(36).slice(2,9)}`,this.visible=!1,this.handleShow=()=>{this.disabled||this.alwaysShow||(this.clearTimers(),this.showTimer=setTimeout(()=>this.setVisible(!0),Math.max(0,this.delay)))},this.handleHide=()=>{this.alwaysShow||(this.clearTimers(),this.hideTimer=setTimeout(()=>this.setVisible(!1),Math.max(0,this.hideDelay)))},this.handleKeyDown=t=>{"Escape"===t.key&&(this.clearTimers(),this.setVisible(!1))},this.handleReposition=()=>{(this.visible||this.alwaysShow)&&(this.repositionRaf&&cancelAnimationFrame(this.repositionRaf),this.repositionRaf=requestAnimationFrame(()=>this.calculatePosition()))}}static get observedAttributes(){return["content","position","size","variant","disabled","always-show","delay","hide-delay","max-width","show-arrow"]}get content(){return this.getAttribute("content")||""}set content(t){this.setAttribute("content",t)}get position(){return this.getAttribute("position")||"top"}set position(t){this.setAttribute("position",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get variant(){return this.getAttribute("variant")||"default"}set variant(t){this.setAttribute("variant",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}get alwaysShow(){return this.hasAttribute("always-show")}set alwaysShow(t){this.toggleAttribute("always-show",t)}get delay(){return Number(this.getAttribute("delay")??"200")}get hideDelay(){return Number(this.getAttribute("hide-delay")??"80")}get maxWidth(){return Number(this.getAttribute("max-width")??"240")}get showArrow(){return"false"!==this.getAttribute("show-arrow")}connectedCallback(){this.render(),this.childObserver=new MutationObserver(()=>this.render()),this.childObserver.observe(this,{childList:!0}),window.addEventListener("scroll",this.handleReposition,!0),window.addEventListener("resize",this.handleReposition)}disconnectedCallback(){this.childObserver?.disconnect(),this.clearTimers(),this.repositionRaf&&cancelAnimationFrame(this.repositionRaf),window.removeEventListener("scroll",this.handleReposition,!0),window.removeEventListener("resize",this.handleReposition),this.tooltip?.remove(),this.tooltip=void 0}attributeChangedCallback(){this.isConnected&&(this.render(),this.alwaysShow?this.setVisible(!0):this.visible||this.removeTooltip())}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=void 0,this.hideTimer=void 0}groupOf(t){return t.startsWith("top")?"top":t.startsWith("bottom")?"bottom":t.startsWith("left")?"left":"right"}resolvedPosition(){return POSITIONS$4.includes(this.position)?this.position:"top"}collectTriggerChildren(){const isInternalNode=t=>t.hasAttribute("data-wc-internal")||t===this.trigger,t=Array.from(this.children).filter(t=>!isInternalNode(t));return t.length>0?t:Array.from(this.trigger?.children||[])}ensureTrigger(){this.trigger||(this.trigger=document.createElement("span"),this.trigger.className="designbase-wc-tooltip__trigger",this.trigger.setAttribute("data-wc-internal",""),this.trigger.tabIndex=0,this.trigger.addEventListener("mouseenter",this.handleShow),this.trigger.addEventListener("mouseleave",this.handleHide),this.trigger.addEventListener("focus",this.handleShow),this.trigger.addEventListener("blur",this.handleHide),this.trigger.addEventListener("keydown",this.handleKeyDown)),this.trigger.parentElement!==this&&this.append(this.trigger)}mountTriggerChildren(t){this.trigger&&t.forEach(t=>{t.parentElement!==this.trigger&&this.trigger.append(t)})}render(){this.ensureTrigger(),this.mountTriggerChildren(this.collectTriggerChildren()),this.alwaysShow&&this.setVisible(!0)}ensureTooltip(){this.tooltip||(this.tooltip=document.createElement("div"),this.tooltip.className="designbase-wc-tooltip",this.tooltip.setAttribute("data-wc-internal",""),this.tooltip.setAttribute("role","tooltip"),this.tooltip.id=this.tooltipId,this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-tooltip__content",this.arrow=document.createElement("div"),this.arrow.className="designbase-wc-tooltip__arrow",this.tooltip.append(this.contentEl,this.arrow),document.body.append(this.tooltip))}syncTooltipClasses(){if(!this.tooltip||!this.arrow)return;const t=this.resolvedPosition(),e=SIZES$t.includes(this.size)?this.size:"m",i=VARIANTS$l.includes(this.variant)?this.variant:"default";this.tooltip.className=["designbase-wc-tooltip",`designbase-wc-tooltip--${e}`,`designbase-wc-tooltip--${i}`,`designbase-wc-tooltip--${t}`,(this.visible||this.alwaysShow)&&"designbase-wc-tooltip--visible",this.disabled&&"designbase-wc-tooltip--disabled"].filter(Boolean).join(" "),this.arrow.className=`designbase-wc-tooltip__arrow designbase-wc-tooltip__arrow--${t}`,this.arrow.hidden=!this.showArrow,this.tooltip.setAttribute("data-placement-group",this.groupOf(t)),this.tooltip.setAttribute("aria-hidden",String(!(this.visible||this.alwaysShow))),this.tooltip.style.maxWidth=`${this.maxWidth}px`,this.tooltip.style.zIndex="9999",this.tooltip.style.pointerEvents="none",this.contentEl&&(this.contentEl.textContent=this.content)}calculatePosition(){if(!this.trigger||!this.tooltip||!this.arrow)return;const t=this.resolvedPosition(),e=this.trigger.getBoundingClientRect(),i=this.tooltip.getBoundingClientRect();let s=0,n=0,a=0,r=0;switch(t){case"top":s=e.top-i.height-GAP$1,n=e.left+e.width/2-i.width/2,a=i.height-INSET,r=i.width/2-ARW;break;case"top-start":s=e.top-i.height-GAP$1,n=e.left,a=i.height-INSET,r=PAD;break;case"top-end":s=e.top-i.height-GAP$1,n=e.right-i.width,a=i.height-INSET,r=i.width-PAD-ARW;break;case"bottom":s=e.bottom+GAP$1,n=e.left+e.width/2-i.width/2,a=OUT,r=i.width/2-ARW;break;case"bottom-start":s=e.bottom+GAP$1,n=e.left,a=OUT,r=PAD;break;case"bottom-end":s=e.bottom+GAP$1,n=e.right-i.width,a=OUT,r=i.width-PAD-ARW;break;case"left":s=e.top+e.height/2-i.height/2,n=e.left-i.width-GAP$1,a=i.height/2-ARW,r=i.width-INSET;break;case"left-start":s=e.top,n=e.left-i.width-GAP$1,a=PAD,r=i.width-INSET;break;case"left-end":s=e.bottom-i.height,n=e.left-i.width-GAP$1,a=i.height-PAD-ARW,r=i.width-INSET;break;case"right":s=e.top+e.height/2-i.height/2,n=e.right+GAP$1,a=i.height/2-ARW,r=OUT;break;case"right-start":s=e.top,n=e.right+GAP$1,a=PAD,r=OUT;break;case"right-end":s=e.bottom-i.height,n=e.right+GAP$1,a=i.height-PAD-ARW,r=OUT}const o=window.innerWidth,l=window.innerHeight;n<8&&(n=8),n+i.width>o-8&&(n=o-i.width-8),s<8&&(s=8),s+i.height>l-8&&(s=l-i.height-8);const h=this.groupOf(t);if("top"===h||"bottom"===h){const t=e.left+e.width/2-n-ARW;r=Math.min(i.width-PAD-ARW,Math.max(PAD,t))}else{const t=e.top+e.height/2-s-ARW;a=Math.min(i.height-PAD-ARW,Math.max(PAD,t))}this.tooltip.style.position="fixed",this.tooltip.style.top=`${s}px`,this.tooltip.style.left=`${n}px`,this.arrow.style.position="absolute",this.arrow.style.top=`${a}px`,this.arrow.style.left=`${r}px`}setVisible(t){if(!this.disabled||!t){if(this.visible=t,!t&&!this.alwaysShow)return this.removeTooltip(),void this.trigger?.removeAttribute("aria-describedby");this.ensureTooltip(),this.syncTooltipClasses(),this.trigger?.setAttribute("aria-describedby",this.tooltipId),requestAnimationFrame(()=>{this.syncTooltipClasses(),this.calculatePosition()})}}removeTooltip(){this.tooltip?.remove(),this.tooltip=void 0,this.contentEl=void 0,this.arrow=void 0}}customElements.get("db-tooltip")||customElements.define("db-tooltip",DbTooltip);class DbAccordion extends HTMLElement{constructor(){super(...arguments),this.expanded=new Set,this.isRendering=!1,this.suppressExpandedAttrCallback=!1}static get observedAttributes(){return["items","variant","style","size","allow-multiple","expand-mode","expanded-items","default-item-type"]}get items(){try{const t=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}get allowMultiple(){return this.hasAttribute("allow-multiple")}set allowMultiple(t){this.toggleAttribute("allow-multiple",t)}get expandedItems(){const t=(this.getAttribute("expanded-items")||"").trim();if(!t)return[];if("all"===t)return this.items.map((t,e)=>this.resolveItemKey(t,e));try{const e=JSON.parse(t);if(Array.isArray(e))return e.map(t=>String(t).trim()).filter(Boolean)}catch{}return t.split(",").map(t=>t.trim()).filter(Boolean)}set expandedItems(t){Array.isArray(t)?this.setAttribute("expanded-items",t.join(",")):this.setAttribute("expanded-items",t)}connectedCallback(){this.syncExpandedFromAttributes(),this.render(),this.childObserver=new MutationObserver(t=>{if(this.isRendering)return;t.some(t=>Array.from(t.addedNodes).some(t=>t instanceof HTMLElement&&t.hasAttribute("slot")))&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.childObserver?.disconnect()}attributeChangedCallback(t){if(this.isConnected){if("expanded-items"===t){if(this.suppressExpandedAttrCallback)return;return this.syncExpandedFromAttributes(),void this.syncExpandedState()}return"expand-mode"===t||"allow-multiple"===t?(this.syncExpandedFromAttributes(),void this.syncExpandedState()):"items"===t?(this.syncExpandedFromAttributes(),void this.render()):void this.render()}}resolveItemKey(t,e){return t.id??String(e)}getExpandMode(){const t=this.getAttribute("expand-mode");return"single"===t||"multiple"===t||"all"===t?t:(this.hasAttribute("allow-multiple"),"multiple")}syncExpandedFromAttributes(){const t=this.items.map((t,e)=>this.resolveItemKey(t,e)),e=this.expandedItems,i=this.getExpandMode();e.length>0?this.expanded=new Set(e.filter(e=>t.includes(e))):this.expanded="all"!==i?new Set:new Set(t)}iconSize(t){return"s"===t?16:"l"===t?24:20}collectPanelContent(){const t=new Map,register=(e,i)=>{if(!(e instanceof HTMLElement)||"SLOT"===e.tagName)return;t.has(i)||t.set(i,[]);const s=t.get(i);s.includes(e)||s.push(e)};return Array.from(this.children).forEach(t=>{const e=t.getAttribute("slot")?.match(/^content-(\d+)$/);e&®ister(t,Number(e[1]))}),this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach((t,e)=>{const i=t.querySelector(":scope > .designbase-wc-accordion__content > .designbase-wc-accordion__content-inner");i&&Array.from(i.children).forEach(t=>register(t,e))}),t}isItemExpanded(t,e){return this.expanded.has(this.resolveItemKey(t,e))}syncExpandedState(){const t=this.items;this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach((e,i)=>{const s=t[i];if(!s)return;const n=this.isItemExpanded(s,i);e.classList.toggle("designbase-wc-accordion__item--expanded",n),e.classList.toggle("designbase-wc-accordion__item--disabled",Boolean(s.disabled));const a=e.querySelector(".designbase-wc-accordion__trigger"),r=e.querySelector(".designbase-wc-accordion__content");a?.setAttribute("aria-expanded",String(n)),r?.setAttribute("aria-hidden",String(!n))})}render(){this.isRendering=!0;const t=this.collectPanelContent(),e=this.getAttribute("style")||this.getAttribute("variant")||"default",i=this.getAttribute("size")||"m",s=this.getExpandMode(),n=this.getAttribute("default-item-type")||"none",a=this.items,r=this.iconSize(i);this.className=["designbase-wc-accordion",`designbase-wc-accordion--${e}`,`designbase-wc-accordion--${i}`,"multiple"===s&&"designbase-wc-accordion--multiple","single"===s&&"designbase-wc-accordion--single","all"===s&&"designbase-wc-accordion--all"].filter(Boolean).join(" "),this.setAttribute("role","region"),this.setAttribute("aria-label","아코디언"),this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach(t=>t.remove()),a.forEach((i,s)=>{const a=this.resolveItemKey(i,s),o=this.isItemExpanded(i,s),l=document.createElement("div");l.className=["designbase-wc-accordion__item",`designbase-wc-accordion__item--${e}`,o&&"designbase-wc-accordion__item--expanded",i.disabled&&"designbase-wc-accordion__item--disabled"].filter(Boolean).join(" "),l.dataset.itemKey=a;const h=document.createElement("button");h.type="button",h.className="designbase-wc-accordion__trigger",h.disabled=Boolean(i.disabled),h.setAttribute("aria-expanded",String(o)),h.setAttribute("aria-controls",`accordion-content-${a}`),h.addEventListener("click",()=>{i.disabled||this.toggle(a)});const d=i.itemType||n;if("number"===d){const t=document.createElement("div");t.className="designbase-wc-accordion__number",t.textContent=`${s+1}.`,h.append(t)}else if("question"===d){const t=document.createElement("div");t.className="designbase-wc-accordion__question",t.textContent="Q.",h.append(t)}else if("icon"===d&&i.icon){const t=document.createElement("div");t.className="designbase-wc-accordion__icon",t.append(createDbIcon(i.icon,r)),h.append(t)}const u=document.createElement("span");u.className="designbase-wc-accordion__title",u.textContent=i.title;const p=document.createElement("div");p.className="designbase-wc-accordion__chevron",p.append(createDbIcon("chevron-down",r)),h.append(u,p);const m=document.createElement("div");m.id=`accordion-content-${a}`,m.className="designbase-wc-accordion__content",m.setAttribute("aria-hidden",String(!o));const g=document.createElement("div");g.className="designbase-wc-accordion__content-inner",(t.get(s)||[]).forEach(t=>{t.removeAttribute("slot"),g.append(t)}),m.append(g),l.append(h,m),this.append(l)}),this.isRendering=!1}toggle(t){const e=this.getExpandMode();this.expanded.has(t)?this.expanded.delete(t):"single"===e?this.expanded=new Set([t]):this.expanded.add(t);const i=Array.from(this.expanded);this.syncExpandedState(),this.suppressExpandedAttrCallback=!0,this.expandedItems=i,this.suppressExpandedAttrCallback=!1,this.dispatchEvent(new CustomEvent("db-change",{detail:{expandedItems:i},bubbles:!0,composed:!0}))}}customElements.get("db-accordion")||customElements.define("db-accordion",DbAccordion);const SIZES$s=["xs","s","m","l","xl","2xl"],VARIANTS$k=["default","primary","success","warning","danger","info"],STATUSES=["online","offline","away","busy"],LIGHT_COLORS=["#E3F2FD","#F3E5F5","#E8F5E8","#FFF3E0","#FCE4EC","#E0F2F1","#FFF8E1","#F1F8E9","#E8EAF6","#FFEBEE"],DARK_COLORS=["#1976D2","#7B1FA2","#388E3C","#F57C00","#C2185B","#00796B","#F9A825","#689F38","#3F51B5","#D32F2F"];function initialsColor(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);const i=Math.abs(e)%LIGHT_COLORS.length;return{backgroundColor:LIGHT_COLORS[i],color:DARK_COLORS[i]}}function iconSize(t){return"xs"===t?12:"s"===t?16:"m"===t?20:"l"===t?24:"xl"===t?32:40}class DbAvatar extends HTMLElement{constructor(){super(...arguments),this.imageFailed=!1,this.imageLoaded=!1,this.handleClick=()=>{!this.hasAttribute("disabled")&&this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{this.hasAttribute("clickable")&&!this.hasAttribute("disabled")&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["src","alt","initials","size","variant","status","disabled","clickable","badge","badge-max-count","badge-variant","badge-style","badge-text"]}connectedCallback(){this.render(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(t){"src"===t&&(this.imageFailed=!1,this.imageLoaded=!1),this.render()}render(){const t=SIZES$s.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",e=VARIANTS$k.includes(this.getAttribute("variant")||"default")&&this.getAttribute("variant")||"default",i=this.hasAttribute("disabled"),s=this.hasAttribute("clickable"),n=this.getAttribute("src"),a=this.getAttribute("initials")||"",r=Boolean(n&&!this.imageFailed),o=r&&!this.imageLoaded;if(this.className=["designbase-wc-avatar",`designbase-wc-avatar--${t}`,`designbase-wc-avatar--${e}`,s&&"designbase-wc-avatar--clickable",i&&"designbase-wc-avatar--disabled",o&&"designbase-wc-avatar--loading"].filter(Boolean).join(" "),s&&!i?(this.setAttribute("role","button"),this.tabIndex=0):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.toggleAttribute("aria-disabled",i),this.replaceChildren(),o){const t=document.createElement("div");t.className="designbase-wc-avatar__loading";const e=document.createElement("div");e.className="designbase-wc-avatar__skeleton",t.append(e),this.append(t)}if(r){const t=document.createElement("img");t.className="designbase-wc-avatar__image",t.src=n,t.alt=this.getAttribute("alt")||"아바타 이미지",t.loading="lazy",t.addEventListener("load",()=>{this.imageLoaded=!0,this.classList.remove("designbase-wc-avatar--loading"),this.querySelector(".designbase-wc-avatar__loading")?.remove()}),t.addEventListener("error",()=>{this.imageFailed=!0,this.imageLoaded=!1,this.render()}),this.append(t)}else if(a){const t=document.createElement("div");if(t.className="designbase-wc-avatar__initials","default"===e){const e=initialsColor(a);t.style.backgroundColor=e.backgroundColor,t.style.color=e.color}t.textContent=a.charAt(0).toUpperCase(),this.append(t)}else{const e=document.createElement("div");e.className="designbase-wc-avatar__icon",e.append(createDbIcon("user",iconSize(t))),this.append(e)}const l=this.getAttribute("status")||"";if(STATUSES.includes(l)){const t=document.createElement("span");t.className=`designbase-wc-avatar__status designbase-wc-avatar__status--${l}`,this.append(t)}if(this.hasAttribute("badge")){const e=document.createElement("div");e.className="designbase-wc-avatar__badge";const i=document.createElement("db-badge");i.setAttribute("count",this.getAttribute("badge")||"0");const s=this.getAttribute("badge-style")||"number";i.setAttribute("badge-style",s),this.hasAttribute("badge-max-count")&&i.setAttribute("max-count",this.getAttribute("badge-max-count")),i.setAttribute("variant",this.getAttribute("badge-variant")||"danger"),this.hasAttribute("badge-text")&&(i.textContent=this.getAttribute("badge-text"));const n="xl"===t||"2xl"===t?"m":"s";i.setAttribute("size",n),e.append(i),this.append(e)}}}customElements.get("db-avatar")||customElements.define("db-avatar",DbAvatar);const COLOR_PRESETS=["primary","secondary","success","warning","danger","muted"];class DbDivider extends HTMLElement{static get observedAttributes(){return["orientation","thickness","color","length","variant","margin"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){const t=this.getAttribute("orientation")||"horizontal",e=this.getAttribute("variant")||"solid",i=Number(this.getAttribute("thickness")||1),s=this.getAttribute("color"),n=this.getAttribute("length"),a=this.getAttribute("margin");this.className=["designbase-wc-divider",`designbase-wc-divider--${t}`,`designbase-wc-divider--${e}`,s&&COLOR_PRESETS.includes(s)?`designbase-wc-divider--${s}`:""].filter(Boolean).join(" "),this.setAttribute("role","separator"),this.setAttribute("aria-orientation",t),this.style.border="none",this.style.background="none",this.style.margin="",this.style.width="",this.style.height="","vertical"===t?(this.style.display="inline-block",this.style.borderLeft=`${i}px ${e} var(--db-border-base)`,this.style.verticalAlign="middle",n&&(this.style.height=n.endsWith("px")||n.endsWith("%")?n:`${n}px`)):(this.style.display="block",this.style.width="100%",this.style.borderTop=`${i}px ${e} var(--db-border-base)`),s&&!COLOR_PRESETS.includes(s)&&("vertical"===t?this.style.borderLeftColor=s:this.style.borderTopColor=s),a&&(this.style.margin=/^\d+$/.test(a)?`${a}px`:a)}}customElements.get("db-divider")||customElements.define("db-divider",DbDivider);const SIZES$r=["s","m","l"],VARIANTS$j=["default","success","warning","danger"],CIRCULAR_STYLES=["default","minimal"];function getCircularMetrics(t,e){if("minimal"===t)return{svgSize:20,radius:8,strokeWidth:2,center:10};switch(e){case"s":return{svgSize:64,radius:26,strokeWidth:4,center:32};case"l":return{svgSize:160,radius:62,strokeWidth:10,center:80};default:return{svgSize:120,radius:45,strokeWidth:8,center:60}}}function createSvgCircle(t,e,i,s,n,a){const r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("class",t),r.setAttribute("cx",String(e)),r.setAttribute("cy",String(i)),r.setAttribute("r",String(s)),r.setAttribute("stroke-width",String(n)),a&&Object.entries(a).forEach(([t,e])=>r.setAttribute(t,e)),r}class DbProgress extends HTMLElement{static get observedAttributes(){return["value","max","size","variant","type","circular-style","show-value","animated","striped"]}get value(){return Number(this.getAttribute("value")||0)}set value(t){this.setAttribute("value",String(t))}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){const t=Number(this.getAttribute("max")||100),e=Math.min(Math.max(this.value/t*100,0),100),i=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",n=this.getAttribute("type")||"linear",a=this.getAttribute("circular-style")||"default",r=SIZES$r.includes(i)?i:"m",o=VARIANTS$j.includes(s)?s:"default",l=CIRCULAR_STYLES.includes(a)?a:"default";if(this.className=["designbase-wc-progress",`designbase-wc-progress--size-${r}`,`designbase-wc-progress--variant-${o}`,`designbase-wc-progress--type-${n}`,"circular"===n&&"minimal"===l?"designbase-wc-progress--circular-minimal":"",this.hasAttribute("animated")?"designbase-wc-progress--animated":"",this.hasAttribute("striped")?"designbase-wc-progress--striped":""].filter(Boolean).join(" "),this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(t)),this.setAttribute("aria-valuenow",String(this.value)),this.replaceChildren(),"circular"===n){const{svgSize:t,radius:i,strokeWidth:s,center:n}=getCircularMetrics(l,r),a=2*Math.PI*i,o=a-e/100*a,h=document.createElement("div");h.className="designbase-wc-progress__circular";const d=document.createElementNS("http://www.w3.org/2000/svg","svg");if(d.setAttribute("class","designbase-wc-progress__circular-svg"),d.setAttribute("width",String(t)),d.setAttribute("height",String(t)),d.setAttribute("viewBox",`0 0 ${t} ${t}`),d.setAttribute("aria-hidden","true"),d.append(createSvgCircle("designbase-wc-progress__circular-track",n,n,i,s),createSvgCircle("designbase-wc-progress__circular-bar",n,n,i,s,{"stroke-dasharray":String(a),"stroke-dashoffset":String(o),transform:`rotate(-90 ${n} ${n})`})),h.append(d),this.hasAttribute("show-value")&&"minimal"!==l){const t=document.createElement("span");t.className="designbase-wc-progress__circular-value",t.textContent=`${Math.round(e)}%`,h.append(t)}return void this.append(h)}const h=document.createElement("div");h.className="designbase-wc-progress__linear";const d=document.createElement("div");d.className="designbase-wc-progress__track";const u=document.createElement("div");if(u.className="designbase-wc-progress__bar",u.style.width=`${e}%`,d.append(u),h.append(d),this.hasAttribute("show-value")){const t=document.createElement("span");t.className="designbase-wc-progress__value",t.textContent=`${Math.round(e)}%`,h.append(t)}this.append(h)}}customElements.get("db-progress")||customElements.define("db-progress",DbProgress);const SIZES$q=["s","m","l"];class DbSelect extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.searchTerm="",this.focusedIndex=-1,this.handleTriggerClick=()=>{this.hasAttribute("disabled")||this.hasAttribute("readonly")||(this.open=!this.open,this.open&&this.searchable&&setTimeout(()=>this.searchInput?.focus(),0))},this.handleTriggerFocus=()=>{this.trigger?.classList.add("designbase-wc-select__trigger--focused")},this.handleTriggerBlur=()=>{this.trigger?.classList.remove("designbase-wc-select__trigger--focused")},this.handleClear=t=>{t.stopPropagation();const e=[];this.setSelectedValues(e),this.syncTrigger(),this.syncOptions(),this.dispatchChange(e)},this.handleSearchInput=()=>{this.searchTerm=this.searchInput?.value||"",this.focusedIndex=-1,this.syncOptions()},this.handleDocumentMouseDown=t=>{this.contains(t.target)||(this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1,this.syncOptions())},this.handleDocumentKeyDown=t=>{if(!this.contains(document.activeElement))return;if(!this.open)return void("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.open=!0));const e=this.getFilteredOptions();switch(t.key){case"Escape":t.preventDefault(),this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1,this.syncOptions();break;case"ArrowDown":t.preventDefault(),this.focusedIndex=Math.min(this.focusedIndex+1,e.length-1),this.syncOptions();break;case"ArrowUp":t.preventDefault(),this.focusedIndex=Math.max(this.focusedIndex-1,0),this.syncOptions();break;case"Enter":t.preventDefault(),this.focusedIndex>=0&&e[this.focusedIndex]&&this.selectOption(e[this.focusedIndex])}}}static get observedAttributes(){return["options","value","placeholder","label","size","full-width","disabled","readonly","required","error","error-message","helper-text","multiple","searchable","show-clear-button","open","max-height","position","dropdown-width"]}get open(){return this.hasAttribute("open")}set open(t){this.toggleAttribute("open",t),this.syncOpenState()}get value(){return this.getAttribute("value")||""}set value(t){t?this.setAttribute("value",t):this.removeAttribute("value"),this.syncTrigger(),this.syncOptions()}connectedCallback(){this.built||this.build(),this.syncState(),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}attributeChangedCallback(t){if(this.built){if("open"!==t)return"value"===t?(this.syncTrigger(),void this.syncOptions()):void this.syncState();this.syncOpenState()}}get multiple(){return this.hasAttribute("multiple")}set multiple(t){this.toggleAttribute("multiple",Boolean(t))}get searchable(){return this.hasAttribute("searchable")}set searchable(t){this.toggleAttribute("searchable",Boolean(t))}get showClearButton(){return!this.hasAttribute("show-clear-button")||"false"!==this.getAttribute("show-clear-button")}parseOptions(){const t=this.getAttribute("options")||"[]";try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return t.split(",").map(t=>t.trim()).filter(Boolean).map(t=>({value:t,label:t}))}}parseSelectedValues(){const t=this.getAttribute("value")||"";if(!t)return[];if(this.multiple)try{const e=JSON.parse(t);return Array.isArray(e)?e.map(String):[]}catch{return t.split(",").map(t=>t.trim()).filter(Boolean)}return t?[t]:[]}setSelectedValues(t){this.multiple?t.length?this.setAttribute("value",JSON.stringify(t)):this.removeAttribute("value"):t[0]?this.setAttribute("value",t[0]):this.removeAttribute("value")}getIconSize(){const t=this.getAttribute("size")||"m";return getDbComponentIconSize(SIZES$q.includes(t)?t:"m")}syncIndicatorIcons(){const t=this.getIconSize();this.clearButton?.replaceChildren(createDbIcon("close",t)),this.chevronEl&&this.chevronEl.replaceChildren(createDbIcon(this.open?"chevron-up":"chevron-down",t))}build(){const t=this.getAttribute("id")||`db-select-${Math.random().toString(36).slice(2)}`,e=`${t}-listbox`;this.hasAttribute("id")||this.setAttribute("id",t),this.labelEl=document.createElement("label"),this.labelEl.className="designbase-wc-select__label",this.trigger=document.createElement("div"),this.trigger.className="designbase-wc-select__trigger",this.trigger.tabIndex=0,this.trigger.setAttribute("role","combobox"),this.trigger.setAttribute("aria-haspopup","listbox"),this.trigger.setAttribute("aria-controls",e),this.trigger.addEventListener("click",this.handleTriggerClick),this.trigger.addEventListener("focus",this.handleTriggerFocus),this.trigger.addEventListener("blur",this.handleTriggerBlur),this.valueEl=document.createElement("div"),this.valueEl.className="designbase-wc-select__value",this.indicatorsEl=document.createElement("div"),this.indicatorsEl.className="designbase-wc-select__indicators",this.clearButton=document.createElement("button"),this.clearButton.type="button",this.clearButton.className="designbase-wc-select__clear-button",this.clearButton.setAttribute("aria-label","모든 값 지우기"),this.clearButton.hidden=!0,this.clearButton.appendChild(createDbIcon("close",this.getIconSize())),this.clearButton.addEventListener("click",this.handleClear),this.chevronEl=document.createElement("div"),this.chevronEl.className="designbase-wc-select__chevron",this.indicatorsEl.append(this.clearButton,this.chevronEl),this.trigger.append(this.valueEl,this.indicatorsEl),this.dropdown=document.createElement("div"),this.dropdown.className="designbase-wc-select__dropdown",this.searchWrap=document.createElement("div"),this.searchWrap.className="designbase-wc-select__search",this.searchWrap.hidden=!0,this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="designbase-wc-select__search-input",this.searchInput.placeholder="옵션 검색",this.searchInput.addEventListener("input",this.handleSearchInput),this.searchInput.addEventListener("mousedown",t=>t.stopPropagation()),this.searchInput.addEventListener("click",t=>t.stopPropagation()),this.searchWrap.appendChild(this.searchInput),this.optionsEl=document.createElement("div"),this.optionsEl.className="designbase-wc-select__options",this.optionsEl.id=e,this.optionsEl.setAttribute("role","listbox"),this.dropdown.append(this.searchWrap,this.optionsEl),this.helperEl=document.createElement("p"),this.helperEl.className="designbase-wc-select__helper-text",this.errorEl=document.createElement("p"),this.errorEl.className="designbase-wc-select__error-message",this.append(this.labelEl,this.trigger,this.dropdown,this.helperEl,this.errorEl),this.built=!0}getFilteredOptions(){const t=this.parseOptions();if(!this.searchable||!this.searchTerm)return t;const e=this.searchTerm.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))}selectOption(t){if(t.disabled)return;const e=this.parseSelectedValues();let i;this.multiple?i=e.includes(t.value)?e.filter(e=>e!==t.value):[...e,t.value]:(i=[t.value],this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1),this.setSelectedValues(i),this.syncTrigger(),this.syncOptions(),this.dispatchChange(i)}dispatchChange(t){const e=this.parseOptions();if(this.multiple)return void this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t,labels:t.map(t=>e.find(e=>e.value===t)?.label||t)},bubbles:!0,composed:!0}));const i=t[0]||"",s=e.find(t=>t.value===i)?.label||"";this.dispatchEvent(new CustomEvent("db-change",{detail:{value:i,label:s},bubbles:!0,composed:!0}))}syncState(){if(!this.trigger||!this.dropdown||!this.optionsEl)return;const t=SIZES$q.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",e="top"===this.getAttribute("position")?"top":"bottom",i="full"===this.getAttribute("dropdown-width")?"full":"auto",s=Number(this.getAttribute("max-height")||200),n=this.getAttribute("label")||"",a=this.getAttribute("helper-text")||"",r=this.getAttribute("error-message")||"",o=this.hasAttribute("error"),l=this.getAttribute("id")||"";this.className=["designbase-wc-select",`designbase-wc-select--${t}`,this.open&&"designbase-wc-select--open",o&&"designbase-wc-select--error",this.hasAttribute("disabled")&&"designbase-wc-select--disabled",this.hasAttribute("readonly")&&"designbase-wc-select--readonly",this.hasAttribute("full-width")&&"designbase-wc-select--full-width",this.multiple&&"designbase-wc-select--multiple",this.searchable&&"designbase-wc-select--searchable"].filter(Boolean).join(" ");const h=this.parseSelectedValues();if(this.classList.toggle("designbase-wc-select--has-value",h.length>0),this.labelEl){const t=this.hasAttribute("required")?'<span class="designbase-wc-select__required" aria-hidden="true">*</span>':"";this.labelEl.innerHTML=n?`${this.escape(n)}${t}`:"",this.labelEl.hidden=!n}this.dropdown.className=["designbase-wc-select__dropdown",`designbase-wc-select__dropdown--${i}`,`designbase-wc-select__dropdown--${e}`,this.open&&"designbase-wc-select__dropdown--open"].filter(Boolean).join(" "),this.optionsEl.style.maxHeight=`${s}px`,this.searchWrap&&(this.searchWrap.hidden=!this.searchable);const d=`${l}-helper`,u=`${l}-error`;o&&r?(this.errorEl.id=u,this.errorEl.textContent=r,this.errorEl.hidden=!1,this.helperEl.hidden=!0,this.trigger.setAttribute("aria-describedby",u),this.trigger.setAttribute("aria-invalid","true")):a?(this.helperEl.id=d,this.helperEl.textContent=a,this.helperEl.hidden=!1,this.errorEl.hidden=!0,this.trigger.setAttribute("aria-describedby",d),this.trigger.removeAttribute("aria-invalid")):(this.helperEl.hidden=!0,this.errorEl.hidden=!0,this.trigger.removeAttribute("aria-describedby"),this.trigger.removeAttribute("aria-invalid")),this.hasAttribute("disabled")||this.hasAttribute("readonly")?this.trigger.tabIndex=-1:this.trigger.tabIndex=0,this.syncOpenState(),this.syncTrigger(),this.syncOptions(),this.syncIndicatorIcons()}syncOpenState(){this.trigger&&this.dropdown&&this.chevronEl&&(this.trigger.setAttribute("aria-expanded",String(this.open)),this.classList.toggle("designbase-wc-select--open",this.open),this.dropdown.classList.toggle("designbase-wc-select__dropdown--open",this.open),this.syncIndicatorIcons())}syncTrigger(){if(!this.valueEl||!this.clearButton)return;const t=this.parseOptions(),e=this.parseSelectedValues(),i=this.getAttribute("placeholder")||"선택하세요",s=e.length>0,n=s&&this.showClearButton&&!this.hasAttribute("disabled")&&!this.hasAttribute("readonly");if(this.valueEl.replaceChildren(),this.multiple)if(0===e.length){const t=document.createElement("span");t.className="designbase-wc-select__placeholder",t.textContent=i,this.valueEl.appendChild(t)}else{const i=document.createElement("div");i.className="designbase-wc-select__tags",e.forEach(s=>{const n=t.find(t=>t.value===s),a=document.createElement("span");a.className="designbase-wc-select__tag";const r=document.createElement("span");r.className="designbase-wc-select__tag-label",r.textContent=n?.label||s;const o=document.createElement("button");o.type="button",o.className="designbase-wc-select__tag-remove",o.setAttribute("aria-label",`${n?.label||s} 제거`),o.appendChild(createDbIcon("close",12)),o.addEventListener("click",t=>{t.stopPropagation();const i=e.filter(t=>t!==s);this.setSelectedValues(i),this.syncTrigger(),this.syncOptions(),this.dispatchChange(i)}),a.append(r,o),i.appendChild(a)}),this.valueEl.appendChild(i)}else{const n=document.createElement("span");n.className="designbase-wc-select__single-value";const a=t.find(t=>t.value===e[0]);n.textContent=s?a?.label||e[0]:i,s||n.classList.add("designbase-wc-select__placeholder"),this.valueEl.appendChild(n)}this.clearButton.hidden=!n,this.clearButton.setAttribute("aria-hidden",n?"false":"true"),this.classList.toggle("designbase-wc-select--has-value",s)}syncOptions(){if(!this.optionsEl)return;const t=this.getFilteredOptions(),e=this.parseSelectedValues(),i=this.getAttribute("id")||"db-select";if(this.optionsEl.replaceChildren(),0===t.length){const t=document.createElement("div");return t.className="designbase-wc-select__no-options",t.textContent=this.searchTerm?"검색 결과가 없습니다.":"옵션이 없습니다.",void this.optionsEl.appendChild(t)}t.forEach((t,s)=>{const n=e.includes(t.value),a=s===this.focusedIndex,r=document.createElement("div");if(r.className=["designbase-wc-select__option",n&&"designbase-wc-select__option--selected",a&&"designbase-wc-select__option--focused",t.disabled&&"designbase-wc-select__option--disabled"].filter(Boolean).join(" "),r.id=`${i}-option-${s}`,r.setAttribute("role","option"),r.setAttribute("aria-selected",String(n)),r.addEventListener("click",()=>this.selectOption(t)),this.multiple){const e=document.createElement("div");e.className="designbase-wc-select__checkbox";const i=document.createElement("db-checkbox");i.setAttribute("size","s"),i.setAttribute("has-label","false"),n&&i.setAttribute("checked",""),t.disabled&&i.setAttribute("disabled",""),e.appendChild(i),r.appendChild(e)}const o=document.createElement("span");o.className="designbase-wc-select__option-label",o.textContent=t.label,r.appendChild(o),this.optionsEl.appendChild(r)}),this.focusedIndex>=0?this.trigger?.setAttribute("aria-activedescendant",`${i}-option-${this.focusedIndex}`):this.trigger?.removeAttribute("aria-activedescendant")}escape(t){return t.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[t]||t))}}customElements.get("db-select")||customElements.define("db-select",DbSelect);const SIZES$p=["s","m","l"];class DbTextarea extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.handleInput=()=>{this.field&&(this.setAttribute("value",this.field.value),this.updateCharacterCount(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:this.field.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:this.field.value},bubbles:!0,composed:!0})))}}static get observedAttributes(){return["label","placeholder","value","default-value","size","rows","max-length","show-character-count","character-count-position","disabled","readonly","required","error","error-message","helper-text","full-width","resizable"]}get value(){return this.field?.value??this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.field&&(this.field.value=t,this.updateCharacterCount())}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}connectedCallback(){this.built||this.build(),this.syncState()}attributeChangedCallback(t){if(this.built)return"value"===t&&this.field?(this.field.value=this.getAttribute("value")||"",void this.updateCharacterCount()):void this.syncState()}focus(){this.field?.focus()}get showCharacterCount(){return this.hasAttribute("show-character-count")}get characterCountPosition(){return this.getAttribute("character-count-position")||"bottom"}build(){const t=this.getAttribute("id")||`db-textarea-${Math.random().toString(36).slice(2)}`;this.hasAttribute("id")||this.setAttribute("id",t),this.labelEl=document.createElement("label"),this.labelEl.className="designbase-wc-textarea__label",this.labelEl.htmlFor=t,this.countTop=document.createElement("div"),this.countTop.className="designbase-wc-textarea__character-count designbase-wc-textarea__character-count--top",this.countTop.hidden=!0;const e=document.createElement("div");e.className="designbase-wc-textarea__wrapper",this.field=document.createElement("textarea"),this.field.id=t,this.field.className="designbase-wc-textarea__field",this.field.addEventListener("input",this.handleInput),e.appendChild(this.field),this.footerEl=document.createElement("div"),this.footerEl.className="designbase-wc-textarea__footer",this.errorEl=document.createElement("div"),this.errorEl.className="designbase-wc-textarea__error-message",this.errorEl.setAttribute("role","alert"),this.helperEl=document.createElement("div"),this.helperEl.className="designbase-wc-textarea__helper-text",this.countBottom=document.createElement("div"),this.countBottom.className="designbase-wc-textarea__character-count designbase-wc-textarea__character-count--bottom",this.countBottom.hidden=!0,this.footerEl.append(this.errorEl,this.helperEl,this.countBottom),this.append(this.labelEl,this.countTop,e,this.footerEl),this.built=!0}syncState(){if(!this.field)return;const t=SIZES$p.includes(this.size)?this.size:"m",e=this.getAttribute("label")||"",i=this.getAttribute("helper-text")||"",s=this.getAttribute("error-message")||"",n=this.hasAttribute("error"),a=this.getAttribute("value")??this.getAttribute("default-value")??"";if(this.className=["designbase-wc-textarea",`designbase-wc-textarea--${t}`,n&&"designbase-wc-textarea--error",this.hasAttribute("disabled")&&"designbase-wc-textarea--disabled",this.hasAttribute("readonly")&&"designbase-wc-textarea--readonly",this.hasAttribute("full-width")&&"designbase-wc-textarea--full-width",this.hasAttribute("resizable")?"":"designbase-wc-textarea--not-resizable"].filter(Boolean).join(" "),this.labelEl){const t=this.hasAttribute("required")?'<span aria-hidden="true"> *</span>':"";this.labelEl.innerHTML=e?`${this.escape(e)}${t}`:"",this.labelEl.hidden=!e}this.field.placeholder=this.getAttribute("placeholder")||"",this.field.value=a,this.field.rows=Number(this.getAttribute("rows")||4),this.field.disabled=this.hasAttribute("disabled"),this.field.readOnly=this.hasAttribute("readonly"),this.field.required=this.hasAttribute("required"),this.field.setAttribute("aria-invalid",String(n));const r=this.getAttribute("max-length");r?this.field.maxLength=Number(r):this.field.removeAttribute("maxLength");const o=`${this.getAttribute("id")}-helper`,l=`${this.getAttribute("id")}-error`;n&&s?(this.errorEl.id=l,this.errorEl.textContent=s,this.errorEl.hidden=!1,this.helperEl.hidden=!0,this.field.setAttribute("aria-describedby",l)):i?(this.helperEl.id=o,this.helperEl.textContent=i,this.helperEl.hidden=!1,this.errorEl.hidden=!0,this.field.setAttribute("aria-describedby",o)):(this.helperEl.hidden=!0,this.errorEl.hidden=!0,this.field.removeAttribute("aria-describedby")),this.updateCharacterCount()}updateCharacterCount(){if(!this.field||!this.countTop||!this.countBottom)return;const t=this.field.value.length,e=this.getAttribute("max-length"),i=Boolean(e&&t>Number(e)),s=`${t}${e?` / ${e}`:""}`,renderCount=t=>{t.innerHTML=`<span class="designbase-wc-textarea__character-count-text${i?" designbase-wc-textarea__character-count-text--error":""}">${s}</span>`};this.showCharacterCount&&"top"===this.characterCountPosition?(renderCount(this.countTop),this.countTop.hidden=!1,this.countBottom.hidden=!0):this.showCharacterCount?(renderCount(this.countBottom),this.countBottom.hidden=!1,this.countTop.hidden=!0):(this.countTop.hidden=!0,this.countBottom.hidden=!0)}escape(t){return t.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[t]||t))}}customElements.get("db-textarea")||customElements.define("db-textarea",DbTextarea);const SIZES$o=["s","m","l"];class DbRadio extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.handleChange=()=>{if(!this.input||this.disabled||this.readOnly)return;const t=this.input.checked;this.toggleAttribute("checked",t),this.syncVisual(),this.syncClasses(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:t,selected:t,value:this.getAttribute("value")||""},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","size","disabled","readonly","required","name","value","has-label"]}get checked(){return this.input?.checked??(this.hasAttribute("checked")||this.hasAttribute("selected"))}set checked(t){this.toggleAttribute("checked",t),this.input&&(this.input.checked=t,this.syncVisual(),this.syncClasses())}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t),this.input&&(this.input.disabled=t),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(t){this.toggleAttribute("readonly",t),this.input&&(this.input.readOnly=t),this.syncClasses()}get required(){return this.hasAttribute("required")}set required(t){this.toggleAttribute("required",t),this.input&&(this.input.required=t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(t){if(this.built)return"checked"===t||"selected"===t?(this.input&&(this.input.checked=this.hasAttribute("checked")||this.hasAttribute("selected")),this.syncVisual(),void this.syncClasses()):void this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){for(this.root=document.createElement("label"),this.root.className="designbase-wc-radio",this.input=document.createElement("input"),this.input.type="radio",this.input.className="designbase-wc-radio__input",this.visual=document.createElement("span"),this.visual.className="designbase-wc-radio__visual",this.visual.setAttribute("aria-hidden","true"),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-radio__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(this.input,this.visual,this.labelEl),this.appendChild(this.root),this.input.addEventListener("change",this.handleChange),this.built=!0}syncState(){if(!this.root||!this.input||!this.visual)return;const t=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.hasAttribute("checked")&&!this.hasAttribute("selected")&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected"));this.input.checked=t,this.input.disabled=this.disabled,this.input.readOnly=this.readOnly,this.input.required=this.required,this.input.name=this.getAttribute("name")||"",this.input.value=this.getAttribute("value")||"",this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncVisual(),this.syncClasses()}syncVisual(){if(this.visual&&this.input&&(this.visual.replaceChildren(),this.input.checked)){const t=document.createElement("span");t.className="designbase-wc-radio__dot",this.visual.appendChild(t)}}syncClasses(){if(!this.root||!this.input)return;const t=SIZES$o.includes(this.size)?this.size:"m",e=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim());this.root.className=["designbase-wc-radio",`designbase-wc-radio--${t}`,this.input.checked&&"designbase-wc-radio--selected",this.disabled&&"designbase-wc-radio--disabled",this.readOnly&&"designbase-wc-radio--readonly",!e&&"designbase-wc-radio--no-label"].filter(Boolean).join(" ")}}customElements.get("db-radio")||customElements.define("db-radio",DbRadio);class DbPagination extends HTMLElement{static get observedAttributes(){return["current-page","total-pages","size","variant","alignment","show-first-last","show-previous-next","sibling-count","boundary-count","disabled","full-width"]}get currentPage(){return Number(this.getAttribute("current-page")||1)}set currentPage(t){this.setAttribute("current-page",String(t))}get totalPages(){return Number(this.getAttribute("total-pages")||1)}set totalPages(t){this.setAttribute("total-pages",String(t))}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}iconSize(){const t=this.getAttribute("size")||"m";return"s"===t?14:"l"===t?18:16}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("alignment")||"center",s=this.hasAttribute("disabled"),n=this.hasAttribute("full-width"),a=this.hasAttribute("show-first-last"),r="false"!==this.getAttribute("show-previous-next"),o=this.currentPage,l=this.totalPages,h=o<=1,d=o>=l;this.className=["designbase-wc-pagination",`designbase-wc-pagination--${t}`,`designbase-wc-pagination--${e}`,`designbase-wc-pagination--${i}`,s&&"designbase-wc-pagination--disabled",n&&"designbase-wc-pagination--full-width"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","페이지 네비게이션"),this.replaceChildren();const u=document.createElement("div");u.className=["designbase-wc-pagination__container",n&&"designbase-wc-pagination__container--full-width"].filter(Boolean).join(" ");const p=document.createElement("nav");p.className="designbase-wc-pagination__nav",p.setAttribute("aria-label","페이지 네비게이션");const m=document.createElement("ul");m.className="designbase-wc-pagination__list",a&&!h&&m.append(this.createIconButton("arrow-bar-left",1,"첫 페이지로 이동","first")),r&&!h&&m.append(this.createIconButton("chevron-left",o-1,"이전 페이지로 이동","previous")),this.getPageNumbers().forEach((t,e)=>{if("..."===t){const t=document.createElement("li");t.className="designbase-wc-pagination__ellipsis";const e=document.createElement("span");return e.className="designbase-wc-pagination__ellipsis-text",e.textContent="...",t.append(e),void m.append(t)}"number"==typeof t&&m.append(this.createPageButton(t,s))}),r&&!d&&m.append(this.createIconButton("chevron-right",o+1,"다음 페이지로 이동","next")),a&&!d&&m.append(this.createIconButton("arrow-bar-right",l,"마지막 페이지로 이동","last")),p.append(m),u.append(p),this.append(u)}getPageNumbers(){const t=Number(this.getAttribute("sibling-count")||1),e=Number(this.getAttribute("boundary-count")||1),i=this.totalPages,s=this.currentPage;if(i<=2*t+3+2)return Array.from({length:i},(t,e)=>e+1);const n=Math.max(s-t,e),a=Math.min(s+t,i-e+1),r=n>e+2,o=a<i-e-1;if(!r&&o){const e=3+2*t;return[...Array.from({length:e},(t,e)=>e+1),"...",i]}if(r&&!o){const e=3+2*t;return[1,"...",...Array.from({length:e},(t,s)=>i-e+s+1)]}if(r&&o){return[1,"...",...Array.from({length:a-n+1},(t,e)=>n+e),"...",i]}return Array.from({length:i},(t,e)=>e+1)}createPageButton(t,e){const i=t===this.currentPage,s=document.createElement("li");s.className="designbase-wc-pagination__item";const n=document.createElement("button");return n.type="button",n.className=["designbase-wc-pagination__button",i&&"designbase-wc-pagination__button--active"].filter(Boolean).join(" "),n.textContent=String(t),n.disabled=e,i&&n.setAttribute("aria-current","page"),n.setAttribute("aria-label",`페이지 ${t}로 이동`),n.addEventListener("click",()=>this.select(t)),s.append(n),s}createIconButton(t,e,i,s){const n=document.createElement("li");n.className="designbase-wc-pagination__item";const a=document.createElement("button");return a.type="button",a.className=`designbase-wc-pagination__button designbase-wc-pagination__button--${s}`,a.disabled=this.hasAttribute("disabled"),a.setAttribute("aria-label",i),a.append(createDbIcon(t,this.iconSize())),a.addEventListener("click",()=>this.select(e)),n.append(a),n}select(t){this.hasAttribute("disabled")||t===this.currentPage||t<1||t>this.totalPages||(this.currentPage=t,this.dispatchEvent(new CustomEvent("db-change",{detail:{page:t},bubbles:!0,composed:!0})))}}customElements.get("db-pagination")||customElements.define("db-pagination",DbPagination);class DbBreadcrumbs extends HTMLElement{static get observedAttributes(){return["items","size","variant","breadcrumb-style","max-items"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}visibleItems(){const t=this.items,e=Number(this.getAttribute("max-items")||0);if(!e||t.length<=e)return t;const i=t[0],s=t[t.length-1],n=t.slice(1,-1),a=e-2;if(a<=0)return[i,s];const r=Math.floor(n.length/2)-Math.floor(a/2);return[i,...n.slice(r,r+a),s]}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("breadcrumb-style")||this.getAttribute("variant")||"default",i=this.visibleItems(),s=i.length<this.items.length;this.className=["designbase-wc-breadcrumbs",`designbase-wc-breadcrumbs--${t}`,`designbase-wc-breadcrumbs--${e}`,s&&"designbase-wc-breadcrumbs--collapsed"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","브레드크럼 네비게이션"),this.replaceChildren();const n=document.createElement("ol");n.className="designbase-wc-breadcrumbs__list",i.forEach((t,e)=>{const s=e===i.length-1,a=document.createElement("li");a.className="designbase-wc-breadcrumbs__item";const r=!t.href||s||t.disabled?document.createElement("span"):document.createElement("a");if(r.className=r instanceof HTMLAnchorElement?["designbase-wc-breadcrumbs__link",t.active&&"designbase-wc-breadcrumbs__link--active",t.disabled&&"designbase-wc-breadcrumbs__link--disabled"].filter(Boolean).join(" "):["designbase-wc-breadcrumbs__text",s&&"designbase-wc-breadcrumbs__text--active",t.disabled&&"designbase-wc-breadcrumbs__text--disabled"].filter(Boolean).join(" "),t.icon){const e=document.createElement("span");e.className="designbase-wc-breadcrumbs__icon",e.append(createDbIcon(t.icon,16)),r.append(e)}const o=document.createElement("span");if(o.className="designbase-wc-breadcrumbs__label",o.textContent=t.label,r.append(o),r instanceof HTMLAnchorElement&&(r.href=t.href||"#"),r.addEventListener("click",e=>{(t.disabled||t.active||s)&&e.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{detail:{item:t},bubbles:!0,composed:!0}))}),a.append(r),!s){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__separator",t.setAttribute("aria-hidden","true"),t.append(createDbIcon("chevron-right",16)),a.append(t)}n.append(a)}),this.append(n)}}customElements.get("db-breadcrumbs")||customElements.define("db-breadcrumbs",DbBreadcrumbs);const SIZES$n=["s","m","l"],VARIANTS$i=["default","striped","hoverable"];class DbTable extends HTMLElement{constructor(){super(...arguments),this.internalSelectedRows=[],this.internalSortDirection=null,this.internalPage=1}static get observedAttributes(){return["columns","data","title","size","variant","empty-message","sortable","sort-column","sort-direction","selectable","multi-select","selected-rows","row-key","loading","pagination","page","page-size","total-items","show-count-badge","clickable"]}get columns(){try{return JSON.parse(this.getAttribute("columns")||"[]")}catch{return[]}}set columns(t){this.setAttribute("columns","string"==typeof t?t:JSON.stringify(t))}get data(){try{return JSON.parse(this.getAttribute("data")||"[]")}catch{return[]}}set data(t){this.setAttribute("data","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.render()}attributeChangedCallback(t){"selected-rows"===t&&this.syncSelectedRowsFromAttribute(),"sort-column"!==t&&"sort-direction"!==t||this.syncSortFromAttributes(),"page"===t&&(this.internalPage=Number(this.getAttribute("page")||1)),this.render()}syncSelectedRowsFromAttribute(){try{this.internalSelectedRows=JSON.parse(this.getAttribute("selected-rows")||"[]")}catch{this.internalSelectedRows=[]}}syncSortFromAttributes(){const t=this.getAttribute("sort-column"),e=this.getAttribute("sort-direction");this.internalSortColumn=t||void 0,this.internalSortDirection="asc"===e||"desc"===e?e:null}getRowKey(t,e){const i=t[this.getAttribute("row-key")||"id"];return String(null!=i?i:e)}getSortedData(){const t=this.data,e=this.getAttribute("sort-column")||this.internalSortColumn,i=this.getAttribute("sort-direction")||this.internalSortDirection;if(!e||!i)return t;const s=this.columns.find(t=>t.key===e);return s?.sortable?[...t].sort((t,s)=>{const n=t[e],a=s[e];return n===a?0:null==n?1:null==a?-1:n<a?"asc"===i?-1:1:"asc"===i?1:-1}):t}handleSort(t){if(!this.hasAttribute("sortable")||!t.sortable)return;let e="asc";this.internalSortColumn===t.key&&("asc"===this.internalSortDirection?e="desc":"desc"===this.internalSortDirection&&(e=null)),this.internalSortColumn=e?t.key:void 0,this.internalSortDirection=e,this.dispatchEvent(new CustomEvent("db-sort-change",{bubbles:!0,composed:!0,detail:{column:t.key,direction:e}})),this.render()}handleRowSelect(t,e,i){i?.stopPropagation();let s;s=this.hasAttribute("multi-select")?e?[...this.internalSelectedRows,t]:this.internalSelectedRows.filter(e=>e!==t):e?[t]:[],this.internalSelectedRows=s,this.dispatchEvent(new CustomEvent("db-selection-change",{bubbles:!0,composed:!0,detail:{selectedRows:s}})),this.render()}handleSelectAll(t){const e=t?this.data.map((t,e)=>this.getRowKey(t,e)):[];this.internalSelectedRows=e,this.dispatchEvent(new CustomEvent("db-selection-change",{bubbles:!0,composed:!0,detail:{selectedRows:e}})),this.render()}getPaginatedData(){const t=this.getSortedData();if(!this.hasAttribute("pagination"))return t;const e=Number(this.getAttribute("page-size")||10),i=Number(this.getAttribute("total-items")||t.length),s=Math.max(1,Math.ceil(i/e)),n=(Math.min(this.internalPage,s)-1)*e;return t.slice(n,n+e)}createSortIcon(t){const e=document.createElement("span");e.className="designbase-wc-table__sort-icon";return this.internalSortColumn===t.key&&Boolean(this.internalSortDirection)?e.classList.add("asc"===this.internalSortDirection?"designbase-wc-table__sort-icon--asc":"designbase-wc-table__sort-icon--desc"):e.classList.add("designbase-wc-table__sort-icon--idle"),e.append(createDbIcon("caret-updown-filled",14)),e}createCheckbox(t){const e=document.createElement("db-checkbox");return e.setAttribute("size","s"),e.setAttribute("has-label","false"),t.checked&&e.setAttribute("checked",""),t.indeterminate&&e.setAttribute("indeterminate",""),t.stopPropagation&&e.addEventListener("click",t=>t.stopPropagation()),e.addEventListener("db-change",e=>{const i=e.detail;t.onChange?.(i.checked)}),e}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=SIZES$n.includes(t)?t:"m",s=VARIANTS$i.includes(e)?e:"default",n=this.columns,a=this.getPaginatedData(),r=this.getSortedData(),o=this.hasAttribute("loading"),l=this.hasAttribute("selectable"),h=this.hasAttribute("sortable"),d=this.getAttribute("empty-message")||"데이터가 없습니다.";if(this.className=["designbase-wc-table",`designbase-wc-table--${i}`,`designbase-wc-table--${s}`,l&&"designbase-wc-table--selectable",h&&"designbase-wc-table--sortable",o&&"designbase-wc-table--loading"].filter(Boolean).join(" "),this.replaceChildren(),o){const t=document.createElement("div");t.className="designbase-wc-table__loading";const e=document.createElement("div");e.className="designbase-wc-table__loading-spinner";const i=document.createElement("span");return i.textContent="로딩 중...",t.append(e,i),void this.append(t)}const u=this.getAttribute("title"),p=this.hasAttribute("show-count-badge");if(u||p){const t=document.createElement("div");t.className="designbase-wc-table__header";const e=document.createElement("div");if(e.className="designbase-wc-table__header-left",u){const t=document.createElement("h3");t.className="designbase-wc-table__title",t.textContent=u,e.append(t)}if(p){const t=document.createElement("db-badge");t.setAttribute("count",String(this.data.length)),t.setAttribute("badge-style","number"),t.setAttribute("variant","primary"),t.setAttribute("size","s"),e.append(t)}t.append(e),this.append(t)}const m=document.createElement("div");m.className="designbase-wc-table__container";const g=document.createElement("table");g.className="designbase-wc-table__table";const b=document.createElement("thead");b.className="designbase-wc-table__thead";const f=document.createElement("tr");f.className="designbase-wc-table__tr";const v=a.map((t,e)=>this.getRowKey(t,e)),y=v.filter(t=>this.internalSelectedRows.includes(t)),E=this.hasAttribute("clickable");if(l){const t=document.createElement("th");t.className="designbase-wc-table__th designbase-wc-table__th--checkbox";const e=this.createCheckbox({checked:v.length>0&&y.length===v.length,indeterminate:y.length>0&&y.length<v.length,onChange:t=>this.handleSelectAll(t)});t.append(e),f.append(t)}n.forEach(t=>{const e=document.createElement("th");e.className=["designbase-wc-table__th",`designbase-wc-table__th--${t.align||"left"}`,h&&t.sortable&&"designbase-wc-table__th--sortable",this.internalSortColumn===t.key&&this.internalSortDirection&&"designbase-wc-table__th--sorted"].filter(Boolean).join(" "),t.width&&(e.style.width="number"==typeof t.width?`${t.width}px`:t.width);const i=document.createElement("div");i.className="designbase-wc-table__th-content";const s=document.createElement("span");s.className="designbase-wc-table__th-text",s.textContent=t.header,i.append(s),h&&t.sortable&&i.append(this.createSortIcon(t)),e.append(i),h&&t.sortable&&e.addEventListener("click",()=>this.handleSort(t)),f.append(e)}),b.append(f);const S=document.createElement("tbody");if(S.className="designbase-wc-table__tbody",0===r.length){const t=document.createElement("tr");t.className="designbase-wc-table__tr";const e=document.createElement("td");e.className="designbase-wc-table__td designbase-wc-table__td--empty",e.colSpan=Math.max(n.length+(l?1:0),1);const i=document.createElement("db-empty-state");i.setAttribute("title","데이터가 없습니다"),i.setAttribute("description",d),i.setAttribute("variant","no-data"),i.setAttribute("size","m"),e.append(i),t.append(e),S.append(t)}else a.forEach((t,e)=>{const i=this.getRowKey(t,e),s=this.internalSelectedRows.includes(i),a=document.createElement("tr");if(a.className=["designbase-wc-table__tr",E&&"designbase-wc-table__tr--clickable",s&&"designbase-wc-table__tr--selected"].filter(Boolean).join(" "),E&&a.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-row-click",{detail:{item:t,index:e},bubbles:!0,composed:!0}))}),l){const t=document.createElement("td");t.className="designbase-wc-table__td designbase-wc-table__td--checkbox";const e=this.createCheckbox({checked:s,stopPropagation:!0,onChange:t=>this.handleRowSelect(i,t)});t.append(e),a.append(t)}n.forEach(e=>{const i=document.createElement("td");i.className=["designbase-wc-table__td",`designbase-wc-table__td--${e.align||"left"}`].join(" "),i.textContent=String(t[e.key]??""),a.append(i)}),S.append(a)});if(g.append(b,S),m.append(g),this.append(m),this.hasAttribute("pagination")){const t=Number(this.getAttribute("page-size")||10),e=Number(this.getAttribute("total-items")||r.length),s=Math.max(1,Math.ceil(e/t)),n=document.createElement("div");n.className="designbase-wc-table__footer";const a=document.createElement("db-pagination");a.setAttribute("current-page",String(this.internalPage)),a.setAttribute("total-pages",String(s)),a.setAttribute("size",i),a.setAttribute("show-first-last",""),a.addEventListener("db-change",t=>{const e=Number(t.detail?.page||1);this.internalPage=e,this.dispatchEvent(new CustomEvent("db-page-change",{bubbles:!0,composed:!0,detail:{page:e}})),this.render()}),n.append(a),this.append(n)}}}customElements.get("db-table")||customElements.define("db-table",DbTable);const CLASS$u="designbase-wc-alert";class DbAlert extends HTMLElement{static get observedAttributes(){return["title","message","variant","size","show-icon","closable","action-label","action-variant","action-buttons"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(t){return"success"===t?"circle-checked":"warning"===t?"warning-filled":"danger"===t?"error-filled":"info-filled"}parseActionButtons(){const t=this.getAttribute("action-buttons");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}render(){const t=this.getAttribute("variant")||"default",e=this.getAttribute("size")||"m",i="false"!==this.getAttribute("show-icon"),s="false"!==this.getAttribute("closable"),n=this.getAttribute("title")?.trim()||"",a=this.getAttribute("message")?.trim()||"",r=this.getAttribute("action-label"),o=this.getAttribute("action-variant")||"tertiary",l=this.parseActionButtons(),h=Boolean(a),d=Boolean(n),u=d&&!h||!d&&h,p=l.length>0?l:r?[{label:r,variant:o}]:[];this.className=[CLASS$u,`${CLASS$u}--${t}`,`${CLASS$u}--${e}`,i&&`${CLASS$u}--with-icon`,s&&`${CLASS$u}--closable`,u&&`${CLASS$u}--text-single`,p.length>0&&`${CLASS$u}--has-actions`].filter(Boolean).join(" "),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.querySelector(`.${CLASS$u}__content`)?.remove(),this.querySelector(`.${CLASS$u}__actions`)?.remove(),Array.from(this.childNodes).forEach(t=>{t.nodeType===Node.TEXT_NODE&&t.remove()});const m=document.createElement("div");if(m.className=`${CLASS$u}__content`,i){const i=document.createElement("div");i.className=`${CLASS$u}__icon`,i.append(createDbIcon(this.getIconName(t),"s"===e?16:"l"===e?24:20)),m.append(i)}const g=document.createElement("div");if(g.className=`${CLASS$u}__body`,d){const t=document.createElement("div");t.className=`${CLASS$u}__title`,t.textContent=n,g.append(t)}if(h){const t=document.createElement("div");t.className=`${CLASS$u}__message`,t.textContent=a,g.append(t)}if(m.append(g),p.length>0){const t=document.createElement("div");t.className=`${CLASS$u}__actions`;const i=document.createElement("div");i.className=`${CLASS$u}__action-buttons`,p.forEach((t,s)=>{const n=document.createElement("db-button");n.setAttribute("variant",t.variant||"tertiary"),n.setAttribute("size",t.size||e),n.textContent=t.label,t.disabled&&n.setAttribute("disabled",""),n.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:s,label:t.label}}))}),i.append(n)}),t.append(i),m.append(t)}if(s){const t=document.createElement("button");t.type="button",t.className=`${CLASS$u}__close`,t.setAttribute("aria-label","알림 닫기"),t.append(createDbIcon("close",20)),t.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}),m.append(t)}this.replaceChildren(m)}}customElements.get("db-alert")||customElements.define("db-alert",DbAlert);const SIZES$m=["s","m","l"],VARIANTS$h=["default","primary","success","warning","danger","info","neutral"];class DbChip extends HTMLElement{static get observedAttributes(){return["label","size","variant","deletable","disabled","selected","full-width","clickable","start-icon","end-icon"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}iconSize(t){return"s"===t?12:"l"===t?20:16}render(){const t=this.getAttribute("label")||this.textContent?.trim()||"",e=this.getAttribute("size")||"m",i=this.getAttribute("variant")||"default",s=this.hasAttribute("disabled"),n=this.hasAttribute("deletable"),a=this.hasAttribute("selected"),r=this.hasAttribute("full-width"),o=this.hasAttribute("clickable"),l=this.getAttribute("start-icon"),h=this.getAttribute("end-icon"),d=SIZES$m.includes(e)?e:"m",u=VARIANTS$h.includes(i)?i:"default",p=this.iconSize(d);if(this.className=["designbase-wc-chip",`designbase-wc-chip--${d}`,`designbase-wc-chip--${u}`,n&&"designbase-wc-chip--deletable",s&&"designbase-wc-chip--disabled",a&&"designbase-wc-chip--selected",o&&"designbase-wc-chip--clickable",r&&"designbase-wc-chip--full-width"].filter(Boolean).join(" "),this.replaceChildren(),o&&!s?(this.setAttribute("role","button"),this.tabIndex=0):(this.removeAttribute("role"),this.removeAttribute("tabindex")),l){const t=document.createElement("span");t.className="designbase-wc-chip__start-icon",t.append(createDbIcon(l,p)),this.append(t)}const m=document.createElement("span");if(m.className="designbase-wc-chip__label",m.textContent=t,this.append(m),h&&!n){const t=document.createElement("span");t.className="designbase-wc-chip__end-icon",t.append(createDbIcon(h,p)),this.append(t)}if(n){const e=document.createElement("button");e.type="button",e.className="designbase-wc-chip__delete-button",e.disabled=s,e.setAttribute("aria-label",`${t} 삭제`),e.append(createDbIcon("close",p)),e.addEventListener("click",t=>{t.stopPropagation(),s||this.dispatchEvent(new CustomEvent("db-delete",{bubbles:!0,composed:!0}))}),this.append(e)}this.onclick=()=>{!s&&o&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.onkeydown=t=>{"Enter"!==t.key&&" "!==t.key||s||!o||(t.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})))}}}customElements.get("db-chip")||customElements.define("db-chip",DbChip);const VARIANTS$g=["text","circular","rectangular","rounded"],SIZES$l=["xs","s","m","l","xl"];function getDefaultSize(t,e){if("circular"===t)switch(e){case"xs":return"16px";case"s":return"24px";case"l":return"48px";case"xl":return"64px";default:return"32px"}switch(e){case"xs":return"12px";case"s":return"16px";case"l":return"24px";case"xl":return"32px";default:return"20px"}}function getTextLineHeight(t){switch(t){case"xs":return"12px";case"s":return"16px";case"l":return"24px";case"xl":return"32px";default:return"20px"}}function toCssSize(t){return/^\d+$/.test(t)?`${t}px`:t}class DbSkeleton extends HTMLElement{static get observedAttributes(){return["variant","size","width","height","animation","lines","line-spacing","last-line-width","aria-label"]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}render(){const t=this.getAttribute("variant")||"text",e=this.getAttribute("size")||"m",i=this.getAttribute("animation")||"pulse",s=Number(this.getAttribute("lines")||1),n=this.getAttribute("width"),a=this.getAttribute("height"),r=this.getAttribute("line-spacing")||"8px",o=this.getAttribute("last-line-width")||"60%",l=VARIANTS$g.includes(t)?t:"text",h=SIZES$l.includes(e)?e:"m",d=["designbase-wc-skeleton",`designbase-wc-skeleton--${l}`,`designbase-wc-skeleton--${h}`,`designbase-wc-skeleton--${i}`,(n||a)&&"designbase-wc-skeleton--custom-size"].filter(Boolean).join(" ");this.className!==d&&(this.className=d);const u=this.getAttribute("aria-label")??`${l} 스켈레톤 로딩 중`;if(this.getAttribute("aria-label")!==u&&this.setAttribute("aria-label",u),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren(),this.style.width=n?toCssSize(n):"circular"===l?getDefaultSize(l,h):"100%",this.style.height=a?toCssSize(a):"circular"===l?getDefaultSize(l,h):getTextLineHeight(h),"text"===l&&s>1)for(let t=1;t<s;t+=1){const e=document.createElement("div");e.className="designbase-wc-skeleton__line",e.style.marginTop=toCssSize(r),t===s-1&&(e.style.width=toCssSize(o)),this.append(e)}}}customElements.get("db-skeleton")||customElements.define("db-skeleton",DbSkeleton);class DbLabel extends HTMLElement{static get observedAttributes(){return["label","html-for","id","size","required","disabled","error"]}connectedCallback(){this.sync()}attributeChangedCallback(){this.sync()}sync(){const t=this.getAttribute("size")||"s",e=this.hasAttribute("required"),i=this.hasAttribute("disabled"),s=this.hasAttribute("error"),n=this.getAttribute("html-for"),a=this.getAttribute("id"),r=this.getAttribute("label");this.className=["designbase-wc-label",`designbase-wc-label--${t}`,i&&"designbase-wc-label--disabled",s&&"designbase-wc-label--error"].filter(Boolean).join(" ");let o=this.querySelector(":scope > label.designbase-wc-label__text");if(null!==r&&""!==r)o||(this.replaceChildren(),o=document.createElement("label"),o.className="designbase-wc-label__text",this.append(o)),o.textContent=r;else if(!o&&this.childNodes.length>0){o=document.createElement("label"),o.className="designbase-wc-label__text";Array.from(this.childNodes).forEach(t=>o.append(t)),this.append(o)}if(o&&(n?o.htmlFor=n:o.removeAttribute("for"),a?o.id=a:o.removeAttribute("id"),o.querySelector(".designbase-wc-label__required")?.remove(),e)){const t=document.createElement("span");t.className="designbase-wc-label__required",t.textContent="*",o.append(t)}}}customElements.get("db-label")||customElements.define("db-label",DbLabel);const LOGO_PATHS='\n<polygon points="58.4,23.6 77.3,23.6 77.3,16.2 58.4,16.2 58.4,7.7 79.4,7.7 79.4,0.4 49.5,0.4 49.5,39.6 80,39.6 80,32.3 58.4,32.3"/>\n<path d="M95.6,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3c-4.5-2.8-9.6-4.2-14.9-4.2c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.2,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C116.5,13.9,95.6,18,95.6,10.8z"/>\n<rect x="122.7" y="0.4" width="8.8" height="39.2"/>\n<path d="M158.8,7.8c4,0.1,7.8,1.7,10.8,4.4l5-6.3c-4.4-3.7-10-5.7-15.7-5.7c-12.2,0-21.4,8.5-21.4,19.9s9,20,20.9,20 c5.7-0.1,11.2-1.9,15.9-5.1V19.8h-7.6v10.3c-2.4,1.3-5,2-7.7,2.1h-0.4c-6.7-0.1-12.1-5.6-12-12.3v-0.4 C146.7,13,152.2,7.7,158.8,7.8z"/>\n<polygon points="209.1,25.6 190.1,0.4 182,0.4 182,39.6 190.5,39.6 190.5,14.5 209.5,39.6 217.5,39.6 217.5,0.4 209.1,0.4"/>\n<path d="M263.3,18.8c4-0.9,6.9-4.5,6.8-8.6c0-6-5.4-9.8-14-9.8h-24.5v6.5l6.4,1v31.8h18.7c9.1,0,14.8-4.2,14.8-10.9 C271.7,23.8,268.2,19.5,263.3,18.8z M246.9,7.6h8.7c3.4-0.1,5.4,1.5,5.4,4.2s-2,4.4-5.4,4.4h-8.7V7.6z M255.7,32.4h-8.7v-9.3h8.7 c4.1,0,6.7,1.7,6.7,4.5C262.4,30.6,259.8,32.4,255.7,32.4z"/>\n<path d="M290.5,0.4l-17,39.2h9.1l3.1-7.6h18.2l3,7.6h9.5L299.6,0.4H290.5z M288.6,24.9l6.2-15.2l6.2,15.2L288.6,24.9z"/>\n<path d="M328.9,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3C345,1.4,339.9,0,334.6,0c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.1,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C349.8,13.9,328.9,18,328.9,10.8z"/>\n<polygon points="364.4,32.3 364.4,23.6 383.3,23.6 383.3,16.2 364.4,16.2 364.4,7.7 385.4,7.7 385.4,0.4 355.5,0.4 355.5,39.6 386,39.6 386,32.3"/>\n<path d="M23.1,0.4H0v6.5l6.5,1v31.8h16.3c12.4,0,21-8.1,21-19.6S35.2,0.4,23.1,0.4z M34.7,20.1c0,7.2-4.8,12.1-11.4,12.1h-8V7.8H23 C29.8,7.8,34.8,12.8,34.7,20.1L34.7,20.1z"/>\n',MARK_PATH="M45,0H0V8l10,2V90L0,92v8H45A50,50,0,0,0,45,0ZM43.12,90H20V10H38.33a15,15,0,0,1,0,30H30.11V50h13a20,20,0,0,1,0,40ZM71.4,80A30,30,0,0,0,55.83,42.83,24.93,24.93,0,0,0,60.27,13,40,40,0,0,1,71.4,80Z",LOGO_DIMENSIONS={xs:{width:96,height:20,markSize:19},s:{width:125,height:26,markSize:25},m:{width:193,height:40,markSize:38},l:{width:256,height:53,markSize:50},xl:{width:320,height:66,markSize:63}};function getLogoDimensions(t){return LOGO_DIMENSIONS[t]||LOGO_DIMENSIONS.m}function getLogoColor(t){if("original"===t)return;const e={light:"#ffffff",dark:"#000000",default:"var(--db-text-primary)",primary:"var(--db-brand-primary)",secondary:"var(--db-text-secondary)",white:"#ffffff"};return e[t]??e.default}function createDesignBaseLogoSvg(t,e,i,s){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width",String(t)),n.setAttribute("height",String(e)),n.setAttribute("viewBox","0 0 386 40"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("aria-label","DesignBase Logo"),s&&n.setAttribute("class",s);const a=document.createElementNS("http://www.w3.org/2000/svg","g");return a.setAttribute("fill",i||"#000000"),a.innerHTML=LOGO_PATHS,n.append(a),n}function createDesignBaseLogoMarkSvg(t,e,i){const s=.95*t,n=t,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("width",String(s)),a.setAttribute("height",String(n)),a.setAttribute("viewBox","0 0 95 100"),a.setAttribute("fill","none"),a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("aria-label","DesignBase Mark"),i&&a.setAttribute("class",i);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("fill",e||"#000000"),r.setAttribute("d",MARK_PATH),a.append(r),a}class DbLogo extends HTMLElement{static get observedAttributes(){return["type","text","src","alt","size","variant","clickable","href","target","full-width"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}handleClick(t){(this.hasAttribute("clickable")||this.getAttribute("href"))&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})))}renderLogoContent(t){const e=this.getAttribute("type")||"designbase",i=this.getAttribute("text")||"Logo",s=this.getAttribute("src"),n=this.getAttribute("alt")||i,a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"original",{width:o,height:l,markSize:h}=getLogoDimensions(a),d=getLogoColor(r);if("designbase"===e){const e=document.createElement("div");return e.className="designbase-wc-logo__svg",e.append(createDesignBaseLogoSvg(o,l,d)),void t.append(e)}if("designbase-mark"===e){const e=document.createElement("div");return e.className="designbase-wc-logo__svg",e.append(createDesignBaseLogoMarkSvg(h,d)),void t.append(e)}if(s){const e=document.createElement("img");return e.className="designbase-wc-logo__image",e.src=s,e.alt=n,void t.append(e)}const u=document.createElement("span");u.className="designbase-wc-logo__text",u.textContent=i,t.append(u)}render(){const t=this.getAttribute("type")||"designbase",e=this.getAttribute("size")||"m",i=this.getAttribute("variant")||"original",s=this.hasAttribute("clickable")||Boolean(this.getAttribute("href")),n=this.hasAttribute("full-width"),a=this.getAttribute("href"),r=this.getAttribute("target")||"_self";this.className="",this.replaceChildren();const o=document.createElement("div");if(o.className=["designbase-wc-logo",`designbase-wc-logo--${e}`,i?`designbase-wc-logo--${i}`:"",s?"designbase-wc-logo--clickable":"",n?"designbase-wc-logo--full-width":"","custom"!==t?"designbase-wc-logo--svg":""].filter(Boolean).join(" "),s&&(o.addEventListener("click",t=>this.handleClick(t)),a||o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick(t))})),this.renderLogoContent(o),a){const t=document.createElement("a");return t.className="designbase-wc-logo__link",t.href=a,t.target=r,"_blank"===r&&(t.rel="noopener noreferrer"),t.append(o),void this.append(t)}this.append(o)}}customElements.get("db-logo")||customElements.define("db-logo",DbLogo);class DbEmptyState extends HTMLElement{static get observedAttributes(){return["variant","size","title","description","action-text","secondary-action-text","image","image-alt"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(t){return"no-results"===t?"search":"no-access"===t?"user":"error"===t?"cloud-close":"onboarding"===t?"bulb":"plus"}render(){const t=this.getAttribute("variant")||"no-data",e=this.getAttribute("size")||"m",i=this.getAttribute("title")||"",s=this.getAttribute("description")||"",n=this.getAttribute("action-text"),a=this.getAttribute("secondary-action-text"),r=this.getAttribute("image"),o=this.getAttribute("image-alt")||i,l="s"===e?24:"l"===e?48:32;this.className=`designbase-wc-empty-state designbase-wc-empty-state--${t} designbase-wc-empty-state--${e}`,this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren();const h=document.createElement("div");if(h.className="designbase-wc-empty-state__content",r){const t=document.createElement("div");t.className="designbase-wc-empty-state__image";const e=document.createElement("img");e.className="designbase-wc-empty-state__image-element",e.src=r,e.alt=o,t.append(e),h.append(t)}else{const e=document.createElement("div");e.className="designbase-wc-empty-state__icon",e.append(createDbIcon(this.getIconName(t),l)),h.append(e)}const d=document.createElement("h3");if(d.className="designbase-wc-empty-state__title",d.textContent=i,h.append(d),s){const t=document.createElement("p");t.className="designbase-wc-empty-state__description",t.textContent=s,h.append(t)}if(n||a){const i=document.createElement("div");if(i.className="designbase-wc-empty-state__actions",n){const s=document.createElement("db-button");s.setAttribute("variant","onboarding"===t?"primary":"secondary"),s.setAttribute("size",e),s.textContent=n,s.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0}))}),i.append(s)}if(a){const t=document.createElement("db-button");t.setAttribute("variant","tertiary"),t.setAttribute("size",e),t.textContent=a,t.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-secondary-action",{bubbles:!0,composed:!0}))}),i.append(t)}h.append(i)}this.append(h)}}customElements.get("db-empty-state")||customElements.define("db-empty-state",DbEmptyState);const ANIMATIONS$1=["fade","slide","zoom","none"];class DbBackdrop extends HTMLElement{constructor(){super(...arguments),this.keyHandler=null,this.handlePortalClick=t=>{t.target===this.portal&&"true"!==this.getAttribute("disable-backdrop-click")&&(this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0})))}}static get observedAttributes(){return["open","blur","opacity","blur-amount","animation","animation-duration","z-index","background-color","disable-backdrop-click","disable-escape-key-down"]}connectedCallback(){this.style.display="contents",this.render()}disconnectedCallback(){this.detachListeners(),this.portal?.remove(),this.portal=void 0,document.body.style.overflow=""}attributeChangedCallback(){this.isConnected&&this.render()}isOpen(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}collectChildren(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-wc-internal"))}attachListeners(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key&&"true"!==this.getAttribute("disable-escape-key-down")&&(this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0})))},document.addEventListener("keydown",this.keyHandler))}detachListeners(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}render(){const t=this.isOpen(),e=this.hasAttribute("blur"),i=this.getAttribute("opacity")||"0.5",s=this.getAttribute("blur-amount")||"4",n=ANIMATIONS$1.includes(this.getAttribute("animation")||"fade")&&this.getAttribute("animation")||"fade",a=this.getAttribute("animation-duration")||"300",r=this.getAttribute("z-index")||"1000",o=this.getAttribute("background-color"),l=this.collectChildren();document.body.style.overflow=t?"hidden":"",t?this.attachListeners():this.detachListeners(),this.portal||(this.portal=document.createElement("div"),this.portal.setAttribute("data-wc-internal",""),this.portal.addEventListener("click",this.handlePortalClick)),this.portal.className=["designbase-wc-backdrop",`designbase-wc-backdrop--${n}`,t?"designbase-wc-backdrop--open":"",e?"designbase-wc-backdrop--blur":""].filter(Boolean).join(" "),this.portal.setAttribute("role","presentation"),this.portal.setAttribute("aria-hidden",t?"false":"true"),this.portal.style.setProperty("--backdrop-opacity",i),this.portal.style.setProperty("--backdrop-blur-amount",`${s}px`),this.portal.style.setProperty("--backdrop-animation-duration",`${a}ms`),this.portal.style.setProperty("--backdrop-z-index",r),o?this.portal.style.backgroundColor=o:this.portal.style.removeProperty("background-color"),this.portal.replaceChildren(...l),t?this.portal.isConnected||document.body.append(this.portal):this.portal.isConnected&&this.portal.remove()}}customElements.get("db-backdrop")||customElements.define("db-backdrop",DbBackdrop);const PLACEMENTS=["top","bottom","left","right","top-start","top-end","bottom-start","bottom-end","left-start","left-end","right-start","right-end"],TRIGGERS=["click","hover","focus","manual"],GAP=8;class DbPopover extends HTMLElement{constructor(){super(...arguments),this.onDocMouseDown=null,this.onDocKeyDown=null,this.onExternalTriggerClick=null,this.handleTriggerClick=t=>{"click"===this.resolvedTrigger()&&(t.preventDefault(),t.stopPropagation(),this.setOpen(!this.isOpen()))},this.handleTriggerMouseEnter=()=>{"hover"===this.resolvedTrigger()&&this.scheduleOpen()},this.handleTriggerMouseLeave=()=>{"hover"===this.resolvedTrigger()&&this.scheduleClose()},this.handleTriggerFocus=()=>{"focus"===this.resolvedTrigger()&&this.scheduleOpen()},this.handleTriggerBlur=()=>{"focus"===this.resolvedTrigger()&&this.scheduleClose()},this.handleReposition=()=>{this.isOpen()&&(this.repositionRaf&&cancelAnimationFrame(this.repositionRaf),this.repositionRaf=requestAnimationFrame(()=>{this.positionPanel(),this.repositionRaf=void 0}))}}static get observedAttributes(){return["open","placement","position","title","content","size","variant","trigger","delay","hide-delay","always-show","disabled","max-width","show-arrow","close-on-outside-click","close-on-escape","trigger-id"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}connectedCallback(){this.classList.add("designbase-wc-popover-host"),this.render(),this.childObserver=new MutationObserver(()=>this.render()),this.childObserver.observe(this,{childList:!0}),this.bindExternalTrigger(),this.attachGlobalListeners(),this.syncOpenFromAttributes()}disconnectedCallback(){this.childObserver?.disconnect(),this.clearTimers(),this.repositionRaf&&cancelAnimationFrame(this.repositionRaf),this.unbindExternalTrigger(),this.detachGlobalListeners(),this.removePanel()}attributeChangedCallback(t){this.isConnected&&("trigger-id"===t&&(this.unbindExternalTrigger(),this.bindExternalTrigger()),"open"!==t&&"always-show"!==t&&"disabled"!==t?("content"===t&&this.bodyEl&&(this.bodyEl.textContent=this.getAttribute("content")||""),this.isOpen()&&(this.updatePanelMetadata(),requestAnimationFrame(()=>this.positionPanel()))):this.syncOpenFromAttributes())}resolvedPlacement(){const t=this.getAttribute("position")||this.getAttribute("placement")||"top";return PLACEMENTS.includes(t)?t:"top"}resolvedTrigger(){const t=this.getAttribute("trigger")||"click";return TRIGGERS.includes(t)?t:"click"}isControlled(){return this.hasAttribute("open")}isOpen(){return!this.hasAttribute("disabled")&&(!!this.hasAttribute("always-show")||(this.isControlled()?"false"!==this.getAttribute("open"):this.panel?.classList.contains("designbase-wc-popover--visible")??!1))}setOpen(t){this.hasAttribute("disabled")||this.hasAttribute("always-show")||(this.isControlled()?t?this.setAttribute("open",""):this.removeAttribute("open"):t?this.showPanel():this.hidePanel(),this.dispatchEvent(new CustomEvent("db-open-change",{bubbles:!0,composed:!0,detail:{open:t}})),t||this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0})))}syncOpenFromAttributes(){this.hasAttribute("always-show")?this.showPanel():this.isControlled()&&("false"!==this.getAttribute("open")?this.showPanel():this.hidePanel())}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=void 0,this.hideTimer=void 0}groupOf(t){return t.startsWith("top")?"top":t.startsWith("bottom")?"bottom":t.startsWith("left")?"left":"right"}collectTriggerChildren(){const isInternalNode=t=>t.hasAttribute("data-wc-internal")||t===this.triggerWrap,t=Array.from(this.children).filter(t=>!isInternalNode(t));return t.length>0?t:Array.from(this.triggerWrap?.children||[])}ensureTriggerWrap(){this.triggerWrap||(this.triggerWrap=document.createElement("span"),this.triggerWrap.className="designbase-wc-popover__trigger",this.triggerWrap.setAttribute("data-wc-internal",""),this.triggerWrap.tabIndex=0,this.triggerWrap.addEventListener("click",this.handleTriggerClick),this.triggerWrap.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.triggerWrap.addEventListener("mouseleave",this.handleTriggerMouseLeave),this.triggerWrap.addEventListener("focus",this.handleTriggerFocus),this.triggerWrap.addEventListener("blur",this.handleTriggerBlur))}mountTriggerChildren(t){this.triggerWrap&&t.forEach(t=>{t.parentElement!==this.triggerWrap&&this.triggerWrap.append(t)})}collectBodyChildren(){return Array.from(this.querySelectorAll('[slot="content"]'))}bindExternalTrigger(){const t=this.getAttribute("trigger-id");t&&(this.triggerEl=document.getElementById(t),this.triggerEl&&(this.onExternalTriggerClick=()=>{"click"===this.resolvedTrigger()&&this.setOpen(!this.isOpen())},this.triggerEl.addEventListener("click",this.onExternalTriggerClick)))}unbindExternalTrigger(){this.triggerEl&&this.onExternalTriggerClick&&this.triggerEl.removeEventListener("click",this.onExternalTriggerClick),this.triggerEl=null,this.onExternalTriggerClick=null}attachGlobalListeners(){this.onDocMouseDown=t=>{if(!this.isOpen()||"false"===this.getAttribute("close-on-outside-click"))return;const e=t.target;this.panel?.contains(e)||this.triggerWrap?.contains(e)||this.triggerEl?.contains(e)||this.setOpen(!1)},this.onDocKeyDown=t=>{"Escape"===t.key&&this.isOpen()&&"false"!==this.getAttribute("close-on-escape")&&this.setOpen(!1)},document.addEventListener("mousedown",this.onDocMouseDown),document.addEventListener("keydown",this.onDocKeyDown)}detachGlobalListeners(){this.onDocMouseDown&&document.removeEventListener("mousedown",this.onDocMouseDown),this.onDocKeyDown&&document.removeEventListener("keydown",this.onDocKeyDown),this.onDocMouseDown=null,this.onDocKeyDown=null}scheduleOpen(){this.clearTimers();const t="hover"===this.resolvedTrigger()?Math.max(0,Number(this.getAttribute("delay")||0)):0;this.showTimer=setTimeout(()=>this.showPanel(),t)}scheduleClose(){this.clearTimers();const t="hover"===this.resolvedTrigger()?Math.max(0,Number(this.getAttribute("hide-delay")||80)):0;this.hideTimer=setTimeout(()=>this.setOpen(!1),t)}getTriggerRect(){const t=this.triggerEl||this.triggerWrap;return t?.getBoundingClientRect()}positionPanel(){if(!this.panel)return;const t=this.getTriggerRect();if(!t)return;const e=this.resolvedPlacement(),i=this.panel.getBoundingClientRect();let s=0,n=0,a=0,r=0;switch(e){case"top":s=t.top-i.height-GAP,n=t.left+t.width/2-i.width/2,a=i.height,r=i.width/2-4;break;case"top-start":s=t.top-i.height-GAP,n=t.left,a=i.height,r=12;break;case"top-end":s=t.top-i.height-GAP,n=t.right-i.width,a=i.height,r=i.width-12;break;case"bottom":s=t.bottom+GAP,n=t.left+t.width/2-i.width/2,a=-4,r=i.width/2-4;break;case"bottom-start":s=t.bottom+GAP,n=t.left,a=-4,r=12;break;case"bottom-end":s=t.bottom+GAP,n=t.right-i.width,a=-4,r=i.width-12;break;case"left":s=t.top+t.height/2-i.height/2,n=t.left-i.width-GAP,a=i.height/2-4,r=i.width;break;case"left-start":s=t.top,n=t.left-i.width-GAP,a=12,r=i.width;break;case"left-end":s=t.bottom-i.height,n=t.left-i.width-GAP,a=i.height-12,r=i.width;break;case"right":s=t.top+t.height/2-i.height/2,n=t.right+GAP,a=i.height/2-4,r=-4;break;case"right-start":s=t.top,n=t.right+GAP,a=12,r=-4;break;case"right-end":s=t.bottom-i.height,n=t.right+GAP,a=i.height-12,r=-4}n=Math.max(8,Math.min(n,window.innerWidth-i.width-8)),s=Math.max(8,Math.min(s,window.innerHeight-i.height-8));const o=Number(this.getAttribute("max-width")||300);this.panel.style.top=`${s}px`,this.panel.style.left=`${n}px`,this.panel.style.maxWidth=`${o}px`,this.panel.dataset.placementGroup=this.groupOf(e),this.arrowEl&&(this.arrowEl.style.top=`${a}px`,this.arrowEl.style.left=`${r}px`),this.panel.classList.add("designbase-wc-popover--visible")}updatePanelMetadata(){if(!this.panel)return;const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.resolvedPlacement();this.panel.className=["designbase-wc-popover",`designbase-wc-popover--${t}`,`designbase-wc-popover--${e}`,`designbase-wc-popover--${i}`,this.isOpen()?"designbase-wc-popover--visible":"",this.hasAttribute("disabled")?"designbase-wc-popover--disabled":""].filter(Boolean).join(" ")}ensurePanel(){if(this.panel)return;const t=document.createElement("div");t.className="designbase-wc-popover",t.setAttribute("data-wc-internal",""),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.style.position="fixed",t.style.zIndex="9999";const e=document.createElement("div");e.className="designbase-wc-popover__content";const i=document.createElement("div");i.className="designbase-wc-popover__header";const s=document.createElement("h3");s.className="designbase-wc-popover__title";const n=document.createElement("button");n.type="button",n.className="designbase-wc-popover__close-button",n.setAttribute("aria-label","팝오버 닫기"),n.append(createDbIcon("close")),n.addEventListener("click",()=>this.setOpen(!1)),i.append(s,n),this.bodyEl=document.createElement("div"),this.bodyEl.className="designbase-wc-popover__body",e.append(i,this.bodyEl),t.append(e),"false"!==this.getAttribute("show-arrow")&&(this.arrowEl=document.createElement("div"),this.arrowEl.className=`designbase-wc-popover__arrow designbase-wc-popover__arrow--${this.resolvedPlacement()}`,t.append(this.arrowEl)),this.panel=t,this.panel.querySelector(".designbase-wc-popover__title").textContent=this.getAttribute("title")||"",this.panel.querySelector(".designbase-wc-popover__title").hidden=!this.getAttribute("title"),document.body.append(t),t.addEventListener("mouseenter",()=>{"hover"===this.resolvedTrigger()&&this.clearTimers()}),t.addEventListener("mouseleave",()=>{"hover"===this.resolvedTrigger()&&this.scheduleClose()})}showPanel(){if(this.hasAttribute("disabled"))return;this.ensurePanel(),this.updatePanelMetadata();const t=this.collectBodyChildren();t.length>0?this.bodyEl.replaceChildren(...t.map(t=>t.cloneNode(!0))):this.bodyEl.textContent=this.getAttribute("content")||"";const e=this.panel.querySelector(".designbase-wc-popover__title");e.textContent=this.getAttribute("title")||"",e.hidden=!this.getAttribute("title"),requestAnimationFrame(()=>{this.positionPanel(),window.addEventListener("scroll",this.handleReposition,!0),window.addEventListener("resize",this.handleReposition)})}hidePanel(){this.panel?.classList.remove("designbase-wc-popover--visible"),window.removeEventListener("scroll",this.handleReposition,!0),window.removeEventListener("resize",this.handleReposition),this.hasAttribute("always-show")||this.removePanel()}removePanel(){this.panel?.remove(),this.panel=void 0,this.bodyEl=void 0,this.arrowEl=void 0}render(){this.ensureTriggerWrap();const t=this.collectTriggerChildren();this.mountTriggerChildren(t);const e=Boolean(this.getAttribute("trigger-id"));this.triggerWrap&&(t.length>0||!e?this.triggerWrap.parentElement!==this&&this.append(this.triggerWrap):this.triggerWrap.parentElement===this&&this.triggerWrap.remove()),this.hasAttribute("always-show")&&this.showPanel()}}customElements.get("db-popover")||customElements.define("db-popover",DbPopover);const POSITIONS$3=["left","right","top","bottom"],SIZES$k=["s","m","l","xl","full"];class DbDrawer extends HTMLElement{constructor(){super(...arguments),this.isMounted=!1,this.isActive=!1,this.previousActiveElement=null,this.keyHandler=null}static get observedAttributes(){return["open","title","position","size","show-close-button","close-on-backdrop-click","close-on-escape","animation-duration","show-overlay","overlay-closable","z-index","trap-focus","drawer-id"]}connectedCallback(){this.style.display="contents",this.render(),this.syncOpenState()}disconnectedCallback(){this.clearTimers(),this.detachEscape(),this.root?.remove(),this.root=void 0,document.body.style.overflow="",this.previousActiveElement&&this.previousActiveElement.focus()}attributeChangedCallback(t){this.isConnected&&("open"!==t?(this.render(),this.isMounted&&this.syncActiveClasses()):this.syncOpenState())}isOpenRequested(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}clearTimers(){null!=this.enterFrame&&(cancelAnimationFrame(this.enterFrame),this.enterFrame=void 0),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=void 0)}attachEscape(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key&&"false"!==this.getAttribute("close-on-escape")&&this.close()},document.addEventListener("keydown",this.keyHandler))}detachEscape(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}close(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}collectChildren(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-wc-internal"))}syncOpenState(){const t=this.isOpenRequested(),e=Number(this.getAttribute("animation-duration")||300);if(this.clearTimers(),t)return this.render(),this.isMounted=!0,this.isActive=!1,this.syncActiveClasses(),this.root&&!this.root.isConnected&&document.body.append(this.root),"false"!==this.getAttribute("trap-focus")&&(this.previousActiveElement=document.activeElement),this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=void 0,this.isActive=!0,this.syncActiveClasses(),"false"!==this.getAttribute("trap-focus")&&this.container?.focus()})}),document.body.style.overflow="hidden",void this.attachEscape();this.isActive=!1,this.syncActiveClasses(),this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,this.isMounted=!1,this.syncActiveClasses(),this.root?.remove(),document.body.style.overflow="",this.detachEscape(),"false"!==this.getAttribute("trap-focus")&&this.previousActiveElement&&(this.previousActiveElement.focus(),this.previousActiveElement=null)},e),this.detachEscape()}syncActiveClasses(){this.root&&(this.root.classList.toggle("designbase-wc-drawer--open",this.isActive),this.root.classList.toggle("designbase-wc-drawer--closing",this.isMounted&&!this.isActive),this.overlay?.classList.toggle("designbase-wc-drawer__overlay--open",this.isActive),this.container?.classList.toggle("designbase-wc-drawer__container--open",this.isActive))}render(){const t=POSITIONS$3.includes(this.getAttribute("position")||"right")&&this.getAttribute("position")||"right",e=SIZES$k.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",i=this.getAttribute("title"),s="false"!==this.getAttribute("show-close-button"),n="false"!==this.getAttribute("show-overlay"),a=this.getAttribute("animation-duration")||"300",r=this.getAttribute("z-index")||"1000",o=this.getAttribute("drawer-id")||"drawer",l=this.collectChildren();this.root||(this.root=document.createElement("div"),this.root.setAttribute("data-wc-internal",""),this.overlay=document.createElement("div"),this.overlay.className="designbase-wc-drawer__overlay",this.overlay.setAttribute("aria-hidden","true"),this.overlay.addEventListener("click",t=>{if(t.target!==this.overlay)return;const e="false"!==this.getAttribute("overlay-closable"),i="false"!==this.getAttribute("close-on-backdrop-click");e&&i&&this.close()}),this.container=document.createElement("div"),this.container.className=`designbase-wc-drawer__container designbase-wc-drawer__container--${t}`,this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.tabIndex=-1,this.container.addEventListener("click",t=>t.stopPropagation()),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-drawer__content",this.container.append(this.contentEl)),this.root.className=["designbase-wc-drawer",`designbase-wc-drawer--${t}`,`designbase-wc-drawer--${e}`].join(" "),this.root.style.setProperty("--drawer-animation-duration",`${a}ms`),this.root.style.setProperty("--drawer-z-index",r),this.container.className=`designbase-wc-drawer__container designbase-wc-drawer__container--${t}`,this.container.id=o,i?this.container.setAttribute("aria-labelledby",`${o}-title`):this.container.removeAttribute("aria-labelledby"),this.contentEl.id=`${o}-content`,this.root.replaceChildren(),n&&this.overlay&&this.root.append(this.overlay);if(Boolean(i)||s){const t=document.createElement("div");if(t.className="designbase-wc-drawer__header",i){const e=document.createElement("h2");e.className="designbase-wc-drawer__title",e.id=`${o}-title`,e.textContent=i,t.append(e)}if(s){const e=document.createElement("button");e.type="button",e.className="designbase-wc-drawer__close-button",e.setAttribute("aria-label","닫기"),e.append(createDbIcon("close")),e.addEventListener("click",()=>this.close()),t.append(e)}this.container.replaceChildren(t,this.contentEl)}else this.container.replaceChildren(this.contentEl);this.contentEl.replaceChildren(...l),this.root.append(this.container),this.isMounted&&!this.root.isConnected&&document.body.append(this.root)}}customElements.get("db-drawer")||customElements.define("db-drawer",DbDrawer);class DbToast extends HTMLElement{constructor(){super(...arguments),this.timeoutId=null,this.progressInterval=null,this.closed=!1}static get observedAttributes(){return["toast-id","status","title","description","duration","show-close","show-progress","auto-remove"]}connectedCallback(){this.closed=!1,this.render(),this.startTimers(),requestAnimationFrame(()=>this.classList.add("designbase-wc-toast--visible"))}disconnectedCallback(){this.clearTimers()}attributeChangedCallback(t){if(!this.isConnected)return;const e=this.classList.contains("designbase-wc-toast--visible");this.render(),e&&requestAnimationFrame(()=>this.classList.add("designbase-wc-toast--visible")),"duration"!==t&&"show-progress"!==t||(this.clearTimers(),this.startTimers())}clearTimers(){this.timeoutId&&clearTimeout(this.timeoutId),this.progressInterval&&clearInterval(this.progressInterval),this.timeoutId=null,this.progressInterval=null}startTimers(){const t=Number(this.getAttribute("duration")??"5000");if(!Number.isFinite(t)||t<=0)return;this.timeoutId=setTimeout(()=>this.close(),t);if("false"!==this.getAttribute("show-progress")&&this.hasAttribute("show-progress")){const e=this.querySelector(".designbase-wc-toast__progress-bar"),i=Date.now();this.progressInterval=setInterval(()=>{const s=Date.now()-i,n=Math.min(100,s/t*100);e&&(e.style.width=`${n}%`),n>=100&&this.close()},50)}}close(){this.closed||(this.closed=!0,this.clearTimers(),this.classList.remove("designbase-wc-toast--visible"),setTimeout(()=>{this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0,detail:{id:this.getAttribute("toast-id")||""}}));("true"===this.getAttribute("auto-remove")||this.hasAttribute("auto-remove")&&"false"!==this.getAttribute("auto-remove"))&&this.remove()},300))}iconForStatus(t){return"success"===t?"circle-checked":"warning"===t?"warning-filled":"error"===t?"error-filled":"info-filled"}render(){const t=this.getAttribute("status")||"info",e=this.getAttribute("title")||"",i=this.getAttribute("description")||"",s="false"!==this.getAttribute("show-close"),n="false"!==this.getAttribute("show-progress")&&this.hasAttribute("show-progress");if(this.className=`designbase-wc-toast designbase-wc-toast--${t}`,this.setAttribute("role","alert"),this.setAttribute("aria-live","assertive"),this.replaceChildren(),n){const t=document.createElement("div");t.className="designbase-wc-toast__progress";const e=document.createElement("div");e.className="designbase-wc-toast__progress-bar",e.style.width="0%",t.append(e),this.append(t)}const a=document.createElement("div");a.className=`designbase-wc-toast__icon designbase-wc-toast__icon--${t}`,a.append(createDbIcon(this.iconForStatus(t),20));const r=document.createElement("div");r.className="designbase-wc-toast__content";const o=document.createElement("div");if(o.className="designbase-wc-toast__title",o.textContent=e,r.append(o),i){const t=document.createElement("div");t.className="designbase-wc-toast__description",t.textContent=i,r.append(t)}if(this.append(a,r),s){const t=document.createElement("button");t.type="button",t.className="designbase-wc-toast__close-button",t.setAttribute("aria-label","토스트 닫기"),t.append(createDbIcon("close",18)),t.addEventListener("click",()=>this.close()),this.append(t)}}}customElements.get("db-toast")||customElements.define("db-toast",DbToast);class DbConfirm extends HTMLElement{constructor(){super(...arguments),this.root=null,this.keyHandler=null}static get observedAttributes(){return["open","title","message","confirm-text","cancel-text","confirm-variant","variant","size","show-icon","initial-focus","confirm-disabled","cancel-disabled","close-on-escape","close-on-backdrop"]}connectedCallback(){this.render()}disconnectedCallback(){this.detachEscape(),document.body.style.overflow="",this.root?.remove(),this.root=null}attributeChangedCallback(){this.render()}isOpen(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}attachEscape(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key&&"false"!==this.getAttribute("close-on-escape")&&this.dispatchCancel()},document.addEventListener("keydown",this.keyHandler))}detachEscape(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}dispatchCancel(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-cancel",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}dispatchConfirm(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-confirm",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}iconForVariant(t){return"success"===t?"award":"warning"===t?"bell-active":"danger"===t?"cloud-close":"bulb"}iconSize(t){return"s"===t?20:"l"===t?32:24}render(){if(this.root?.remove(),this.root=null,this.detachEscape(),!this.isOpen())return document.body.style.overflow="",void this.replaceChildren();document.body.style.overflow="hidden",this.attachEscape();const t=this.getAttribute("title")||"",e=this.getAttribute("message")||this.textContent?.trim()||"",i=this.getAttribute("confirm-text")||"확인",s=this.getAttribute("cancel-text")||"취소",n=this.getAttribute("confirm-variant")||"primary",a=this.getAttribute("variant")||"info",r=this.getAttribute("size")||"s",o="false"!==this.getAttribute("show-icon"),l=this.getAttribute("initial-focus")||"confirm",h="true"===this.getAttribute("confirm-disabled"),d="true"===this.getAttribute("cancel-disabled"),u=document.createElement("div");u.className="designbase-wc-confirm__overlay",u.setAttribute("role","dialog"),u.setAttribute("aria-modal","true"),t&&u.setAttribute("aria-labelledby","confirm-title"),u.setAttribute("aria-describedby","confirm-content"),u.addEventListener("click",t=>{t.target===u&&"false"!==this.getAttribute("close-on-backdrop")&&this.dispatchCancel()});const p=document.createElement("div");p.className=["designbase-wc-confirm__modal",`designbase-wc-confirm__modal--${a}`,`designbase-wc-confirm__modal--${r}`,!o&&"designbase-wc-confirm__modal--no-icon"].filter(Boolean).join(" ");const m=document.createElement("div");if(m.className=["designbase-wc-confirm__header",!o&&"designbase-wc-confirm__header--no-icon"].filter(Boolean).join(" "),o){const t=document.createElement("div");t.className="designbase-wc-confirm__icon",t.append(createDbIcon(this.iconForVariant(a),this.iconSize(r))),m.append(t)}const g=document.createElement("div");if(g.className="designbase-wc-confirm__title-area",t){const e=document.createElement("h2");e.id="confirm-title",e.className="designbase-wc-confirm__title",e.textContent=t,g.append(e)}m.append(g),p.append(m);const b=document.createElement("div");b.id="confirm-content",b.className="designbase-wc-confirm__content",b.textContent=e,p.append(b);const f=document.createElement("div");f.className="designbase-wc-confirm__footer";const v=document.createElement("db-button");v.setAttribute("variant","tertiary"),v.setAttribute("full-width",""),v.textContent=s,d&&v.setAttribute("disabled",""),v.addEventListener("db-click",()=>this.dispatchCancel());const y=document.createElement("db-button");y.setAttribute("variant",n),y.setAttribute("full-width",""),y.textContent=i,h&&y.setAttribute("disabled",""),y.addEventListener("db-click",()=>this.dispatchConfirm()),f.append(v,y),p.append(f),u.append(p),document.body.append(u),this.root=u,requestAnimationFrame(()=>{("cancel"===l?v:y).focus()})}}customElements.get("db-confirm")||customElements.define("db-confirm",DbConfirm);const TYPES$2=["dots","numbers","line","dot-line","slide","combined"],SIZES$j=["s","m","l"],DIRECTIONS$3=["horizontal","vertical"];class DbIndicator extends HTMLElement{constructor(){super(...arguments),this.timerFrame=0,this.progress=0,this.pausedProgress=0,this.activeStep=0,this.isPlayingInternal=!1}static get observedAttributes(){return["total","current","default-current","indicator-type","type","size","direction","clickable","timer","timer-duration","auto-roll","playing","default-playing","playback-disabled"]}get total(){return Math.max(1,Number(this.getAttribute("total")||1))}set total(t){this.setAttribute("total",String(t))}normalizeStep(t){const e=this.total;return(t%e+e)%e}get isCurrentControlled(){return this.hasAttribute("current")}get isPlayingControlled(){return this.hasAttribute("playing")}get resolvedCurrent(){return this.isCurrentControlled?this.normalizeStep(Number(this.getAttribute("current")||0)):this.activeStep}get resolvedPlaying(){return!!this.isPlayingControlled||this.isPlayingInternal}get indicatorType(){const t=this.getAttribute("indicator-type")||this.getAttribute("type")||"dots";return TYPES$2.includes(t)?t:"dots"}get size(){const t=this.getAttribute("size")||"m";return SIZES$j.includes(t)?t:"m"}set size(t){this.setAttribute("size",t)}get direction(){const t=this.getAttribute("direction")||"horizontal";return DIRECTIONS$3.includes(t)?t:"horizontal"}set direction(t){this.setAttribute("direction",t)}get clickable(){return this.hasAttribute("clickable")}set clickable(t){this.toggleAttribute("clickable",Boolean(t))}get timer(){return this.hasAttribute("timer")}set timer(t){this.toggleAttribute("timer",Boolean(t))}connectedCallback(){this.activeStep=this.normalizeStep(Number(this.getAttribute("default-current")||0)),this.isPlayingInternal=this.hasAttribute("default-playing"),this.render(),this.startTimer()}disconnectedCallback(){cancelAnimationFrame(this.timerFrame)}attributeChangedCallback(t){if(this.isConnected){if("current"===t&&this.isCurrentControlled)return this.resetProgress(),this.render(),void this.startTimer();if("playing"===t)return this.resolvedPlaying||(this.pausedProgress=this.progress),this.syncRootClasses(),this.syncPlaybackButton(),void this.startTimer();if("default-current"===t&&!this.isCurrentControlled)return this.activeStep=this.normalizeStep(Number(this.getAttribute("default-current")||0)),this.resetProgress(),this.render(),void this.startTimer();if("default-playing"===t&&!this.isPlayingControlled)return this.isPlayingInternal=this.hasAttribute("default-playing"),this.syncRootClasses(),this.syncPlaybackButton(),void this.startTimer();if("timer"===t||"timer-duration"===t||"auto-roll"===t)return this.resetProgress(),this.render(),void this.startTimer();this.render(),this.startTimer()}}resetProgress(){this.pausedProgress=0,this.progress=0}emitChange(t){const e={current:t,index:t};this.dispatchEvent(new CustomEvent("db-change",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-current-change",{detail:e,bubbles:!0,composed:!0}))}goToStep(t){const e=this.normalizeStep(t);this.isCurrentControlled||(this.activeStep=e,this.resetProgress(),this.render(),this.startTimer()),this.emitChange(e)}startTimer(){if(cancelAnimationFrame(this.timerFrame),!this.timer||!this.resolvedPlaying||!this.isConnected)return;const t=Number(this.getAttribute("timer-duration")||3e3),e=Date.now()-this.pausedProgress*t,tick=()=>{const i=Date.now()-e,s=Math.min(i/t,1);this.progress=s,this.pausedProgress=s,this.updateTimerVisuals(),s<1?this.timerFrame=requestAnimationFrame(tick):(this.dispatchEvent(new CustomEvent("db-timer-complete",{detail:{step:this.resolvedCurrent},bubbles:!0,composed:!0})),this.resetProgress(),"false"===this.getAttribute("auto-roll")?this.render():this.goToStep(this.resolvedCurrent+1))};this.timerFrame=requestAnimationFrame(tick)}updateTimerVisuals(){this.querySelectorAll(".designbase-wc-indicator__line-fill, .designbase-wc-indicator__track-fill").forEach(t=>{t.style.transform="vertical"===this.direction?`scaleY(${this.progress})`:`scaleX(${this.progress})`});const t=this.querySelector(".designbase-wc-indicator__dot-ring-progress");if(t){const e=15.9155,i=2*Math.PI*e;t.setAttribute("stroke-dashoffset",String(i*(1-this.progress)))}}syncRootClasses(){const t=this.indicatorType;this.className=["designbase-wc-indicator",`designbase-wc-indicator--${t}`,"combined"===t&&"designbase-wc-indicator--dots",`designbase-wc-indicator--${this.size}`,`designbase-wc-indicator--${this.direction}`,this.clickable&&"designbase-wc-indicator--clickable",this.timer&&!this.resolvedPlaying&&"designbase-wc-indicator--paused"].filter(Boolean).join(" ")}syncPlaybackButton(){const t=this.querySelector(".designbase-wc-indicator__playback-button");t&&(t.disabled=this.hasAttribute("playback-disabled"),t.setAttribute("aria-label",this.resolvedPlaying?"일시정지":"재생"),t.replaceChildren(createDbIcon(this.resolvedPlaying?"pause":"play")))}renderDotRing(){const t=15.9155,e=2*Math.PI*t,i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("class","designbase-wc-indicator__dot-ring"),i.setAttribute("viewBox","0 0 36 36"),i.setAttribute("aria-hidden","true");const s=document.createElementNS("http://www.w3.org/2000/svg","circle");s.setAttribute("class","designbase-wc-indicator__dot-ring-bg"),s.setAttribute("cx","18"),s.setAttribute("cy","18"),s.setAttribute("r",String(t)),s.setAttribute("fill","none");const n=document.createElementNS("http://www.w3.org/2000/svg","circle");return n.setAttribute("class","designbase-wc-indicator__dot-ring-progress"),n.setAttribute("cx","18"),n.setAttribute("cy","18"),n.setAttribute("r",String(t)),n.setAttribute("fill","none"),n.setAttribute("stroke-dasharray",String(e)),n.setAttribute("stroke-dashoffset",String(e*(1-this.progress))),n.setAttribute("stroke-linecap","round"),i.append(s,n),i}renderStep(t,e,i){const s=t===this.resolvedCurrent,n=this.clickable?document.createElement("button"):document.createElement("span");return n.className=e,this.clickable&&n instanceof HTMLButtonElement?(n.type="button",n.setAttribute("aria-label",`${t+1}단계`),s&&n.setAttribute("aria-current","step"),n.addEventListener("click",()=>{this.goToStep(t),this.dispatchEvent(new CustomEvent("db-step-click",{detail:{current:t,index:t},bubbles:!0,composed:!0}))})):s||n.setAttribute("aria-hidden","true"),i&&n.append(i),n}renderDots(){const t=document.createDocumentFragment(),e=this.indicatorType,i="combined"===e?"dots":e,s=this.timer,n=this.resolvedPlaying,a=this.resolvedCurrent;this.direction;const r=this.total;if("dots"!==i)return t;for(let e=0;e<r;e+=1){const i=e===a,r=s&&i&&n,o=r||s&&i&&!n&&this.progress>0,l=document.createElement("span");l.className="designbase-wc-indicator__dot-core";const h=document.createDocumentFragment();h.append(l),s&&i&&(r||this.progress>0)&&h.append(this.renderDotRing()),t.append(this.renderStep(e,["designbase-wc-indicator__dot",i&&"designbase-wc-indicator__dot--active",o&&"designbase-wc-indicator__dot--with-ring"].filter(Boolean).join(" "),h))}return t}renderPlaybackButton(){const t=document.createElement("button");return t.type="button",t.className="designbase-wc-indicator__playback-button",t.disabled=this.hasAttribute("playback-disabled"),t.setAttribute("aria-label",this.resolvedPlaying?"일시정지":"재생"),t.append(createDbIcon(this.resolvedPlaying?"pause":"play")),t.addEventListener("click",()=>{if(this.hasAttribute("playback-disabled"))return;const t=!this.resolvedPlaying;this.isPlayingControlled?t?this.setAttribute("playing",""):(this.removeAttribute("playing"),this.pausedProgress=this.progress):(this.isPlayingInternal=t,t||(this.pausedProgress=this.progress)),this.syncRootClasses(),this.syncPlaybackButton(),this.startTimer(),this.dispatchEvent(new CustomEvent("db-playing-change",{detail:{playing:t},bubbles:!0,composed:!0}))}),t}render(){const t=this.indicatorType,e="combined"===t?"dots":t,i=this.direction,s=this.resolvedCurrent,n=this.total,a=this.timer,r=this.resolvedPlaying;if(this.syncRootClasses(),this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","1"),this.setAttribute("aria-valuemax",String(n)),this.setAttribute("aria-valuenow",String(s+1)),this.replaceChildren(),"numbers"===e){const t=document.createElement("span");t.className="designbase-wc-indicator__current",t.textContent=String(s+1);const e=document.createElement("span");e.className="designbase-wc-indicator__separator",e.textContent="/";const i=document.createElement("span");return i.className="designbase-wc-indicator__total",i.textContent=String(n),void this.append(t,e,i)}if("slide"===e){const t=document.createElement("div");t.className="designbase-wc-indicator__track";const e=document.createElement("div");e.className="designbase-wc-indicator__track-thumb";const o=100/n;if("vertical"===i?(e.style.height=`${o}%`,e.style.transform=`translateY(${100*s}%)`):(e.style.width=`${o}%`,e.style.transform=`translateX(${100*s}%)`),a&&r){const t=document.createElement("div");t.className="designbase-wc-indicator__track-fill",t.style.transform="vertical"===i?`scaleY(${this.progress})`:`scaleX(${this.progress})`,e.append(t)}return t.append(e),void this.append(t)}if("line"===e){const t=document.createDocumentFragment();for(let e=0;e<n;e+=1){const n=e===s,o=a&&n&&r?(()=>{const t=document.createElement("span");return t.className="designbase-wc-indicator__line-fill",t.style.transform="vertical"===i?`scaleY(${this.progress})`:`scaleX(${this.progress})`,t})():void 0;t.append(this.renderStep(e,["designbase-wc-indicator__line-segment",n&&!a&&"designbase-wc-indicator__line-segment--active",n&&a&&"designbase-wc-indicator__line-segment--current"].filter(Boolean).join(" "),o))}return void this.append(t)}if("dot-line"===e){const t=document.createDocumentFragment();for(let e=0;e<n;e+=1){const i=e===s;t.append(this.renderStep(e,["designbase-wc-indicator__dot-line-item",i&&"designbase-wc-indicator__dot-line-item--active"].filter(Boolean).join(" ")))}return void this.append(t)}if("combined"===t){const t=document.createElement("div");return t.className="designbase-wc-indicator__steps",t.append(this.renderDots()),void this.append(t,this.renderPlaybackButton())}this.append(this.renderDots())}}customElements.get("db-indicator")||customElements.define("db-indicator",DbIndicator);class DbList extends HTMLElement{constructor(){super(...arguments),this.groupName=`db-list-${Math.random().toString(36).slice(2,9)}`}static get observedAttributes(){return["items","size","variant","layout","spacing","selectable","multiple","selected-items","empty-message","show-description","show-arrow","show-badge","loading","loading-count"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}get selectedItems(){const t=this.getAttribute("selected-items")||"[]";try{const e=JSON.parse(t);return Array.isArray(e)?e.map(String):[]}catch{return[]}}set selectedItems(t){this.setAttribute("selected-items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.render()}attributeChangedCallback(t){this.isConnected&&("selected-items"!==t?this.render():this.syncSelectionState())}flag(t,e=!0){return this.hasAttribute(t)?"false"!==this.getAttribute(t):e}controlSize(){return"l"===(this.getAttribute("size")||"m")?"m":"s"}parseBadge(t){return t?"string"==typeof t?{text:t,variant:"primary",style:"text"}:{text:t.text,variant:t.variant||"primary",style:t.style||"text"}:null}isSelected(t){return t.selected||this.selectedItems.includes(t.id)}setSelection(t){const e=JSON.stringify(t);this.getAttribute("selected-items")!==e?(this.setAttribute("selected-items",e),this.syncSelectionState(),this.dispatchEvent(new CustomEvent("db-select",{detail:{selectedItems:t},bubbles:!0,composed:!0}))):this.syncSelectionState()}toggleSelection(t){const e=this.hasAttribute("multiple"),i=this.selectedItems;let s;s=e?i.includes(t)?i.filter(e=>e!==t):[...i,t]:i.includes(t)?[]:[t],this.setSelection(s)}syncSelectionState(){const t=new Set(this.selectedItems);this.querySelectorAll(":scope > .designbase-wc-list__item").forEach(e=>{const i=e.dataset.itemId;if(!i)return;const s=t.has(i);e.classList.toggle("designbase-wc-list__item--selected",s),e.setAttribute("aria-selected",String(s));const n=e.querySelector("db-checkbox, db-radio");n&&(s?n.setAttribute("checked",""):n.removeAttribute("checked"))})}createSelectControl(t,e){const i=document.createElement("div");i.className="designbase-wc-list__item-select";const s=document.createElement(e?"db-checkbox":"db-radio");return s.setAttribute("has-label","false"),s.setAttribute("size",this.controlSize()),s.setAttribute("value",t.id),e||s.setAttribute("name",this.groupName),this.isSelected(t)&&s.setAttribute("checked",""),t.disabled&&s.setAttribute("disabled",""),s.addEventListener("click",t=>t.stopPropagation()),s.addEventListener("db-change",e=>{e.stopPropagation(),t.disabled||this.toggleSelection(t.id)}),i.append(s),i}createBadge(t){const e=document.createElement("db-badge");return e.setAttribute("size","s"),e.setAttribute("variant",t.variant),e.setAttribute("badge-style",t.style),"number"===t.style?e.setAttribute("count",t.text):e.textContent=t.text,e}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"navigation",i=this.getAttribute("layout")||"vertical",s=this.getAttribute("spacing")||"s",n=this.hasAttribute("selectable"),a=this.hasAttribute("multiple"),r=this.hasAttribute("loading"),o=Number(this.getAttribute("loading-count")||3),l=this.flag("show-description",!1),h=this.flag("show-arrow",!0),d=this.flag("show-badge",!0),u=this.items,p="s"===t?16:"l"===t?24:20;if(this.className=["designbase-wc-list",`designbase-wc-list--size-${t}`,`designbase-wc-list--variant-${e}`,`designbase-wc-list--layout-${i}`,`designbase-wc-list--spacing-${s}`,n&&"designbase-wc-list--selectable",a&&"designbase-wc-list--multiple",r&&"designbase-wc-list--loading"].filter(Boolean).join(" "),this.replaceChildren(),r)for(let t=0;t<o;t+=1){const t=document.createElement("div");t.className="designbase-wc-list__item designbase-wc-list__item--loading",t.innerHTML='\n <div class="designbase-wc-list__item-skeleton">\n <div class="designbase-wc-list__item-skeleton-icon"></div>\n <div class="designbase-wc-list__item-skeleton-content">\n <div class="designbase-wc-list__item-skeleton-title"></div>\n <div class="designbase-wc-list__item-skeleton-description"></div>\n </div>\n </div>\n ',this.append(t)}else{if(0===u.length){const t=document.createElement("div");return t.className="designbase-wc-list__empty",t.textContent=this.getAttribute("empty-message")||"항목이 없습니다.",void this.append(t)}u.forEach((r,o)=>{const u=this.isSelected(r),m=l&&Boolean(r.description),g=Boolean(r.meta?.length),b=this.parseBadge(r.badge),f=Boolean(d&&b||h),v=document.createElement("div");if(v.className=["designbase-wc-list__item",`designbase-wc-list__item--size-${t}`,`designbase-wc-list__item--variant-${e}`,`designbase-wc-list__item--layout-${i}`,`designbase-wc-list__item--spacing-${s}`,u&&"designbase-wc-list__item--selected",r.disabled&&"designbase-wc-list__item--disabled",(n||!r.disabled)&&"designbase-wc-list__item--clickable",r.icon&&"designbase-wc-list__item--with-leading",(m||g)&&"designbase-wc-list__item--with-secondary",f&&"designbase-wc-list__item--with-trailing"].filter(Boolean).join(" "),v.dataset.itemId=r.id,v.tabIndex=r.disabled?-1:0,n&&v.setAttribute("aria-selected",String(u)),n&&v.append(this.createSelectControl(r,a)),r.icon){const t=document.createElement("div");t.className="designbase-wc-list__item-icon",t.append(createDbIcon(r.icon,p)),v.append(t)}else if(r.image){const t=document.createElement("div");t.className="designbase-wc-list__item-image";const e=document.createElement("img");e.src=r.image,e.alt=r.title,t.append(e),v.append(t)}const y=document.createElement("div");y.className="designbase-wc-list__item-content";const E=document.createElement("div");E.className="designbase-wc-list__item-header";const S=document.createElement("h4");if(S.className="designbase-wc-list__item-title",S.textContent=r.title,E.append(S),y.append(E),m){const t=document.createElement("p");t.className="designbase-wc-list__item-description",t.textContent=r.description||"",y.append(t)}if(g&&r.meta){const t=document.createElement("div");t.className="designbase-wc-list__item-meta",r.meta.forEach(e=>{const i=document.createElement("div");i.className="designbase-wc-list__item-meta-item";const s=document.createElement("span");s.className="designbase-wc-list__item-meta-label",s.textContent=`${e.label}:`;const n=document.createElement("span");n.className="designbase-wc-list__item-meta-value",n.textContent=e.value,i.append(s,n),t.append(i)}),y.append(t)}if(v.append(y),f){const t=document.createElement("div");if(t.className="designbase-wc-list__item-trailing",d&&b&&t.append(this.createBadge(b)),h){const e=document.createElement("div");e.className="designbase-wc-list__item-arrow",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("chevron-right",16)),t.append(e)}v.append(t)}const handleActivate=()=>{r.disabled||(this.dispatchEvent(new CustomEvent("db-item-click",{detail:{item:r,index:o},bubbles:!0,composed:!0})),n&&this.toggleSelection(r.id))};v.addEventListener("click",handleActivate),v.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),handleActivate())}),this.append(v)})}}}customElements.get("db-list")||customElements.define("db-list",DbList);class DbMenuItem extends HTMLElement{static get observedAttributes(){return["label","href","icon","active","disabled","badge","badge-color","size","variant","type","menu-style","expanded","expandable","sub-items","depth"]}get subItems(){try{return JSON.parse(this.getAttribute("sub-items")||"[]")}catch{return[]}}set subItems(t){this.setAttribute("sub-items","string"==typeof t?t:JSON.stringify(t))}get expanded(){return this.hasAttribute("expanded")}set expanded(t){this.toggleAttribute("expanded",t)}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}iconSize(t){return"s"===t?16:"l"===t?24:20}render(){const t=this.getAttribute("label")||"",e=this.getAttribute("href")||"",i=this.getAttribute("icon"),s=this.getAttribute("size")||"m",n=this.getAttribute("variant")||"default",a=this.getAttribute("type")||"block",r=this.getAttribute("menu-style")||"accordion",o=Number(this.getAttribute("depth")||0),l=this.hasAttribute("active"),h=this.hasAttribute("disabled"),d=this.getAttribute("badge")||"",u=this.getAttribute("badge-color")||"primary",p=this.subItems,m=p.length>0,g=this.hasAttribute("expandable")||m,b=this.expanded,f=this.iconSize(s);this.className=["designbase-wc-menu-item",`designbase-wc-menu-item--${a}`,`designbase-wc-menu-item--${s}`,`designbase-wc-menu-item--${n}`,`designbase-wc-menu-item--${r}`,`designbase-wc-menu-item--depth-${o}`,l&&"designbase-wc-menu-item--active",h&&"designbase-wc-menu-item--disabled",g&&"designbase-wc-menu-item--expandable",b&&"designbase-wc-menu-item--expanded",m&&"designbase-wc-menu-item--with-children",d&&"designbase-wc-menu-item--with-badge",i&&"designbase-wc-menu-item--with-icon"].filter(Boolean).join(" "),this.replaceChildren();const v=document.createElement("div");if(v.className=["designbase-wc-menu-item__content","designbase-wc-menu-item__content--clickable"].join(" "),i){const t=document.createElement("div");t.className=["designbase-wc-menu-item__icon",`designbase-wc-menu-item__icon--${n}`,l&&"designbase-wc-menu-item__icon--active",h&&"designbase-wc-menu-item__icon--disabled"].filter(Boolean).join(" "),t.append(createDbIcon(i,f)),v.append(t)}const y=document.createElement("span");if(y.className="designbase-wc-menu-item__label",y.textContent=t,v.append(y),d){const t=document.createElement("db-badge");t.setAttribute("size","s"),t.setAttribute("variant",u),t.setAttribute("badge-style","number"),t.setAttribute("count",d),v.append(t)}if(m){const t=document.createElement("div");t.className="designbase-wc-menu-item__expand-icon",t.append(createDbIcon(b?"chevron-up":"chevron-down",16)),v.append(t)}if(v.addEventListener("click",i=>{h||(m&&g?(i.preventDefault(),this.expanded=!this.expanded):e&&(window.location.href=e),this.dispatchEvent(new CustomEvent("db-click",{detail:{label:t,href:e,expanded:this.expanded},bubbles:!0,composed:!0})))}),this.append(v),m&&b){const t=document.createElement("div");t.className=`designbase-wc-menu-item__children designbase-wc-menu-item__children--${r}`,p.forEach(e=>{const i=document.createElement("db-menu-item");i.setAttribute("label",e.label),i.setAttribute("type","block"),i.setAttribute("menu-style",r),i.setAttribute("size",s),i.setAttribute("depth",String(o+1)),e.href&&i.setAttribute("href",e.href),e.icon&&i.setAttribute("icon",e.icon),e.active&&i.setAttribute("active",""),e.disabled&&i.setAttribute("disabled",""),void 0!==e.badge&&i.setAttribute("badge",String(e.badge)),e.badgeColor&&i.setAttribute("badge-color",e.badgeColor),e.variant&&i.setAttribute("variant",e.variant),i.addEventListener("db-click",t=>{t.stopPropagation(),e.disabled||this.dispatchEvent(new CustomEvent("db-child-click",{detail:{child:e},bubbles:!0,composed:!0}))}),t.append(i)}),this.append(t)}}}customElements.get("db-menu-item")||customElements.define("db-menu-item",DbMenuItem);const SIZES$i=["s","m","l"],VARIANTS$f=["default","outlined","filled"],RECENT_LAYOUTS=["vertical","horizontal"];class DbSearchBar extends HTMLElement{constructor(){super(...arguments),this.recentSearches=[],this.isFocused=!1,this.currentSuggestion=0,this.scrollParents=[]}static get observedAttributes(){return["value","default-value","placeholder","size","variant","disabled","readonly","full-width","show-shortcut","shortcut-label","enable-recent-searches","recent-searches-key","recent-searches-layout","suggested-searches","suggestion-rolling-interval","categories","selected-category","search-results","empty-state-message"]}getResolvedSize(){const t=this.getAttribute("size")||"m";return SIZES$i.includes(t)?t:"m"}getIconPx(){return getDbComponentIconSize(this.getResolvedSize())}syncIcons(){const t=this.getIconPx();this.querySelector(".designbase-wc-search-bar__search-icon")?.replaceChildren(createDbIcon("search",t)),this.clearButton?.replaceChildren(createDbIcon("close",t))}hasInputValue(){return Boolean((this.input?.value??this.getAttribute("value")??"").trim())}get value(){return this.input?.value??this.getAttribute("value")??""}set value(t){this.setAttribute("value",t),this.input&&(this.input.value=t)}connectedCallback(){this.loadRecentSearches(),this.render(),this.bindGlobalShortcut()}disconnectedCallback(){this.clearSuggestionInterval(),this.unbindGlobalShortcut(),this.detachDropdownPortal(),this.blurTimer&&clearTimeout(this.blurTimer)}attributeChangedCallback(t){if(this.isConnected)return"value"===t&&this.input?(this.input.value=this.getAttribute("value")||"",this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),void this.syncSuggestionRolling()):"disabled"===t||"readonly"===t||"placeholder"===t||"show-shortcut"===t||"shortcut-label"===t||"selected-category"===t||"search-results"===t||"empty-state-message"===t||"suggested-searches"===t?(this.syncAttributes(),this.syncPlaceholder(),this.updateDropdown(),void this.syncSuggestionRolling()):"enable-recent-searches"===t||"recent-searches-key"===t?(this.loadRecentSearches(),void this.updateDropdown()):void("categories"!==t&&"recent-searches-layout"!==t?this.render():this.updateDropdown())}focus(){this.input?.focus()}parseJsonArray(t){try{const e=JSON.parse(this.getAttribute(t)||"[]");return Array.isArray(e)?e:[]}catch{return[]}}getRecentSearchesKey(){return this.getAttribute("recent-searches-key")||"searchbar-recent-searches"}loadRecentSearches(){if(this.hasAttribute("enable-recent-searches"))try{const t=localStorage.getItem(this.getRecentSearchesKey());this.recentSearches=t?JSON.parse(t):[],Array.isArray(this.recentSearches)||(this.recentSearches=[])}catch{this.recentSearches=[]}else this.recentSearches=[]}saveRecentSearches(){try{localStorage.setItem(this.getRecentSearchesKey(),JSON.stringify(this.recentSearches))}catch{}}clearSuggestionInterval(){this.suggestionInterval&&(clearInterval(this.suggestionInterval),this.suggestionInterval=void 0)}syncSuggestionRolling(){this.clearSuggestionInterval();const t=this.parseJsonArray("suggested-searches"),e=this.hasInputValue(),i=Number(this.getAttribute("suggestion-rolling-interval")||5e3);t.length>0&&!e&&(this.suggestionInterval=setInterval(()=>{this.currentSuggestion=(this.currentSuggestion+1)%t.length,this.syncPlaceholder(),this.updateDropdown()},i))}syncPlaceholder(){if(!this.input)return;const t=this.parseJsonArray("suggested-searches"),e=this.hasInputValue(),i=this.getAttribute("placeholder")||"검색...";t.length>0&&!e?this.input.placeholder=t[this.currentSuggestion]||i:this.input.placeholder=i}syncValueState(){const t=this.hasInputValue();this.classList.toggle("designbase-wc-search-bar--has-value",t),this.clearButton&&(this.clearButton.hidden=!t||this.hasAttribute("disabled")||this.hasAttribute("readonly")),this.shortcutBadge&&(this.shortcutBadge.hidden=!this.hasAttribute("show-shortcut")||t||this.hasAttribute("disabled")||this.hasAttribute("readonly")),this.syncIcons()}syncAttributes(){const t=this.getAttribute("size")||"m",e=this.hasAttribute("disabled"),i=this.hasAttribute("readonly"),s=this.hasAttribute("show-shortcut");this.className=["designbase-wc-search-bar",`designbase-wc-search-bar--${SIZES$i.includes(t)?t:"m"}`,`designbase-wc-search-bar--${VARIANTS$f.includes(this.getAttribute("variant")||"default")&&this.getAttribute("variant")||"default"}`,e&&"designbase-wc-search-bar--disabled",i&&"designbase-wc-search-bar--readonly",this.hasAttribute("full-width")&&"designbase-wc-search-bar--full-width",Boolean(this.hasInputValue())&&"designbase-wc-search-bar--has-value"].filter(Boolean).join(" "),this.input&&(this.input.disabled=e,this.input.readOnly=i),this.shortcutBadge&&(this.shortcutBadge.hidden=!s||this.hasInputValue()||e||i,this.shortcutBadge.textContent=this.getAttribute("shortcut-label")||"⌘K"),this.syncValueState()}bindGlobalShortcut(){this.unbindGlobalShortcut(),!this.hasAttribute("show-shortcut")||this.hasAttribute("disabled")||this.hasAttribute("readonly")||(this.globalKeyHandler=t=>{const e=t.metaKey||t.ctrlKey;let i="k";const s=(this.getAttribute("shortcut-label")||"⌘K").slice(-1).toLowerCase();s&&(i=s),e&&t.key.toLowerCase()===i&&(t.preventDefault(),this.focus())},window.addEventListener("keydown",this.globalKeyHandler))}unbindGlobalShortcut(){this.globalKeyHandler&&(window.removeEventListener("keydown",this.globalKeyHandler),this.globalKeyHandler=void 0)}positionDropdown(){if(!this.dropdown||this.dropdown.hidden)return;const t=this.getBoundingClientRect(),e=this.input?.getBoundingClientRect(),i=e??t;this.dropdown.style.top=`${i.bottom+4}px`,this.dropdown.style.left=`${t.left}px`,this.dropdown.style.width=`${t.width}px`,this.dropdown.style.right="auto"}bindRepositionListeners(){if(this.repositionHandler)return;this.repositionHandler=()=>{requestAnimationFrame(()=>this.positionDropdown())},window.addEventListener("scroll",this.repositionHandler,!0),window.addEventListener("resize",this.repositionHandler),this.scrollParents=[];let t=this.parentElement;for(;t&&t!==document.body;){const e=getComputedStyle(t),i=/(auto|scroll|overlay)/.test(e.overflowY),s=/(auto|scroll|overlay)/.test(e.overflow);(i||s)&&t.scrollHeight>t.clientHeight&&(t.addEventListener("scroll",this.repositionHandler,{passive:!0}),this.scrollParents.push(t)),t=t.parentElement}}unbindRepositionListeners(){this.repositionHandler&&(window.removeEventListener("scroll",this.repositionHandler,!0),window.removeEventListener("resize",this.repositionHandler),this.scrollParents.forEach(t=>t.removeEventListener("scroll",this.repositionHandler)),this.scrollParents=[],this.repositionHandler=void 0)}attachDropdownPortal(){this.dropdown&&!this.dropdown.hidden&&(this.dropdown.classList.add("designbase-wc-search-bar__dropdown--portal"),this.dropdown.parentElement!==document.body&&document.body.append(this.dropdown),requestAnimationFrame(()=>this.positionDropdown()),this.repositionHandler||this.bindRepositionListeners())}detachDropdownPortal(){this.unbindRepositionListeners(),this.dropdown&&(this.dropdown.classList.remove("designbase-wc-search-bar__dropdown--portal"),this.dropdown.style.top="",this.dropdown.style.left="",this.dropdown.style.width="",this.dropdown.style.right="",this.dropdown.parentElement===document.body&&this.isConnected&&this.append(this.dropdown))}shouldShowDropdown(){const t=this.hasInputValue(),e=this.parseJsonArray("categories"),i=this.parseJsonArray("suggested-searches"),s=this.getAttribute("search-results"),n=this.getAttribute("empty-state-message");return this.isFocused&&(e.length>0||this.hasAttribute("enable-recent-searches")&&this.recentSearches.length>0&&!t||i.length>0&&!t||null!==s&&t||Boolean(n)&&!t&&(!this.hasAttribute("enable-recent-searches")||0===this.recentSearches.length)&&0===i.length)}formatSearchResult(t){if("string"==typeof t||"number"==typeof t)return String(t);if(t&&"object"==typeof t){const e=t;if("string"==typeof e.title)return e.title;if("string"==typeof e.label)return e.label}return String(t)}handleSearch(t){const e=(t??this.value).trim();e&&(this.dispatchEvent(new CustomEvent("db-search",{detail:{value:e},bubbles:!0,composed:!0})),this.hasAttribute("enable-recent-searches")&&(this.recentSearches=[e,...this.recentSearches.filter(t=>t!==e)].slice(0,10),this.saveRecentSearches(),this.updateDropdown()))}updateDropdown(){if(!this.dropdown)return;const t=this.shouldShowDropdown();if(this.dropdown.hidden=!t,!t)return this.dropdown.replaceChildren(),void this.detachDropdownPortal();this.dropdown.replaceChildren();const e=this.hasInputValue(),i=this.parseJsonArray("categories"),s=this.parseJsonArray("suggested-searches"),n=this.getAttribute("selected-category")||"",a=this.parseJsonArray("search-results"),r=this.getAttribute("empty-state-message"),o=RECENT_LAYOUTS.includes(this.getAttribute("recent-searches-layout")||"vertical")&&this.getAttribute("recent-searches-layout")||"vertical";if(i.length>0){const t=document.createElement("div");t.className="designbase-wc-search-bar__categories",i.forEach(e=>{const i=document.createElement("db-chip");i.setAttribute("label",e),i.setAttribute("size","s"),i.setAttribute("variant",e===n?"primary":"default"),i.setAttribute("clickable",""),i.addEventListener("mousedown",t=>{t.preventDefault(),this.setAttribute("selected-category",e),this.dispatchEvent(new CustomEvent("db-category-change",{detail:{category:e},bubbles:!0,composed:!0})),this.updateDropdown()}),t.append(i)}),this.dropdown.append(t)}if(e&&this.hasAttribute("search-results")){const t=document.createElement("div");if(t.className="designbase-wc-search-bar__results",a.length>0){const e=document.createElement("ul");e.className="designbase-wc-search-bar__results-list",a.forEach((t,i)=>{const s=document.createElement("li");s.className="designbase-wc-search-bar__result-item",s.textContent=this.formatSearchResult(t),s.addEventListener("mousedown",e=>{e.preventDefault(),this.isFocused=!1,this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-search-result-click",{detail:{result:t,index:i},bubbles:!0,composed:!0}))}),e.append(s)}),t.append(e)}else{const e=document.createElement("div");e.className="designbase-wc-search-bar__results-empty",e.textContent="검색 결과가 없습니다.",t.append(e)}return this.dropdown.append(t),void this.attachDropdownPortal()}if(this.hasAttribute("enable-recent-searches")&&!e&&this.recentSearches.length>0){const t=document.createElement("div");t.className=`designbase-wc-search-bar__recent-searches designbase-wc-search-bar__recent-searches--${o}`;const e=document.createElement("div");e.className="designbase-wc-search-bar__recent-header";const i=document.createElement("span");i.className="designbase-wc-search-bar__recent-title",i.textContent="최근 검색어";const s=document.createElement("button");s.type="button",s.className="designbase-wc-search-bar__clear-all-button",s.setAttribute("aria-label","모든 최근 검색어 삭제"),s.textContent="전체 삭제",s.addEventListener("mousedown",t=>{t.preventDefault(),this.recentSearches=[];try{localStorage.removeItem(this.getRecentSearchesKey())}catch{}this.updateDropdown()}),e.append(i,s);const n=document.createElement("div");n.className="designbase-wc-search-bar__recent-list",this.recentSearches.forEach(t=>{const e=document.createElement("div");e.className="designbase-wc-search-bar__recent-item";const i=document.createElement("button");i.type="button",i.className="designbase-wc-search-bar__recent-search-button",i.textContent=t,i.addEventListener("mousedown",e=>{if(e.preventDefault(),!this.input)return;this.input.value=t,this.setAttribute("value",t),this.syncValueState(),this.syncPlaceholder(),this.handleSearch(t);const i={value:t};this.dispatchEvent(new CustomEvent("db-input",{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:i,bubbles:!0,composed:!0})),this.isFocused=!1,this.updateDropdown()});const s=document.createElement("button");s.type="button",s.className="designbase-wc-search-bar__recent-remove-button",s.setAttribute("aria-label",`${t} 삭제`),s.append(createDbIcon("close",getDbComponentIconSize("s"))),s.addEventListener("mousedown",e=>{e.preventDefault(),this.recentSearches=this.recentSearches.filter(e=>e!==t),this.saveRecentSearches(),this.updateDropdown()}),e.append(i,s),n.append(e)}),t.append(e,n),this.dropdown.append(t)}if(s.length>0&&!e){const t=document.createElement("div");t.className="designbase-wc-search-bar__suggestions";const e=document.createElement("div");e.className="designbase-wc-search-bar__suggestions-header";const i=document.createElement("span");i.className="designbase-wc-search-bar__suggestions-title",i.textContent="추천 검색어",e.append(i);const n=document.createElement("div");n.className="designbase-wc-search-bar__suggestions-list",s.forEach((t,e)=>{const i=document.createElement("button");i.type="button",i.className=["designbase-wc-search-bar__suggestion-item",e===this.currentSuggestion&&"designbase-wc-search-bar__suggestion-item--active"].filter(Boolean).join(" "),i.textContent=t,i.addEventListener("mousedown",e=>{if(e.preventDefault(),!this.input)return;this.clearSuggestionInterval(),this.input.value=t,this.setAttribute("value",t),this.syncValueState(),this.syncPlaceholder(),this.handleSearch(t);const i={value:t};this.dispatchEvent(new CustomEvent("db-input",{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:i,bubbles:!0,composed:!0})),this.isFocused=!1,this.updateDropdown()}),n.append(i)}),t.append(e,n),this.dropdown.append(t)}if(r&&!e&&(!this.hasAttribute("enable-recent-searches")||0===this.recentSearches.length)&&0===s.length){const t=document.createElement("div");t.className="designbase-wc-search-bar__empty-state",t.textContent=r,this.dropdown.append(t)}this.attachDropdownPortal()}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.hasAttribute("disabled"),s=this.hasAttribute("readonly"),n=this.hasAttribute("full-width"),a=this.hasAttribute("show-shortcut"),r=this.getAttribute("value")??this.getAttribute("default-value")??"",o=Boolean(r.trim()),l=this.getIconPx();this.className=["designbase-wc-search-bar",`designbase-wc-search-bar--${SIZES$i.includes(t)?t:"m"}`,`designbase-wc-search-bar--${VARIANTS$f.includes(e)?e:"default"}`,i&&"designbase-wc-search-bar--disabled",s&&"designbase-wc-search-bar--readonly",n&&"designbase-wc-search-bar--full-width",o&&"designbase-wc-search-bar--has-value"].filter(Boolean).join(" "),this.setAttribute("role","search"),this.clearSuggestionInterval(),this.detachDropdownPortal(),this.replaceChildren();const h=document.createElement("div");h.className="designbase-wc-search-bar__container";const d=document.createElement("div");d.className="designbase-wc-search-bar__search-icon",d.setAttribute("aria-hidden","true"),d.append(createDbIcon("search",l));const u=document.createElement("input");if(u.type="text",u.className="designbase-wc-search-bar__input",u.value=r,u.disabled=i,u.readOnly=s,u.setAttribute("aria-label","검색어 입력"),this.input=u,a){const e=document.createElement("db-badge");e.className="designbase-wc-search-bar__shortcut-badge",e.setAttribute("size","l"===t?"m":"s"),e.setAttribute("variant","secondary"),e.setAttribute("badge-style","text"),e.setAttribute("aria-hidden","true"),e.textContent=this.getAttribute("shortcut-label")||"⌘K",e.hidden=o||i||s,this.shortcutBadge=e,h.append(d,u,e)}else h.append(d,u);const p=document.createElement("button");p.type="button",p.className="designbase-wc-search-bar__clear-button",p.setAttribute("aria-label","검색어 지우기"),p.hidden=!o||i||s,p.append(createDbIcon("close",l)),this.clearButton=p,h.append(p);const m=document.createElement("div");m.className="designbase-wc-search-bar__dropdown",m.hidden=!0,m.addEventListener("mousedown",t=>{t.preventDefault()}),this.dropdown=m,u.addEventListener("input",()=>{this.setAttribute("value",u.value),this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),this.syncSuggestionRolling();const t={value:u.value};this.dispatchEvent(new CustomEvent("db-input",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:t,bubbles:!0,composed:!0}))}),u.addEventListener("keydown",t=>{"Enter"===t.key&&this.handleSearch()}),u.addEventListener("focus",()=>{this.isFocused=!0,this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-focus",{bubbles:!0,composed:!0}))}),u.addEventListener("blur",()=>{this.isFocused=!1,this.blurTimer&&clearTimeout(this.blurTimer),this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-blur",{bubbles:!0,composed:!0}))}),p.addEventListener("click",()=>{u.value="",this.setAttribute("value",""),this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),this.syncSuggestionRolling(),u.focus(),this.dispatchEvent(new CustomEvent("db-clear",{bubbles:!0,composed:!0}));const t={value:""};this.dispatchEvent(new CustomEvent("db-input",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:t,bubbles:!0,composed:!0}))}),this.append(h,m),this.syncIcons(),this.syncPlaceholder(),this.syncSuggestionRolling(),this.bindGlobalShortcut(),this.updateDropdown()}}customElements.get("db-search-bar")||customElements.define("db-search-bar",DbSearchBar);const SHARE_ICON_PATHS={facebook:'<path fill="currentColor" d="M2.002 12.001c0 4.99 3.656 9.126 8.437 9.879v-6.988h-2.54v-2.891h2.54V9.798c0-2.508 1.493-3.891 3.776-3.891q1.095 0 2.24.195V8.56h-1.264c-1.24 0-1.628.772-1.628 1.563v1.875h2.771l-.443 2.891h-2.328v6.988C18.344 21.129 22 16.992 22 12.001c0-5.522-4.477-10-9.999-10-5.522.001-10 4.478-10 10"/>',x:'<path fill="currentColor" d="M17.801 3h3.066l-6.731 7.638L22 21h-6.171l-4.832-6.297L5.466 21H2.4l7.13-8.17L2 3h6.325l4.365 5.752zm-1.073 16.207h1.7L7.432 4.727H5.605z"/>',instagram:'<path fill="currentColor" fill-rule="evenodd" d="M7.376 12a4.623 4.623 0 1 0 9.246.002A4.623 4.623 0 0 0 7.376 12m1.619 0a3.003 3.003 0 1 1 6.007.001 3.003 3.003 0 0 1-6.007 0m8.889-4.793a1.078 1.078 0 1 0-2.156 0 1.078 1.078 0 0 0 2.156 0m.016-3.728a6.6 6.6 0 0 0-2.186-.42c-.963-.042-1.268-.054-3.71-.054s-2.755 0-3.71.054a6.6 6.6 0 0 0-2.184.42A4.6 4.6 0 0 0 3.477 6.11a6.6 6.6 0 0 0-.419 2.186c-.043.962-.056 1.267-.056 3.71s0 2.753.056 3.71c.015.748.156 1.486.419 2.187a4.6 4.6 0 0 0 2.634 2.632 6.6 6.6 0 0 0 2.185.45c.963.042 1.268.055 3.71.055s2.755 0 3.71-.055a6.6 6.6 0 0 0 2.186-.42 4.61 4.61 0 0 0 2.633-2.632c.263-.7.404-1.438.419-2.186.043-.962.056-1.267.056-3.71s0-2.753-.056-3.71a6.6 6.6 0 0 0-.421-2.217A4.6 4.6 0 0 0 17.9 3.479m1.104 13.852a2.99 2.99 0 0 1-1.712 1.71 5 5 0 0 1-1.67.312c-.95.044-1.218.055-3.654.055-2.438 0-2.687 0-3.655-.055a5 5 0 0 1-1.67-.311 2.99 2.99 0 0 1-1.718-1.711 5.1 5.1 0 0 1-.311-1.67c-.043-.95-.053-1.217-.053-3.653s0-2.686.053-3.655a5 5 0 0 1 .311-1.687c.305-.79.93-1.41 1.719-1.712a5 5 0 0 1 1.669-.311c.95-.043 1.218-.055 3.655-.055s2.687 0 3.654.055a5 5 0 0 1 1.67.31 3 3 0 0 1 1.712 1.713 5.1 5.1 0 0 1 .311 1.669c.043.95.054 1.218.054 3.655s0 2.698-.043 3.654h-.011v-.001a5 5 0 0 1-.311 1.688" clip-rule="evenodd"/>',linkedin:'<path fill="currentColor" fill-rule="evenodd" d="M17 21v-6.75c0-1.059-1.188-1.944-2.246-1.944-1.06 0-1.754.885-1.754 1.944V21H9V9h4v2c.662-1.071 2.356-1.763 3.525-1.763C18.997 9.237 21 11.28 21 13.75V21zM3 21V9h4v12zM7 5a2 2 0 1 1-4 0 2 2 0 0 1 4 0" clip-rule="evenodd"/>',pinterest:'<path fill="currentColor" d="M12 2C6.474 2 2 6.478 2 12.008a10 10 0 0 0 6.351 9.316c-.09-.797-.165-1.999.03-2.87.18-.782 1.172-4.974 1.172-4.974s-.3-.601-.3-1.488c0-1.397.81-2.434 1.801-2.434.856 0 1.261.646 1.261 1.413 0 .856-.54 2.149-.825 3.335-.24.992.495 1.804 1.486 1.804 1.772 0 3.138-1.879 3.138-4.583 0-2.39-1.727-4.072-4.174-4.072-2.838 0-4.52 2.133-4.52 4.342 0 .857.33 1.788.751 2.284.075.105.09.18.075.286-.075.315-.24.991-.27 1.127-.045.18-.15.225-.33.135-1.247-.586-2.027-2.404-2.027-3.877 0-3.155 2.297-6.056 6.606-6.056 3.469 0 6.156 2.48 6.156 5.77 0 3.442-2.177 6.222-5.18 6.222-1.006 0-1.967-.526-2.297-1.142l-.616 2.374c-.225.871-.84 1.953-1.246 2.63.931.285 1.922.45 2.958.45 5.526 0 10-4.478 10-10.007C22 6.478 17.526 2 12 2"/>',whatsapp:'<path fill="currentColor" d="M12.042 2a9.92 9.92 0 0 1 7.044 2.906A9.83 9.83 0 0 1 22 11.918c-.003 5.464-4.47 9.91-9.958 9.91h-.005a10 10 0 0 1-4.758-1.206L2 22l1.413-5.136a9.86 9.86 0 0 1-1.329-4.954C2.086 6.446 6.553 2 12.042 2M8.516 7.333a.92.92 0 0 0-.663.31c-.228.249-.872.848-.872 2.066s.89 2.394 1.016 2.562c.124.165 1.722 2.746 4.251 3.739 2.101.825 2.53.661 2.985.62.457-.041 1.473-.6 1.68-1.178s.208-1.074.146-1.178-.229-.165-.478-.289-1.472-.723-1.7-.805-.394-.124-.56.124-.643.805-.788.97c-.145.166-.29.187-.539.063s-1.05-.386-2-1.23c-.74-.656-1.239-1.466-1.385-1.714s-.015-.383.11-.506c.111-.111.248-.29.373-.434.124-.144.166-.248.249-.413s.04-.31-.022-.434c-.062-.123-.545-1.348-.766-1.838-.187-.413-.383-.422-.56-.43z"/>',telegram:'<path fill="currentColor" d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m4.08 6.012c-.375.008-.958.209-3.73 1.366-.975.408-2.915 1.248-5.829 2.514-.466.191-.716.375-.74.558-.042.35.457.458 1.081.657.517.167 1.2.358 1.558.367.325.008.682-.125 1.082-.4 2.72-1.838 4.118-2.77 4.213-2.789.066-.017.15-.033.208.017s.059.15.05.175c-.05.208-2.604 2.537-2.755 2.689-.566.583-1.208.94-.217 1.59.858.566 1.349.924 2.231 1.499.558.366 1 .799 1.583.749.266-.025.54-.275.682-1.024.333-1.765.982-5.603 1.132-7.185.017-.133 0-.308-.017-.392a.44.44 0 0 0-.141-.274c-.125-.1-.308-.117-.39-.117"/>',mail:'<path fill="currentColor" fill-rule="evenodd" d="m1.665 8.67.67-1.34L12 12.161l9.665-4.833.67 1.342L12 13.839z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V7c0-.69-.56-1.25-1.25-1.25zM1.25 7A2.75 2.75 0 0 1 4 4.25h16A2.75 2.75 0 0 1 22.75 7v10A2.75 2.75 0 0 1 20 19.75H4A2.75 2.75 0 0 1 1.25 17z" clip-rule="evenodd"/>',link:'<path fill="currentColor" fill-rule="evenodd" d="m15.344 9.698-5.657 5.657-1.06-1.06 5.657-5.657z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M17.819 6.163a4.25 4.25 0 0 0-6.01 0l-1.415 1.414-1.06-1.06 1.414-1.414a5.75 5.75 0 0 1 8.132 8.132l-1.416 1.414-1.06-1.062 1.415-1.413a4.25 4.25 0 0 0 0-6.01M6.154 11.818l1.412-1.412-.53-.531-.53-.53-1.414 1.414-.003.003c-2.22 2.244-2.211 5.86.029 8.075 2.245 2.22 5.824 2.31 8.102.056l.003-.003 1.414-1.414-1.06-1.06-1.412 1.41v.002c-1.67 1.65-4.308 1.608-5.993-.057-1.645-1.627-1.659-4.293-.018-5.953" clip-rule="evenodd"/>',copy:'<path fill="currentColor" fill-rule="evenodd" d="M8 3.75a.25.25 0 0 0-.25.25v12c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V4a.25.25 0 0 0-.25-.25zM6.25 4c0-.966.784-1.75 1.75-1.75h12c.966 0 1.75.784 1.75 1.75v12A1.75 1.75 0 0 1 20 17.75H8A1.75 1.75 0 0 1 6.25 16z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M3.75 9v9A2.25 2.25 0 0 0 6 20.25h9v1.5H6A3.75 3.75 0 0 1 2.25 18V9z" clip-rule="evenodd"/>',"scan-qrcode":'<path fill="currentColor" d="M2.25 4c0-.964.786-1.75 1.75-1.75h3v1.5H4a.253.253 0 0 0-.25.25v3h-1.5zM20.25 4a.253.253 0 0 0-.25-.25h-3v-1.5h3c.964 0 1.75.786 1.75 1.75v3h-1.5zM20.25 20v-3h1.5v3c0 .964-.786 1.75-1.75 1.75h-3v-1.5h3c.136 0 .25-.114.25-.25M2.25 20v-3h1.5v3c0 .136.114.25.25.25h3v1.5H4c-.964 0-1.75-.786-1.75-1.75M9.5 7.5v2h-2v-2zM11 6H6v5h5zM16.5 7.5v2h-2v-2zM18 6h-5v5h5zM9.5 14.5v2h-2v-2zM11 13H6v5h5zM14.5 16.5H13V18h1.5zM18 15h-1.5v3H18z"/><path fill="currentColor" d="M18 15h-3v1.5h3zM14.5 13H13v1.5h1.5z"/>',"share-alt":'<path fill="currentColor" fill-rule="evenodd" d="M13.69 3.317a.75.75 0 0 1 .804.119l8 7a.75.75 0 0 1 0 1.128l-8 7A.75.75 0 0 1 13.25 18v-3.24c-1.925.051-3.579.315-5.062.932-1.659.692-3.157 1.85-4.588 3.758A.75.75 0 0 1 2.25 19c0-4.145 1.147-6.888 3.291-8.698 1.96-1.655 4.655-2.437 7.709-2.943V4a.75.75 0 0 1 .44-.683m1.06 2.336V8a.75.75 0 0 1-.638.742c-3.283.497-5.85 1.225-7.603 2.706-1.359 1.147-2.303 2.812-2.631 5.39 1.153-1.15 2.386-1.969 3.734-2.53 1.928-.804 4.04-1.058 6.388-1.058a.75.75 0 0 1 .75.75v2.347L20.861 11z" clip-rule="evenodd"/>'},PLATFORM_ICON_MAP={facebook:"facebook",x:"x",instagram:"instagram",linkedin:"linkedin",pinterest:"pinterest",whatsapp:"whatsapp",telegram:"telegram",email:"mail",link:"link",qr:"scan-qrcode"};function createShareIcon(t,e=24){const i=document.createElement("template");return i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="${e}" height="${e}" aria-hidden="true" focusable="false" data-designbase-icon="${t}">${SHARE_ICON_PATHS[t]}</svg>`,i.content.firstElementChild}function createSharePlatformIcon(t,e=24){return createShareIcon(PLATFORM_ICON_MAP[t],e)}const DEFAULT_PLATFORMS=["facebook","x","linkedin","whatsapp","email","link"],PLATFORM_CONFIGS={facebook:{name:"Facebook",color:"#1877f2",shareUrl:"https://www.facebook.com/sharer/sharer.php?u={url}"},x:{name:"X",color:"#000000",shareUrl:"https://twitter.com/intent/tweet?url={url}&text={title}&hashtags={hashtags}"},instagram:{name:"Instagram",color:"#e4405f",shareUrl:"https://www.instagram.com/",customShare:()=>{window.alert("Instagram에 직접 공유하려면 링크를 복사하여 사용하세요.")}},linkedin:{name:"LinkedIn",color:"#0077b5",shareUrl:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},pinterest:{name:"Pinterest",color:"#bd081c",shareUrl:"https://pinterest.com/pin/create/button/?url={url}&description={title}&media={imageUrl}"},whatsapp:{name:"WhatsApp",color:"#25d366",shareUrl:"https://wa.me/?text={title}%20{url}"},telegram:{name:"Telegram",color:"#0088cc",shareUrl:"https://t.me/share/url?url={url}&text={title}"},email:{name:"이메일",color:"#ea4335",shareUrl:"mailto:?subject={title}&body={description}%20{url}"},link:{name:"링크 복사",color:"#6c757d",shareUrl:""},qr:{name:"QR 코드",color:"#6c757d",shareUrl:""}};class DbShare extends HTMLElement{constructor(){super(...arguments),this.isCopied=!1,this.qrCodeData="",this.copyResetTimer=null,this.modalEl=null,this.contentSlot=null,this.dropdownEl=null}static get observedAttributes(){return["url","title","description","image-url","hashtags","variant","size","position","platforms","button-text","modal-title","show-qr-code","qr-code-size","copy-success-message","open"]}connectedCallback(){this.render()}disconnectedCallback(){this.copyResetTimer&&clearTimeout(this.copyResetTimer)}attributeChangedCallback(t){"open"===t&&"modal"===this.getAttribute("variant")&&this.modalEl?this.syncModalOpen():"url"===t&&this.contentSlot?this.refreshLinkInputValue():this.render()}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open","true"):this.removeAttribute("open")}parseListAttribute(t){const e=this.getAttribute(t);if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(t=>String(t).trim()).filter(Boolean)}catch{}return e.split(",").map(t=>t.trim()).filter(Boolean)}getResolvedUrl(){const t=this.getAttribute("url");return t||("undefined"!=typeof window&&window.location?.href?window.location.href:"")}getContext(){return{url:this.getResolvedUrl(),title:this.getAttribute("share-title")||this.getAttribute("title")||"",description:this.getAttribute("description")||"",imageUrl:this.getAttribute("image-url")||"",hashtags:this.parseListAttribute("hashtags"),host:this}}getActivePlatforms(){const t=this.parseListAttribute("platforms");return(t.length>0?t:DEFAULT_PLATFORMS).filter(t=>t in PLATFORM_CONFIGS)}replaceUrlVariables(t,e){return t.replace("{url}",encodeURIComponent(e.url)).replace("{title}",encodeURIComponent(e.title)).replace("{description}",encodeURIComponent(e.description)).replace("{imageUrl}",encodeURIComponent(e.imageUrl)).replace("{hashtags}",e.hashtags.join(","))}async handleCopyLink(t){try{await navigator.clipboard.writeText(t.url),this.isCopied=!0,this.dispatchEvent(new CustomEvent("db-copy-success",{bubbles:!0,composed:!0,detail:{url:t.url}})),this.refreshContent(),this.copyResetTimer&&clearTimeout(this.copyResetTimer),this.copyResetTimer=setTimeout(()=>{this.isCopied=!1,this.refreshContent()},3e3)}catch(t){this.dispatchEvent(new CustomEvent("db-copy-error",{bubbles:!0,composed:!0,detail:{error:t}}))}}handleShowQrCode(t){if(this.qrCodeData=t.url,"modal"===this.getAttribute("variant"))return this.open=!0,void this.refreshContent();this.refreshContent()}handlePlatformShare(t){const e=this.getContext(),i=PLATFORM_CONFIGS[t];if(i)try{if("link"===t)this.handleCopyLink(e);else if("qr"===t)this.handleShowQrCode(e);else if(i.customShare)i.customShare(e);else if(i.shareUrl){const t=this.replaceUrlVariables(i.shareUrl,e);window.open(t,"_blank","width=600,height=400")}this.dispatchEvent(new CustomEvent("db-share",{bubbles:!0,composed:!0,detail:{platform:t,url:e.url}}))}catch(e){this.dispatchEvent(new CustomEvent("db-share-error",{bubbles:!0,composed:!0,detail:{platform:t,error:e}}))}}getPlacement(){const t=this.getAttribute("position")||"bottom";return"top"===t||"left"===t?"top-left":"right"===t?"bottom-right":"bottom-left"}mapButtonSize(){const t=this.getAttribute("size")||"m";return"s"===t?"s":"l"===t?"l":"m"}createTriggerButton(t){const e=document.createElement("db-button");return e.className=t||"designbase-wc-share__trigger",e.setAttribute("variant","secondary"),e.setAttribute("size",this.mapButtonSize()),e.textContent=this.getAttribute("button-text")||"공유",e.prepend(createShareIcon("share-alt",16)),e.addEventListener("db-click",()=>{"modal"!==this.getAttribute("variant")?this.open=!this.open:this.open=!0}),e}createPlatformIcon(t){const e=document.createElement("span");return e.className="designbase-wc-share__platform-icon",e.append(createSharePlatformIcon(t,24)),e}createPlatformButton(t){const e=PLATFORM_CONFIGS[t],i=document.createElement("button");i.type="button",i.className=["designbase-wc-share__platform-button",`designbase-wc-share__platform-button--${t}`,"link"===t&&this.isCopied?"designbase-wc-share__platform-button--copied":""].filter(Boolean).join(" "),i.style.setProperty("--platform-color",e.color),i.title=e.name,i.setAttribute("aria-label",`${e.name}에 공유하기`),i.append(this.createPlatformIcon(t));const s=document.createElement("span");if(s.className="designbase-wc-share__platform-name",s.textContent=e.name,i.append(s),"link"===t&&this.isCopied){const t=document.createElement("span");t.className="designbase-wc-share__copy-success",t.append(createShareIcon("copy",12));const e=document.createElement("span");e.textContent="복사됨!",t.append(e),i.append(t)}return i.addEventListener("click",()=>this.handlePlatformShare(t)),i}createLinkInput(t){const e=document.createElement("db-input");return e.className="designbase-wc-share__link-input",e.setAttribute("type","text"),e.setAttribute("readonly",""),e.setAttribute("size","s"),e.setAttribute("full-width",""),e.setAttribute("value",t),customElements.whenDefined("db-input").then(()=>{e.setAttribute("value",t),e.value=t}),e}refreshLinkInputValue(){const t=this.getResolvedUrl(),e=this.contentSlot?.querySelector("db-input.designbase-wc-share__link-input");e&&(e.setAttribute("value",t),e.value=t)}createCopyButton(t){const e=document.createElement("db-button");e.className="designbase-wc-share__copy-button",e.setAttribute("size","s"),e.setAttribute("variant","primary");const i=document.createElement("span");return i.className="designbase-wc-button__start-icon",i.setAttribute("aria-hidden","true"),i.append(createShareIcon(this.isCopied?"copy":"link",16)),e.append(i),e.append(document.createTextNode(this.isCopied?"복사됨!":"복사")),e.addEventListener("db-click",()=>{this.handleCopyLink(t)}),e}generateQrCodeUrl(){const t=Number(this.getAttribute("qr-code-size")||200);return`https://api.qrserver.com/v1/create-qr-code/?size=${t}x${t}&data=${encodeURIComponent(this.qrCodeData)}`}createShareContent(){const t=document.createElement("div");return t.className="designbase-wc-share__content",this.populateShareContent(t),t}populateShareContent(t){const e=document.createElement("div");e.className="designbase-wc-share__platforms",this.getActivePlatforms().forEach(t=>{e.append(this.createPlatformButton(t))}),t.append(e);if("false"!==this.getAttribute("show-qr-code")&&this.qrCodeData){const e=document.createElement("div");e.className="designbase-wc-share__qr-section";const i=document.createElement("h4");i.className="designbase-wc-share__qr-title",i.textContent="QR 코드",e.append(i);const s=document.createElement("div");s.className="designbase-wc-share__qr-code";const n=document.createElement("img"),a=Number(this.getAttribute("qr-code-size")||200);n.src=this.generateQrCodeUrl(),n.alt="QR Code",n.width=a,n.height=a,s.append(n),e.append(s);const r=document.createElement("p");r.className="designbase-wc-share__qr-description",r.textContent="QR 코드를 스캔하여 링크에 접속하세요",e.append(r),t.append(e)}const i=this.getContext(),s=document.createElement("div");s.className="designbase-wc-share__link-preview";const n=document.createElement("h4");n.className="designbase-wc-share__link-title",n.textContent="공유 링크",s.append(n);const a=document.createElement("div");a.className="designbase-wc-share__link-container",a.append(this.createLinkInput(i.url)),a.append(this.createCopyButton(i)),s.append(a),t.append(s)}refreshContent(){const t=this.getAttribute("variant");if("inline"===t){const t=this.querySelector(":scope > .designbase-wc-share__content");return void t?.replaceWith(this.createShareContent())}"modal"===t&&this.contentSlot&&(this.contentSlot.replaceChildren(),this.populateShareContent(this.contentSlot))}syncModalOpen(){this.modalEl&&(this.open?(this.refreshLinkInputValue(),this.modalEl.setAttribute("open","true")):this.modalEl.removeAttribute("open"))}renderDropdown(){const t=document.createElement("db-dropdown");t.className="designbase-wc-share__dropdown",t.setAttribute("placement",this.getPlacement()),t.setAttribute("label",this.getAttribute("button-text")||"공유"),t.setAttribute("trigger-variant","secondary"),t.setAttribute("trigger-icon","share-alt"),t.setAttribute("size",this.mapButtonSize()),t.setAttribute("items",JSON.stringify(this.getActivePlatforms().map(t=>({id:t,label:PLATFORM_CONFIGS[t].name})))),t.addEventListener("db-change",t=>{const e=t.detail,i=e?.id;i&&this.handlePlatformShare(i)}),this.dropdownEl=t,this.append(t)}renderModal(){const t=this.createTriggerButton();this.append(t);const e=document.createElement("db-modal");e.className="designbase-wc-share__modal",e.setAttribute("title",this.getAttribute("modal-title")||"공유하기"),e.setAttribute("size","m"),this.contentSlot=document.createElement("div"),this.contentSlot.className="designbase-wc-share designbase-wc-share__content",this.contentSlot.setAttribute("data-modal-part","body"),this.populateShareContent(this.contentSlot),e.append(this.contentSlot),e.addEventListener("db-close",()=>{this.open=!1,this.qrCodeData="",this.contentSlot&&(this.contentSlot.replaceChildren(),this.populateShareContent(this.contentSlot))}),this.modalEl=e,this.append(e),this.syncModalOpen()}render(){const t=this.getAttribute("variant")||"button";this.className=`designbase-wc-share designbase-wc-share--${t}`,this.replaceChildren(),this.modalEl=null,this.contentSlot=null,this.dropdownEl=null,"inline"!==t?"dropdown"!==t?"modal"!==t?this.append(this.createTriggerButton()):this.renderModal():this.renderDropdown():this.append(this.createShareContent())}}customElements.get("db-share")||customElements.define("db-share",DbShare);const VARIANTS$e=["primary","white","dark"];class DbTopBanner extends HTMLElement{static get observedAttributes(){return["badge-text","content","image","link-text","variant","fixed","dismissed"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}isDarkBg(t){return"primary"===t||"dark"===t}createLinkButton(t,e){const i=this.isDarkBg(t),s=document.createElement("db-button");s.setAttribute("variant",i?"secondary":"ghost"),s.setAttribute("size","s"),s.classList.add("designbase-wc-top-banner__link");const n=document.createElement("span");n.textContent=e;const a=document.createElement("span");return a.className="designbase-wc-button__end-icon",a.append(createDbIcon("chevron-right",16)),s.append(n,a),s.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-link",{bubbles:!0,composed:!0}))}),s}createCloseButton(){const t=document.createElement("db-button");return t.setAttribute("variant","ghost"),t.setAttribute("size","m"),t.setAttribute("icon-only",""),t.setAttribute("aria-label","닫기"),t.classList.add("designbase-wc-top-banner__close"),t.append(createDbIcon("close",20)),t.addEventListener("db-click",()=>{this.setAttribute("dismissed",""),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0})),this.render()}),t}createBadge(t,e){const i=document.createElement("db-badge");return i.setAttribute("size","s"),i.setAttribute("variant",e?"secondary":"primary"),i.setAttribute("badge-style","text"),i.textContent=t,i.classList.add("designbase-wc-top-banner__badge"),i}render(){if(this.hasAttribute("dismissed"))return this.replaceChildren(),this.className="designbase-wc-top-banner designbase-wc-top-banner--dismissed",void(this.style.display="none");this.style.display="";const t=this.getAttribute("badge-text")||"",e=this.getAttribute("content")||"",i=this.getAttribute("image")||"",s=this.getAttribute("link-text")||"",n=this.getAttribute("variant")||"primary",a=VARIANTS$e.includes(n)?n:"primary",r=this.hasAttribute("fixed"),o=this.isDarkBg(a);if(this.className=["designbase-wc-top-banner",`designbase-wc-top-banner--${a}`,r&&"designbase-wc-top-banner--fixed",i&&"designbase-wc-top-banner--has-image"].filter(Boolean).join(" "),this.setAttribute("role","alert"),i?this.style.setProperty("--db-top-banner-bg-image",`url("${i}")`):this.style.removeProperty("--db-top-banner-bg-image"),this.replaceChildren(),i){const t=document.createElement("div");t.className="designbase-wc-top-banner__background",t.setAttribute("aria-hidden","true");const e=document.createElement("div");e.className="designbase-wc-top-banner__overlay",e.setAttribute("aria-hidden","true"),this.append(t,e)}const l=document.createElement("div");l.className="designbase-wc-top-banner__container";const h=document.createElement("div");h.className="designbase-wc-top-banner__content",t&&h.append(this.createBadge(t,o));const d=document.createElement("span");d.className="designbase-wc-top-banner__text",d.textContent=e,h.append(d),s&&h.append(this.createLinkButton(a,s)),l.append(h),l.append(this.createCloseButton()),this.append(l)}}customElements.get("db-top-banner")||customElements.define("db-top-banner",DbTopBanner);const SIZES$h=["s","m","l"],VARIANTS$d=["default","minimal","card","colored","iconBox"],LAYOUTS$1=["horizontal","vertical","reverse"],COLORS$1=["primary","secondary","success","warning","error","info","custom"],ICON_BOX_GLYPH_PX={s:16,m:20,l:24};class DbStat extends HTMLElement{constructor(){super(...arguments),this.handleClick=()=>{!this.hasAttribute("disabled")&&this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{this.hasAttribute("clickable")&&!this.hasAttribute("disabled")&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["value","label","icon","icon-position","size","variant","layout","color","custom-color","progress","show-progress","change","show-change","description","show-description","clickable","disabled","animated"]}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.render()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(){this.render()}parseChange(){const t=this.getAttribute("change");if(!t)return null;try{const e=JSON.parse(t);if(e&&"number"==typeof e.value&&e.type)return e}catch{}return null}getChangeText(t){const e="increase"===t.type?"+":"-",i=t.period?` ${t.period}`:"";return`${e}${Math.abs(t.value)}%${i}`}resolveIconName(t){if(!t)return;return t in{user:1,sparkle:1,award:1,bulb:1,edit:1,search:1}?t:void 0}getProgressVariant(t){return"primary"===t?"primary":"success"===t?"success":"warning"===t?"warning":"error"===t?"danger":"default"}render(){const t=this.getAttribute("value")??"",e=this.getAttribute("label")||"",i=this.getAttribute("icon")||"",s=this.getAttribute("icon-position")||"left",n=this.getAttribute("size")||"m",a=SIZES$h.includes(n)?n:"m",r=this.getAttribute("variant")||"default",o=VARIANTS$d.includes(r)?r:"default",l=this.getAttribute("layout")||"horizontal",h=LAYOUTS$1.includes(l)?l:"horizontal",d=this.getAttribute("color")||"primary",u=COLORS$1.includes(d)?d:"primary",p=this.getAttribute("custom-color")||"",m=this.getAttribute("progress"),g=null!==m?Number(m):NaN,b=this.hasAttribute("show-progress"),f=this.parseChange(),v=this.hasAttribute("show-change"),y=this.getAttribute("description")||"",E=this.hasAttribute("show-description"),S=this.hasAttribute("clickable"),w=this.hasAttribute("disabled"),_=this.hasAttribute("animated");this.className=["designbase-wc-stat",`designbase-wc-stat--size-${a}`,`designbase-wc-stat--variant-${o}`,`designbase-wc-stat--layout-${h}`,`designbase-wc-stat--color-${u}`,S&&"designbase-wc-stat--clickable",w&&"designbase-wc-stat--disabled",_&&"designbase-wc-stat--animated",b&&"designbase-wc-stat--with-progress",v&&f&&"designbase-wc-stat--with-change",E&&y&&"designbase-wc-stat--with-description"].filter(Boolean).join(" "),p?this.style.setProperty("--stat-color",p):this.style.removeProperty("--stat-color"),S&&!w?(this.setAttribute("role","button"),this.setAttribute("tabindex","0")):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.replaceChildren();const x=document.createElement("div");x.className="designbase-wc-stat__body";const k=this.resolveIconName(i);if(k){const t=document.createElement("div");t.className=`designbase-wc-stat__icon designbase-wc-stat__icon--${s}`;const e="iconBox"===o?ICON_BOX_GLYPH_PX[a]:20;t.append(createDbIcon(k,e)),x.append(t)}const L=document.createElement("div");L.className="designbase-wc-stat__content";const P=document.createElement("div");P.className="designbase-wc-stat__main";const T=document.createElement("div");T.className="designbase-wc-stat__label",T.textContent=e;const D=document.createElement("div");if(D.className="designbase-wc-stat__value",D.textContent=String(t),P.append(T,D),L.append(P),v&&f){const t=document.createElement("div");t.className=["designbase-wc-stat__change","increase"===f.type?"designbase-wc-stat__change--increase":"designbase-wc-stat__change--decrease"].join(" "),t.textContent=this.getChangeText(f),L.append(t)}if(E&&y){const t=document.createElement("div");t.className="designbase-wc-stat__description",t.textContent=y,L.append(t)}if(x.append(L),this.append(x),b&&!Number.isNaN(g)){const t=Math.min(Math.max(g,0),100),e=document.createElement("div");e.className="designbase-wc-stat__progress";const i=document.createElement("db-progressbar");i.setAttribute("value",String(t)),i.setAttribute("size","s"),i.setAttribute("variant",this.getProgressVariant(u)),i.setAttribute("full-width",""),e.append(i),this.append(e)}}}customElements.get("db-stat")||customElements.define("db-stat",DbStat);const RATIOS=["1:1","16:9","4:3","3:2","3:4","2:1","auto"],FITS=["cover","contain","fill","none","scale-down"],LOADINGS=["lazy","eager"],PLACEHOLDERS=["skeleton","blur","none"],ROUNDED=["s","m","l","full"],SHADOWS=["s","m","l"];class DbImage extends HTMLElement{constructor(){super(...arguments),this.imageState="loading",this.currentSrc="",this.showPlaceholder=!1,this.imgEl=null,this.placeholderEl=null,this.errorEl=null,this.initialized=!1,this.handleLoad=()=>{"loaded"!==this.imageState&&(this.imageState="loaded",this.showPlaceholder=!1,this.syncVisualState(),this.dispatchEvent(new CustomEvent("db-load",{bubbles:!0,composed:!0})))},this.handleError=()=>{const t=this.getAttribute("fallback-src")||"";if(t&&this.currentSrc!==t)return this.currentSrc=t,this.imageState="loading",this.updateImageSource(),void this.syncVisualState();this.imageState="error",this.showPlaceholder=!1,this.syncVisualState(),this.dispatchEvent(new CustomEvent("db-error",{bubbles:!0,composed:!0}))},this.handleClick=()=>{this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{this.hasAttribute("clickable")&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["src","alt","ratio","fit","loading","fallback-src","placeholder","rounded","width","height","max-width","max-height","full-width","full-height","shadow","hover","clickable"]}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.resetFromAttributes(),this.ensureStructure(),this.syncVisualState()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(t,e,i){if(e!==i||"src"===t){if("src"===t){const t=i||"";if(t!==this.currentSrc){this.currentSrc=t,this.imageState="loading";const e=this.getAttribute("placeholder")||"none";this.showPlaceholder="none"!==e,this.updateImageSource()}}"placeholder"===t&&(this.showPlaceholder="none"!==(i||"none")&&"loading"===this.imageState),this.ensureStructure(),this.syncVisualState()}else this.syncVisualState()}resetFromAttributes(){this.currentSrc=this.getAttribute("src")||"";const t=this.getAttribute("placeholder")||"none";this.showPlaceholder="none"!==t,this.imageState="loading"}getRoundedClass(){const t=this.getAttribute("rounded");return t?"true"===t||""===t?"designbase-wc-image--rounded":"s"===t?"designbase-wc-image--rounded-sm":"m"===t?"designbase-wc-image--rounded-md":"l"===t?"designbase-wc-image--rounded-lg":ROUNDED.includes(t)?"full"===t?"designbase-wc-image--rounded-full":`designbase-wc-image--rounded-${t}`:"":""}getShadowClass(){const t=this.getAttribute("shadow");return t?"true"===t||""===t?"designbase-wc-image--shadow":SHADOWS.includes(t)?`designbase-wc-image--shadow-${t}`:"":""}getRatioClass(){const t=this.getAttribute("ratio")||"auto";return"auto"===t?"designbase-wc-image--ratio-auto":RATIOS.includes(t)?`designbase-wc-image--ratio-${t.replace(":","-")}`:"designbase-wc-image--ratio-auto"}applyContainerStyle(){const t=this.style,e=this.hasAttribute("full-width"),i=this.hasAttribute("full-height"),s=this.getAttribute("width"),n=this.getAttribute("height"),a=this.getAttribute("max-width"),r=this.getAttribute("max-height");t.width=e?"100%":s||"",t.height=i?"100%":n||"",t.maxWidth=a||"",t.maxHeight=r||""}ensureStructure(){if(!this.initialized){this.placeholderEl=document.createElement("div"),this.placeholderEl.className="designbase-wc-image__placeholder",this.errorEl=document.createElement("div"),this.errorEl.className="designbase-wc-image__error",this.errorEl.append(createDbIcon("gallery",20));const t=document.createElement("span");t.className="designbase-wc-image__error-text",this.errorEl.append(t),this.imgEl=document.createElement("img"),this.imgEl.className="designbase-wc-image__img",this.imgEl.draggable=!1,this.imgEl.addEventListener("load",this.handleLoad),this.imgEl.addEventListener("error",this.handleError),this.append(this.placeholderEl,this.errorEl,this.imgEl),this.initialized=!0}this.updateImageSource(),this.updatePlaceholderContent(),this.updateErrorContent()}updateImageSource(){if(!this.imgEl)return;const t=this.getAttribute("alt")||"",e=this.getAttribute("loading")||"lazy",i=LOADINGS.includes(e)?e:"lazy";this.imgEl.alt=t,this.imgEl.loading=i;const s=this.currentSrc;if(!s)return void this.imgEl.removeAttribute("src");const n=new URL(s,window.location.href).href;this.imgEl.src!==n?this.imgEl.src=s:this.imgEl.complete&&this.imgEl.naturalWidth>0&&"loading"===this.imageState&&this.handleLoad()}updatePlaceholderContent(){if(!this.placeholderEl)return;const t=this.getAttribute("placeholder")||"none",e=PLACEHOLDERS.includes(t)?t:"none";if(this.placeholderEl.className=["designbase-wc-image__placeholder",`designbase-wc-image__placeholder--${e}`].join(" "),this.placeholderEl.replaceChildren(),"skeleton"===e){const t=document.createElement("div");t.className="designbase-wc-image__skeleton",this.placeholderEl.append(t)}if("blur"===e){const t=document.createElement("div");t.className="designbase-wc-image__blur",this.placeholderEl.append(t)}}updateErrorContent(){if(!this.errorEl)return;const t=this.errorEl.querySelector(".designbase-wc-image__error-text");t&&(t.textContent=this.getAttribute("alt")||"이미지를 불러올 수 없습니다")}syncVisualState(){const t=this.getAttribute("fit")||"cover",e=FITS.includes(t)?t:"cover",i=this.hasAttribute("clickable"),s=this.hasAttribute("hover");if(this.className=["designbase-wc-image",this.getRatioClass(),`designbase-wc-image--fit-${e}`,this.getRoundedClass(),this.getShadowClass(),s&&"designbase-wc-image--hover",this.hasAttribute("full-width")&&"designbase-wc-image--full-width",this.hasAttribute("full-height")&&"designbase-wc-image--full-height",i&&"designbase-wc-image--clickable","loading"===this.imageState&&"designbase-wc-image--loading","error"===this.imageState&&"designbase-wc-image--error"].filter(Boolean).join(" "),this.applyContainerStyle(),i?(this.setAttribute("role","button"),this.setAttribute("tabindex","0")):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.placeholderEl){const t=this.showPlaceholder&&"loading"===this.imageState;this.placeholderEl.classList.toggle("designbase-wc-image__placeholder--visible",t),this.placeholderEl.hidden=!t}if(this.errorEl){const t="error"===this.imageState;this.errorEl.hidden=!t}if(this.imgEl){const t=Boolean(this.currentSrc)&&"error"!==this.imageState;this.imgEl.hidden=!t,this.imgEl.classList.toggle("designbase-wc-image__img--loaded","loaded"===this.imageState),this.imgEl.classList.toggle("designbase-wc-image__img--error","error"===this.imageState)}}}customElements.get("db-image")||customElements.define("db-image",DbImage);class DbImagePlaceholder extends HTMLElement{constructor(){super(...arguments),this.handleClick=()=>{this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{this.hasAttribute("clickable")&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["label","show-label","pattern-size","pattern-color","background-color","width","height","aspect-ratio","hover-effect","clickable"]}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.render()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(){this.render()}render(){const t=this.getAttribute("label")||"",e=this.hasAttribute("show-label"),i=Number(this.getAttribute("pattern-size")||20),s=this.getAttribute("pattern-color")||"#f3f3f3",n=this.getAttribute("background-color")||"#e7e7e7",a=this.getAttribute("width")||"100%",r=this.getAttribute("height")||"",o=this.getAttribute("aspect-ratio")||"",l=this.hasAttribute("hover-effect"),h=this.hasAttribute("clickable");this.className=["designbase-wc-image-placeholder",l&&"designbase-wc-image-placeholder--hover",h&&"designbase-wc-image-placeholder--clickable"].filter(Boolean).join(" "),this.style.width=a,this.style.height=r,this.style.aspectRatio=o,h?(this.setAttribute("role","button"),this.setAttribute("tabindex","0")):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.replaceChildren();const d=document.createElement("div");if(d.className="designbase-wc-image-placeholder__pattern",d.style.setProperty("--db-placeholder-bg",n),d.style.setProperty("--db-placeholder-pattern",s),d.style.setProperty("--db-placeholder-size",`${i}px`),d.style.setProperty("--db-placeholder-half-size",i/2+"px"),this.append(d),e&&t){const e=document.createElement("div");e.className="designbase-wc-image-placeholder__label-wrap";const i=document.createElement("span");i.className="designbase-wc-image-placeholder__label",i.textContent=t,e.append(i),this.append(e)}}}customElements.get("db-image-placeholder")||customElements.define("db-image-placeholder",DbImagePlaceholder);const LAYOUTS=["grid","list","gallery","carousel"],COLUMNS$1=["1","2","3","4","5","6"],SPACINGS$2=["xs","s","m","l","xl"];class DbImageList extends HTMLElement{constructor(){super(...arguments),this.lightboxEl=null,this.selectedIndex=null}static get observedAttributes(){return["images","layout","columns","spacing","ratio","fit","rounded","shadow","hover","clickable","lightbox","loading","responsive"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}parseImages(){const t=this.getAttribute("images");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}mapRoundedAttr(){const t=this.getAttribute("rounded");if(t&&"false"!==t)return"true"===t||""===t?"m":t}createImageItem(t,e){const i=document.createElement("div");i.className="designbase-wc-image-list__item";const s=document.createElement("db-image");s.className="designbase-wc-image-list__image",s.setAttribute("src",t.thumbnail||t.src),s.setAttribute("alt",t.alt||t.title||`이미지 ${e+1}`),s.setAttribute("ratio",this.getAttribute("ratio")||"16:9"),s.setAttribute("fit",this.getAttribute("fit")||"cover"),s.setAttribute("loading",this.getAttribute("loading")||"lazy"),s.setAttribute("full-width","");const n=this.mapRoundedAttr();n&&s.setAttribute("rounded",n);const a=this.getAttribute("shadow");if(a&&"false"!==a&&s.setAttribute("shadow","true"===a?"":a),"false"!==this.getAttribute("hover")&&s.setAttribute("hover",""),t.thumbnail&&t.thumbnail!==t.src&&s.setAttribute("fallback-src",t.src),s.addEventListener("db-load",()=>{this.dispatchEvent(new CustomEvent("db-image-load",{bubbles:!0,composed:!0,detail:{image:t,index:e}}))}),s.addEventListener("db-error",()=>{this.dispatchEvent(new CustomEvent("db-image-error",{bubbles:!0,composed:!0,detail:{image:t,index:e}}))}),i.append(s),t.title||t.description){const e=document.createElement("div");if(e.className="designbase-wc-image-list__overlay",t.title){const i=document.createElement("h3");i.className="designbase-wc-image-list__title",i.textContent=t.title,e.append(i)}if(t.description){const i=document.createElement("p");i.className="designbase-wc-image-list__description",i.textContent=t.description,e.append(i)}i.append(e)}if(t.metadata?.date||t.metadata?.size){const e=document.createElement("div");if(e.className="designbase-wc-image-list__metadata",t.metadata.date){const i=document.createElement("span");i.className="designbase-wc-image-list__date",i.textContent=t.metadata.date,e.append(i)}if(t.metadata.size){const i=document.createElement("span");i.className="designbase-wc-image-list__size",i.textContent=t.metadata.size,e.append(i)}i.append(e)}return"false"!==this.getAttribute("clickable")&&i.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-image-click",{bubbles:!0,composed:!0,detail:{image:t,index:e}})),"false"!==this.getAttribute("lightbox")&&this.openLightbox(e)}),i}openLightbox(t){this.selectedIndex=t,this.lightboxEl||(this.lightboxEl=document.createElement("db-lightbox"),this.lightboxEl.addEventListener("db-close",()=>{this.selectedIndex=null,this.lightboxEl?.removeAttribute("open")}),this.lightboxEl.addEventListener("db-image-change",t=>{const e=t.detail;"number"==typeof e?.index&&(this.selectedIndex=e.index)}),this.append(this.lightboxEl));const e=this.parseImages();this.lightboxEl.setAttribute("images",JSON.stringify(e.map((t,e)=>({id:t.id||`image-${e}`,src:t.src,alt:t.alt||t.title||"",title:t.title,description:t.description,thumbnail:t.thumbnail})))),this.lightboxEl.setAttribute("current-index",String(t)),this.lightboxEl.setAttribute("open","")}render(){const t=this.parseImages(),e=this.getAttribute("layout")||"grid",i=this.getAttribute("columns")||"3",s=this.getAttribute("spacing")||"m",n="false"!==this.getAttribute("responsive");this.className=["designbase-wc-image-list",`designbase-wc-image-list--${LAYOUTS.includes(e)?e:"grid"}`,`designbase-wc-image-list--columns-${COLUMNS$1.includes(i)?i:"3"}`,`designbase-wc-image-list--spacing-${SPACINGS$2.includes(s)?s:"m"}`,n&&"designbase-wc-image-list--responsive","false"!==this.getAttribute("clickable")&&"designbase-wc-image-list--clickable","false"!==this.getAttribute("hover")&&"designbase-wc-image-list--hover"].filter(Boolean).join(" ");const a=this.lightboxEl;if(this.replaceChildren(),"carousel"===e){const e=document.createElement("div");e.className="designbase-wc-image-list__carousel",t.forEach((t,i)=>{const s=document.createElement("div");s.className="designbase-wc-image-list__carousel-item",s.append(this.createImageItem(t,i)),e.append(s)}),this.append(e)}else t.forEach((t,e)=>{this.append(this.createImageItem(t,e))});a&&(this.lightboxEl=a,this.append(a),null!==this.selectedIndex&&(a.setAttribute("current-index",String(this.selectedIndex)),a.setAttribute("open","")))}}customElements.get("db-image-list")||customElements.define("db-image-list",DbImageList);const SIZES$g=["s","m","l","xl"];class DbLightbox extends HTMLElement{constructor(){super(...arguments),this.portalEl=null,this.imageEl=null,this.loadingEl=null,this.errorEl=null,this.counterBadge=null,this.prevNav=null,this.nextNav=null,this.currentIndex=0,this.imageLoaded=!1,this.imageError=!1,this.keydownHandler=null,this.boundSrc="",this.handleImageLoad=()=>{this.imageLoaded=!0,this.imageError=!1,this.syncImageLayers()},this.handleImageError=()=>{this.imageLoaded=!1,this.imageError=!0,this.syncImageLayers()}}static get observedAttributes(){return["images","current-index","size","open","enable-keyboard","show-thumbnails","show-counter","show-close-button","show-navigation-buttons","show-toolbar","close-on-backdrop-click","close-on-escape"]}connectedCallback(){this.classList.add("designbase-wc-lightbox-host"),this.syncOpenState()}disconnectedCallback(){this.unmount()}attributeChangedCallback(t,e,i){if("current-index"===t)return this.currentIndex=Number(i||0),this.resetImageState(),void(this.open&&this.refreshView());"open"!==t?"images"===t&&this.open&&this.refreshView():this.syncOpenState()}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}parseImages(){const t=this.getAttribute("images");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}getCurrentImage(){return this.parseImages()[this.currentIndex]||null}resetImageState(){this.imageLoaded=!1,this.imageError=!1,this.boundSrc=""}close(){this.open=!1,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}goTo(t){const e=this.parseImages();if(!e.length)return;const i=(t%e.length+e.length)%e.length;i!==this.currentIndex&&(this.currentIndex=i,this.setAttribute("current-index",String(i)),this.resetImageState(),this.refreshView(),this.dispatchEvent(new CustomEvent("db-image-change",{bubbles:!0,composed:!0,detail:{index:i}})))}createIconButton(t,e,i,s,n,a={}){const r=document.createElement("db-button");r.className=t,r.setAttribute("variant",a.variant||"ghost"),r.setAttribute("size","m"),r.setAttribute("icon-only",""),r.setAttribute("aria-label",s),a.radius&&r.setAttribute("radius",a.radius);const o=document.createElement("span");return o.className="designbase-wc-button__start-icon",o.append(createDbIcon(e,i)),r.append(o),r.addEventListener("db-click",n),r}buildPortal(){const t=this.getAttribute("size")||"l",e=SIZES$g.includes(t)?t:"l",i=document.createElement("div");i.className=`designbase-wc-lightbox designbase-wc-lightbox--size-${e}`,i.setAttribute("data-wc-internal","");const s=document.createElement("div");s.className="designbase-wc-lightbox__overlay";const n=document.createElement("div");n.className="designbase-wc-lightbox__modal";const a=document.createElement("div");a.className="designbase-wc-lightbox__header";const r=document.createElement("div");r.className="designbase-wc-lightbox__title";const o=document.createElement("h3");o.className="designbase-wc-lightbox__title-text";const l=document.createElement("db-badge");l.className="designbase-wc-lightbox__counter",l.setAttribute("size","s"),l.setAttribute("variant","secondary"),l.setAttribute("badge-style","text"),r.append(o,l);const h=document.createElement("div");h.className="designbase-wc-lightbox__header-actions","false"!==this.getAttribute("show-close-button")&&h.append(this.createIconButton("designbase-wc-lightbox__close-button","close",20,"닫기",()=>this.close())),a.append(r,h);const d=document.createElement("div");d.className="designbase-wc-lightbox__content",this.prevNav=this.createIconButton("designbase-wc-lightbox__nav-button designbase-wc-lightbox__nav-button--prev","chevron-left",24,"이전 이미지",()=>this.goTo(this.currentIndex-1),{radius:"pill"}),this.nextNav=this.createIconButton("designbase-wc-lightbox__nav-button designbase-wc-lightbox__nav-button--next","chevron-right",24,"다음 이미지",()=>this.goTo(this.currentIndex+1),{radius:"pill"});const u=document.createElement("div");u.className="designbase-wc-lightbox__image-container",this.errorEl=document.createElement("div"),this.errorEl.className="designbase-wc-lightbox__error",this.errorEl.hidden=!0;const p=createDbIcon("gallery",24);p.classList.add("designbase-wc-lightbox__error-icon"),this.errorEl.append(p);const m=document.createElement("p");m.className="designbase-wc-lightbox__error-text",m.textContent="이미지를 불러올 수 없습니다",this.errorEl.append(m),this.loadingEl=document.createElement("div"),this.loadingEl.className="designbase-wc-lightbox__loading";const g=document.createElement("db-spinner");g.setAttribute("type","circular"),g.setAttribute("size","m"),g.setAttribute("show-label",""),g.setAttribute("label","이미지 로딩 중..."),this.loadingEl.append(g),this.imageEl=document.createElement("img"),this.imageEl.className="designbase-wc-lightbox__image",this.imageEl.draggable=!1,this.imageEl.addEventListener("load",this.handleImageLoad),this.imageEl.addEventListener("error",this.handleImageError),u.append(this.errorEl,this.loadingEl,this.imageEl);const b=document.createElement("div");b.className="designbase-wc-lightbox__description";const f=document.createElement("p");f.className="designbase-wc-lightbox__description-text",b.append(f),"false"!==this.getAttribute("show-navigation-buttons")&&d.append(this.prevNav,this.nextNav),d.append(u,b);const v=document.createElement("div");v.className="designbase-wc-lightbox__thumbnails";const y=document.createElement("div");return y.className="designbase-wc-lightbox__thumbnails-container",v.append(y),n.append(a,d,v),s.append(n),i.append(s),s.addEventListener("click",t=>{t.target===s&&"false"!==this.getAttribute("close-on-backdrop-click")&&this.close()}),this.portalEl=i,this.counterBadge=l,i}syncImageLayers(){this.imageEl&&this.loadingEl&&this.errorEl&&(this.imageEl.classList.toggle("designbase-wc-lightbox__image--loaded",this.imageLoaded),this.loadingEl.hidden=this.imageLoaded||this.imageError,this.errorEl.hidden=!this.imageError,this.imageEl.hidden=this.imageError)}updateThumbnails(){if(!this.portalEl)return;const t=this.portalEl.querySelector(".designbase-wc-lightbox__thumbnails-container"),e=this.portalEl.querySelector(".designbase-wc-lightbox__thumbnails");if(!t||!e)return;const i=this.parseImages(),s="false"!==this.getAttribute("show-thumbnails")&&i.length>1;e.hidden=!s,t.replaceChildren(),s&&i.forEach((e,i)=>{const s=document.createElement("button");s.type="button",s.className=["designbase-wc-lightbox__thumbnail",i===this.currentIndex&&"designbase-wc-lightbox__thumbnail--active"].filter(Boolean).join(" "),s.title=e.title||`이미지 ${i+1}`,s.setAttribute("aria-label",e.alt||e.title||`이미지 ${i+1}`),s.setAttribute("aria-current",i===this.currentIndex?"true":"false");const n=document.createElement("img");n.className="designbase-wc-lightbox__thumbnail-image",n.src=e.thumbnail||e.src,n.alt="",n.draggable=!1,n.loading="lazy",n.decoding="async",s.append(n),s.addEventListener("click",()=>this.goTo(i)),t.append(s)})}loadCurrentImage(){if(!this.imageEl)return;const t=this.getCurrentImage();if(!t?.src)return this.imageEl.removeAttribute("src"),this.resetImageState(),void this.syncImageLayers();this.boundSrc!==t.src&&(this.boundSrc=t.src,this.resetImageState(),this.imageEl.src=t.src,this.imageEl.alt=t.alt||t.title||`이미지 ${this.currentIndex+1}`,this.syncImageLayers(),this.imageEl.complete&&this.imageEl.naturalWidth>0&&this.handleImageLoad())}refreshView(){if(!this.portalEl)return;const t=this.getCurrentImage(),e=this.parseImages(),i=this.portalEl.querySelector(".designbase-wc-lightbox__title-text"),s=this.portalEl.querySelector(".designbase-wc-lightbox__description-text"),n=this.portalEl.querySelector(".designbase-wc-lightbox__description");if(i&&(i.textContent=t?.title||"",i.hidden=!t?.title),this.counterBadge){const t="false"!==this.getAttribute("show-counter")&&e.length>1?`${this.currentIndex+1} / ${e.length}`:"";this.counterBadge.textContent=t,this.counterBadge.hidden=!t}n&&s&&(s.textContent=t?.description||"",n.hidden=!t?.description);const a="false"!==this.getAttribute("show-navigation-buttons")&&e.length>1;this.prevNav&&(this.prevNav.hidden=!a),this.nextNav&&(this.nextNav.hidden=!a),this.loadCurrentImage(),this.updateThumbnails()}mount(){this.portalEl||(this.portalEl=this.buildPortal()),this.portalEl.isConnected||document.body.append(this.portalEl),document.body.style.overflow="hidden",this.keydownHandler||(this.keydownHandler=t=>{this.open&&"false"!==this.getAttribute("enable-keyboard")&&("Escape"===t.key&&"false"!==this.getAttribute("close-on-escape")&&(t.preventDefault(),this.close()),"ArrowLeft"===t.key&&this.goTo(this.currentIndex-1),"ArrowRight"===t.key&&this.goTo(this.currentIndex+1))},document.addEventListener("keydown",this.keydownHandler)),this.currentIndex=Number(this.getAttribute("current-index")||0),this.refreshView()}unmount(){this.portalEl?.remove(),document.body.style.overflow="",this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null)}syncOpenState(){this.open?this.mount():this.unmount()}}customElements.get("db-lightbox")||customElements.define("db-lightbox",DbLightbox);const SIZES$f=["s","m","l"],BACKGROUNDS=["default","glass","transparent"];function resolveIcon$1(t){if(t)return t}function mapBadgeVariant(t){return"error"===t?"danger":"warning"===t?"warning":"success"===t?"success":"info"===t?"info":"primary"===t?"primary":"secondary"}class DbBottomNavigation extends HTMLElement{static get observedAttributes(){return["items","active-item-id","size","background-color","fixed"]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}parseItems(){try{const t=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}iconSize(t){return"s"===t?20:"l"===t?28:24}syncHostClasses(){const t=this.getAttribute("size")||"m",e=SIZES$f.includes(t)?t:"m",i=this.getAttribute("background-color")||"default",s=BACKGROUNDS.includes(i)?i:"default";this.className=["designbase-wc-bottom-navigation",`designbase-wc-bottom-navigation--${e}`,`designbase-wc-bottom-navigation--${s}`,"false"!==this.getAttribute("fixed")&&"designbase-wc-bottom-navigation--fixed"].filter(Boolean).join(" ")}render(){this.syncHostClasses(),this.setAttribute("role","navigation"),this.setAttribute("aria-label","하단 네비게이션");const t=this.parseItems(),e=this.getAttribute("active-item-id")||"",i=this.getAttribute("size")||"m",s=this.iconSize(i);let n=this.querySelector(".designbase-wc-bottom-navigation__container");n?n.replaceChildren():(n=document.createElement("div"),n.className="designbase-wc-bottom-navigation__container",this.replaceChildren(n)),t.forEach(t=>{const i=e===t.id||Boolean(t.isActive),a=resolveIcon$1(i&&t.activeIcon?t.activeIcon:t.icon),r=document.createElement("button");r.type="button",r.className=["designbase-wc-bottom-navigation__item",i&&"designbase-wc-bottom-navigation__item--active",t.disabled&&"designbase-wc-bottom-navigation__item--disabled"].filter(Boolean).join(" "),r.disabled=Boolean(t.disabled),r.setAttribute("aria-label",t.label),i&&r.setAttribute("aria-current","page");const o=document.createElement("div");o.className="designbase-wc-bottom-navigation__item-content";const l=document.createElement("div");if(l.className="designbase-wc-bottom-navigation__icon-wrapper",a){const t=createDbIcon(a,s);t.classList.add("designbase-wc-bottom-navigation__icon"),l.append(t)}if(void 0!==t.badge&&""!==t.badge){const e=document.createElement("db-badge");e.className="designbase-wc-bottom-navigation__badge",e.setAttribute("size","s"),e.setAttribute("variant",mapBadgeVariant(t.badgeColor)),e.setAttribute("badge-style","number"),e.setAttribute("count",String(t.badge)),l.append(e)}const h=document.createElement("span");h.className="designbase-wc-bottom-navigation__label",h.textContent=t.label,o.append(l,h),r.append(o),r.addEventListener("click",()=>{t.disabled||this.dispatchEvent(new CustomEvent("db-item-click",{bubbles:!0,composed:!0,detail:{item:t}}))}),n.append(r)})}}customElements.get("db-bottom-navigation")||customElements.define("db-bottom-navigation",DbBottomNavigation);const SIZES$e=["s","m","l"],VARIANTS$c=["default","transparent"],POSITIONS$2=["fixed","sticky","static"];function resolveIcon(t){if(t)return t}class DbNavbar extends HTMLElement{constructor(){super(...arguments),this.mobileOpen=!1,this.userMenuOpen=!1,this.expandedMobile={},this.outsideHandler=null}static get observedAttributes(){return["items","user-menu-items","user-profile","size","variant","position","is-authenticated","show-search","search-placeholder","full-width","shadow"]}connectedCallback(){this.render(),this.bindOutsideClick()}disconnectedCallback(){this.unbindOutsideClick()}attributeChangedCallback(){this.isConnected&&this.render()}parseItems(t="items"){try{const e=JSON.parse(this.getAttribute(t)||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseUserProfile(){const t=this.getAttribute("user-profile");if(!t)return null;try{return JSON.parse(t)}catch{return null}}iconSize(t){return"s"===t?16:"l"===t?24:20}bindOutsideClick(){this.outsideHandler||(this.outsideHandler=t=>{this.contains(t.target)||(this.userMenuOpen=!1,this.updateUserMenuVisibility())},document.addEventListener("mousedown",this.outsideHandler))}unbindOutsideClick(){this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler),this.outsideHandler=null)}dispatchItemClick(t,e){this.dispatchEvent(new CustomEvent("user"===e?"db-user-menu-item-click":"db-item-click",{bubbles:!0,composed:!0,detail:{item:t,source:e}}))}syncHostClasses(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("position")||"static";this.className=["designbase-wc-navbar",`designbase-wc-navbar--${SIZES$e.includes(t)?t:"m"}`,`designbase-wc-navbar--${VARIANTS$c.includes(e)?e:"default"}`,`designbase-wc-navbar--${POSITIONS$2.includes(i)?i:"static"}`,this.hasAttribute("full-width")&&"designbase-wc-navbar--full-width",this.hasAttribute("shadow")&&"designbase-wc-navbar--shadow",this.mobileOpen&&"designbase-wc-navbar--mobile-open"].filter(Boolean).join(" ")}createDesktopNavItem(t,e){const i=document.createElement("li");i.className="designbase-wc-navbar__nav-item";if(Boolean(t.children?.length)){const s=document.createElement("div");s.className="designbase-wc-navbar__dropdown";const n=document.createElement("button");n.type="button",n.className=["designbase-wc-navbar__nav-link","designbase-wc-navbar__nav-link--has-children",t.active&&"designbase-wc-navbar__nav-link--active",t.disabled&&"designbase-wc-navbar__nav-link--disabled"].filter(Boolean).join(" "),n.disabled=Boolean(t.disabled);const a=resolveIcon(t.icon);a&&n.append(createDbIcon(a,e)),n.append(document.createTextNode(t.label));const r=createDbIcon("chevron-down",12);r.classList.add("designbase-wc-navbar__chevron"),n.append(r);const o=document.createElement("ul");return o.className="designbase-wc-navbar__dropdown-menu",t.children.forEach(t=>{const i=document.createElement("li"),s=document.createElement("a");s.href=t.href||"#",s.className=["designbase-wc-navbar__dropdown-item",t.active&&"designbase-wc-navbar__dropdown-item--active",t.disabled&&"designbase-wc-navbar__dropdown-item--disabled"].filter(Boolean).join(" ");const n=resolveIcon(t.icon);n&&s.append(createDbIcon(n,e)),s.append(document.createTextNode(t.label)),s.addEventListener("click",e=>{t.disabled?e.preventDefault():(e.preventDefault(),this.dispatchItemClick(t,"nav"))}),i.append(s),o.append(i)}),s.append(n,o),i.append(s),i}const s=document.createElement("a");s.href=t.href||"#",s.className=["designbase-wc-navbar__nav-link",t.active&&"designbase-wc-navbar__nav-link--active",t.disabled&&"designbase-wc-navbar__nav-link--disabled"].filter(Boolean).join(" ");const n=resolveIcon(t.icon);return n&&s.append(createDbIcon(n,e)),s.append(document.createTextNode(t.label)),s.addEventListener("click",e=>{t.disabled?e.preventDefault():(e.preventDefault(),this.dispatchItemClick(t,"nav"))}),i.append(s),i}createUserMenuItemElement(t,e,i){const s=document.createElement("db-menu-item");return s.setAttribute("label",t.label),s.setAttribute("type","block"),s.setAttribute("menu-style","dropdown"),s.setAttribute("size",e),t.href&&s.setAttribute("href",t.href),t.icon&&s.setAttribute("icon",t.icon),t.disabled&&s.setAttribute("disabled",""),s.addEventListener("db-click",()=>{t.disabled||(i(),this.dispatchItemClick(t,"user"))}),s}bindSearchEvents(t){t.addEventListener("db-search",t=>{const e=t.detail,i=e.query??e.value??"";this.dispatchEvent(new CustomEvent("db-search",{bubbles:!0,composed:!0,detail:{query:i,value:i}}))})}applyAvatarProfile(t,e,i){t.setAttribute("size","s"===i?"s":"l"===i?"l":"m"),t.setAttribute("initials",e.name),t.setAttribute("alt",e.name),e.avatar&&t.setAttribute("src",e.avatar),void 0!==e.badge&&t.setAttribute("badge",String(e.badge)),e.badgeVariant&&t.setAttribute("badge-variant",e.badgeVariant),e.badgeStyle&&t.setAttribute("badge-style",e.badgeStyle),e.badgeText&&t.setAttribute("badge-text",e.badgeText)}createMobileMenuItem(t,e){const i=Boolean(t.children?.length),s=Boolean(this.expandedMobile[t.id]),n=document.createElement("db-menu-item");return n.setAttribute("label",t.label),n.setAttribute("type","block"),n.setAttribute("menu-style","accordion"),n.setAttribute("size",e),t.href&&n.setAttribute("href",t.href),t.icon&&n.setAttribute("icon",t.icon),t.active&&n.setAttribute("active",""),t.disabled&&n.setAttribute("disabled",""),i&&(n.setAttribute("expandable",""),n.subItems=(t.children||[]).map(t=>({id:t.id,label:t.label,href:t.href,icon:t.icon,active:t.active,disabled:t.disabled})),s&&n.setAttribute("expanded","")),n.addEventListener("db-click",()=>{if(!t.disabled){if(i)return this.expandedMobile[t.id]=!s,void this.renderMobileMenu();this.mobileOpen=!1,this.dispatchItemClick(t,"mobile"),this.render()}}),n.addEventListener("db-child-click",t=>{const e=t.detail;this.mobileOpen=!1,this.dispatchItemClick(e.child,"mobile"),this.render()}),n}updateUserMenuVisibility(){const t=this.querySelector(".designbase-wc-navbar__user-dropdown-menu");t&&(t.hidden=!this.userMenuOpen)}renderMobileMenu(){const t=this.querySelector(".designbase-wc-navbar__mobile-nav-list");if(!t)return;const e=this.getAttribute("size")||"m",i=this.parseItems();t.replaceChildren(...i.map(t=>this.createMobileMenuItem(t,e)))}render(){this.syncHostClasses(),this.setAttribute("role","navigation"),this.setAttribute("aria-label","메인 네비게이션");const t=this.getAttribute("size")||"m",e=this.iconSize(t),i=this.parseItems(),s=this.parseItems("user-menu-items"),n=this.parseUserProfile(),a=this.hasAttribute("is-authenticated"),r=this.hasAttribute("show-search");this.replaceChildren();const o=document.createElement("div");o.className=["designbase-wc-navbar__container",this.hasAttribute("full-width")&&"designbase-wc-navbar__container--full-width"].filter(Boolean).join(" ");const l=document.createElement("div");l.className="designbase-wc-navbar__left";const h=document.createElement("div");h.className="designbase-wc-navbar__brand";const d=document.createElement("div");d.className="designbase-wc-navbar__logo";const u=document.createElement("db-logo");u.setAttribute("type","designbase"),u.setAttribute("size","s"),u.setAttribute("clickable",""),u.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-logo-click",{bubbles:!0,composed:!0}))}),d.append(u),h.append(d),l.append(h);const p=document.createElement("div");p.className="designbase-wc-navbar__right";const m=document.createElement("div");m.className="designbase-wc-navbar__nav designbase-wc-navbar__nav--desktop";const g=document.createElement("ul");if(g.className="designbase-wc-navbar__nav-list",i.forEach(t=>g.append(this.createDesktopNavItem(t,e))),m.append(g),p.append(m),r){const e=document.createElement("div");e.className="designbase-wc-navbar__search";const i=document.createElement("db-search-bar");i.setAttribute("variant","outlined"),i.setAttribute("size","s"===t?"s":"l"===t?"l":"m"),i.setAttribute("placeholder",this.getAttribute("search-placeholder")||"검색..."),this.bindSearchEvents(i),e.append(i),p.append(e)}const b=document.createElement("div");if(b.className="designbase-wc-navbar__user-menu",a&&n){const e=document.createElement("div");e.className="designbase-wc-navbar__user-dropdown";const i=document.createElement("button");i.type="button",i.className="designbase-wc-navbar__user-toggle",i.setAttribute("aria-expanded",String(this.userMenuOpen));const a=document.createElement("db-avatar");this.applyAvatarProfile(a,n,t);const r=document.createElement("span");r.className="designbase-wc-navbar__user-name",r.textContent=n.name,i.append(a,r,createDbIcon("chevron-down",12)),i.addEventListener("click",()=>{this.userMenuOpen=!this.userMenuOpen,i.setAttribute("aria-expanded",String(this.userMenuOpen)),this.updateUserMenuVisibility()});const o=document.createElement("ul");if(o.className="designbase-wc-navbar__user-dropdown-menu",o.hidden=!this.userMenuOpen,n.email){const t=document.createElement("li");t.className="designbase-wc-navbar__user-info";const e=document.createElement("span");e.className="designbase-wc-navbar__user-email",e.textContent=n.email,t.append(e),o.append(t)}s.forEach(e=>{const i=document.createElement("li");i.append(this.createUserMenuItemElement(e,t,()=>{this.userMenuOpen=!1,this.updateUserMenuVisibility()})),o.append(i)}),e.append(i,o),b.append(e)}else{const e=document.createElement("db-button");e.setAttribute("variant","primary"),e.setAttribute("size","s"===t?"s":"l"===t?"l":"m"),e.textContent="로그인",e.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-login-click",{bubbles:!0,composed:!0}))}),b.append(e)}p.append(b);const f=document.createElement("button");f.type="button",f.className="designbase-wc-navbar__mobile-toggle",f.setAttribute("aria-expanded",String(this.mobileOpen)),f.setAttribute("aria-label","메뉴 열기");for(let t=0;t<3;t+=1){const t=document.createElement("span");t.className="designbase-wc-navbar__mobile-toggle-line",f.append(t)}if(f.addEventListener("click",()=>{this.mobileOpen=!this.mobileOpen,this.render()}),o.append(l,p,f),this.append(o),this.mobileOpen){const t=document.createElement("div");if(t.className="designbase-wc-navbar__mobile-menu",r){const e=document.createElement("div");e.className="designbase-wc-navbar__mobile-search";const i=document.createElement("db-search-bar");i.setAttribute("variant","outlined"),i.setAttribute("size","s"),i.setAttribute("full-width",""),i.setAttribute("placeholder",this.getAttribute("search-placeholder")||"검색..."),this.bindSearchEvents(i),e.append(i),t.append(e)}const e=document.createElement("ul");e.className="designbase-wc-navbar__mobile-nav-list",t.append(e);const i=document.createElement("div");if(i.className="designbase-wc-navbar__mobile-user",a&&n){const t=document.createElement("div");t.className="designbase-wc-navbar__mobile-user-info";const e=document.createElement("db-avatar");this.applyAvatarProfile(e,n,"m");const a=document.createElement("div"),r=document.createElement("div");if(r.className="designbase-wc-navbar__mobile-user-name",r.textContent=n.name,a.append(r),n.email){const t=document.createElement("div");t.className="designbase-wc-navbar__mobile-user-email",t.textContent=n.email,a.append(t)}if(t.append(e,a),i.append(t),s.length){const t=document.createElement("ul");t.className="designbase-wc-navbar__mobile-user-menu",s.forEach(e=>{const i=document.createElement("li");i.append(this.createUserMenuItemElement(e,"m",()=>{this.mobileOpen=!1,this.render()})),t.append(i)}),i.append(t)}}else{const t=document.createElement("db-button");t.setAttribute("variant","primary"),t.setAttribute("size","m"),t.setAttribute("full-width",""),t.textContent="로그인",t.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-login-click",{bubbles:!0,composed:!0}))}),i.append(t)}t.append(i),this.append(t),this.renderMobileMenu()}}}customElements.get("db-navbar")||customElements.define("db-navbar",DbNavbar);const SIZES$d=["s","m","l"],VARIANTS$b=["default","dark","light"],POSITIONS$1=["left","right"];class DbSidebar extends HTMLElement{constructor(){super(...arguments),this.expandedItems=new Set,this.userMenuOpen=!1,this.outsideHandler=null}static get observedAttributes(){return["items","sections","user-menu-items","user-profile","default-expanded-ids","size","variant","position","collapsed","collapsible","show-logo","full-height","shadow"]}connectedCallback(){this.seedExpanded(),this.render(),this.bindOutsideClick()}disconnectedCallback(){this.unbindOutsideClick()}attributeChangedCallback(t){this.isConnected&&("default-expanded-ids"===t&&this.seedExpanded(),"collapsed"===t&&this.hasAttribute("collapsed")&&(this.userMenuOpen=!1),this.render())}seedExpanded(){try{const t=JSON.parse(this.getAttribute("default-expanded-ids")||"[]");Array.isArray(t)&&(this.expandedItems=new Set(t))}catch{this.expandedItems=new Set}}parseSections(){const t=this.getAttribute("sections");if(t)try{const e=JSON.parse(t);if(Array.isArray(e)&&e.length)return e}catch{}try{const t=JSON.parse(this.getAttribute("items")||"[]");return[{id:"main",items:Array.isArray(t)?t:[]}]}catch{return[{id:"main",items:[]}]}}parseUserMenuItems(){try{const t=JSON.parse(this.getAttribute("user-menu-items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}parseUserProfile(){const t=this.getAttribute("user-profile");if(!t)return null;try{return JSON.parse(t)}catch{return null}}bindOutsideClick(){this.outsideHandler||(this.outsideHandler=t=>{const e=this.querySelector(".designbase-wc-sidebar__user");e&&!e.contains(t.target)&&(this.userMenuOpen=!1,this.updateUserMenuVisibility())},document.addEventListener("mousedown",this.outsideHandler))}unbindOutsideClick(){this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler),this.outsideHandler=null)}syncHostClasses(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("position")||"left";this.className=["designbase-wc-sidebar",`designbase-wc-sidebar--${SIZES$d.includes(t)?t:"m"}`,`designbase-wc-sidebar--${VARIANTS$b.includes(e)?e:"default"}`,`designbase-wc-sidebar--${POSITIONS$1.includes(i)?i:"left"}`,this.hasAttribute("collapsed")&&"designbase-wc-sidebar--collapsed",this.hasAttribute("full-height")&&"designbase-wc-sidebar--full-height",this.hasAttribute("shadow")&&"designbase-wc-sidebar--shadow"].filter(Boolean).join(" ")}dispatchItemClick(t){this.dispatchEvent(new CustomEvent("db-item-click",{bubbles:!0,composed:!0,detail:{item:t}}))}dispatchUserMenuItemClick(t){this.dispatchEvent(new CustomEvent("db-user-menu-item-click",{bubbles:!0,composed:!0,detail:{item:t}}))}updateUserMenuVisibility(){const t=this.querySelector(".designbase-wc-sidebar__user-dropdown");t&&(t.hidden=!this.userMenuOpen)}createSidebarMenuItem(t,e,i=0){const s=Boolean(t.children?.length),n=this.expandedItems.has(t.id),a=this.hasAttribute("collapsed"),r=document.createElement("li");r.className="designbase-wc-sidebar__item";const o=document.createElement("db-menu-item");return o.setAttribute("label",t.label),o.setAttribute("type","block"),o.setAttribute("menu-style","accordion"),o.setAttribute("size",e),o.setAttribute("depth",String(i)),t.href&&o.setAttribute("href",t.href),t.icon&&o.setAttribute("icon",t.icon),t.active&&o.setAttribute("active",""),t.disabled&&o.setAttribute("disabled",""),void 0!==t.badge&&o.setAttribute("badge",String(t.badge)),t.badgeColor&&o.setAttribute("badge-color",t.badgeColor),s&&(o.setAttribute("expandable",""),o.subItems=(t.children||[]).map(t=>({id:t.id,label:t.label,href:t.href,icon:t.icon,active:t.active,disabled:t.disabled,badge:t.badge,badgeColor:t.badgeColor})),n&&!a&&o.setAttribute("expanded","")),o.addEventListener("db-click",()=>{if(!t.disabled)return s&&!a?(this.expandedItems.has(t.id)?this.expandedItems.delete(t.id):this.expandedItems.add(t.id),void this.renderNav()):void this.dispatchItemClick(t)}),o.addEventListener("db-child-click",t=>{const e=t.detail;this.dispatchItemClick(e.child)}),r.append(o),r}renderNav(){const t=this.querySelector(".designbase-wc-sidebar__nav");if(!t)return;const e=this.getAttribute("size")||"m",i=this.parseSections();t.replaceChildren(),i.forEach(i=>{const s=document.createElement("div");if(s.className="designbase-wc-sidebar__section",!this.hasAttribute("collapsed")&&i.title){const t=document.createElement("div");t.className="designbase-wc-sidebar__section-title",t.textContent=i.title,s.append(t)}const n=document.createElement("ul");n.className="designbase-wc-sidebar__nav-list",i.items.forEach(t=>n.append(this.createSidebarMenuItem(t,e))),s.append(n),t.append(s)})}render(){this.syncHostClasses(),this.setAttribute("role","complementary"),this.setAttribute("aria-label","사이드바 네비게이션");const t=this.getAttribute("size")||"m",e="false"!==this.getAttribute("collapsible"),i="false"!==this.getAttribute("show-logo"),s=this.hasAttribute("collapsed"),n=this.parseUserProfile(),a=this.parseUserMenuItems(),r="l"===t?"m":"s"===t?"xs":"s";this.replaceChildren();const o=document.createElement("div");if(o.className="designbase-wc-sidebar__container",e||i&&!s){const t=document.createElement("div");if(t.className=["designbase-wc-sidebar__header",(s||!i)&&"designbase-wc-sidebar__header--collapsed-only"].filter(Boolean).join(" "),!s&&i){const e=document.createElement("div");e.className="designbase-wc-sidebar__logo";const i=document.createElement("db-logo");i.setAttribute("type","designbase"),i.setAttribute("size",r),e.append(i),e.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-logo-click",{bubbles:!0,composed:!0}))}),t.append(e)}if(e){const e=document.createElement("db-button");e.className="designbase-wc-sidebar__toggle",e.setAttribute("variant","tertiary"),e.setAttribute("size","s"),e.setAttribute("icon-only",""),e.setAttribute("aria-label",s?"사이드바 펼치기":"사이드바 접기");const i=document.createElement("span");i.className="designbase-wc-button__start-icon designbase-wc-sidebar__toggle-icon",i.append(createDbIcon(s?"arrow-bar-right":"arrow-bar-left",16)),e.append(i),e.addEventListener("db-click",()=>{const t=!this.hasAttribute("collapsed");t?this.setAttribute("collapsed",""):this.removeAttribute("collapsed"),this.dispatchEvent(new CustomEvent("db-toggle",{bubbles:!0,composed:!0,detail:{collapsed:t}}))}),t.append(e)}o.append(t)}const l=document.createElement("div");l.className="designbase-wc-sidebar__nav-wrapper";const h=document.createElement("nav");h.className="designbase-wc-sidebar__nav",h.setAttribute("aria-label","주 메뉴"),l.append(h),o.append(l);const d=document.createElement("div");if(d.className="designbase-wc-sidebar__footer",n&&!s){const t=document.createElement("div");t.className="designbase-wc-sidebar__user";const e=document.createElement("div");if(e.className="designbase-wc-sidebar__user-dropdown",e.setAttribute("role","menu"),e.setAttribute("aria-label","사용자 메뉴"),e.hidden=!this.userMenuOpen,a.length){const t=document.createElement("ul");t.className="designbase-wc-sidebar__user-menu",a.forEach(e=>{const i=document.createElement("li");i.className="designbase-wc-sidebar__user-menu-item";const s=document.createElement("db-menu-item");s.setAttribute("label",e.label),s.setAttribute("type","block"),s.setAttribute("menu-style","accordion"),s.setAttribute("size","s"),e.icon&&s.setAttribute("icon",e.icon),e.href&&s.setAttribute("href",e.href),s.addEventListener("db-click",()=>{this.userMenuOpen=!1,this.updateUserMenuVisibility(),this.dispatchUserMenuItemClick(e)}),i.append(s),t.append(i)}),e.append(t)}const i=document.createElement("div");i.className="designbase-wc-sidebar__user-info",i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-expanded",String(this.userMenuOpen));const s=document.createElement("db-avatar");s.className="designbase-wc-sidebar__user-avatar",s.setAttribute("size","s"),s.setAttribute("initials",n.name),s.setAttribute("alt",n.name),n.avatar&&s.setAttribute("src",n.avatar);const r=document.createElement("div");r.className="designbase-wc-sidebar__user-details";const o=document.createElement("div");if(o.className="designbase-wc-sidebar__user-name",o.textContent=n.name,r.append(o),n.email){const t=document.createElement("div");t.className="designbase-wc-sidebar__user-email",t.textContent=n.email,r.append(t)}if(i.append(s,r),a.length){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-more",t.setAttribute("aria-hidden","true"),t.append(createDbIcon("more-vertical",16)),i.append(t),i.setAttribute("aria-haspopup","menu")}i.addEventListener("click",()=>{a.length&&(this.userMenuOpen=!this.userMenuOpen,i.setAttribute("aria-expanded",String(this.userMenuOpen)),this.updateUserMenuVisibility())}),t.append(e,i),d.append(t)}else if(n&&s){const t=document.createElement("div");t.className="designbase-wc-sidebar__user-collapsed",t.setAttribute("role","button"),t.setAttribute("tabindex","0");const e=document.createElement("db-avatar");e.className="designbase-wc-sidebar__user-avatar-collapsed",e.setAttribute("size","m"),e.setAttribute("initials",n.name),e.setAttribute("alt",n.name),n.avatar&&e.setAttribute("src",n.avatar),t.append(e),d.append(t)}o.append(d),this.append(o),this.renderNav()}}customElements.get("db-sidebar")||customElements.define("db-sidebar",DbSidebar);class DbContextMenu extends HTMLElement{constructor(){super(...arguments),this.externalTarget=null,this.activeSubMenu=null,this.onExternalContextMenu=null,this.handleDocumentMouseDown=t=>{if(!this.open)return;const e=t.target;this.menuEl?.contains(e)||this.targetWrap?.contains(e)||this.externalTarget?.contains(e)||this.close()},this.handleKeyDown=t=>{this.open&&"Escape"===t.key&&this.close()},this.handleContextMenu=t=>{this.hasAttribute("disabled")||(t.preventDefault(),t.stopPropagation(),this.openAt(t.clientX,t.clientY))}}static get observedAttributes(){return["open","x","y","items","target-id","disabled"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open","true"):this.removeAttribute("open")}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.style.display="contents",requestAnimationFrame(()=>{this.renderTarget(),this.syncMenu()}),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleKeyDown),this.unbindExternalTarget(),this.menuEl?.remove(),this.menuEl=void 0}attributeChangedCallback(t){if(this.isConnected)return"target-id"===t?(this.unbindExternalTarget(),void this.bindExternalTarget()):void("open"!==t&&"x"!==t&&"y"!==t&&"items"!==t||this.syncMenu())}openAt(t,e){this.setAttribute("x",String(t)),this.setAttribute("y",String(e)),this.setAttribute("open","true"),this.dispatchEvent(new CustomEvent("db-open",{bubbles:!0,composed:!0,detail:{x:t,y:e}})),this.syncMenu()}close(){this.activeSubMenu=null,this.removeAttribute("open"),this.menuEl?.remove(),this.menuEl=void 0,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}collectTargetChildren(){const t=Array.from(this.children).filter(t=>!t.hasAttribute("data-wc-internal")&&t!==this.targetWrap);return t.length>0?t:Array.from(this.targetWrap?.children||[])}bindExternalTarget(){const t=this.getAttribute("target-id");t&&(this.externalTarget=document.getElementById(t),this.externalTarget&&(this.onExternalContextMenu=t=>this.handleContextMenu(t),this.externalTarget.addEventListener("contextmenu",this.onExternalContextMenu)))}unbindExternalTarget(){this.externalTarget&&this.onExternalContextMenu&&this.externalTarget.removeEventListener("contextmenu",this.onExternalContextMenu),this.externalTarget=null,this.onExternalContextMenu=null}renderTarget(){const t=this.collectTargetChildren();this.getAttribute("target-id")?(this.replaceChildren(),this.bindExternalTarget()):(this.targetWrap||(this.targetWrap=document.createElement("div"),this.targetWrap.className="designbase-wc-context-menu__target",this.targetWrap.addEventListener("contextmenu",this.handleContextMenu)),this.replaceChildren(),t.forEach(t=>this.targetWrap.append(t)),t.length>0&&this.append(this.targetWrap))}adjustPosition(){if(!this.menuEl)return;const t=Number(this.getAttribute("x")||0),e=Number(this.getAttribute("y")||0),i=this.menuEl.getBoundingClientRect();let s=t,n=e;t+i.width>window.innerWidth&&(s=t-i.width),e+i.height>window.innerHeight&&(n=e-i.height),this.menuEl.style.left=`${Math.max(0,s)}px`,this.menuEl.style.top=`${Math.max(0,n)}px`}createMenuItem(t){const e=document.createElement("db-menu-item");return e.setAttribute("label",t.label||t.id),e.setAttribute("type","block"),e.setAttribute("menu-style","dropdown"),t.icon&&e.setAttribute("icon",t.icon),t.disabled&&e.setAttribute("disabled",""),t.variant&&e.setAttribute("variant",t.variant),t.subItems?.length&&(e.setAttribute("sub-items",JSON.stringify(t.subItems)),e.setAttribute("expandable","")),e.addEventListener("db-click",()=>{t.disabled||t.subItems?.length||(this.dispatchEvent(new CustomEvent("db-select",{detail:{item:t},bubbles:!0,composed:!0})),this.close())}),e.addEventListener("db-child-click",t=>{const e=t.detail?.child;this.dispatchEvent(new CustomEvent("db-select",{detail:{item:e},bubbles:!0,composed:!0})),this.close()}),e}renderItem(t,e){if(t.divider||t.isDivider){const t=document.createElement("db-divider");return t.className="designbase-wc-divider",t}const i=document.createElement("div");i.className="designbase-wc-context-menu__item-wrapper",i.append(this.createMenuItem(t));if(Boolean(t.subItems?.length)){const e=document.createElement("div");e.className=["designbase-wc-context-menu__submenu",this.activeSubMenu===t.id&&"designbase-wc-context-menu__submenu--open"].filter(Boolean).join(" "),t.subItems?.forEach((t,i)=>{const s=this.renderItem(t,i);s&&e.append(s)}),i.addEventListener("mouseenter",()=>{this.activeSubMenu=t.id,e.classList.add("designbase-wc-context-menu__submenu--open")}),i.addEventListener("mouseleave",()=>{this.activeSubMenu=null,e.classList.remove("designbase-wc-context-menu__submenu--open")}),i.append(e)}return i}syncMenu(){if(this.menuEl?.remove(),this.menuEl=void 0,!this.open)return;const t=Number(this.getAttribute("x")||0),e=Number(this.getAttribute("y")||0),i=this.items,s=document.createElement("div");s.className="designbase-wc-context-menu",s.setAttribute("data-wc-internal",""),s.style.position="fixed",s.style.left=`${t}px`,s.style.top=`${e}px`,s.style.zIndex="1000",s.setAttribute("role","menu"),s.setAttribute("aria-orientation","vertical"),i.forEach((t,e)=>{const i=this.renderItem(t,e);i&&s.append(i)}),document.body.append(s),this.menuEl=s,requestAnimationFrame(()=>this.adjustPosition())}}customElements.get("db-context-menu")||customElements.define("db-context-menu",DbContextMenu);const SIZES$c=["s","m","l"],VARIANTS$a=["default","primary","success","warning","danger"],STYLES=["solid","striped","animated"];class DbProgressbar extends HTMLElement{static get observedAttributes(){return["value","min","max","size","variant","bar-style","show-label","label","label-position","full-width","disabled"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){const t=Number(this.getAttribute("min")||0),e=Number(this.getAttribute("max")||100),i=Number(this.getAttribute("value")||0),s=Math.max(t,Math.min(e,i)),n=e===t?0:(s-t)/(e-t)*100,a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"default",o=this.getAttribute("bar-style")||"solid",l=this.getAttribute("label-position")||"top",h=this.hasAttribute("show-label"),d=this.getAttribute("label")||(h?`${Math.round(n)}%`:""),u=this.hasAttribute("disabled");this.className=["designbase-wc-progressbar",`designbase-wc-progressbar--${SIZES$c.includes(a)?a:"m"}`,`designbase-wc-progressbar--${VARIANTS$a.includes(r)?r:"default"}`,`designbase-wc-progressbar--${STYLES.includes(o)?o:"solid"}`,this.hasAttribute("full-width")&&"designbase-wc-progressbar--full-width",u&&"designbase-wc-progressbar--disabled",100===n&&"designbase-wc-progressbar--completed"].filter(Boolean).join(" "),this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin",String(t)),this.setAttribute("aria-valuemax",String(e)),this.setAttribute("aria-valuenow",String(s)),d&&this.setAttribute("aria-label",d),this.replaceChildren();const p=document.createElement("div");if(p.className=`designbase-wc-progressbar__container designbase-wc-progressbar__container--${l}`,d&&"inside"!==l){const t=document.createElement("span");t.className=`designbase-wc-progressbar__label designbase-wc-progressbar__label--${l}`,t.textContent=d,p.append(t)}const m=document.createElement("div");m.className="designbase-wc-progressbar__track";const g=document.createElement("div");if(g.className="designbase-wc-progressbar__fill",g.style.width=`${n}%`,d&&"inside"===l){const t=document.createElement("span");t.className="designbase-wc-progressbar__fill-label",t.textContent=d,g.append(t)}m.append(g),p.append(m),this.append(p)}}customElements.get("db-progressbar")||customElements.define("db-progressbar",DbProgressbar);class DbProgressStep extends HTMLElement{static get observedAttributes(){return["items","size","layout","current-step","clickable","full-width","disabled"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}resolveStatus(t,e){const i=e.status??"pending";if("pending"!==i)return i;const s=Number(this.getAttribute("current-step")||0);return t<s?"completed":t===s?"active":"pending"}iconSize(t){return"s"===t?12:"l"===t?20:16}renderIndicatorContent(t,e,i){const s=document.createElement("div");if(s.className="designbase-wc-progress-step__icon","completed"===t)s.append(createDbIcon("done",this.iconSize(i)));else if("error"===t)s.append(createDbIcon("warning-filled",this.iconSize(i)));else{const t=document.createElement("span");t.className="designbase-wc-progress-step__number",t.textContent=String(e+1),s.append(t)}return s}handleStepClick(t,e){const i=this.hasAttribute("disabled"),s=this.hasAttribute("clickable");i||t.disabled||!s||this.dispatchEvent(new CustomEvent("db-step-click",{detail:{item:t,index:e},bubbles:!0,composed:!0}))}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("layout")||"horizontal",i=this.hasAttribute("clickable"),s=this.hasAttribute("disabled"),n=this.items;this.className=["designbase-wc-progress-step",`designbase-wc-progress-step--${t}`,`designbase-wc-progress-step--${e}`,i&&"designbase-wc-progress-step--clickable",this.hasAttribute("full-width")&&"designbase-wc-progress-step--full-width",s&&"designbase-wc-progress-step--disabled"].filter(Boolean).join(" "),this.replaceChildren(),n.forEach((e,a)=>{const r=this.resolveStatus(a,e),o=a===n.length-1,l=i&&!s&&!e.disabled,h="completed"===(a>0?this.resolveStatus(a-1,n[a-1]):"pending")?"completed":r,d=document.createElement("div");d.className=["designbase-wc-progress-step__item",`designbase-wc-progress-step__item--${r}`,l&&"designbase-wc-progress-step__item--clickable",e.disabled&&"designbase-wc-progress-step__item--disabled"].filter(Boolean).join(" ");const u=document.createElement("div");u.className="designbase-wc-progress-step__indicator-container";const p=document.createElement("div");if(p.className="designbase-wc-progress-step__indicator",l?(p.tabIndex=0,p.setAttribute("role","button"),p.setAttribute("aria-label",`${e.title} 단계로 이동`),p.addEventListener("click",()=>this.handleStepClick(e,a)),p.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleStepClick(e,a))})):p.tabIndex=-1,"active"===r){const t=document.createElement("div");t.className="designbase-wc-progress-step__pulse",p.append(t)}if(p.append(this.renderIndicatorContent(r,a,t)),u.append(p),!o){const t=document.createElement("div");t.className=["designbase-wc-progress-step__connector",`designbase-wc-progress-step__connector--${h}`].join(" "),u.append(t)}d.append(u);const m=document.createElement("div");m.className="designbase-wc-progress-step__content";const g=document.createElement("div");g.className="designbase-wc-progress-step__header";const b=document.createElement("h3");if(b.className="designbase-wc-progress-step__title",b.textContent=e.title,g.append(b),m.append(g),e.description){const t=document.createElement("p");t.className="designbase-wc-progress-step__description",t.textContent=e.description,m.append(t)}if(e.timestamp){const t=document.createElement("span");t.className="designbase-wc-progress-step__timestamp",t.textContent=e.timestamp,m.append(t)}d.append(m),this.append(d)})}}customElements.get("db-progress-step")||customElements.define("db-progress-step",DbProgressStep);const CLASS$t="designbase-wc-range-slider";class DbRangeSlider extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.valuesEl=null,this.containerEl=null,this.trackEl=null,this.fillEl=null,this.thumbEls=[],this.currentValue=50,this.currentRange=[25,75],this.isDragging=!1,this.activeThumb=null,this.boundTrackClick=t=>this.handleTrackClick(t),this.boundPointerMove=t=>this.handlePointerMove(t),this.boundPointerUp=()=>this.handlePointerUp(),this.boundContainerKeyDown=t=>this.handleKeyDown(t)}static get observedAttributes(){return["value","range","min","max","step","size","variant","show-value","value-position","show-marks","marks","mark-labels","disabled","readonly","full-width","vertical"]}connectedCallback(){this.built||(this.build(),this.built=!0),this.readAttributeValues(),this.syncClasses(),this.syncStructure(),this.syncVisuals(),this.syncA11y(),this.bindEvents()}disconnectedCallback(){this.unbindEvents()}attributeChangedCallback(t){this.built&&(this.readAttributeValues(),this.syncClasses(),this.isStructuralAttribute(t)&&this.syncStructure(),this.syncVisuals(),this.syncA11y())}isStructuralAttribute(t){return["range","show-value","show-marks","marks","mark-labels","vertical"].includes(t)}get value(){return this.currentValue}set value(t){this.currentValue=this.clamp(t),this.setAttribute("value",String(this.currentValue)),this.syncVisuals()}get range(){if(this.hasAttribute("range"))return[...this.currentRange]}set range(t){if(void 0===t)return void this.removeAttribute("range");const e=[Math.min(t[0],t[1]),Math.max(t[0],t[1])];this.currentRange=[this.clamp(e[0]),this.clamp(e[1])],this.setAttribute("range",`${this.currentRange[0]},${this.currentRange[1]}`),this.syncVisuals()}build(){this.classList.add(CLASS$t),this.valuesEl=document.createElement("div"),this.valuesEl.className=`${CLASS$t}__values`,this.containerEl=document.createElement("div"),this.containerEl.className=`${CLASS$t}__container`,this.containerEl.setAttribute("role","slider"),this.containerEl.setAttribute("tabindex","0"),this.trackEl=document.createElement("div"),this.trackEl.className=`${CLASS$t}__track`,this.fillEl=document.createElement("div"),this.fillEl.className=`${CLASS$t}__fill`,this.trackEl.appendChild(this.fillEl),this.containerEl.appendChild(this.trackEl),this.appendChild(this.valuesEl),this.appendChild(this.containerEl)}bindEvents(){this.trackEl?.addEventListener("click",this.boundTrackClick),this.containerEl?.addEventListener("keydown",this.boundContainerKeyDown)}unbindEvents(){this.trackEl?.removeEventListener("click",this.boundTrackClick),this.containerEl?.removeEventListener("keydown",this.boundContainerKeyDown),document.removeEventListener("pointermove",this.boundPointerMove),document.removeEventListener("pointerup",this.boundPointerUp)}readAttributeValues(){const t=this.getNumberAttr("min",0),e=this.getNumberAttr("max",100),i=this.getNumberAttr("step",1);if(this.hasAttribute("range")){const s=this.parseRangeAttr(this.getAttribute("range"));s&&(this.currentRange=[this.clamp(s[0],t,e,i),this.clamp(s[1],t,e,i)])}else this.currentValue=this.clamp(this.getNumberAttr("value",50),t,e,i)}syncClasses(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.hasAttribute("range"),s=this.getAttribute("value-position")||"top",n=[CLASS$t,`${CLASS$t}--${t}`,`${CLASS$t}--${e}`,`${CLASS$t}--value-${i?"top":"top"===s?"right":s}`,this.hasAttribute("disabled")?`${CLASS$t}--disabled`:"",this.hasAttribute("readonly")?`${CLASS$t}--readonly`:"",this.hasAttribute("full-width")?`${CLASS$t}--full-width`:"",this.hasAttribute("vertical")?`${CLASS$t}--vertical`:"",i?`${CLASS$t}--range`:""].filter(Boolean);this.className=n.join(" "),this.trackEl&&(this.trackEl.className=`${CLASS$t}__track`,this.hasAttribute("disabled")&&this.trackEl.classList.add(`${CLASS$t}__track--disabled`),this.hasAttribute("readonly")&&this.trackEl.classList.add(`${CLASS$t}__track--readonly`))}syncStructure(){if(!this.valuesEl||!this.trackEl||!this.fillEl)return;const t=this.hasAttribute("show-value"),e=this.hasAttribute("range"),i=this.hasAttribute("show-marks");if(this.valuesEl.innerHTML="",t)if(e){const t=document.createElement("span");t.className=`${CLASS$t}__value ${CLASS$t}__value--min`;const e=document.createElement("span");e.className=`${CLASS$t}__value ${CLASS$t}__value--max`,this.valuesEl.append(t,e)}else{const t=document.createElement("span");t.className=`${CLASS$t}__value ${CLASS$t}__value--single`,this.valuesEl.appendChild(t)}if(this.thumbEls.forEach(t=>t.remove()),this.thumbEls=[],this.trackEl.querySelectorAll(`.${CLASS$t}__mark`).forEach(t=>t.remove()),i){const t=this.parseMarks();if(t.length>0){const e=this.parseMarkLabels();t.forEach(t=>{const i=document.createElement("div");if(i.className=`${CLASS$t}__mark`,i.setAttribute("aria-hidden","true"),this.isMarkActive(t)&&i.classList.add(`${CLASS$t}__mark--active`),this.hasAttribute("vertical")?i.style.bottom=`${this.valueToPercent(t)}%`:i.style.left=`${this.valueToPercent(t)}%`,void 0!==e[t]){const s=document.createElement("span");s.className=`${CLASS$t}__mark-label`,s.textContent=e[t],i.appendChild(s)}this.trackEl.insertBefore(i,this.fillEl)})}}const s=e?2:1,n=this.hasAttribute("disabled")||this.hasAttribute("readonly");for(let t=0;t<s;t++){const i=document.createElement("div");i.className=`${CLASS$t}__thumb`,i.setAttribute("role","slider"),i.setAttribute("draggable","false"),i.setAttribute("tabindex",n?"-1":"0");const s=e?0===t?"min":"max":"single";e&&(i.dataset.thumb=s),i.addEventListener("pointerdown",t=>this.handleThumbPointerDown(t,s)),i.addEventListener("keydown",t=>this.handleKeyDown(t,s)),this.trackEl.appendChild(i),this.thumbEls.push(i)}}isMarkActive(t){if(this.hasAttribute("range")){const[e,i]=this.currentRange;return t>=e&&t<=i}return t<=this.currentValue}syncVisuals(){if(!this.fillEl)return;const t=this.hasAttribute("range"),e=this.getNumberAttr("min",0),i=this.getNumberAttr("max",100);if(t){const[t,s]=this.currentRange,n=this.valueToPercent(t),a=this.valueToPercent(s);this.hasAttribute("vertical")?(this.fillEl.style.left="",this.fillEl.style.width="",this.fillEl.style.bottom=`${n}%`,this.fillEl.style.height=a-n+"%"):(this.fillEl.style.bottom="",this.fillEl.style.height="",this.fillEl.style.left=`${n}%`,this.fillEl.style.width=a-n+"%"),this.thumbEls[0]&&(this.setThumbPosition(this.thumbEls[0],n),this.thumbEls[0].setAttribute("aria-valuemin",String(e)),this.thumbEls[0].setAttribute("aria-valuemax",String(s)),this.thumbEls[0].setAttribute("aria-valuenow",String(t))),this.thumbEls[1]&&(this.setThumbPosition(this.thumbEls[1],a),this.thumbEls[1].setAttribute("aria-valuemin",String(t)),this.thumbEls[1].setAttribute("aria-valuemax",String(i)),this.thumbEls[1].setAttribute("aria-valuenow",String(s)));const r=this.valuesEl?.querySelector(`.${CLASS$t}__value--min`),o=this.valuesEl?.querySelector(`.${CLASS$t}__value--max`);r&&(r.textContent=String(t)),o&&(o.textContent=String(s))}else{const t=this.valueToPercent(this.currentValue);this.hasAttribute("vertical")?(this.fillEl.style.left="",this.fillEl.style.width="",this.fillEl.style.bottom="0",this.fillEl.style.height=`${t}%`):(this.fillEl.style.bottom="",this.fillEl.style.height="",this.fillEl.style.left="0",this.fillEl.style.width=`${t}%`),this.thumbEls[0]&&(this.setThumbPosition(this.thumbEls[0],t),this.thumbEls[0].setAttribute("aria-valuemin",String(e)),this.thumbEls[0].setAttribute("aria-valuemax",String(i)),this.thumbEls[0].setAttribute("aria-valuenow",String(this.currentValue)));const s=this.valuesEl?.querySelector(`.${CLASS$t}__value--single`);s&&(s.textContent=String(this.currentValue))}}syncA11y(){if(!this.containerEl)return;const t=this.getNumberAttr("min",0),e=this.getNumberAttr("max",100),i=this.hasAttribute("range"),s=this.hasAttribute("disabled"),n=this.hasAttribute("readonly");this.containerEl.setAttribute("aria-valuemin",String(t)),this.containerEl.setAttribute("aria-valuemax",String(e)),this.containerEl.setAttribute("aria-valuenow",String(i?this.currentRange[0]:this.currentValue)),this.containerEl.setAttribute("aria-valuetext",i?`${this.currentRange[0]} to ${this.currentRange[1]}`:String(this.currentValue)),this.containerEl.setAttribute("aria-disabled",String(s)),this.containerEl.setAttribute("aria-readonly",String(n)),this.containerEl.setAttribute("tabindex",s||n?"-1":"0")}setThumbPosition(t,e){this.hasAttribute("vertical")?(t.style.left="",t.style.bottom=`${e}%`):(t.style.bottom="",t.style.left=`${e}%`)}valueToPercent(t){const e=this.getNumberAttr("min",0),i=this.getNumberAttr("max",100);return i===e?0:(t-e)/(i-e)*100}percentToValue(t){const e=this.getNumberAttr("min",0),i=this.getNumberAttr("max",100),s=this.getNumberAttr("step",1),n=e+t/100*(i-e);return this.snapToStep(n,e,i,s)}snapToStep(t,e,i,s){const n=Math.round(t/s)*s;return Math.min(i,Math.max(e,n))}clamp(t,e=this.getNumberAttr("min",0),i=this.getNumberAttr("max",100),s=this.getNumberAttr("step",1)){return this.snapToStep(Math.min(i,Math.max(e,t)),e,i,s)}getNumberAttr(t,e){const i=this.getAttribute(t);if(null===i||""===i)return e;const s=Number(i);return Number.isFinite(s)?s:e}parseRangeAttr(t){if(!t)return null;if(t.startsWith("[")){try{const e=JSON.parse(t);if(Array.isArray(e)&&2===e.length){const t=Number(e[0]),i=Number(e[1]);if(Number.isFinite(t)&&Number.isFinite(i))return[t,i]}}catch{return null}return null}const e=t.split(",").map(t=>Number(t.trim()));return 2!==e.length||e.some(t=>!Number.isFinite(t))?null:[e[0],e[1]]}parseMarks(){const t=this.getAttribute("marks");if(!t)return[];if(t.startsWith("[")){try{const e=JSON.parse(t);if(Array.isArray(e))return e.map(t=>Number(t)).filter(t=>Number.isFinite(t))}catch{return[]}return[]}return t.split(",").map(t=>Number(t.trim())).filter(t=>Number.isFinite(t))}parseMarkLabels(){const t=this.getAttribute("mark-labels");if(!t)return{};try{const e=JSON.parse(t),i={};return Object.entries(e).forEach(([t,e])=>{i[Number(t)]=e}),i}catch{return{}}}isInteractive(){return!this.hasAttribute("disabled")&&!this.hasAttribute("readonly")}getTrackPercent(t,e){if(!this.trackEl)return 0;const i=this.trackEl.getBoundingClientRect();if(this.hasAttribute("vertical")){const t=Math.max(i.top,Math.min(i.bottom,e));return(i.bottom-t)/i.height*100}return(Math.max(i.left,Math.min(i.right,t))-i.left)/i.width*100}handleThumbPointerDown(t,e){this.isInteractive()&&(t.preventDefault(),this.isDragging=!0,this.activeThumb=e,this.setThumbActive(e,!0),document.addEventListener("pointermove",this.boundPointerMove),document.addEventListener("pointerup",this.boundPointerUp))}handleTrackClick(t){if(!this.isInteractive()||!this.trackEl)return;if(t.target.closest(`.${CLASS$t}__thumb`))return;const e=this.getTrackPercent(t.clientX,t.clientY),i=this.percentToValue(e);this.commitValueAtPosition(i)}handlePointerMove(t){if(!this.isDragging||!this.isInteractive())return;const e=this.getTrackPercent(t.clientX,t.clientY),i=this.percentToValue(e);this.applyDragValue(i)}handlePointerUp(){this.isDragging&&(this.activeThumb&&this.setThumbActive(this.activeThumb,!1),this.isDragging=!1,this.activeThumb=null,document.removeEventListener("pointermove",this.boundPointerMove),document.removeEventListener("pointerup",this.boundPointerUp))}setThumbActive(t,e){if(this.hasAttribute("range")){const i=this.thumbEls["min"===t?0:1];return void i?.classList.toggle(`${CLASS$t}__thumb--active`,e)}this.thumbEls[0]?.classList.toggle(`${CLASS$t}__thumb--active`,e)}applyDragValue(t){if(this.hasAttribute("range")){const[e,i]=this.currentRange;if("min"===this.activeThumb)this.currentRange=[Math.min(t,i),i];else if("max"===this.activeThumb)this.currentRange=[e,Math.max(t,e)];else{Math.abs(t-e)<=Math.abs(t-i)?(this.currentRange=[Math.min(t,i),i],this.activeThumb="min"):(this.currentRange=[e,Math.max(t,e)],this.activeThumb="max")}this.syncVisuals(),this.dispatchRangeChange()}else this.currentValue=t,this.syncVisuals(),this.syncA11y(),this.dispatchValueChange()}commitValueAtPosition(t){if(this.hasAttribute("range")){const[e,i]=this.currentRange,s=Math.abs(t-e),n=Math.abs(t-i);this.currentRange=s<=n?[Math.min(t,i),i]:[e,Math.max(t,e)],this.setAttribute("range",`${this.currentRange[0]},${this.currentRange[1]}`),this.syncVisuals(),this.dispatchRangeChange()}else this.currentValue=t,this.setAttribute("value",String(this.currentValue)),this.syncVisuals(),this.syncA11y(),this.dispatchValueChange()}handleKeyDown(t,e="single"){if(!this.isInteractive())return;const i=this.getNumberAttr("step",1),s=this.getNumberAttr("min",0),n=this.getNumberAttr("max",100);let a;if(this.hasAttribute("range")&&"single"!==e){const r="min"===e?this.currentRange[0]:this.currentRange[1];switch(t.key){case"ArrowLeft":case"ArrowDown":a=this.clamp(r-i,s,n);break;case"ArrowRight":case"ArrowUp":a=this.clamp(r+i,s,n);break;case"Home":a=s;break;case"End":a=n;break;default:return}const o=[...this.currentRange];if("min"===e?o[0]=a:o[1]=a,o[0]>o[1])return;return t.preventDefault(),this.currentRange=o,void this.afterKeyboard()}if(!this.hasAttribute("range")){switch(t.key){case"ArrowLeft":case"ArrowDown":a=this.clamp(this.currentValue-i,s,n);break;case"ArrowRight":case"ArrowUp":a=this.clamp(this.currentValue+i,s,n);break;case"Home":a=s;break;case"End":a=n;break;default:return}t.preventDefault(),this.currentValue=a,this.afterKeyboard()}}afterKeyboard(){this.hasAttribute("range")?(this.setAttribute("range",`${this.currentRange[0]},${this.currentRange[1]}`),this.syncVisuals(),this.dispatchRangeChange()):(this.setAttribute("value",String(this.currentValue)),this.syncVisuals(),this.syncA11y(),this.dispatchValueChange())}dispatchValueChange(){this.dispatchEvent(new CustomEvent("db-change",{bubbles:!0,composed:!0,detail:{value:this.currentValue}}))}dispatchRangeChange(){this.dispatchEvent(new CustomEvent("db-change",{bubbles:!0,composed:!0,detail:{range:[...this.currentRange]}}))}}customElements.get("db-range-slider")||customElements.define("db-range-slider",DbRangeSlider);const CLASS$s="designbase-wc-segment-control",ICON_SVGS={bar:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="12" width="4" height="8"/><rect x="10" y="8" width="4" height="12"/><rect x="17" y="4" width="4" height="16"/></svg>',line:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 16 9 10 14 13 20 6"/></svg>',pie:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v10l8.66 5"/><circle cx="12" cy="12" r="10"/></svg>',donut:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3"/></svg>',radar:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 20 8 17 20 7 20 4 8"/></svg>'};class DbSegmentControl extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.indicatorEl=null,this.segmentButtons=[],this.focusedIndex=-1,this.boundKeyDown=t=>this.handleKeyDown(t)}static get observedAttributes(){return["options","value","default-value","size","variant","full-width","disabled"]}connectedCallback(){this.built||(this.built=!0),this.render(),this.addEventListener("keydown",this.boundKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this.boundKeyDown)}attributeChangedCallback(t){this.built&&("value"!==t?this.render():this.updateSelection())}get options(){return this.parseOptions(this.getAttribute("options"))}set options(t){this.setAttribute("options","string"==typeof t?t:JSON.stringify(t))}get value(){return this.getAttribute("value")||this.getAttribute("default-value")||this.options[0]?.value||""}set value(t){this.setAttribute("value",t)}parseOptions(t){if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.hasAttribute("disabled"),s=this.options,n=this.value;this.className=[CLASS$s,`${CLASS$s}--${t}`,`${CLASS$s}--${e}`,this.hasAttribute("full-width")&&`${CLASS$s}--full-width`,i&&`${CLASS$s}--disabled`].filter(Boolean).join(" "),this.setAttribute("role","tablist"),this.setAttribute("aria-label","세그먼트 컨트롤"),this.replaceChildren(),this.segmentButtons=[],s.forEach((t,s)=>{const a=t.value===n,r=Boolean(i||t.disabled),o=document.createElement("button");if(o.type="button",o.className=[`${CLASS$s}__segment`,a&&`${CLASS$s}__segment--selected`,r&&`${CLASS$s}__segment--disabled`].filter(Boolean).join(" "),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(a)),o.setAttribute("aria-disabled",String(r)),o.setAttribute("tabindex",a?"0":"-1"),o.disabled=r,t.icon&&ICON_SVGS[t.icon]){const e=document.createElement("span");e.className=`${CLASS$s}__segment-icon`,e.innerHTML=ICON_SVGS[t.icon],o.appendChild(e)}const l=document.createElement("span");l.className=`${CLASS$s}__segment-label`,l.textContent=t.label,"icon-only"===e&&l.setAttribute("aria-label",t.label),o.appendChild(l),o.addEventListener("click",()=>this.select(t.value)),o.addEventListener("focus",()=>{this.focusedIndex=s,o.classList.add(`${CLASS$s}__segment--focused`)}),o.addEventListener("blur",()=>{this.focusedIndex=-1,o.classList.remove(`${CLASS$s}__segment--focused`)}),this.appendChild(o),this.segmentButtons.push(o)}),this.indicatorEl=document.createElement("div"),this.indicatorEl.className=`${CLASS$s}__indicator`,this.appendChild(this.indicatorEl),this.updateSelection()}updateSelection(){const t=this.options,e=this.value,i=t.findIndex(t=>t.value===e);this.segmentButtons.forEach((i,s)=>{const n=t[s],a=n?.value===e;i.classList.toggle(`${CLASS$s}__segment--selected`,a),i.setAttribute("aria-selected",String(a)),i.setAttribute("tabindex",a?"0":"-1")}),this.indicatorEl&&t.length>0&&i>=0&&(this.indicatorEl.style.width=100/t.length+"%",this.indicatorEl.style.transform=`translateX(${100*i}%)`)}select(t){if(this.hasAttribute("disabled"))return;const e=this.options.find(e=>e.value===t);e&&!e.disabled&&(this.setAttribute("value",t),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t},bubbles:!0,composed:!0})))}handleKeyDown(t){if(this.hasAttribute("disabled"))return;const e=this.options,i=e.findIndex(t=>t.value===this.value);if(-1===i)return;let s=i;switch(t.key){case"ArrowLeft":t.preventDefault(),s=i>0?i-1:e.length-1;break;case"ArrowRight":t.preventDefault(),s=i<e.length-1?i+1:0;break;case"Home":t.preventDefault(),s=0;break;case"End":t.preventDefault(),s=e.length-1;break;case"Enter":case" ":return t.preventDefault(),void this.select(e[s]?.value??this.value);default:return}for(;s!==i;){const i=e[s];if(i&&!i.disabled){this.segmentButtons[s]?.focus();break}s="ArrowLeft"===t.key||"Home"===t.key?s>0?s-1:e.length-1:s<e.length-1?s+1:0}}}customElements.get("db-segment-control")||customElements.define("db-segment-control",DbSegmentControl);const CLASS$r="designbase-wc-stepper",SIZES$b=["s","m","l"],MINUS_SVG='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>',PLUS_SVG='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>',VALUE_INPUT_APPEARANCE={display:"block",width:"100%",minWidth:"0",height:"auto",padding:"0",margin:"0",border:"0",background:"transparent",color:"inherit",fontFamily:"inherit",fontWeight:"600",lineHeight:"1",textAlign:"center",outline:"none",boxShadow:"none",boxSizing:"border-box",appearance:"none"};class DbStepper extends HTMLElement{constructor(){super(...arguments),this.decrementBtn=null,this.incrementBtn=null,this.valueWrapEl=null,this.valueTextEl=null,this.valueInputEl=null,this.descriptionEl=null,this.boundInputKeyDown=t=>this.handleInputKeyDown(t),this.boundInputInput=()=>this.handleInputInput(),this.boundInputPaste=t=>this.handleInputPaste(t),this.boundInputBlur=()=>this.commitInputValue()}static get observedAttributes(){return["value","min","max","step","size","editable","disabled","readonly"]}connectedCallback(){this.querySelector(`.${CLASS$r}__button`)||this.build(),this.syncFromAttributes()}attributeChangedCallback(t){this.decrementBtn&&this.syncFromAttributes()}get value(){return Number(this.getAttribute("value")||0)}set value(t){this.setAttribute("value",String(t))}build(){this.decrementBtn=document.createElement("button"),this.decrementBtn.type="button",this.decrementBtn.className=`${CLASS$r}__button ${CLASS$r}__button--decrement`,this.decrementBtn.setAttribute("aria-label","감소"),this.decrementBtn.innerHTML=MINUS_SVG,this.valueWrapEl=document.createElement("div"),this.valueWrapEl.className=`${CLASS$r}__value`,this.valueTextEl=document.createElement("span"),this.valueTextEl.className=`${CLASS$r}__value-text`,this.valueWrapEl.appendChild(this.valueTextEl),this.incrementBtn=document.createElement("button"),this.incrementBtn.type="button",this.incrementBtn.className=`${CLASS$r}__button ${CLASS$r}__button--increment`,this.incrementBtn.setAttribute("aria-label","증가"),this.incrementBtn.innerHTML=PLUS_SVG,this.descriptionEl=document.createElement("div"),this.descriptionEl.id="stepper-description",this.descriptionEl.className="sr-only",this.decrementBtn.addEventListener("click",()=>this.change(this.value-this.getStep())),this.incrementBtn.addEventListener("click",()=>this.change(this.value+this.getStep())),this.append(this.decrementBtn,this.valueWrapEl,this.incrementBtn,this.descriptionEl)}isEditable(){return this.hasAttribute("editable")&&!this.hasAttribute("disabled")&&!this.hasAttribute("readonly")}syncFromAttributes(){const t=this.getAttribute("size")||"m",e=this.hasAttribute("disabled"),i=this.hasAttribute("readonly"),s=this.getMin(),n=this.getMax(),a=this.getStep(),r=this.clamp(this.snapToStep(this.value));if(this.getAttribute("value")!==String(r)&&this.setAttribute("value",String(r)),this.className=[CLASS$r,`${CLASS$r}--size-${SIZES$b.includes(t)?t:"m"}`,this.isEditable()&&`${CLASS$r}--editable`,e&&`${CLASS$r}--disabled`,i&&`${CLASS$r}--readonly`].filter(Boolean).join(" "),this.syncValueField(r),this.descriptionEl){const t=this.isEditable()?"값을 직접 입력할 수 있습니다. ":"";this.descriptionEl.textContent=`${t}숫자 조정기. +/- 버튼으로 값을 조정할 수 있습니다. 현재 값: ${r}, 최소값: ${s}, 최대값: ${n}, 단계: ${a}`}this.decrementBtn?.setAttribute("aria-describedby","stepper-description"),this.incrementBtn?.setAttribute("aria-describedby","stepper-description"),this.updateButtons()}applyValueInputAppearance(){this.valueInputEl&&(Object.assign(this.valueInputEl.style,VALUE_INPUT_APPEARANCE),this.valueInputEl.style.setProperty("-webkit-appearance","none"),this.valueInputEl.style.setProperty("-moz-appearance","textfield"))}syncValueField(t){if(this.valueWrapEl){if(this.isEditable())return this.valueInputEl||(this.valueInputEl=document.createElement("input"),this.valueInputEl.className=`${CLASS$r}__value-input`,this.valueInputEl.type="text",this.valueInputEl.setAttribute("inputmode",this.allowsDecimal()?"decimal":"numeric"),this.valueInputEl.setAttribute("pattern",this.buildInputPattern()),this.valueInputEl.setAttribute("aria-label","값 입력"),this.valueInputEl.autocomplete="off",this.valueInputEl.spellcheck=!1,this.valueInputEl.addEventListener("keydown",this.boundInputKeyDown),this.valueInputEl.addEventListener("input",this.boundInputInput),this.valueInputEl.addEventListener("paste",this.boundInputPaste),this.valueInputEl.addEventListener("blur",this.boundInputBlur),this.applyValueInputAppearance()),this.applyValueInputAppearance(),this.valueInputEl.setAttribute("inputmode",this.allowsDecimal()?"decimal":"numeric"),this.valueInputEl.setAttribute("pattern",this.buildInputPattern()),this.valueInputEl.setAttribute("aria-valuemin",String(this.getMin())),this.valueInputEl.setAttribute("aria-valuemax",String(this.getMax())),this.valueInputEl.disabled=!1,document.activeElement!==this.valueInputEl&&(this.valueInputEl.value=String(t)),this.valueTextEl?.remove(),void(this.valueWrapEl.contains(this.valueInputEl)||this.valueWrapEl.appendChild(this.valueInputEl));this.valueInputEl&&(this.valueInputEl.removeEventListener("keydown",this.boundInputKeyDown),this.valueInputEl.removeEventListener("input",this.boundInputInput),this.valueInputEl.removeEventListener("paste",this.boundInputPaste),this.valueInputEl.removeEventListener("blur",this.boundInputBlur),this.valueInputEl.remove(),this.valueInputEl=null),this.valueTextEl||(this.valueTextEl=document.createElement("span"),this.valueTextEl.className=`${CLASS$r}__value-text`),this.valueTextEl.textContent=String(t),this.valueWrapEl.contains(this.valueTextEl)||this.valueWrapEl.appendChild(this.valueTextEl)}}allowsNegative(){return this.getMin()<0}allowsDecimal(){const t=this.getStep();return!Number.isInteger(t)}buildInputPattern(){return`^${this.allowsNegative()?"-?":""}\\d*${this.allowsDecimal()?"(\\.\\d*)?":""}$`}sanitizeInputString(t){let e="",i=!1,s=!1;for(let n=0;n<t.length;n++){const a=t[n];"-"!==a||!this.allowsNegative()||0!==e.length||i?"."!==a||!this.allowsDecimal()||s?/\d/.test(a)&&(e+=a):(e+=a,s=!0):(e+=a,i=!0)}return e}parseInputValue(t){const e=t.trim();if(""===e||"-"===e||"."===e)return null;const i=Number(e);return Number.isFinite(i)?i:null}enforceInputBounds(t,e={}){const i=this.sanitizeInputString(t),s=this.parseInputValue(i);if(null===s)return i;const n=this.getMin(),a=this.getMax();return s>a?String(a):e.clampMin&&s<n?String(n):i}handleInputKeyDown(t){if(!["Backspace","Delete","Tab","Escape","ArrowLeft","ArrowRight","Home","End"].includes(t.key)){if("Enter"===t.key)return t.preventDefault(),this.commitInputValue(),void this.valueInputEl?.blur();if("-"===t.key&&this.allowsNegative()){const t=this.valueInputEl;if(t&&0===t.selectionStart&&0===t.selectionEnd&&!t.value.includes("-"))return}"."===t.key&&this.allowsDecimal()&&!this.valueInputEl?.value.includes(".")||/^\d$/.test(t.key)||t.preventDefault()}}handleInputInput(){if(!this.valueInputEl)return;const t=this.enforceInputBounds(this.valueInputEl.value);this.valueInputEl.value!==t&&(this.valueInputEl.value=t)}handleInputPaste(t){if(t.preventDefault(),!this.valueInputEl)return;const e=t.clipboardData?.getData("text")??"",i=this.enforceInputBounds(this.sanitizeInputString(this.valueInputEl.value+e));this.valueInputEl.value=i,this.handleInputInput()}commitInputValue(){if(!this.valueInputEl||!this.isEditable())return;const t=this.valueInputEl.value.trim();if(""===t||"-"===t||"."===t)return void(this.valueInputEl.value=String(this.value));const e=this.parseInputValue(t);if(null===e)return void(this.valueInputEl.value=String(this.value));const i=this.snapToStep(e);this.valueInputEl.value=String(i),this.change(i)}getMin(){return Number(this.getAttribute("min")??0)}getMax(){return Number(this.getAttribute("max")??100)}getStep(){return Number(this.getAttribute("step")??1)}snapToStep(t){const e=this.getStep(),i=Math.round(t/e)*e;return this.clamp(i)}clamp(t){return Math.max(this.getMin(),Math.min(this.getMax(),t))}updateButtons(){const t=this.getMin(),e=this.getMax(),i=this.hasAttribute("disabled"),s=this.hasAttribute("readonly"),n=this.value,a=n<=t,r=n>=e;if(this.decrementBtn){const t=i||s||a;this.decrementBtn.disabled=t,this.decrementBtn.classList.toggle(`${CLASS$r}__button--disabled`,t)}if(this.incrementBtn){const t=i||s||r;this.incrementBtn.disabled=t,this.incrementBtn.classList.toggle(`${CLASS$r}__button--disabled`,t)}}change(t){if(this.hasAttribute("disabled")||this.hasAttribute("readonly"))return;const e=this.getMin(),i=this.getMax(),s=this.clamp(this.snapToStep(t)),n=this.value;if(s!==n){if(this.setAttribute("value",String(s)),this.valueTextEl&&(this.valueTextEl.textContent=String(s)),this.valueInputEl&&(this.valueInputEl.value=String(s)),this.updateButtons(),this.descriptionEl){const t=this.getStep(),n=this.isEditable()?"값을 직접 입력할 수 있습니다. ":"";this.descriptionEl.textContent=`${n}숫자 조정기. +/- 버튼으로 값을 조정할 수 있습니다. 현재 값: ${s}, 최소값: ${e}, 최대값: ${i}, 단계: ${t}`}this.dispatchEvent(new CustomEvent("db-change",{detail:{value:s,minReached:s<=e,maxReached:s>=i},bubbles:!0,composed:!0})),s<=e&&n>e&&this.dispatchEvent(new CustomEvent("db-min-reached",{bubbles:!0,composed:!0,detail:{value:s}})),s>=i&&n<i&&this.dispatchEvent(new CustomEvent("db-max-reached",{bubbles:!0,composed:!0,detail:{value:s}}))}else this.valueInputEl&&(this.valueInputEl.value=String(s))}}customElements.get("db-stepper")||customElements.define("db-stepper",DbStepper);const SIZES$a=["s","m","l","xl","full"],VARIANTS$9=["plain","wrapper"],PADDINGS=["none","s","m","l","xl"];class DbContainer extends HTMLElement{static get observedAttributes(){return["size","variant","padding","margin","max-width","full-width","border","rounded","shadow","background-color"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const t=this.getAttribute("size")||"l",e=this.getAttribute("variant")||"plain",i=this.getAttribute("padding")||"m",s=this.getAttribute("margin")||"none",n=this.getAttribute("max-width"),a=this.getAttribute("background-color"),r=VARIANTS$9.includes(e)?e:"plain";this.className=["designbase-wc-container",`designbase-wc-container--size-${SIZES$a.includes(t)?t:"l"}`,`designbase-wc-container--variant-${r}`,"wrapper"===r&&PADDINGS.includes(i)&&`designbase-wc-container--padding-${i}`,"wrapper"===r&&PADDINGS.includes(s)&&`designbase-wc-container--margin-${s}`,this.hasAttribute("full-width")&&"designbase-wc-container--full-width","wrapper"===r&&this.hasAttribute("border")&&"designbase-wc-container--border","wrapper"===r&&this.hasAttribute("rounded")&&"designbase-wc-container--rounded","wrapper"===r&&this.hasAttribute("shadow")&&"designbase-wc-container--shadow"].filter(Boolean).join(" "),this.hasAttribute("full-width")?this.style.maxWidth="100%":n?this.style.maxWidth=n.includes("px")||n.includes("%")?n:`${n}px`:this.style.removeProperty("max-width"),"wrapper"===r&&a?this.style.backgroundColor=a:this.style.removeProperty("background-color")}}customElements.get("db-container")||customElements.define("db-container",DbContainer);const DIRECTIONS$2=["vertical","horizontal"],ALIGNMENTS=["start","center","end","stretch"],JUSTIFY=["start","center","end","space-between","space-around","space-evenly"],SPACINGS$1=["none","xs","s","m","l","xl"];class DbStack extends HTMLElement{static get observedAttributes(){return["direction","alignment","justify","spacing","full-width","full-height","wrap"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const t=this.getAttribute("direction")||"vertical",e=this.getAttribute("alignment")||"start",i=this.getAttribute("justify")||"start",s=this.getAttribute("spacing")||"m",n=SPACINGS$1.includes(s)?s:"m";this.className=["designbase-wc-stack",`designbase-wc-stack--direction-${DIRECTIONS$2.includes(t)?t:"vertical"}`,`designbase-wc-stack--alignment-${ALIGNMENTS.includes(e)?e:"start"}`,`designbase-wc-stack--justify-${JUSTIFY.includes(i)?i:"start"}`,`designbase-wc-stack--spacing-${{none:"none",xs:"xs",s:"sm",m:"md",l:"lg",xl:"xl"}[n]||"md"}`,this.hasAttribute("full-width")&&"designbase-wc-stack--full-width",this.hasAttribute("full-height")&&"designbase-wc-stack--full-height",this.hasAttribute("wrap")&&"designbase-wc-stack--wrap"].filter(Boolean).join(" ")}}customElements.get("db-stack")||customElements.define("db-stack",DbStack);class DbGrid extends HTMLElement{static get observedAttributes(){return["columns","gap","fixed","no-padding","full-width"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const t=Math.max(1,Number(this.getAttribute("columns")||12)),e=this.getAttribute("gap")||"m",i=["none","xs","s","m","l","xl"].includes(e)?e:"m",s={none:"0",xs:"var(--db-gap-xs)",s:"var(--db-gap-s)",m:"var(--db-gap-m)",l:"var(--db-gap-l)",xl:"var(--db-gap-xl)"};this.className=["designbase-wc-grid",`designbase-wc-grid--gap-${i}`,this.hasAttribute("fixed")&&"designbase-wc-grid--fixed",this.hasAttribute("no-padding")&&"designbase-wc-grid--no-padding",this.hasAttribute("full-width")&&"designbase-wc-grid--full-width"].filter(Boolean).join(" "),this.style.setProperty("--db-wc-grid-columns",String(t)),this.style.display="grid",this.style.gridTemplateColumns=`repeat(${t}, minmax(0, 1fr))`,this.style.gap=s[i]||s.m,this.style.alignItems="start"}}class DbGridItem extends HTMLElement{static get observedAttributes(){return["span","span-sm","span-md","span-lg","span-xl"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const parseSpan=(t,e=12)=>{const i=Number(t??e);return Math.min(12,Math.max(1,Number.isFinite(i)?i:e))},t=parseSpan(this.getAttribute("span")),e=parseSpan(this.getAttribute("span-sm"),t),i=parseSpan(this.getAttribute("span-md"),e),s=parseSpan(this.getAttribute("span-lg"),i),n=parseSpan(this.getAttribute("span-xl"),s);this.className="designbase-wc-grid__item",this.style.gridColumn=`span ${t}`,this.style.setProperty("--db-wc-grid-item-span",String(t)),this.style.setProperty("--db-wc-grid-item-span-sm",String(e)),this.style.setProperty("--db-wc-grid-item-span-md",String(i)),this.style.setProperty("--db-wc-grid-item-span-lg",String(s)),this.style.setProperty("--db-wc-grid-item-span-xl",String(n))}}customElements.get("db-grid")||customElements.define("db-grid",DbGrid),customElements.get("db-grid-item")||customElements.define("db-grid-item",DbGridItem);class DbToolbar extends HTMLElement{static get observedAttributes(){return["items","size","variant","position","full-width","shadow","rounded","fixed"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.render()}attributeChangedCallback(t){"items"!==t?this.syncHostClasses():this.render()}syncHostClasses(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("position")||"top";this.className=["designbase-wc-toolbar",`designbase-wc-toolbar--size-${t}`,`designbase-wc-toolbar--variant-${e}`,`designbase-wc-toolbar--position-${i}`,this.hasAttribute("full-width")&&"designbase-wc-toolbar--full-width",this.hasAttribute("fixed")&&"designbase-wc-toolbar--fixed",this.hasAttribute("shadow")&&"designbase-wc-toolbar--shadow",this.hasAttribute("rounded")&&"designbase-wc-toolbar--rounded"].filter(Boolean).join(" ")}render(){this.syncHostClasses(),this.setAttribute("role","toolbar");let t=this.querySelector(".designbase-wc-toolbar__content");t?t.replaceChildren():(t=document.createElement("div"),t.className="designbase-wc-toolbar__content",this.replaceChildren(t));const e=document.createElement("div");e.className="designbase-wc-toolbar__group",t.append(e),this.items.forEach(t=>{if("separator"===t.type){const t=document.createElement("div");return t.className="designbase-wc-toolbar__item designbase-wc-toolbar__item--separator",t.setAttribute("role","separator"),void e.append(t)}const i=document.createElement("button");i.type="button",i.className=["designbase-wc-toolbar__item","designbase-wc-toolbar__item--button",t.active&&"designbase-wc-toolbar__item--active",t.disabled&&"designbase-wc-toolbar__item--disabled"].filter(Boolean).join(" "),i.textContent=t.label||t.id,i.disabled=Boolean(t.disabled),t.tooltip&&(i.title=t.tooltip),i.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-item-click",{detail:{item:t},bubbles:!0,composed:!0}))}),e.append(i)})}}customElements.get("db-toolbar")||customElements.define("db-toolbar",DbToolbar);const CLASS$q="designbase-wc-form";class DbForm extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.formEl=null,this.headerEl=null,this.fieldsEl=null,this.actionsEl=null,this.submitBtn=null,this.resetBtn=null,this.values={},this.errors={},this.touched={},this.initialValues={},this.fieldWrappers=new Map,this.boundSubmit=t=>this.handleSubmit(t),this.boundReset=t=>this.handleReset(t)}static get observedAttributes(){return["fields","columns","size","variant","title","description","submit-text","reset-text","show-reset","submit-loading","submit-disabled","initial-values"]}connectedCallback(){this.built||(this.buildShell(),this.built=!0),this.bootstrapValues(),this.syncAll()}attributeChangedCallback(t){this.built&&("initial-values"===t&&this.bootstrapValues(),"fields"===t&&this.bootstrapValues(),this.syncAll())}get fields(){return this.parseFields(this.getAttribute("fields"))}set fields(t){this.setAttribute("fields","string"==typeof t?t:JSON.stringify(t))}parseFields(t){if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}parseInitialValues(){const t=this.getAttribute("initial-values");if(!t)return{};try{const e=JSON.parse(t);return e&&"object"==typeof e?e:{}}catch{return{}}}bootstrapValues(){this.initialValues=this.parseInitialValues();const t={...this.initialValues};this.fields.forEach(e=>{void 0===t[e.name]&&(void 0===e.value?void 0===e.defaultValue?"checkbox"===e.type&&e.checkboxGroup?t[e.name]=[]:"checkbox"!==e.type?t[e.name]="":t[e.name]=!1:t[e.name]=e.defaultValue:t[e.name]=e.value)}),this.values=t}buildShell(){this.formEl=document.createElement("form"),this.formEl.className=`${CLASS$q}__native`,this.formEl.noValidate=!0,this.formEl.addEventListener("submit",this.boundSubmit),this.headerEl=document.createElement("div"),this.headerEl.className=`${CLASS$q}__header`,this.fieldsEl=document.createElement("div"),this.fieldsEl.className=`${CLASS$q}__fields`,this.actionsEl=document.createElement("div"),this.actionsEl.className=`${CLASS$q}__actions`,this.submitBtn=document.createElement("db-button"),this.submitBtn.setAttribute("type","submit"),this.submitBtn.setAttribute("variant","primary"),this.resetBtn=document.createElement("db-button"),this.resetBtn.setAttribute("type","button"),this.resetBtn.setAttribute("variant","secondary"),this.resetBtn.addEventListener("click",this.boundReset),this.actionsEl.append(this.submitBtn,this.resetBtn),this.formEl.append(this.fieldsEl,this.actionsEl),this.append(this.headerEl,this.formEl)}syncAll(){this.syncClasses(),this.syncHeader(),this.renderFields(),this.syncActions()}syncClasses(){const t=this.getAttribute("columns")||"1",e=this.getAttribute("size")||"m",i=this.getAttribute("variant")||"default";this.className=[CLASS$q,`${CLASS$q}--columns-${t}`,`${CLASS$q}--${e}`,`${CLASS$q}--${i}`,this.hasAttribute("submit-loading")&&`${CLASS$q}--loading`].filter(Boolean).join(" ")}syncHeader(){if(!this.headerEl)return;const t=this.getAttribute("title")||"",e=this.getAttribute("description")||"";if(this.headerEl.innerHTML="",t||e){if(this.headerEl.hidden=!1,t){const e=document.createElement("h3");e.className=`${CLASS$q}__title`,e.textContent=t,this.headerEl.appendChild(e)}if(e){const t=document.createElement("p");t.className=`${CLASS$q}__description`,t.textContent=e,this.headerEl.appendChild(t)}}else this.headerEl.hidden=!0}syncActions(){const t=this.getAttribute("submit-text")||"제출",e=this.getAttribute("reset-text")||"리셋",i=this.hasAttribute("show-reset");this.submitBtn&&(this.submitBtn.textContent=t,this.hasAttribute("submit-loading")?this.submitBtn.setAttribute("loading",""):this.submitBtn.removeAttribute("loading"),this.hasAttribute("submit-disabled")?this.submitBtn.setAttribute("disabled",""):this.submitBtn.removeAttribute("disabled")),this.resetBtn&&(this.resetBtn.textContent=e,this.resetBtn.hidden=!i)}renderFields(){if(!this.fieldsEl)return;const t=this.getAttribute("size")||"m";this.fieldsEl.innerHTML="",this.fieldWrappers.clear(),this.fields.forEach(e=>{const i=document.createElement("div");if(i.className=`${CLASS$q}__field-wrapper ${CLASS$q}__field-wrapper--${e.type||"text"}`,i.dataset.field=e.name,e.label&&("checkbox"!==e.type||e.checkboxGroup)){const t=document.createElement("label");if(t.className=`${CLASS$q}__label`,t.htmlFor=`db-form-${e.name}`,t.textContent=e.label,e.required||e.validation?.required){const e=document.createElement("span");e.className=`${CLASS$q}__required`,e.textContent="*",e.setAttribute("aria-hidden","true"),t.appendChild(e)}i.appendChild(t)}i.appendChild(this.createFieldControl(e,t)),this.fieldsEl.appendChild(i),this.fieldWrappers.set(e.name,i),this.refreshFieldState(e.name)})}refreshFieldState(t){const e=this.fields.find(e=>e.name===t),i=this.fieldWrappers.get(t);if(!e||!i)return;const s=Boolean(this.touched[t]&&this.errors[t]);i.classList.toggle(`${CLASS$q}__field-wrapper--error`,s),i.querySelector(`.${CLASS$q}__error`)?.remove(),i.querySelector(`.${CLASS$q}__help`)?.remove();const n=i.querySelector(`.${CLASS$q}__field, db-input, db-textarea, db-select, db-checkbox`);if(n&&(s?(n.setAttribute("error",""),n.setAttribute("error-message",this.errors[t])):(n.removeAttribute("error"),n.removeAttribute("error-message"))),s){const e=document.createElement("div");return e.className=`${CLASS$q}__error`,e.textContent=this.errors[t],void i.appendChild(e)}if(e.helpText){const t=document.createElement("div");t.className=`${CLASS$q}__help`,t.textContent=e.helpText,i.appendChild(t)}}refreshAllFieldStates(){this.fields.forEach(t=>this.refreshFieldState(t.name))}createFieldControl(t,e){const i=t.type||"text",s=this.values[t.name],n=Boolean(this.touched[t.name]&&this.errors[t.name]),a=n?this.errors[t.name]:"";if("textarea"===i){const i=document.createElement("db-textarea");return i.className=`${CLASS$q}__field`,i.setAttribute("name",t.name),i.id=`db-form-${t.name}`,i.setAttribute("size",e),i.setAttribute("full-width",""),t.placeholder&&i.setAttribute("placeholder",t.placeholder),void 0!==s&&i.setAttribute("value",String(s)),t.disabled&&i.setAttribute("disabled",""),t.readOnly&&i.setAttribute("readonly",""),t.required&&i.setAttribute("required",""),t.maxLength&&i.setAttribute("max-length",String(t.maxLength)),n&&(i.setAttribute("error",""),i.setAttribute("error-message",a)),i.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.value)}),i.addEventListener("db-input",e=>{const i=e.detail;this.handleFieldChange(t,i.value,!1)}),i}if("select"===i){const i=document.createElement("db-select");return i.className=`${CLASS$q}__field`,i.setAttribute("name",t.name),i.id=`db-form-${t.name}`,i.setAttribute("size",e),i.setAttribute("full-width",""),t.placeholder&&i.setAttribute("placeholder",t.placeholder),t.options&&i.setAttribute("options",JSON.stringify(t.options)),t.multiple&&i.setAttribute("multiple",""),t.disabled&&i.setAttribute("disabled",""),t.readOnly&&i.setAttribute("readonly",""),t.required&&i.setAttribute("required",""),void 0!==s&&i.setAttribute("value",Array.isArray(s)?JSON.stringify(s):String(s)),n&&(i.setAttribute("error",""),i.setAttribute("error-message",a)),i.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.value)}),i}if("radio"===i&&t.radioGroup){const i=document.createElement("div");return i.className=`${CLASS$q}__radio-group`,i.setAttribute("role","radiogroup"),(t.options||[]).forEach(n=>{const a=document.createElement("db-radio");a.setAttribute("name",t.name),a.setAttribute("value",n.value),a.setAttribute("size",e),s===n.value&&a.setAttribute("checked",""),(t.disabled||n.disabled)&&a.setAttribute("disabled",""),a.textContent=n.label,a.addEventListener("db-change",e=>{e.detail.checked&&this.handleFieldChange(t,n.value)}),i.appendChild(a)}),i}if("checkbox"===i&&t.checkboxGroup){const i=document.createElement("div");i.className=`${CLASS$q}__checkbox-group`;const n=Array.isArray(s)?s:[];return(t.options||[]).forEach(s=>{const a=document.createElement("db-checkbox");a.setAttribute("name",t.name),a.setAttribute("value",s.value),a.setAttribute("size",e),n.includes(s.value)&&a.setAttribute("checked",""),(t.disabled||s.disabled)&&a.setAttribute("disabled",""),a.textContent=s.label,a.addEventListener("db-change",e=>{const i=e.detail,n=Array.isArray(this.values[t.name])?[...this.values[t.name]]:[],a=i.checked?[...new Set([...n,s.value])]:n.filter(t=>t!==s.value);this.handleFieldChange(t,a)}),i.appendChild(a)}),i}if("checkbox"===i){const i=document.createElement("db-checkbox");return i.className=`${CLASS$q}__field`,i.setAttribute("name",t.name),i.id=`db-form-${t.name}`,i.setAttribute("size",e),s&&i.setAttribute("checked",""),t.disabled&&i.setAttribute("disabled",""),t.readOnly&&i.setAttribute("readonly",""),t.required&&i.setAttribute("required",""),i.textContent=t.label||"",i.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.checked)}),i}const r=document.createElement("db-input");return r.className=`${CLASS$q}__field`,r.setAttribute("name",t.name),r.id=`db-form-${t.name}`,r.setAttribute("type",i),r.setAttribute("size",e),r.setAttribute("full-width",""),t.placeholder&&r.setAttribute("placeholder",t.placeholder),void 0!==s&&!1!==s&&r.setAttribute("value",String(s)),t.disabled&&r.setAttribute("disabled",""),t.readOnly&&r.setAttribute("readonly",""),t.required&&r.setAttribute("required",""),void 0!==t.min&&r.setAttribute("min",String(t.min)),void 0!==t.max&&r.setAttribute("max",String(t.max)),void 0!==t.minLength&&r.setAttribute("minlength",String(t.minLength)),void 0!==t.maxLength&&r.setAttribute("maxlength",String(t.maxLength)),t.pattern&&r.setAttribute("pattern",t.pattern),n&&(r.setAttribute("error",""),r.setAttribute("error-message",a)),r.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.value)}),r.addEventListener("db-input",e=>{const i=e.detail;this.handleFieldChange(t,i.value,!1)}),r}handleFieldChange(t,e,i=!0){this.values[t.name]=e,i&&(this.touched[t.name]=!0);const s=this.validateField(t,e);this.errors[t.name]=s||"",this.refreshFieldState(t.name),this.dispatchEvent(new CustomEvent("db-change",{bubbles:!0,composed:!0,detail:{values:{...this.values}}}))}validateField(t,e){const i=t.validation||{};if((i.required??t.required)&&(null==e||""===e||!1===e||Array.isArray(e)&&0===e.length))return t.errorMessage||`${t.label||t.name}은(는) 필수입니다.`;if(void 0!==i.min&&Number(e)<i.min)return t.errorMessage||`최소값은 ${i.min}입니다.`;if(void 0!==i.max&&Number(e)>i.max)return t.errorMessage||`최대값은 ${i.max}입니다.`;if(void 0!==i.minLength&&String(e).length<i.minLength)return t.errorMessage||`최소 ${i.minLength}자 이상 입력해주세요.`;if(void 0!==i.maxLength&&String(e).length>i.maxLength)return t.errorMessage||`최대 ${i.maxLength}자까지 입력 가능합니다.`;const s=i.pattern||t.pattern;if(s&&String(e))try{if(!new RegExp(s).test(String(e)))return t.errorMessage||"올바른 형식으로 입력해주세요."}catch{}}validateForm(){let t=!0;return this.fields.forEach(e=>{const i=this.validateField(e,this.values[e.name]);i?(this.errors[e.name]=i,t=!1):this.errors[e.name]=""}),t}handleSubmit(t){t.preventDefault(),this.fields.forEach(t=>{this.touched[t.name]=!0}),this.validateForm()?this.dispatchEvent(new CustomEvent("db-submit",{bubbles:!0,composed:!0,detail:{values:{...this.values}}})):this.refreshAllFieldStates()}handleReset(t){t.preventDefault(),this.values={...this.initialValues},this.bootstrapValues(),this.errors={},this.touched={},this.renderFields(),this.dispatchEvent(new CustomEvent("db-reset",{bubbles:!0,composed:!0,detail:{values:{...this.values}}})),this.dispatchEvent(new CustomEvent("db-change",{bubbles:!0,composed:!0,detail:{values:{...this.values}}}))}}customElements.get("db-form")||customElements.define("db-form",DbForm);const VARIANTS$8=["default","minimal"],ALIGNS=["center","left"];function navigatePageHeaderBack(t="/"){if("undefined"==typeof window)return;const e=window.history.state?.idx;if("number"==typeof e&&e>0)return void window.history.back();(()=>{try{return!!document.referrer&&new URL(document.referrer).origin===window.location.origin}catch{return!1}})()||window.history.length>1?window.history.back():window.location.assign(t)}class DbPageHeader extends HTMLElement{constructor(){super(...arguments),this.internalTabId="",this.handleBack=()=>{const t=new CustomEvent("db-back",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(t),t.defaultPrevented||navigatePageHeaderBack(this.getAttribute("back-fallback-href")||"/")},this.handleTabChange=t=>{const e=t.detail,i=e?.selectedId??this.parseTabs()[e?.index??0]?.id??String(e?.index??0);this.hasAttribute("selected-tab-id")||(this.internalTabId=i),this.dispatchEvent(new CustomEvent("db-tab-change",{bubbles:!0,composed:!0,detail:{tabId:i}}))}}static get observedAttributes(){return["title","subtitle","description","breadcrumbs","variant","show-back-button","back-fallback-href","back-label","tabs","selected-tab-id","default-selected-tab-id","align"]}connectedCallback(){this.syncDefaultTab(),this.render()}attributeChangedCallback(t){this.isConnected&&("default-selected-tab-id"!==t&&"tabs"!==t||this.syncDefaultTab(),this.render())}syncDefaultTab(){if(this.internalTabId)return;const t=this.parseTabs(),e=this.getAttribute("default-selected-tab-id");this.internalTabId=e||t[0]?.id||""}parseTabs(){try{const t=JSON.parse(this.getAttribute("tabs")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}parseBreadcrumbs(){try{const t=JSON.parse(this.getAttribute("breadcrumbs")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}getActiveTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId}getVariant(){const t=this.getAttribute("variant")||"default";return VARIANTS$8.includes(t)?t:"default"}getAlign(){const t=this.getAttribute("align")||"center";return ALIGNS.includes(t)?t:"center"}collectActions(){const t=Array.from(this.querySelectorAll(':scope > [slot="actions"]'));if(t.length)return t;const e=this.querySelector(":scope > .designbase-wc-page-header__cta")||this.querySelector(":scope > .designbase-wc-page-header__actions");return e?Array.from(e.children):[]}collectDescriptionSlot(){const t=this.querySelector(':scope > [slot="description"]');if(t)return t;const e=this.querySelector(":scope .designbase-wc-page-header__description"),i=e?.firstElementChild;return i||null}renderTitleBlock(t){const e=document.createDocumentFragment(),i=this.getAttribute("title")||"",s=this.getAttribute("subtitle"),n=document.createElement("h1");if(n.className="designbase-wc-page-header__title",n.textContent=i,e.append(n),s){const t=document.createElement("h2");t.className="designbase-wc-page-header__subtitle",t.textContent=s,e.append(t)}const a=this.getAttribute("description");if(t||a){const i=document.createElement("div");i.className="designbase-wc-page-header__description",t?i.append(t):i.textContent=a,e.append(i)}return e}render(){const t=this.collectActions(),e=this.collectDescriptionSlot(),i="minimal"===this.getVariant(),s=this.getAlign(),n=this.parseBreadcrumbs(),a=this.parseTabs(),r=a.length>0,o=this.hasAttribute("show-back-button");if(this.className=["designbase-wc-page-header",i?"designbase-wc-page-header--minimal":`designbase-wc-page-header--${s}`].filter(Boolean).join(" "),this.replaceChildren(),n.length){const t=document.createElement("div");t.className="designbase-wc-page-header__breadcrumbs";const e=document.createElement("db-breadcrumbs");e.setAttribute("size","s"),e.setAttribute("items",JSON.stringify(n)),t.append(e),this.append(t)}const l=document.createElement("div");l.className="designbase-wc-page-header__main";const h=document.createElement("div");if(h.className="designbase-wc-page-header__content",i&&o){const t=document.createElement("div");t.className="designbase-wc-page-header__title-row";const i=document.createElement("db-button");i.className="designbase-wc-page-header__back-button",i.setAttribute("variant","tertiary"),i.setAttribute("size","m"),i.setAttribute("icon-only",""),i.setAttribute("start-icon","chevron-left"),i.setAttribute("aria-label",this.getAttribute("back-label")||"뒤로가기"),i.setAttribute("tooltip",this.getAttribute("back-label")||"뒤로가기"),i.addEventListener("db-click",this.handleBack),t.append(i);const s=document.createElement("div");s.className="designbase-wc-page-header__title-group",s.append(this.renderTitleBlock(e)),t.append(s),h.append(t)}else h.append(this.renderTitleBlock(e));if(l.append(h),i&&t.length){const e=document.createElement("div");e.className="designbase-wc-page-header__cta",t.forEach(t=>e.append(t)),l.append(e)}if(this.append(l),!i&&t.length){const e=document.createElement("div");e.className="designbase-wc-page-header__actions",t.forEach(t=>e.append(t)),this.append(e)}this.renderMinimalTabs(i,r,a)}renderMinimalTabs(t,e,i){if(!t||!e)return;const s=document.createElement("div");s.className="designbase-wc-page-header__toolbar";const n=document.createElement("div");n.className="designbase-wc-page-header__tabs";const a=document.createElement("db-tabs");a.setAttribute("size","s"),a.setAttribute("items",JSON.stringify(i)),a.setAttribute("selected-id",this.getActiveTabId()),a.addEventListener("db-change",this.handleTabChange),n.append(a),s.append(n),this.append(s)}}customElements.get("db-page-header")||customElements.define("db-page-header",DbPageHeader);const SIZES$9=["s","m","l","xl"];class DbSection extends HTMLElement{constructor(){super(...arguments),this.contentId=`db-section-${Math.random().toString(36).slice(2,9)}`,this.internalExpanded=!0,this.handleToggle=()=>{if(!this.isCollapsible())return;const t=!this.isExpanded();this.hasAttribute("expanded")||(this.internalExpanded=t),this.dispatchEvent(new CustomEvent("db-expanded-change",{bubbles:!0,composed:!0,detail:{expanded:t}})),this.hasAttribute("expanded")||(this.syncHostClasses(),this.syncCollapsibleState())}}static get observedAttributes(){return["title","subtitle","description","size","collapsible","default-expanded","expanded","no-padding","full-width","full-height","overflow-visible"]}connectedCallback(){this.internalExpanded="false"!==this.getAttribute("default-expanded"),this.ensureStructure(),this.sync(),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this,{childList:!0})}disconnectedCallback(){this.observer?.disconnect()}attributeChangedCallback(t){this.isConnected&&("default-expanded"!==t||this.hasAttribute("expanded")||(this.internalExpanded="false"!==this.getAttribute("default-expanded")),this.sync())}isCollapsible(){return this.hasAttribute("collapsible")}isExpanded(){return!this.isCollapsible()||(this.hasAttribute("expanded")?"false"!==this.getAttribute("expanded"):this.internalExpanded)}isUserNode(t){return!t.hasAttribute("data-wc-internal")}collectSlotted(t){const e=Array.from(this.querySelectorAll(`:scope > [slot="${t}"]`)).filter(this.isUserNode);if(e.length)return e;if("actions"===t&&this.actionsHostEl)return Array.from(this.actionsHostEl.children);if("footer"===t&&this.footerEl)return Array.from(this.footerEl.children);if("header"===t){const t=this.headerEl?.querySelector(".designbase-wc-section__header-main");return t?Array.from(t.children):[]}if("description"===t){const t=this.headerEl?.querySelector(".designbase-wc-section__description"),e=t?.firstElementChild;return e?[e]:[]}return[]}collectContentNodes(){const t=Array.from(this.children).filter(t=>{if(!this.isUserNode(t))return!1;const e=t.getAttribute("slot");return!e||"default"===e});return t.length?t:this.contentEl?Array.from(this.contentEl.children):[]}ensureStructure(){this.headerEl||(this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-section__header",this.headerEl.setAttribute("data-wc-internal","")),this.bodyEl||(this.bodyEl=document.createElement("div"),this.bodyEl.className="designbase-wc-section__body",this.bodyEl.id=this.contentId,this.bodyEl.setAttribute("data-wc-internal",""),this.bodyInnerEl=document.createElement("div"),this.bodyInnerEl.className="designbase-wc-section__body-inner",this.bodyInnerEl.setAttribute("data-wc-internal",""),this.bodyEl.append(this.bodyInnerEl)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-section__content",this.contentEl.setAttribute("data-wc-internal","")),this.footerEl||(this.footerEl=document.createElement("div"),this.footerEl.className="designbase-wc-section__footer",this.footerEl.setAttribute("data-wc-internal","")),this.headerEl.isConnected||this.append(this.headerEl)}mountBody(){const t=this.collectContentNodes(),e=this.collectSlotted("footer");if(this.contentEl.replaceChildren(...t),this.footerEl.replaceChildren(...e),this.footerEl.hidden=0===e.length,this.isCollapsible())return this.bodyInnerEl.replaceChildren(this.contentEl,this.footerEl),void(this.bodyEl.isConnected||this.append(this.bodyEl));this.bodyEl?.remove(),this.contentEl.isConnected||this.append(this.contentEl),e.length?this.footerEl.isConnected||this.append(this.footerEl):this.footerEl.remove()}getChevronSize(){const t=this.getAttribute("size")||"m";return"s"===t?16:"l"===t||"xl"===t?24:20}createTitleArea(){const t=this.getAttribute("title"),e=this.getAttribute("subtitle"),i=this.getAttribute("description"),s=this.collectSlotted("description")[0];if(!(t||e||i||s))return null;const n=document.createElement("div");if(n.className="designbase-wc-section__title-area",t){const e=document.createElement("h2");e.className="designbase-wc-section__title",e.textContent=t,n.append(e)}if(e){const t=document.createElement("h3");t.className="designbase-wc-section__subtitle",t.textContent=e,n.append(t)}if(s){const t=document.createElement("p");t.className="designbase-wc-section__description",t.append(s),n.append(t)}else if(i){const t=document.createElement("p");t.className="designbase-wc-section__description",t.textContent=i,n.append(t)}return n}createChevron(){const t=document.createElement("span");return t.className="designbase-wc-section__chevron",t.setAttribute("aria-hidden","true"),t.append(createDbIcon("chevron-down",this.getChevronSize())),t}renderHeader(){if(!this.headerEl)return;const t=this.collectSlotted("header")[0],e=this.collectSlotted("actions"),i=this.createTitleArea(),s=Boolean(t||i||e.length);if(this.headerEl.replaceChildren(),this.headerEl.hidden=!s,s)if(this.isCollapsible())if(t){const e=document.createElement("button");e.type="button",e.className="designbase-wc-section__header-trigger",e.setAttribute("aria-expanded",String(this.isExpanded())),e.setAttribute("aria-controls",this.contentId),e.addEventListener("click",this.handleToggle);const i=document.createElement("div");i.className="designbase-wc-section__header-main",i.append(t),e.append(i,this.createChevron()),this.headerEl.append(e)}else{const t=document.createElement("button");t.type="button",t.className="designbase-wc-section__header-trigger",t.setAttribute("aria-expanded",String(this.isExpanded())),t.setAttribute("aria-controls",this.contentId),t.addEventListener("click",this.handleToggle),i&&t.append(i),t.append(this.createChevron()),this.headerEl.append(t),e.length&&(this.actionsHostEl=document.createElement("div"),this.actionsHostEl.className="designbase-wc-section__actions",this.actionsHostEl.addEventListener("click",t=>t.stopPropagation()),e.forEach(t=>this.actionsHostEl.append(t)),this.headerEl.append(this.actionsHostEl))}else t?this.headerEl.append(t):(i&&this.headerEl.append(i),e.length&&(this.actionsHostEl=document.createElement("div"),this.actionsHostEl.className="designbase-wc-section__actions",e.forEach(t=>this.actionsHostEl.append(t)),this.headerEl.append(this.actionsHostEl)))}syncHostClasses(){const t=this.getAttribute("size")||"m",e=SIZES$9.includes(t)?t:"m",i=this.isExpanded();this.className=["designbase-wc-section",`designbase-wc-section--size-${e}`,this.hasAttribute("no-padding")&&"designbase-wc-section--no-padding",this.hasAttribute("full-width")&&"designbase-wc-section--full-width",this.hasAttribute("full-height")&&"designbase-wc-section--full-height",this.hasAttribute("overflow-visible")&&"designbase-wc-section--overflow-visible",this.isCollapsible()&&"designbase-wc-section--collapsible",this.isCollapsible()&&i&&"designbase-wc-section--expanded",this.isCollapsible()&&!i&&"designbase-wc-section--collapsed"].filter(Boolean).join(" ")}syncCollapsibleState(){if(!this.isCollapsible()||!this.bodyEl)return;const t=this.isExpanded();this.bodyEl.setAttribute("aria-hidden",String(!t));const e=this.headerEl?.querySelector(".designbase-wc-section__header-trigger");e?.setAttribute("aria-expanded",String(t))}sync(){this.ensureStructure(),this.syncHostClasses(),this.renderHeader(),this.mountBody(),this.syncCollapsibleState()}}customElements.get("db-section")||customElements.define("db-section",DbSection);const SIZES$8=["s","m","l"],VARIANTS$7=["primary","secondary","tertiary"],CIRCULAR_SPINNER_HTML='<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>',ICON_SIZE={s:16,m:24,l:32};class DbFloatingActionButton extends HTMLElement{constructor(){super(...arguments),this.handleClick=t=>{if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))}}static get observedAttributes(){return["size","variant","icon","loading","disabled","aria-label"]}get size(){const t=this.getAttribute("size")||"m";return SIZES$8.includes(t)?t:"m"}set size(t){this.setAttribute("size",t)}get variant(){const t=this.getAttribute("variant")||"primary";return VARIANTS$7.includes(t)?t:"primary"}set variant(t){this.setAttribute("variant",t)}get loading(){return this.hasAttribute("loading")}set loading(t){this.toggleAttribute("loading",Boolean(t))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",Boolean(t))}connectedCallback(){"button"!==this.getAttribute("role")&&this.setAttribute("role","button"),this.hasAttribute("type")||this.setAttribute("type","button"),this.addEventListener("click",this.handleClick),this.sync()}disconnectedCallback(){this.removeEventListener("click",this.handleClick)}attributeChangedCallback(){this.isConnected&&this.sync()}resolveIconName(t){if(!t)return;return t in{plus:1,search:1,settings:1,edit:1,close:1}?t:void 0}sync(){this.className=["designbase-wc-fab",`designbase-wc-fab--${this.size}`,`designbase-wc-fab--${this.variant}`,this.disabled&&"designbase-wc-fab--disabled",this.loading&&"designbase-wc-fab--loading"].filter(Boolean).join(" ");const t=this.getAttribute("aria-label")||"Floating action button";this.getAttribute("aria-label")!==t&&this.setAttribute("aria-label",t);const e=String(this.loading);this.getAttribute("aria-busy")!==e&&this.setAttribute("aria-busy",e);const i=String(this.disabled||this.loading);this.getAttribute("aria-disabled")!==i&&this.setAttribute("aria-disabled",i);let s=this.querySelector(":scope > .designbase-wc-fab__icon");if(s||(s=document.createElement("div"),s.className="designbase-wc-fab__icon",this.append(s)),s.replaceChildren(),this.loading){const t=document.createElement("span");return t.className="designbase-wc-spinner designbase-wc-spinner--circular designbase-wc-spinner--s",t.setAttribute("aria-hidden","true"),t.innerHTML=CIRCULAR_SPINNER_HTML,void s.append(t)}const n=this.getAttribute("icon"),a=this.resolveIconName(n);if(a)return void s.append(createDbIcon(a,ICON_SIZE[this.size]));const r=Array.from(this.children).find(t=>t!==s&&!t.hasAttribute("data-wc-internal"));r&&!r.isConnected&&s.append(r)}}customElements.get("db-floating-action-button")||customElements.define("db-floating-action-button",DbFloatingActionButton);const HEIGHT_PRESETS={s:40,m:60,l:80,full:100},VARIANTS$6=["default","persistent","temporary","fullscreen"],ANIMATIONS=["slide","fade","scale","none"],MIN_HEIGHT_PERCENT=20,CLOSE_HEIGHT_PERCENT=22,CLOSE_DRAG_PX=72;function resolveHeightPercent(t){if(!t)return HEIGHT_PRESETS.m;const e=HEIGHT_PRESETS[t];if(e)return Math.min(100,Math.max(MIN_HEIGHT_PERCENT,e));const i=Number(t);return Number.isFinite(i)?Math.min(100,Math.max(MIN_HEIGHT_PERCENT,i)):HEIGHT_PRESETS.m}class DbBottomSheet extends HTMLElement{constructor(){super(...arguments),this.sheetHeightPercent=HEIGHT_PRESETS.m,this.isDragging=!1,this.isVisible=!1,this.isMounted=!1,this.keyHandler=null,this.dragState={active:!1,pointerId:-1,startY:0,startHeight:HEIGHT_PRESETS.m,lastY:0,lastTime:0},this.handlePointerDown=t=>{"true"!==this.getAttribute("disable-drag")&&0===t.button&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),this.dragState={active:!0,pointerId:t.pointerId,startY:t.clientY,startHeight:this.sheetHeightPercent,lastY:t.clientY,lastTime:Date.now()},this.isDragging=!0,this.syncActiveClasses())},this.handlePointerMove=t=>{const e=this.dragState;if(!e.active||t.pointerId!==e.pointerId)return;t.preventDefault(),e.lastY=t.clientY,e.lastTime=Date.now();const i=window.innerHeight||1,s=(e.startY-t.clientY)/i*100,n=this.getMaxHeightLimit(resolveHeightPercent(this.getAttribute("height")));this.sheetHeightPercent=Math.min(n,Math.max(MIN_HEIGHT_PERCENT,e.startHeight+s)),this.applySheetDimensions()},this.handlePointerUp=t=>{const e=this.dragState;if(!e.active||t.pointerId!==e.pointerId)return;const i=t.currentTarget;i.hasPointerCapture(t.pointerId)&&i.releasePointerCapture(t.pointerId),this.finishDrag()}}static get observedAttributes(){return["open","title","subtitle","height","max-height","variant","disable-backdrop-click","disable-escape-key-down","disable-drag","show-close-button","animation","animation-duration","z-index","show-backdrop","backdrop-blur","backdrop-opacity","sticky-header","sticky-footer"]}connectedCallback(){this.style.display="contents",this.render(),this.syncOpenState()}disconnectedCallback(){this.clearTimers(),this.detachEscape(),this.root?.remove(),this.root=void 0,document.body.style.overflow=""}attributeChangedCallback(t){this.isConnected&&("open"!==t?("height"===t&&this.isOpenRequested()&&(this.sheetHeightPercent=resolveHeightPercent(this.getAttribute("height"))),this.render(),this.isMounted&&this.syncActiveClasses()):this.syncOpenState())}isOpenRequested(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}clearTimers(){this.enterTimer&&(clearTimeout(this.enterTimer),this.enterTimer=void 0),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=void 0)}getMaxHeightLimit(t){const e=Number(this.getAttribute("max-height")||0),i=t>=100;return Math.min(100,Math.max(t,e||(i?100:90)))}close(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}attachEscape(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key&&"true"!==this.getAttribute("disable-escape-key-down")&&this.close()},document.addEventListener("keydown",this.keyHandler))}detachEscape(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}collectSlotted(t){const e=Array.from(this.querySelectorAll(`:scope > [slot="${t}"]`));if(e.length)return e;if("header"===t){const t=this.sheet?.querySelector(".designbase-wc-bottom-sheet__header-main");return t?Array.from(t.children):[]}if("footer"===t){const t=this.sheet?.querySelector(".designbase-wc-bottom-sheet__footer");return t?Array.from(t.children):[]}return[]}collectContentNodes(){const t=Array.from(this.children).filter(t=>{const e=t.getAttribute("slot");return!e||"default"===e});return t.length?t:this.contentEl?Array.from(this.contentEl.children):[]}finishDrag(){const t=this.dragState;if(!t.active)return;t.active=!1,this.isDragging=!1;const e=t.lastY-t.startY,i=e/Math.max(1,Date.now()-t.lastTime),s=window.innerHeight||1,n=(t.startY-t.lastY)/s*100,a=this.getMaxHeightLimit(resolveHeightPercent(this.getAttribute("height"))),r=Math.min(a,Math.max(MIN_HEIGHT_PERCENT,t.startHeight+n));r<=CLOSE_HEIGHT_PERCENT||e>CLOSE_DRAG_PX||i>.6?this.close():(this.sheetHeightPercent=r,this.applySheetDimensions(),this.syncActiveClasses())}syncOpenState(){const t=this.isOpenRequested(),e=Number(this.getAttribute("animation-duration")||300);if(this.clearTimers(),t)return this.sheetHeightPercent=resolveHeightPercent(this.getAttribute("height")),this.render(),this.isMounted=!0,this.isVisible=!1,this.syncActiveClasses(),this.root&&!this.root.isConnected&&document.body.append(this.root),this.enterTimer=setTimeout(()=>{this.enterTimer=void 0,this.isVisible=!0,this.syncActiveClasses()},10),document.body.style.overflow="hidden",void this.attachEscape();this.isVisible=!1,this.syncActiveClasses(),this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,this.detachContentToHost(),this.isMounted=!1,this.syncActiveClasses(),this.root?.remove(),document.body.style.overflow="",this.detachEscape()},e),this.detachEscape()}syncActiveClasses(){if(!this.sheet)return;const t=resolveHeightPercent(this.getAttribute("height")),e=this.getAttribute("variant")||"default",i=this.getAttribute("animation")||"slide",s=VARIANTS$6.includes(e)?e:"default",n=ANIMATIONS.includes(i)?i:"slide",a="false"!==this.getAttribute("show-backdrop"),r=this.hasAttribute("sticky-header"),o=this.hasAttribute("sticky-footer");this.sheet.className=["designbase-wc-bottom-sheet",`designbase-wc-bottom-sheet--${s}`,`designbase-wc-bottom-sheet--${n}`,this.isMounted&&this.isVisible&&"designbase-wc-bottom-sheet--open",this.isDragging&&"designbase-wc-bottom-sheet--dragging",r&&"designbase-wc-bottom-sheet--sticky-header",o&&"designbase-wc-bottom-sheet--sticky-footer",!a&&"designbase-wc-bottom-sheet--no-backdrop",(t>=100||this.sheetHeightPercent>=100)&&"designbase-wc-bottom-sheet--full"].filter(Boolean).join(" "),this.backdrop?.classList.toggle("designbase-wc-backdrop--open",this.isMounted&&this.isVisible)}applySheetDimensions(){if(!this.sheet)return;const t=this.getMaxHeightLimit(resolveHeightPercent(this.getAttribute("height")));this.sheet.style.height=`${this.sheetHeightPercent}vh`,this.sheet.style.maxHeight=`${t}vh`}detachContentToHost(){this.contentEl&&Array.from(this.contentEl.children).forEach(t=>this.append(t));const t=this.sheet?.querySelector(".designbase-wc-bottom-sheet__header-main");t&&Array.from(t.children).forEach(t=>{"bottom-sheet-title"!==t.id&&"bottom-sheet-subtitle"!==t.id&&this.append(t)});const e=this.sheet?.querySelector(".designbase-wc-bottom-sheet__footer");e&&Array.from(e.children).forEach(t=>this.append(t))}render(){const t=this.getAttribute("title"),e=this.getAttribute("subtitle"),i="false"!==this.getAttribute("show-close-button"),s="false"!==this.getAttribute("show-backdrop"),n=this.hasAttribute("backdrop-blur"),a=this.getAttribute("backdrop-opacity")||"0.5",r=this.getAttribute("animation-duration")||"300",o=this.getAttribute("z-index")||"1000",l=this.hasAttribute("sticky-header"),h=this.hasAttribute("sticky-footer"),d=this.collectSlotted("header"),u=this.collectSlotted("footer"),p=this.collectContentNodes();if(this.root||(this.root=document.createElement("div"),this.root.setAttribute("data-wc-internal",""),this.backdrop=document.createElement("div"),this.backdrop.className="designbase-wc-backdrop designbase-wc-backdrop--bottom-sheet",this.backdrop.setAttribute("role","presentation"),this.backdrop.addEventListener("click",t=>{t.target===this.backdrop&&"true"!==this.getAttribute("disable-backdrop-click")&&this.close()}),this.sheet=document.createElement("div"),this.sheet.setAttribute("role","dialog"),this.sheet.setAttribute("aria-modal","true"),this.grabBar=document.createElement("div"),this.grabBar.className="designbase-wc-bottom-sheet__grab-bar",this.grabBar.addEventListener("pointerdown",this.handlePointerDown),this.grabBar.addEventListener("pointermove",this.handlePointerMove),this.grabBar.addEventListener("pointerup",this.handlePointerUp),this.grabBar.addEventListener("pointercancel",this.handlePointerUp),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-bottom-sheet__content"),this.root.replaceChildren(),s&&this.backdrop&&(this.backdrop.className=["designbase-wc-backdrop","designbase-wc-backdrop--bottom-sheet",n&&"designbase-wc-backdrop--blur"].filter(Boolean).join(" "),this.backdrop.style.setProperty("--backdrop-opacity",a),this.backdrop.style.zIndex=o,this.backdrop.setAttribute("aria-hidden",String(!this.isOpenRequested())),this.root.append(this.backdrop)),!this.sheet||!this.grabBar||!this.contentEl)return;this.sheet.style.zIndex=String(Number(o)+1),this.sheet.style.setProperty("--bottom-sheet-animation-duration",`${r}ms`),this.applySheetDimensions(),t?this.sheet.setAttribute("aria-labelledby","bottom-sheet-title"):this.sheet.removeAttribute("aria-labelledby"),e?this.sheet.setAttribute("aria-describedby","bottom-sheet-subtitle"):this.sheet.removeAttribute("aria-describedby"),this.sheet.replaceChildren();const m="true"===this.getAttribute("disable-drag");if(this.grabBar.className=["designbase-wc-bottom-sheet__grab-bar",!m&&"designbase-wc-bottom-sheet__grab-bar--draggable"].filter(Boolean).join(" "),this.grabBar.replaceChildren(),!m){const t=document.createElement("div");t.className="designbase-wc-bottom-sheet__handle",t.setAttribute("aria-hidden","true"),this.grabBar.append(t)}this.sheet.append(this.grabBar);if(Boolean(t||e||d.length||i)){const s=document.createElement("div");s.className=["designbase-wc-bottom-sheet__header",l&&"designbase-wc-bottom-sheet__header--sticky"].filter(Boolean).join(" ");const n=document.createElement("div");if(n.className="designbase-wc-bottom-sheet__header-main",d.length)d.forEach(t=>n.append(t));else{if(t){const e=document.createElement("h2");e.id="bottom-sheet-title",e.className="designbase-wc-bottom-sheet__title",e.textContent=t,n.append(e)}if(e){const t=document.createElement("p");t.id="bottom-sheet-subtitle",t.className="designbase-wc-bottom-sheet__subtitle",t.textContent=e,n.append(t)}}if(s.append(n),i){const t=document.createElement("button");t.type="button",t.className="designbase-wc-bottom-sheet__close-button",t.setAttribute("aria-label","닫기"),t.append(createDbIcon("close",20)),t.addEventListener("click",()=>this.close()),s.append(t)}this.sheet.append(s)}if(this.contentEl.replaceChildren(...p),this.sheet.append(this.contentEl),u.length){const t=document.createElement("div");t.className=["designbase-wc-bottom-sheet__footer",h&&"designbase-wc-bottom-sheet__footer--sticky"].filter(Boolean).join(" "),u.forEach(e=>t.append(e)),this.sheet.append(t)}this.root.append(this.sheet),this.isMounted&&!this.root.isConnected&&document.body.append(this.root),this.syncActiveClasses()}}customElements.get("db-bottom-sheet")||customElements.define("db-bottom-sheet",DbBottomSheet);const DIRECTIONS$1=["vertical","horizontal","both"],SCROLLBAR_STYLES=["auto","thin","none"];class DbScrollArea extends HTMLElement{static get observedAttributes(){return["direction","scrollbar-style","max-height","max-width","min-height","min-width","full-width","full-height","always-show-scrollbar","scrollbar-color","scrollbar-track-color"]}connectedCallback(){this.ensureStructure(),this.sync(),this.resizeObserver=new ResizeObserver(()=>{this.syncViewportSize(),this.syncScrollState()}),this.resizeObserver.observe(this),this.contentEl&&this.resizeObserver.observe(this.contentEl),this.observer=new MutationObserver(()=>this.syncChildren()),this.observer.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){this.resizeObserver?.disconnect(),this.observer?.disconnect()}attributeChangedCallback(){this.isConnected&&this.sync()}ensureStructure(){this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-scroll-area__content",this.contentEl.setAttribute("data-wc-internal","")),this.contentEl.isConnected||this.append(this.contentEl)}collectContentNodes(){return Array.from(this.children).filter(t=>t!==this.contentEl&&!t.hasAttribute("data-wc-internal"))}syncChildren(){const t=this.collectContentNodes();t.length&&this.contentEl?.append(...t),this.syncScrollState()}toCssSize(t){if(!t)return;if(t.includes("px")||t.includes("%")||t.includes("vh")||t.includes("rem"))return t;const e=Number(t);return Number.isFinite(e)?`${e}px`:t}syncScrollState(){const t=this.contentEl;if(!t)return;const e=t.scrollHeight>t.clientHeight,i=t.scrollWidth>t.clientWidth;this.classList.toggle("designbase-wc-scroll-area--has-vertical",e),this.classList.toggle("designbase-wc-scroll-area--has-horizontal",i)}syncViewportSize(){if(!this.contentEl)return;const t=this.toCssSize(this.getAttribute("max-height"))||this.style.maxHeight||void 0,e=this.toCssSize(this.getAttribute("max-width"))||this.style.maxWidth||void 0,i=this.toCssSize(this.getAttribute("min-height"))||this.style.minHeight||void 0,s=this.toCssSize(this.getAttribute("min-width"))||this.style.minWidth||void 0;this.contentEl.style.maxHeight=t||"",this.contentEl.style.maxWidth=e||"",this.contentEl.style.minHeight=i||"",this.contentEl.style.minWidth=s||""}sync(){this.ensureStructure();const t=this.getAttribute("direction")||"vertical",e=this.getAttribute("scrollbar-style")||"auto",i=DIRECTIONS$1.includes(t)?t:"vertical",s=SCROLLBAR_STYLES.includes(e)?e:"auto";this.className=["designbase-wc-scroll-area",`designbase-wc-scroll-area--direction-${i}`,`designbase-wc-scroll-area--scrollbar-${s}`,this.hasAttribute("full-width")&&"designbase-wc-scroll-area--full-width",this.hasAttribute("full-height")&&"designbase-wc-scroll-area--full-height",this.hasAttribute("always-show-scrollbar")&&"designbase-wc-scroll-area--always-show"].filter(Boolean).join(" ");const n=this.getAttribute("scrollbar-color"),a=this.getAttribute("scrollbar-track-color");n?this.style.setProperty("--scrollbar-color",n):this.style.removeProperty("--scrollbar-color"),a?this.style.setProperty("--scrollbar-track-color",a):this.style.removeProperty("--scrollbar-track-color"),this.syncViewportSize(),this.syncChildren()}}customElements.get("db-scroll-area")||customElements.define("db-scroll-area",DbScrollArea);const SIZES$7=["s","m","l"],VARIANTS$5=["default","outlined","filled"];class DbDropzone extends HTMLElement{constructor(){super(...arguments),this.internalDragOver=!1,this.handleFileInputChange=()=>{this.emitFiles(this.fileInput?.files??null),this.fileInput&&(this.fileInput.value="")},this.handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.isDisabled()||(this.internalDragOver=!0,this.syncClasses(),this.dispatchEvent(new CustomEvent("db-drag-over",{bubbles:!0,composed:!0,detail:{event:t}})))},this.handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.isDisabled()||(this.internalDragOver=!1,this.syncClasses(),this.dispatchEvent(new CustomEvent("db-drag-leave",{bubbles:!0,composed:!0,detail:{event:t}})))},this.handleDrop=t=>{t.preventDefault(),t.stopPropagation(),this.isDisabled()||(this.internalDragOver=!1,this.syncClasses(),this.emitFiles(t.dataTransfer?.files??null),this.dispatchEvent(new CustomEvent("db-drop",{bubbles:!0,composed:!0,detail:{event:t}})))},this.handleClick=t=>{this.isDisabled()||t.target.closest(".designbase-wc-dropzone__button")||(this.fileInput?.click(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0,detail:{event:t}})))}}static get observedAttributes(){return["size","variant","show-icon","icon","image","title","description","button-text","show-button","accept","max-size","multiple","drag-over","disabled","readonly"]}connectedCallback(){this.ensureInput(),this.sync(),this.addEventListener("dragover",this.handleDragOver),this.addEventListener("dragleave",this.handleDragLeave),this.addEventListener("drop",this.handleDrop),this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.removeEventListener("dragover",this.handleDragOver),this.removeEventListener("dragleave",this.handleDragLeave),this.removeEventListener("drop",this.handleDrop),this.removeEventListener("click",this.handleClick)}attributeChangedCallback(){this.isConnected&&this.sync()}ensureInput(){this.fileInput||(this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.style.display="none",this.fileInput.setAttribute("data-wc-internal",""),this.fileInput.addEventListener("change",this.handleFileInputChange),this.append(this.fileInput))}isDisabled(){return this.hasAttribute("disabled")||this.hasAttribute("readonly")}isDragOver(){return this.hasAttribute("drag-over")?"false"!==this.getAttribute("drag-over"):this.internalDragOver}validateFile(t){const e=this.getAttribute("accept");if(e){const i=e.split(",").map(t=>t.trim()),s=t.type,n=`.${t.name.split(".").pop()?.toLowerCase()}`;if(!i.some(t=>t.startsWith(".")?n===t.toLowerCase():s===t||s.startsWith(t.replace("*",""))))return!1}const i=Number(this.getAttribute("max-size")||0);return!(i>0&&t.size>i)}emitFiles(t){if(!t||0===t.length)return;const e=Array.from(t).filter(t=>this.validateFile(t));e.length&&this.dispatchEvent(new CustomEvent("db-file-select",{bubbles:!0,composed:!0,detail:{files:e}}))}getDescriptionText(){const t=this.getAttribute("description");if(t)return t;const e=this.getAttribute("accept");if(!e)return"모든 파일 형식 지원";let i=e.split(",").map(t=>{const e=t.trim();return e.startsWith(".")?e.toUpperCase():e.includes("*")?e.replace("*","").toUpperCase():e}).join(", ");const s=Number(this.getAttribute("max-size")||0);if(s>0){const t=1024,e=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(s)/Math.log(t));i+=` (최대 ${`${parseFloat((s/t**n).toFixed(2))} ${e[n]}`})`}return i}collectChildren(){return Array.from(this.children).filter(t=>t!==this.fileInput&&!t.hasAttribute("data-wc-internal"))}syncClasses(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=SIZES$7.includes(t)?t:"m",s=VARIANTS$5.includes(e)?e:"default";this.className=["designbase-wc-dropzone",`designbase-wc-dropzone--size-${i}`,`designbase-wc-dropzone--variant-${s}`,this.isDragOver()&&"designbase-wc-dropzone--drag-over",this.hasAttribute("disabled")&&"designbase-wc-dropzone--disabled",this.hasAttribute("readonly")&&"designbase-wc-dropzone--readonly"].filter(Boolean).join(" ")}sync(){this.ensureInput(),this.syncClasses();const t=this.getAttribute("accept"),e=this.hasAttribute("multiple");this.fileInput&&(t?this.fileInput.setAttribute("accept",t):this.fileInput.removeAttribute("accept"),this.fileInput.toggleAttribute("multiple",e),this.fileInput.disabled=this.isDisabled());const i=this.collectChildren(),s=this.querySelector(":scope > .designbase-wc-dropzone__content[data-wc-internal]");if(i.length)return void s?.remove();let n=s;n||(n=document.createElement("div"),n.className="designbase-wc-dropzone__content",n.setAttribute("data-wc-internal",""),this.append(n)),n.replaceChildren();const a=this.getAttribute("size")||"m",r=SIZES$7.includes(a)?a:"m",o=this.getAttribute("image"),l="false"!==this.getAttribute("show-icon"),h=this.getAttribute("icon")||"gallery",d=this.getAttribute("title")||"파일을 드래그하여 업로드하거나 클릭하여 선택하세요",u=this.getDescriptionText(),p=this.hasAttribute("show-button"),m=this.getAttribute("button-text")||"파일 선택";if(o){const t=document.createElement("div");t.className="designbase-wc-dropzone__image";const e=document.createElement("img");e.src=o,e.alt="Upload illustration",t.append(e),n.append(t)}else if(l){const t=document.createElement("div");t.className="designbase-wc-dropzone__icon";const e="s"===r?32:"l"===r?56:48;t.append(createDbIcon(h,e)),n.append(t)}if(d){const t=document.createElement("div");t.className="designbase-wc-dropzone__title",t.textContent=d,n.append(t)}if(u){const t=document.createElement("div");t.className="designbase-wc-dropzone__description",t.textContent=u,n.append(t)}if(p){const t=document.createElement("button");t.type="button",t.className="designbase-wc-dropzone__button",t.textContent=m,t.disabled=this.isDisabled(),t.addEventListener("click",t=>{t.stopPropagation(),this.isDisabled()||this.fileInput?.click()}),n.append(t)}}}customElements.get("db-dropzone")||customElements.define("db-dropzone",DbDropzone);class DbOnboardingModal extends HTMLElement{constructor(){super(...arguments),this.internalStep=0,this.keyHandler=null,this.isMounted=!1,this.handlePrev=()=>{this.getCurrentStep()>0&&this.goToStep(this.getCurrentStep()-1)},this.handleNext=()=>{const t=this.getSteps(),e=this.getCurrentStep();e>=t.length-1?this.dispatchEvent(new CustomEvent("db-complete",{bubbles:!0,composed:!0})):this.goToStep(e+1)}}static get observedAttributes(){return["open","steps","current-step","show-close-button","show-indicator","indicator-type","indicator-size"]}connectedCallback(){this.style.display="contents",this.syncStepFromAttribute(),this.syncOpenState()}disconnectedCallback(){this.detachKeyHandler(),this.unmount()}attributeChangedCallback(t){this.isConnected&&("open"!==t?("current-step"===t&&this.syncStepFromAttribute(),this.isMounted&&this.render()):this.syncOpenState())}isOpenRequested(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}parseSteps(){const t=this.getAttribute("steps");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}syncStepFromAttribute(){if(!this.hasAttribute("current-step"))return;const t=Number(this.getAttribute("current-step")||0);Number.isFinite(t)&&(this.internalStep=Math.max(0,t))}getSteps(){return this.parseSteps()}getCurrentStep(){const t=this.getSteps();return t.length?Math.min(Math.max(this.internalStep,0),t.length-1):0}close(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}emitStepChange(t){this.dispatchEvent(new CustomEvent("db-step-change",{bubbles:!0,composed:!0,detail:{step:t}}))}goToStep(t){const e=this.getSteps();if(!e.length)return;const i=Math.min(Math.max(t,0),e.length-1);this.internalStep=i,this.emitStepChange(i),this.render()}attachKeyHandler(){this.keyHandler||(this.keyHandler=t=>{"Escape"!==t.key?"ArrowLeft"===t.key&&this.getCurrentStep()>0?this.handlePrev():"ArrowRight"===t.key&&this.getCurrentStep()<this.getSteps().length-1&&this.handleNext():this.close()},document.addEventListener("keydown",this.keyHandler))}detachKeyHandler(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}syncOpenState(){if(this.isOpenRequested())return this.mount(),void this.attachKeyHandler();this.detachKeyHandler(),this.unmount()}mount(){this.root||(this.root=document.createElement("div"),this.root.className="designbase-wc-onboarding-modal",this.root.setAttribute("role","dialog"),this.root.setAttribute("aria-modal","true"),this.root.tabIndex=-1,this.ensureStructure()),this.root.isConnected||document.body.append(this.root),this.isMounted=!0,this.render()}unmount(){this.isMounted=!1,this.root?.remove()}ensureStructure(){this.root&&!this.contentEl&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="designbase-wc-onboarding-modal__overlay",this.overlayEl.addEventListener("click",()=>this.close()),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-onboarding-modal__content",this.closeButtonEl=document.createElement("button"),this.closeButtonEl.type="button",this.closeButtonEl.className="designbase-wc-onboarding-modal__close-button",this.closeButtonEl.setAttribute("aria-label","닫기"),this.closeButtonEl.append(createDbIcon("close",20)),this.closeButtonEl.addEventListener("click",()=>this.close()),this.mainEl=document.createElement("div"),this.mainEl.className="designbase-wc-onboarding-modal__main",this.imageWrapEl=document.createElement("div"),this.imageWrapEl.className="designbase-wc-onboarding-modal__image",this.imageEl=document.createElement("img"),this.imageWrapEl.append(this.imageEl),this.textEl=document.createElement("div"),this.textEl.className="designbase-wc-onboarding-modal__text",this.titleEl=document.createElement("h2"),this.titleEl.id="onboarding-title",this.titleEl.className="designbase-wc-onboarding-modal__title",this.descriptionEl=document.createElement("p"),this.descriptionEl.id="onboarding-description",this.descriptionEl.className="designbase-wc-onboarding-modal__description",this.textEl.append(this.titleEl,this.descriptionEl),this.mainEl.append(this.imageWrapEl,this.textEl),this.navigationEl=document.createElement("div"),this.navigationEl.className="designbase-wc-onboarding-modal__navigation",this.prevButtonEl=document.createElement("db-button"),this.prevButtonEl.setAttribute("variant","secondary"),this.prevButtonEl.setAttribute("size","m"),this.prevButtonEl.setAttribute("start-icon","chevron-left"),this.prevButtonEl.setAttribute("aria-label","이전"),this.prevButtonEl.addEventListener("db-click",this.handlePrev),this.indicatorEl=document.createElement("db-indicator"),this.indicatorEl.addEventListener("db-step-click",t=>{const e=t.detail;this.goToStep(e.index??e.current)}),this.nextButtonEl=document.createElement("db-button"),this.nextButtonEl.setAttribute("variant","primary"),this.nextButtonEl.setAttribute("size","m"),this.nextButtonEl.addEventListener("db-click",this.handleNext),this.navigationEl.append(this.prevButtonEl,this.indicatorEl,this.nextButtonEl),this.contentEl.append(this.closeButtonEl,this.mainEl,this.navigationEl),this.root.append(this.overlayEl,this.contentEl))}render(){if(!this.root||!this.isMounted)return;this.ensureStructure();const t=this.getSteps(),e=this.getCurrentStep(),i=t[e];if(!i)return void this.root.replaceChildren();const s=!this.hasAttribute("show-close-button")||"false"!==this.getAttribute("show-close-button"),n=!this.hasAttribute("show-indicator")||"false"!==this.getAttribute("show-indicator"),a=this.getAttribute("indicator-type")||"dots",r=this.getAttribute("indicator-size")||"m",o=0===e,l=e===t.length-1;if(this.root.setAttribute("aria-labelledby","onboarding-title"),this.root.setAttribute("aria-describedby","onboarding-description"),this.closeButtonEl&&(this.closeButtonEl.style.display=s?"":"none"),this.imageWrapEl&&this.imageEl&&(i.image?(this.imageEl.src=i.image,this.imageEl.alt=i.title||"온보딩 이미지",this.imageWrapEl.style.display=""):this.imageWrapEl.style.display="none"),this.titleEl&&(this.titleEl.textContent=i.title||"",this.titleEl.style.display=i.title?"":"none"),this.descriptionEl&&(this.descriptionEl.textContent=i.description||"",this.descriptionEl.style.display=i.description?"":"none"),this.prevButtonEl&&(this.prevButtonEl.textContent="이전",o?this.prevButtonEl.setAttribute("disabled",""):this.prevButtonEl.removeAttribute("disabled")),this.nextButtonEl&&(this.nextButtonEl.textContent=l?"완료":"다음",this.nextButtonEl.setAttribute("aria-label",l?"완료":"다음"),l?this.nextButtonEl.removeAttribute("end-icon"):this.nextButtonEl.setAttribute("end-icon","chevron-right")),this.indicatorEl){const i=n&&t.length>1;this.indicatorEl.style.display=i?"":"none",i&&(this.indicatorEl.setAttribute("total",String(t.length)),this.indicatorEl.setAttribute("current",String(e)),this.indicatorEl.setAttribute("indicator-type",a),this.indicatorEl.setAttribute("size",r),this.indicatorEl.setAttribute("clickable",""))}}}customElements.get("db-onboarding-modal")||customElements.define("db-onboarding-modal",DbOnboardingModal);class DbSplitView extends HTMLElement{constructor(){super(...arguments),this.panelSizes=[],this.draggingIndex=null,this.panelSources=[],this.isSyncing=!1,this.isObserving=!1,this.handleMouseDown=t=>e=>{e.preventDefault(),this.draggingIndex=t,document.body.style.cursor="horizontal"===this.getDirection()?"col-resize":"row-resize",document.body.style.userSelect="none"},this.handleMouseMove=t=>{if(null===this.draggingIndex)return;if(!this.panelSources.length)return;const e=this.getDirection(),i=this.getMode(),s=this.getSplitterSize(),n=this.getBoundingClientRect(),a=this.panelSources[this.draggingIndex];if(!a)return;const r=this.readPanelConfig(a,this.draggingIndex,this.panelSources.length);let o=this.panelSizes[this.draggingIndex];if("horizontal"===e){const e=n.width,a=t.clientX-n.left;let l=0;for(let t=0;t<this.draggingIndex;t++){const n=this.panelSizes[t];l+="fixed"===i?n:n*e,l+=s}const h=a-l;if("fixed"===i)o=Math.max(r.minSize||0,Math.min(r.maxSize||e,h));else{o=h/e;const t=r.minSize?r.minSize/e:0,i=r.maxSize?r.maxSize/e:1;o=Math.max(t,Math.min(i,o))}}else{const e=n.height,a=t.clientY-n.top;let l=0;for(let t=0;t<this.draggingIndex;t++){const n=this.panelSizes[t];l+="fixed"===i?n:n*e,l+=s}const h=a-l;if("fixed"===i)o=Math.max(r.minSize||0,Math.min(r.maxSize||e,h));else{o=h/e;const t=r.minSize?r.minSize/e:0,i=r.maxSize?r.maxSize/e:1;o=Math.max(t,Math.min(i,o))}}this.panelSizes[this.draggingIndex]=o,this.applyPanelSizes(),this.classList.toggle("designbase-wc-split-view--dragging",!0)},this.handleMouseUp=()=>{null!==this.draggingIndex&&(this.draggingIndex=null,document.body.style.cursor="",document.body.style.userSelect="",this.classList.toggle("designbase-wc-split-view--dragging",!1))}}static get observedAttributes(){return["direction","mode","splitter-size","splitter-color","splitter-hover-color","gap","full-width","full-height"]}connectedCallback(){this.style.display="flex",this.style.boxSizing="border-box",this.collectPanelSources(),this.initPanelSizes(),this.sync(),this.observer=new MutationObserver(()=>{this.isSyncing||(this.collectPanelSources(),this.initPanelSizes(),this.sync())}),this.startObserving(),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}disconnectedCallback(){this.stopObserving(),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.draggingIndex=null,document.body.style.cursor="",document.body.style.userSelect=""}startObserving(){this.observer&&!this.isObserving&&(this.observer.observe(this,{childList:!0}),this.isObserving=!0)}stopObserving(){this.observer&&this.isObserving&&(this.observer.disconnect(),this.isObserving=!1)}attributeChangedCallback(){this.isConnected&&this.sync()}collectPanelSources(){this.panelSources=[];const t=Array.from(this.querySelectorAll('[slot="panel"]'));if(t.length)return void(this.panelSources=t);const e=Array.from(this.querySelectorAll(":scope > .designbase-wc-split-view__panel > .designbase-wc-split-view__panel-body"));e.length&&(this.panelSources=e.map(t=>t.firstElementChild).filter(t=>t instanceof HTMLElement))}readPanelConfig(t,e,i){const s=t.getAttribute("data-size"),n=t.getAttribute("data-min-size"),a=t.getAttribute("data-max-size"),r=this.getMode();let o;return null!=s&&""!==s&&(o=Number(s)),{size:void 0!==o&&Number.isFinite(o)?o:"ratio"===r?1/i:200,minSize:n?Number(n):void 0,maxSize:a?Number(a):void 0,resizable:"false"!==t.getAttribute("data-resizable"),flexible:t.hasAttribute("data-flexible")||"false"!==t.getAttribute("data-flexible")&&e===i-1}}initPanelSizes(){const t=this.panelSources.length;if(!t)return;if(this.panelSizes.length===t)return;const e=this.getMode();this.panelSizes=this.panelSources.map((i,s)=>this.readPanelConfig(i,s,t).size??("ratio"===e?1/t:200))}getDirection(){return"vertical"===(this.getAttribute("direction")||"horizontal")?"vertical":"horizontal"}getMode(){return"fixed"===(this.getAttribute("mode")||"ratio")?"fixed":"ratio"}getSplitterSize(){return Number(this.getAttribute("splitter-size")||4)}getGap(){return Number(this.getAttribute("gap")||0)}applyPanelSizes(){if(!this.panelSources.length)return;const t=this.getDirection(),e=this.getMode();Array.from(this.querySelectorAll(":scope > .designbase-wc-split-view__panel")).forEach((i,s)=>{const n=this.panelSources[s];if(!n)return;const a=this.readPanelConfig(n,s,this.panelSources.length),r=this.panelSizes[s],o=a.flexible;if(i.style.width="",i.style.height="",i.style.flexBasis="",i.style.flexGrow="",i.style.flexShrink="",i.style.minHeight="",i.style.minWidth="",o)i.style.flex="1 1 0","vertical"===t?i.style.minHeight="0":i.style.minWidth="0";else{const t="fixed"===e?`${r}px`:100*r+"%";i.style.flex=`0 0 ${t}`}i.classList.toggle("designbase-wc-split-view__panel--flexible",Boolean(o)),i.classList.toggle("designbase-wc-split-view__panel--fixed",!o)})}sync(){if(this.isSyncing=!0,this.stopObserving(),this.collectPanelSources(),this.initPanelSizes(),!this.panelSources.length)return this.isSyncing=!1,void this.startObserving();const t=this.getDirection(),e=this.getMode(),i=this.getGap(),s=this.getSplitterSize(),n=this.getAttribute("splitter-color"),a=this.getAttribute("splitter-hover-color");this.className=["designbase-wc-split-view",`designbase-wc-split-view--direction-${t}`,`designbase-wc-split-view--mode-${e}`,this.hasAttribute("full-width")&&"designbase-wc-split-view--full-width",this.hasAttribute("full-height")&&"designbase-wc-split-view--full-height",null!==this.draggingIndex&&"designbase-wc-split-view--dragging"].filter(Boolean).join(" "),this.style.setProperty("--splitter-size",`${s}px`),n?this.style.setProperty("--splitter-color",n):this.style.removeProperty("--splitter-color"),a?this.style.setProperty("--splitter-hover-color",a):this.style.removeProperty("--splitter-hover-color"),this.style.gap=i>0?`${i}px`:"";const r=Array.from(this.querySelectorAll(":scope > .designbase-wc-split-view__panel")),o=Array.from(this.querySelectorAll(":scope > .designbase-wc-split-view__splitter"));r.forEach(t=>t.remove()),o.forEach(t=>t.remove()),this.panelSources.forEach((e,s)=>{const n=this.readPanelConfig(e,s,this.panelSources.length),a=s===this.panelSources.length-1,r=!1!==n.resizable&&!a,o=document.createElement("div");o.className="designbase-wc-split-view__panel";const l=document.createElement("div");if(l.className="designbase-wc-split-view__panel-body",e.parentElement!==l&&l.append(e),o.append(l),this.append(o),!a&&r&&0===i){const e=document.createElement("div");e.className=`designbase-wc-split-view__splitter designbase-wc-split-view__splitter--direction-${t}`,e.style.cursor="horizontal"===t?"col-resize":"row-resize",e.addEventListener("mousedown",this.handleMouseDown(s)),this.append(e)}}),this.applyPanelSizes(),this.isSyncing=!1,this.startObserving()}}customElements.get("db-split-view")||customElements.define("db-split-view",DbSplitView);const SIZES$6=["s","m","l"],VARIANTS$4=["default","outlined","filled"];class DbFileUploader extends HTMLElement{constructor(){super(...arguments),this.uploadedFiles=[],this.uploadIntervals=new Map,this.handleFileSelect=t=>{if(this.isDisabled())return;const e=t.detail,i=e?.files??[];if(!i.length)return;const s=i.map(t=>({file:t,id:`${Date.now()}-${Math.random()}`,status:"pending",progress:0}));this.hasAttribute("multiple")?this.uploadedFiles=[...this.uploadedFiles,...s]:this.uploadedFiles=s,this.dispatchEvent(new CustomEvent("db-upload",{bubbles:!0,composed:!0,detail:{files:s}})),this.simulateUpload(s),this.renderFileList()},this.handleRemove=t=>{if(this.isDisabled())return;const e=this.uploadIntervals.get(t);e&&(clearInterval(e),this.uploadIntervals.delete(t)),this.uploadedFiles=this.uploadedFiles.filter(e=>e.id!==t),this.dispatchEvent(new CustomEvent("db-remove",{bubbles:!0,composed:!0,detail:{fileId:t}})),this.renderFileList()},this.handleRetry=t=>{if(this.isDisabled())return;const e=this.uploadedFiles.find(e=>e.id===t);e&&(this.updateFile(t,{status:"pending",progress:0,error:void 0}),this.dispatchEvent(new CustomEvent("db-retry",{bubbles:!0,composed:!0,detail:{fileId:t}})),this.simulateUpload([e]),this.renderFileList())}}static get observedAttributes(){return["size","variant","accept","max-size","multiple","show-file-list","show-progress","disabled","readonly"]}connectedCallback(){this.ensureDropzone(),this.sync(),this.dropzone?.addEventListener("db-file-select",this.handleFileSelect)}disconnectedCallback(){this.dropzone?.removeEventListener("db-file-select",this.handleFileSelect),this.uploadIntervals.forEach(t=>clearInterval(t)),this.uploadIntervals.clear()}attributeChangedCallback(){this.isConnected&&this.sync()}isDisabled(){return this.hasAttribute("disabled")||this.hasAttribute("readonly")}ensureDropzone(){this.dropzone||(this.dropzone=document.createElement("db-dropzone"),this.dropzone.setAttribute("data-wc-internal",""),this.prepend(this.dropzone))}formatFileSize(t){if(0===t)return"0 Bytes";const e=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/1024**e).toFixed(2))} ${["Bytes","KB","MB","GB"][e]}`}simulateUpload(t){t.forEach((t,e)=>{this.updateFile(t.id,{status:"uploading",progress:0});let i=0;const s=setInterval(()=>{if(i+=20*Math.random(),i>=100)return i=100,clearInterval(s),this.uploadIntervals.delete(t.id),this.updateFile(t.id,{status:"success",progress:100}),void this.renderFileList();this.updateFile(t.id,{progress:i}),this.renderFileList()},100+50*e);this.uploadIntervals.set(t.id,s)})}updateFile(t,e){this.uploadedFiles=this.uploadedFiles.map(i=>i.id===t?{...i,...e}:i)}sync(){if(this.ensureDropzone(),!this.dropzone)return;const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=SIZES$6.includes(t)?t:"m",s=VARIANTS$4.includes(e)?e:"default";this.className=["designbase-wc-file-uploader",`designbase-wc-file-uploader--size-${i}`,`designbase-wc-file-uploader--variant-${s}`,this.hasAttribute("disabled")&&"designbase-wc-file-uploader--disabled",this.hasAttribute("readonly")&&"designbase-wc-file-uploader--readonly"].filter(Boolean).join(" "),this.dropzone.setAttribute("size",i),this.dropzone.setAttribute("variant",s),this.getAttribute("accept")?this.dropzone.setAttribute("accept",this.getAttribute("accept")):this.dropzone.removeAttribute("accept"),this.getAttribute("max-size")?this.dropzone.setAttribute("max-size",this.getAttribute("max-size")):this.dropzone.removeAttribute("max-size"),this.dropzone.toggleAttribute("multiple",this.hasAttribute("multiple")),this.dropzone.toggleAttribute("disabled",this.hasAttribute("disabled")),this.dropzone.toggleAttribute("readonly",this.hasAttribute("readonly")),this.renderFileList()}renderStatusIcon(t){if("uploading"===t){const t=document.createElement("db-spinner");return t.setAttribute("type","circular"),t.setAttribute("size","s"),t}return createDbIcon("success"===t?"done":"error"===t?"error-filled":"gallery",20)}renderFileList(){const t=!this.hasAttribute("show-file-list")||"false"!==this.getAttribute("show-file-list"),e=!this.hasAttribute("show-progress")||"false"!==this.getAttribute("show-progress");if(this.querySelector(":scope > .designbase-wc-file-uploader__file-list")?.remove(),!t||!this.uploadedFiles.length)return;const i=document.createElement("div");i.className="designbase-wc-file-uploader__file-list";const s=document.createElement("div");s.className="designbase-wc-file-uploader__file-list-title",s.textContent=`업로드된 파일들 (${this.uploadedFiles.length}개)`,i.append(s);const n=document.createElement("div");n.className="designbase-wc-file-uploader__file-items",this.uploadedFiles.forEach(t=>{const i=document.createElement("div");i.className=`designbase-wc-file-uploader__file-item designbase-wc-file-uploader__file-item--${t.status}`;const s=document.createElement("div");s.className="designbase-wc-file-uploader__file-info";const a=document.createElement("div");a.className="designbase-wc-file-uploader__file-icon",a.append(this.renderStatusIcon(t.status));const r=document.createElement("div");r.className="designbase-wc-file-uploader__file-details";const o=document.createElement("div");o.className="designbase-wc-file-uploader__file-name",o.textContent=t.file.name;const l=document.createElement("div");if(l.className="designbase-wc-file-uploader__file-size",l.textContent=this.formatFileSize(t.file.size),r.append(o,l),t.error){const e=document.createElement("div");e.className="designbase-wc-file-uploader__file-error",e.textContent=t.error,r.append(e)}if(s.append(a,r),i.append(s),e&&"uploading"===t.status){const e=document.createElement("div");e.className="designbase-wc-file-uploader__progress";const s=document.createElement("db-progressbar");s.setAttribute("value",String(Math.round(t.progress||0))),s.setAttribute("size","s"),s.setAttribute("variant","primary"),s.setAttribute("bar-style","solid"),s.setAttribute("show-label",""),s.setAttribute("label-position","inside"),s.setAttribute("full-width",""),e.append(s),i.append(e)}const h=document.createElement("div");if(h.className="designbase-wc-file-uploader__file-actions","error"===t.status){const e=document.createElement("button");e.type="button",e.className="designbase-wc-file-uploader__retry-button",e.textContent="재시도",e.disabled=this.isDisabled(),e.addEventListener("click",()=>this.handleRetry(t.id)),h.append(e)}const d=document.createElement("button");d.type="button",d.className="designbase-wc-file-uploader__remove-button",d.textContent="삭제",d.disabled=this.isDisabled(),d.addEventListener("click",()=>this.handleRemove(t.id)),h.append(d),i.append(h),n.append(i)}),i.append(n),this.append(i)}}customElements.get("db-file-uploader")||customElements.define("db-file-uploader",DbFileUploader);const startOfDay=t=>{const e=new Date(t);return e.setHours(0,0,0,0),e},endOfDay=t=>{const e=new Date(t);return e.setHours(23,59,59,999),e},addDays=(t,e)=>{const i=new Date(t);return i.setDate(i.getDate()+e),startOfDay(i)},getWeekStart=(t,e)=>{const i=t.getDay();return addDays(t,-("monday"===e?(i+6)%7:i))},getWeekEnd=t=>endOfDay(addDays(t,6)),getMonthStart=t=>startOfDay(new Date(t.getFullYear(),t.getMonth(),1)),getMonthEnd=t=>endOfDay(new Date(t.getFullYear(),t.getMonth()+1,0)),getYearStart=t=>startOfDay(new Date(t.getFullYear(),0,1)),getYearEnd=t=>endOfDay(new Date(t.getFullYear(),11,31)),clampRange=(t,e,i)=>{let{start:s,end:n}=t;return e&&s<e&&(s=startOfDay(e)),i&&n>i&&(n=endOfDay(i)),s>n?{start:n,end:s}:{start:s,end:n}},DEFAULT_DATE_PICKER_PRESETS=[{id:"today",label:"오늘",getRange:({today:t})=>clampRange({start:startOfDay(t),end:endOfDay(t)})},{id:"yesterday",label:"어제",getRange:({today:t})=>{const e=addDays(t,-1);return clampRange({start:e,end:endOfDay(e)})}},{id:"this-week",label:"이번 주",getRange:({today:t,startOfWeek:e,minDate:i,maxDate:s})=>{const n=getWeekStart(t,e);return clampRange({start:n,end:getWeekEnd(n)},i,s)}},{id:"this-month",label:"이번 달",getRange:({today:t,minDate:e,maxDate:i})=>clampRange({start:getMonthStart(t),end:getMonthEnd(t)},e,i)},{id:"this-year",label:"올해",getRange:({today:t,minDate:e,maxDate:i})=>clampRange({start:getYearStart(t),end:getYearEnd(t)},e,i)},{id:"custom",label:"사용자 지정",getRange:()=>null}],addMonths=(t,e)=>{const i=new Date(t);return i.setDate(1),i.setMonth(i.getMonth()+e),i},toISODate=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,parseISODate=t=>{if(!t)return null;const e=t.trim().match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!e)return null;const i=new Date(Number(e[1]),Number(e[2])-1,Number(e[3]));return Number.isNaN(i.getTime())?null:startOfDay(i)},formatDisplayDate=(t,e="ko-KR")=>t.toLocaleDateString(e),generateWeekdays=t=>{const e=["일","월","화","수","목","금","토"];return"monday"===t&&e.push(e.shift()),e},generateCalendarGrid=(t,e,i=!1)=>{const s=t.getFullYear(),n=t.getMonth(),a=new Date(s,n,1),r="monday"===e?(a.getDay()+6)%7:a.getDay();if(i){const t=[];for(let e=0;e<r;e+=1)t.push(null);const e=new Date(s,n+1,0).getDate();for(let i=1;i<=e;i+=1)t.push(new Date(s,n,i));return t}const o=new Date(a);return o.setDate(o.getDate()-r),Array.from({length:42},(t,e)=>{const i=new Date(o);return i.setDate(o.getDate()+e),i})},detectActivePresetId=(t,e,i)=>{if(!t)return"custom";const s=t.start.toDateString(),n=t.end.toDateString();for(const t of e){if("custom"===t.id)continue;const e=t.getRange(i);if(e&&(e.start.toDateString()===s&&e.end.toDateString()===n))return t.id}return"custom"},formatPanelInputDate=(t,e)=>t?t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"}):"",CLASS$p="designbase-wc-date-picker",SIZES$5=["s","m","l"],VARIANTS$3=["default","outlined","filled"],isRangeValue=t=>Boolean(t)&&"object"==typeof t&&!Array.isArray(t)&&"start"in t&&"end"in t;class DbDatePicker extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.isOpen=!1,this.currentMonth=new Date,this.viewStartMonth=new Date,this.rangeStart=null,this.hoveredDate=null,this.activePresetId="custom",this.inputText="",this.boundDocumentMouseDown=t=>this.handleDocumentMouseDown(t)}static get observedAttributes(){return["mode","layout","type","inline","value","default-value","min-date","max-date","size","variant","disabled","readonly","label","full-width","error","locale","start-of-week","show-outside-days","dropdown-position","open","events"]}connectedCallback(){this.built||this.build(),this.readInitialValue(),this.render(),document.addEventListener("mousedown",this.boundDocumentMouseDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.boundDocumentMouseDown)}attributeChangedCallback(t){if(this.built){if("value"===t&&(this.readAttributeValue(),this.syncInputText()),"open"===t)return this.isOpen=this.hasAttribute("open"),void this.render();this.render()}}get value(){return this.getAttribute("value")||""}set value(t){t?this.setAttribute("value",t):this.removeAttribute("value")}get mode(){const t=this.getAttribute("mode")||"single";return"range"===t?"range":"multiple"===t?"multiple":"single"}set mode(t){this.setAttribute("mode",t)}get isPanelLayout(){return"panel"===this.getAttribute("layout")}get effectiveMode(){return this.isPanelLayout?"range":this.mode}get inline(){return this.hasAttribute("inline")}set inline(t){this.toggleAttribute("inline",Boolean(t))}get type(){return"modal"===this.getAttribute("type")?"modal":"dropdown"}get locale(){return this.getAttribute("locale")||"ko-KR"}get startOfWeek(){return"monday"===this.getAttribute("start-of-week")?"monday":"sunday"}get showOutsideDays(){return"false"!==this.getAttribute("show-outside-days")}get usesPendingValue(){return this.isPanelLayout||"modal"===this.type}get today(){return startOfDay(new Date)}get minDate(){return parseISODate(this.getAttribute("min-date"))}get maxDate(){return parseISODate(this.getAttribute("max-date"))}get presets(){return this.isPanelLayout?DEFAULT_DATE_PICKER_PRESETS:[]}get events(){const t=this.getAttribute("events");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}build(){this.built=!0,this.labelEl=document.createElement("label"),this.labelEl.className=`${CLASS$p}__label`,this.triggerEl=document.createElement("div"),this.triggerEl.className=`${CLASS$p}__trigger`;const t=document.createElement("button");t.type="button",t.className=`${CLASS$p}__icon-display`,t.setAttribute("aria-label","날짜 선택 열기"),t.addEventListener("click",()=>this.toggleOpen()),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className=`${CLASS$p}__input`,this.inputEl.setAttribute("aria-label","날짜 입력"),this.inputEl.addEventListener("click",()=>this.openPicker()),this.inputEl.addEventListener("blur",()=>this.handleInputBlur()),this.inputEl.addEventListener("input",()=>{this.inputText=this.inputEl?.value||""});const e=document.createElement("button");e.type="button",e.className=`${CLASS$p}__toggle`,e.setAttribute("aria-label","날짜 선택 열기"),e.addEventListener("click",()=>this.toggleOpen()),this.triggerEl.append(t,this.inputEl,e),this.dropdownEl=document.createElement("div"),this.dropdownEl.className=`${CLASS$p}__dropdown`,this.dropdownEl.setAttribute("role","dialog"),this.dropdownEl.setAttribute("aria-modal","false"),this.calendarHost=document.createElement("div"),this.dropdownEl.appendChild(this.calendarHost)}readInitialValue(){const t=this.getAttribute("value")??this.getAttribute("default-value");if(t&&(this.selectedValue=this.parseValue(t)),this.tempValue=this.selectedValue,this.syncInputText(),isRangeValue(this.selectedValue)){const t=parseISODate(this.selectedValue.start);t&&(this.viewStartMonth=new Date(t))}else if("string"==typeof this.selectedValue){const t=parseISODate(this.selectedValue);t&&(this.currentMonth=new Date(t))}}readAttributeValue(){const t=this.getAttribute("value");if(!t)return this.selectedValue=void 0,void(this.tempValue=void 0);this.selectedValue=this.parseValue(t),this.isOpen&&this.usesPendingValue||(this.tempValue=this.selectedValue)}parseValue(t){if(t){if("multiple"===this.effectiveMode||t.trim().startsWith("["))try{const e=JSON.parse(t);if(Array.isArray(e))return e.filter(t=>Boolean(parseISODate(t)))}catch{return}if("range"===this.effectiveMode||t.trim().startsWith("{"))try{const e=JSON.parse(t);if(e?.start&&e?.end)return{start:e.start,end:e.end}}catch{return}return parseISODate(t)?t:void 0}}serializeValue(t){return t?"string"==typeof t?t:JSON.stringify(t):""}formatDisplay(t){if(!t)return"";if("string"==typeof t){const e=parseISODate(t);return e?formatDisplayDate(e,this.locale):""}if(Array.isArray(t))return t.map(t=>parseISODate(t)).filter(Boolean).map(t=>formatDisplayDate(t,this.locale)).join(", ");const e=parseISODate(t.start),i=parseISODate(t.end);return e&&i?t.start===t.end?formatDisplayDate(e,this.locale):`${formatDisplayDate(e,this.locale)} ~ ${formatDisplayDate(i,this.locale)}`:""}syncInputText(){this.inputText=this.formatDisplay(this.selectedValue),this.inputEl&&(this.inputEl.value=this.inputText)}getWorkingValue(){return"range"===this.effectiveMode&&this.rangeStart?this.tempValue??this.selectedValue:this.usesPendingValue&&(this.isOpen||this.inline)?this.tempValue:this.selectedValue}presetContext(){return{today:this.today,startOfWeek:this.startOfWeek,minDate:this.minDate??void 0,maxDate:this.maxDate??void 0}}isDateValid(t){return!(this.minDate&&t<this.minDate)&&!(this.maxDate&&t>this.maxDate)}emitChange(t){const e=this.serializeValue(t);e?this.setAttribute("value",e):this.removeAttribute("value"),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t??null},bubbles:!0,composed:!0}))}applyValue(t,e=!this.usesPendingValue){if(e)return this.selectedValue=t,this.tempValue=t,this.syncInputText(),void this.emitChange(t);this.tempValue=t,this.renderCalendar()}handleDateClick(t){if(this.disabled||this.readonly||!this.isDateValid(t))return;this.isPanelLayout&&(this.activePresetId="custom");const e=this.getWorkingValue();if("single"===this.effectiveMode){const e=toISODate(t);return this.applyValue(e,!this.usesPendingValue),this.inline||this.isPanelLayout||this.closePicker(),void this.render()}if("multiple"===this.effectiveMode){const i=toISODate(t),s=Array.isArray(e)?e:[],n=s.includes(i)?s.filter(t=>t!==i):[...s,i];return this.applyValue(n,!this.usesPendingValue),void this.render()}if(!this.rangeStart)return this.rangeStart=t,this.applyValue({start:toISODate(t),end:toISODate(t)},!1),void this.renderCalendar();const i=this.rangeStart,s=t,n=i>s?{start:toISODate(s),end:toISODate(i)}:{start:toISODate(i),end:toISODate(s)};this.rangeStart=null,this.applyValue(n,!0),this.inline||this.isPanelLayout||this.closePicker(),this.render()}handlePresetSelect(t){if(this.activePresetId=t.id,this.rangeStart=null,"custom"===t.id)return void this.renderCalendar();const e=t.getRange(this.presetContext());if(!e)return;const i={start:toISODate(e.start),end:toISODate(e.end)};this.viewStartMonth=new Date(e.start),this.applyValue(i,!this.usesPendingValue),this.render()}handlePendingApply(){this.selectedValue=this.tempValue,this.syncInputText(),this.emitChange(this.tempValue),this.rangeStart=null,this.closePicker(),this.render()}handlePendingCancel(){this.tempValue=this.selectedValue,this.rangeStart=null,this.activePresetId=detectActivePresetId(isRangeValue(this.selectedValue)?{start:parseISODate(this.selectedValue.start),end:parseISODate(this.selectedValue.end)}:void 0,this.presets,this.presetContext()),this.closePicker(),this.render()}handleInputBlur(){if(!this.inputEl)return;const t=this.inputEl.value.trim();if(t.match(/^(\d{4})-(\d{2})-(\d{2})$/)){const e=parseISODate(t);if(e&&this.isDateValid(e)){const t=toISODate(e);return this.applyValue(t,!0),void this.render()}}this.syncInputText()}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",Boolean(t))}get readonly(){return this.hasAttribute("readonly")}set readonly(t){this.toggleAttribute("readonly",Boolean(t))}openPicker(){this.disabled||this.readonly||(this.isOpen=!0,this.usesPendingValue&&(this.tempValue=this.selectedValue,this.activePresetId=detectActivePresetId(isRangeValue(this.selectedValue)?{start:parseISODate(this.selectedValue.start),end:parseISODate(this.selectedValue.end)}:void 0,this.presets,this.presetContext())),this.render())}closePicker(){this.isOpen=!1,this.rangeStart=null,this.hoveredDate=null,this.render()}toggleOpen(){this.isOpen?this.closePicker():this.openPicker()}handleDocumentMouseDown(t){this.isOpen&&!this.inline&&(this.contains(t.target)||(this.usesPendingValue&&(this.tempValue=this.selectedValue),this.closePicker()))}isDateSelected(t){const e=toISODate(t),i=this.getWorkingValue();return"single"===this.effectiveMode?"string"==typeof i&&i===e:"multiple"===this.effectiveMode?Array.isArray(i)&&i.includes(e):!(!this.rangeStart||toISODate(this.rangeStart)!==e)||!!isRangeValue(i)&&(i.start===e||i.end===e)}isInRange(t){if("range"!==this.effectiveMode)return!1;let e=null,i=null;if(this.rangeStart)e=this.rangeStart,i=this.hoveredDate;else{const t=this.getWorkingValue();isRangeValue(t)&&(e=parseISODate(t.start),i=parseISODate(t.end))}if(!e)return!1;const s=toISODate(t),n=toISODate(e),a=i?toISODate(i):n;return s>=n&&s<=a}renderDateCell(t,e){const i=t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear(),s=t.toDateString()===this.today.toDateString(),n=this.isDateSelected(t),a=this.isInRange(t),r=0===t.getDay()||6===t.getDay(),o=this.events.filter(e=>{const i=parseISODate(e.date);return!!i&&i.toDateString()===t.toDateString()}),l=this.getWorkingValue(),h=isRangeValue(l)?parseISODate(l.end)?.toDateString():void 0,d=isRangeValue(l)?parseISODate(l.start)?.toDateString():void 0,u=document.createElement("button");u.type="button",u.className=[`${CLASS$p}__date`,!i&&this.showOutsideDays&&`${CLASS$p}__date--outside`,s&&`${CLASS$p}__date--today`,n&&`${CLASS$p}__date--selected`,a&&!n&&`${CLASS$p}__date--in-range`,"range"===this.effectiveMode&&(this.rangeStart?.toDateString()===t.toDateString()||d===t.toDateString())&&`${CLASS$p}__date--range-start`,"range"===this.effectiveMode&&h===t.toDateString()&&`${CLASS$p}__date--range-end`,r&&`${CLASS$p}__date--weekend`,!this.isDateValid(t)&&`${CLASS$p}__date--disabled`,o.length>0&&`${CLASS$p}__date--has-events`].filter(Boolean).join(" "),u.disabled=!this.isDateValid(t)||this.disabled||this.readonly,u.addEventListener("click",()=>this.handleDateClick(t));const p=document.createElement("span");if(p.className=`${CLASS$p}__date-number`,p.textContent=String(t.getDate()),u.appendChild(p),o.length>0){const t=document.createElement("div");t.className=`${CLASS$p}__events`,o.slice(0,3).forEach(e=>{const i=document.createElement("div");i.className=`${CLASS$p}__event ${CLASS$p}__event--${e.type||"dot"}`,e.color&&(i.style.backgroundColor=e.color),e.label&&(i.title=e.label),t.appendChild(i)}),u.appendChild(t)}return u}renderSingleMonth(t,e={}){const{showPrev:i=!1,showNext:s=!1}=e,n=getDbComponentIconSize(this.getAttribute("size")||"m"),a=document.createElement("div");a.className=`${CLASS$p}__month`;const r=document.createElement("div");if(r.className=`${CLASS$p}__header`,i){const t=document.createElement("button");t.type="button",t.className=`${CLASS$p}__nav-button`,t.setAttribute("aria-label","이전 달"),t.disabled=this.disabled||this.readonly,t.appendChild(createDbIcon("chevron-left",n)),t.addEventListener("click",()=>{this.isPanelLayout?this.viewStartMonth=addMonths(this.viewStartMonth,-1):this.currentMonth=addMonths(this.currentMonth,-1),this.renderCalendar()}),r.appendChild(t)}else{const t=document.createElement("span");t.className=`${CLASS$p}__nav-spacer`,t.setAttribute("aria-hidden","true"),r.appendChild(t)}const o=document.createElement("div");if(o.className=`${CLASS$p}__current-month`,o.textContent=t.toLocaleDateString(this.locale,{year:"numeric",month:"long"}),r.appendChild(o),s){const t=document.createElement("button");t.type="button",t.className=`${CLASS$p}__nav-button`,t.setAttribute("aria-label","다음 달"),t.disabled=this.disabled||this.readonly,t.appendChild(createDbIcon("chevron-right",n)),t.addEventListener("click",()=>{this.isPanelLayout?this.viewStartMonth=addMonths(this.viewStartMonth,1):this.currentMonth=addMonths(this.currentMonth,1),this.renderCalendar()}),r.appendChild(t)}else{const t=document.createElement("span");t.className=`${CLASS$p}__nav-spacer`,t.setAttribute("aria-hidden","true"),r.appendChild(t)}a.appendChild(r);const l=document.createElement("div");l.className=`${CLASS$p}__weekdays`,generateWeekdays(this.startOfWeek).forEach(t=>{const e=document.createElement("div");e.className=`${CLASS$p}__weekday`,e.textContent=t,l.appendChild(e)}),a.appendChild(l);const h=document.createElement("div");h.className=`${CLASS$p}__grid`;const d=this.isPanelLayout;return generateCalendarGrid(t,this.startOfWeek,d).forEach((e,i)=>{if(!e){const t=document.createElement("span");return t.className=`${CLASS$p}__date ${CLASS$p}__date--empty`,t.setAttribute("aria-hidden","true"),t.dataset.index=String(i),void h.appendChild(t)}const s=e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear();if(!this.showOutsideDays&&!s){const t=document.createElement("span");return t.className=`${CLASS$p}__date ${CLASS$p}__date--empty`,t.setAttribute("aria-hidden","true"),t.dataset.index=String(i),void h.appendChild(t)}h.appendChild(this.renderDateCell(e,t))}),a.appendChild(h),a}renderDefaultCalendar(){const t=document.createElement("div");t.className=`${CLASS$p}__selector`;const e=this.isPanelLayout?this.viewStartMonth:this.currentMonth;if(t.appendChild(this.renderSingleMonth(e,{showPrev:!0,showNext:!0})),!this.isPanelLayout){const e=document.createElement("div");e.className=`${CLASS$p}__footer`;const i=document.createElement("button");i.type="button",i.className=`${CLASS$p}__today-button`,i.textContent="오늘",i.disabled=this.disabled||this.readonly,i.addEventListener("click",()=>{const t=new Date;this.isPanelLayout?this.viewStartMonth=t:this.currentMonth=t,this.renderCalendar()}),e.appendChild(i),t.appendChild(e)}return t}renderPanelCalendar(){const t=document.createElement("div");t.className=`${CLASS$p}__panel`;const e=document.createElement("div");e.className=`${CLASS$p}__presets`,e.setAttribute("role","listbox"),e.setAttribute("aria-label","기간 프리셋"),this.presets.forEach(t=>{const i=document.createElement("button");i.type="button",i.className=[`${CLASS$p}__preset`,this.activePresetId===t.id&&`${CLASS$p}__preset--active`].filter(Boolean).join(" "),i.setAttribute("role","option"),i.setAttribute("aria-selected",String(this.activePresetId===t.id)),i.textContent=t.label,i.addEventListener("click",()=>this.handlePresetSelect(t)),e.appendChild(i)}),t.appendChild(e);const i=document.createElement("div");i.className=`${CLASS$p}__panel-main`;const s=document.createElement("div");s.className=`${CLASS$p}__months ${CLASS$p}__months--count-2`,[0,1].forEach(t=>{const e=addMonths(this.viewStartMonth,t);s.appendChild(this.renderSingleMonth(e,{showPrev:0===t,showNext:1===t}))}),i.appendChild(s);const n=document.createElement("div");n.className=`${CLASS$p}__panel-footer`;const a=isRangeValue(this.tempValue)?this.tempValue:void 0,r=document.createElement("div");r.className=`${CLASS$p}__range-display`;const o=document.createElement("span");o.className=`${CLASS$p}__range-text`,o.textContent=a?.start&&parseISODate(a.start)?formatPanelInputDate(parseISODate(a.start),this.locale):"시작일";const l=document.createElement("span");l.className=`${CLASS$p}__range-separator`,l.textContent="–";const h=document.createElement("span");h.className=`${CLASS$p}__range-text`,h.textContent=a?.end&&parseISODate(a.end)?formatPanelInputDate(parseISODate(a.end),this.locale):"종료일",r.append(o,l,h),n.appendChild(r);const d=document.createElement("div");d.className=`${CLASS$p}__panel-actions`;const u=document.createElement("db-button");u.setAttribute("variant","secondary"),u.setAttribute("size","m"),u.textContent="취소",u.addEventListener("click",()=>this.handlePendingCancel());const p=document.createElement("db-button");return p.setAttribute("variant","primary"),p.setAttribute("size","m"),p.textContent="적용",p.addEventListener("click",()=>this.handlePendingApply()),d.append(u,p),n.appendChild(d),i.appendChild(n),t.appendChild(i),t}renderCalendar(){this.calendarHost&&(this.calendarHost.replaceChildren(),this.calendarHost.appendChild(this.isPanelLayout?this.renderPanelCalendar():this.renderDefaultCalendar()))}render(){const t=SIZES$5.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",e=VARIANTS$3.includes(this.getAttribute("variant")||"default")&&this.getAttribute("variant")||"default",i=this.getAttribute("dropdown-position")||"bottom-start",s=getDbComponentIconSize(t);if(this.className=[CLASS$p,this.inline?`${CLASS$p}--size-${t}`:`${CLASS$p}--${t}`,`${CLASS$p}--variant-${e}`,this.hasAttribute("full-width")&&`${CLASS$p}--full-width`,this.disabled&&`${CLASS$p}--disabled`,this.readonly&&`${CLASS$p}--readonly`,this.isOpen&&`${CLASS$p}--open`,this.hasAttribute("error")&&`${CLASS$p}--error`,this.isPanelLayout&&`${CLASS$p}--panel`].filter(Boolean).join(" "),this.replaceChildren(),this.inline)return this.calendarHost=document.createElement("div"),this.appendChild(this.calendarHost),void this.renderCalendar();if(!(this.labelEl&&this.triggerEl&&this.inputEl&&this.dropdownEl))return;const n=this.getAttribute("label")||"";this.labelEl.textContent=n,this.labelEl.hidden=!n,this.inputEl.value=this.inputText,this.inputEl.placeholder=this.isPanelLayout?"기간을 선택하세요":"날짜를 선택하세요",this.inputEl.disabled=this.disabled,this.inputEl.readOnly=this.readonly;const a=this.triggerEl.querySelector(`.${CLASS$p}__icon-display`);a&&(a.innerHTML="",a.appendChild(createDbIcon("calendar",s)),a.disabled=this.disabled);const r=this.triggerEl.querySelector(`.${CLASS$p}__toggle`);if(r&&(r.innerHTML="",r.appendChild(createDbIcon("chevron-down",s)),r.disabled=this.disabled),this.dropdownEl.className=[`${CLASS$p}__dropdown`,`${CLASS$p}__dropdown--${i}`,this.isPanelLayout&&`${CLASS$p}__dropdown--panel`].filter(Boolean).join(" "),this.dropdownEl.hidden=!this.isOpen||"modal"===this.type,this.calendarHost=document.createElement("div"),this.dropdownEl.replaceChildren(this.calendarHost),this.renderCalendar(),this.append(this.labelEl,this.triggerEl),this.isOpen&&"dropdown"===this.type&&this.appendChild(this.dropdownEl),this.isOpen&&"modal"===this.type){const t=document.createElement("db-modal");t.setAttribute("open","true"),t.setAttribute("title",this.isPanelLayout?"기간 선택":"날짜 선택"),t.setAttribute("size",this.isPanelLayout?"l":"s"),t.addEventListener("db-close",()=>this.handlePendingCancel());const e=document.createElement("div");if(this.calendarHost=e,this.renderCalendar(),t.append(e),this.usesPendingValue){const e=document.createElement("div");e.className=`${CLASS$p}__modal-footer`;const i=document.createElement("db-button");i.setAttribute("variant","secondary"),i.setAttribute("size","m"),i.textContent="취소",i.addEventListener("click",()=>this.handlePendingCancel());const s=document.createElement("db-button");s.setAttribute("variant","primary"),s.setAttribute("size","m"),s.textContent="적용",s.addEventListener("click",()=>this.handlePendingApply()),e.append(i,s),t.append(e)}this.appendChild(t)}}}customElements.get("db-date-picker")||customElements.define("db-date-picker",DbDatePicker);const CLASS$o="designbase-wc-time-picker",SIZES$4=["s","m","l"],FORMATS$1=["12h","24h","12h-with-seconds","24h-with-seconds"],ITEM_HEIGHT=40;class DbTimePicker extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.isOpen=!1,this.hours=12,this.minutes=0,this.seconds=0,this.period="PM",this.inputText="",this.tempHours=12,this.tempMinutes=0,this.tempSeconds=0,this.tempPeriod="PM",this.boundDocumentMouseDown=t=>this.handleDocumentMouseDown(t)}static get observedAttributes(){return["value","default-value","type","format","minute-step","size","disabled","readonly","label","full-width","error","dropdown-position","open"]}connectedCallback(){this.built||this.build(),this.parseTimeString(this.getAttribute("value")??this.getAttribute("default-value")??"12:00"),this.syncInputText(),this.render(),document.addEventListener("mousedown",this.boundDocumentMouseDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.boundDocumentMouseDown)}attributeChangedCallback(t){if(this.built){if("value"===t){const t=this.getAttribute("value");t&&(this.parseTimeString(t),this.syncInputText())}if("open"===t)return this.isOpen=this.hasAttribute("open"),void this.render();this.render()}}get value(){return this.getAttribute("value")||""}set value(t){t?this.setAttribute("value",t):this.removeAttribute("value")}get format(){const t=this.getAttribute("format")||"24h";return FORMATS$1.includes(t)?t:"24h"}set format(t){this.setAttribute("format",t)}get type(){return"modal"===this.getAttribute("type")?"modal":"dropdown"}get is12h(){return"12h"===this.format||"12h-with-seconds"===this.format}get showSeconds(){return"12h-with-seconds"===this.format||"24h-with-seconds"===this.format}get minuteStep(){const t=Number(this.getAttribute("minute-step")||"1");return Number.isFinite(t)&&t>0?t:1}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",Boolean(t))}get readonly(){return this.hasAttribute("readonly")}set readonly(t){this.toggleAttribute("readonly",Boolean(t))}build(){this.built=!0,this.labelEl=document.createElement("label"),this.labelEl.className=`${CLASS$o}__label`,this.triggerEl=document.createElement("div"),this.triggerEl.className=`${CLASS$o}__trigger`;const t=document.createElement("button");t.type="button",t.className=`${CLASS$o}__icon-display`,t.setAttribute("aria-label","시간 선택 열기"),t.addEventListener("click",()=>this.toggleOpen()),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className=`${CLASS$o}__input`,this.inputEl.setAttribute("aria-label","시간 입력"),this.inputEl.addEventListener("click",()=>this.openPicker()),this.inputEl.addEventListener("blur",()=>this.handleInputBlur()),this.inputEl.addEventListener("input",()=>{this.inputText=this.inputEl?.value||""});const e=document.createElement("button");e.type="button",e.className=`${CLASS$o}__toggle`,e.setAttribute("aria-label","시간 선택 열기"),e.addEventListener("click",()=>this.toggleOpen()),this.triggerEl.append(t,this.inputEl,e),this.dropdownEl=document.createElement("div"),this.dropdownEl.className=`${CLASS$o}__dropdown`,this.dropdownEl.setAttribute("role","dialog"),this.dropdownEl.setAttribute("aria-modal","false")}pad2(t){return String(t).padStart(2,"0")}to24Hour(t,e){return"AM"===e?12===t?0:t:12===t?12:t+12}formatTimeString(t,e,i,s){const n="AM"===(s||this.period)?"오전":"오후";return this.is12h?`${n} ${this.pad2(t)}:${this.pad2(e)}${this.showSeconds?`:${this.pad2(i)}`:""}`:`${this.pad2(t)}:${this.pad2(e)}${this.showSeconds?`:${this.pad2(i)}`:""}`}toValue24(t,e,i,s){const n=this.is12h?this.to24Hour(t,s||this.period):t;return`${this.pad2(n)}:${this.pad2(e)}${this.showSeconds?`:${this.pad2(i)}`:""}`}parseTimeString(t){const e=t.trim();if(this.is12h){const t=this.showSeconds?/^(오전|오후|AM|PM)?\s*(0?[1-9]|1[0-2]):([0-5]\d):([0-5]\d)\s*(AM|PM|오전|오후)?$/i:/^(오전|오후|AM|PM)?\s*(0?[1-9]|1[0-2]):([0-5]\d)\s*(AM|PM|오전|오후)?$/i,i=e.match(t);if(i){const t=i[1],e=this.showSeconds?i[5]:i[4],s=(t||e||"AM").toUpperCase();return this.hours=parseInt(i[2],10),this.minutes=parseInt(i[3],10),this.seconds=this.showSeconds?parseInt(i[4],10):0,void(this.period="오후"===s||"PM"===s?"PM":"AM")}}else{const t=this.showSeconds?/^([01]?\d|2[0-3]):([0-5]\d):([0-5]\d)$/:/^([01]?\d|2[0-3]):([0-5]\d)$/,i=e.match(t);i&&(this.hours=parseInt(i[1],10),this.minutes=parseInt(i[2],10),this.seconds=this.showSeconds?parseInt(i[3],10):0)}}syncInputText(){this.inputText=this.formatTimeString(this.hours,this.minutes,this.seconds),this.inputEl&&(this.inputEl.value=this.inputText)}emitChange(t){this.setAttribute("value",t),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t},bubbles:!0,composed:!0}))}handleTimeChange(t,e,i=this.seconds,s){this.hours=t,this.minutes=e,this.seconds=i,s&&(this.period=s);const n=this.formatTimeString(t,e,i,s);this.inputText=n,this.inputEl&&(this.inputEl.value=n),this.emitChange(this.toValue24(t,e,i,s))}handleInputBlur(){if(!this.inputEl)return;const t=this.inputText;this.parseTimeString(this.inputEl.value);this.formatTimeString(this.hours,this.minutes,this.seconds)!==t||this.inputEl.value.trim()?this.handleTimeChange(this.hours,this.minutes,this.seconds,this.period):this.syncInputText()}openPicker(){this.disabled||this.readonly||(this.isOpen=!0,"modal"===this.type&&(this.tempHours=this.hours,this.tempMinutes=this.minutes,this.tempSeconds=this.seconds,this.tempPeriod=this.period),this.render())}closePicker(){this.isOpen=!1,this.render()}toggleOpen(){this.isOpen?this.closePicker():this.openPicker()}handleDocumentMouseDown(t){this.isOpen&&(this.contains(t.target)||this.closePicker())}createWheel(t){const{label:e,items:i,value:s,onChange:n,formatter:a}=t,r=document.createElement("div");r.className=`${CLASS$o}__wheel-container`;const o=document.createElement("div");o.className=`${CLASS$o}__wheel-label`,o.textContent=e,r.appendChild(o);const l=document.createElement("div");l.className=`${CLASS$o}__wheel-viewport`;const h=document.createElement("div");h.className=`${CLASS$o}__wheel`,h.setAttribute("role","listbox"),h.setAttribute("aria-label",e);let d=null,u=!1,p=!1,m=0,g=0;const indexOfValue=t=>i.findIndex(e=>e===t),scrollToIndex=(t,e=!0)=>{const i=t*ITEM_HEIGHT;u=!0,h.scrollTo({top:i,behavior:e?"smooth":"auto"}),window.setTimeout(()=>{u=!1},150)},fmt=t=>a?a(t):"number"==typeof t?this.pad2(t):String(t);i.forEach(t=>{const e=document.createElement("div");e.className=[`${CLASS$o}__wheel-item`,t===s&&`${CLASS$o}__wheel-item--selected`].filter(Boolean).join(" "),e.setAttribute("role","option"),e.setAttribute("aria-selected",String(t===s)),e.textContent=fmt(t),e.addEventListener("click",()=>{const e=indexOfValue(t);scrollToIndex(e,!0),t!==s&&n(t)}),h.appendChild(e)});const handleScroll=()=>{u||(d&&window.clearTimeout(d),d=window.setTimeout(()=>{const t=h.scrollTop,e=Math.round(t/ITEM_HEIGHT),a=Math.max(0,Math.min(i.length-1,e)),r=i[a];scrollToIndex(a,!0),r!==s&&n(r)},120))};h.addEventListener("scroll",handleScroll),h.addEventListener("pointerdown",t=>{p=!0,m=t.clientY,g=h.scrollTop,h.setPointerCapture(t.pointerId),h.style.cursor="grabbing"}),h.addEventListener("pointermove",t=>{p&&(h.scrollTop=g-(t.clientY-m))});const endDrag=t=>{p&&(p=!1,h.releasePointerCapture(t.pointerId),h.style.cursor="grab",handleScroll())};h.addEventListener("pointerup",endDrag),h.addEventListener("pointercancel",endDrag);const b=indexOfValue(s);b>=0&&requestAnimationFrame(()=>scrollToIndex(b,!1));const f=document.createElement("div");f.className=`${CLASS$o}__wheel-center-indicator`,f.setAttribute("aria-hidden","true");const v=document.createElement("div");v.className=`${CLASS$o}__wheel-fade wheel-fade--top`,v.setAttribute("aria-hidden","true");const y=document.createElement("div");return y.className=`${CLASS$o}__wheel-fade wheel-fade--bottom`,y.setAttribute("aria-hidden","true"),l.append(h,f,v,y),r.appendChild(l),r}renderSelector(t=!1){const e=document.createElement("div");e.className=`${CLASS$o}__selector`;const i=document.createElement("div");i.className=`${CLASS$o}__picker-wheels`;const s=this.is12h?Array.from({length:12},(t,e)=>e+1):Array.from({length:24},(t,e)=>e),n=Array.from({length:Math.floor(60/this.minuteStep)},(t,e)=>e*this.minuteStep),a=Array.from({length:60},(t,e)=>e),r=t?this.tempHours:this.hours,o=t?this.tempMinutes:this.minutes,l=t?this.tempSeconds:this.seconds,h=t?this.tempPeriod:this.period,onChange=(e,i,s,n)=>{if(t)return this.tempHours=e,this.tempMinutes=i,this.tempSeconds=s,void(this.tempPeriod=n);this.handleTimeChange(e,i,s,n)};if(i.appendChild(this.createWheel({label:"시간",items:s,value:r,onChange:t=>onChange(t,o,l,h)})),i.appendChild(this.createWheel({label:"분",items:n,value:n.includes(o)?o:n[0],onChange:t=>onChange(r,t,l,h)})),this.showSeconds&&i.appendChild(this.createWheel({label:"초",items:a,value:l,onChange:t=>onChange(r,o,t,h)})),this.is12h&&i.appendChild(this.createWheel({label:"오전/오후",items:["AM","PM"],value:h,onChange:t=>onChange(r,o,l,t),formatter:t=>"AM"===t?"오전":"오후"})),e.appendChild(i),t)return e;const d=document.createElement("div");d.className=`${CLASS$o}__dropdown-actions`;const u=document.createElement("div");u.className=`${CLASS$o}__preview`,u.setAttribute("aria-live","polite"),u.appendChild(createDbIcon("clock",16));const p=document.createElement("div");p.className=`${CLASS$o}__preview-time`,p.textContent=this.formatTimeString(r,o,l,h),u.appendChild(p);const m=document.createElement("db-button");return m.setAttribute("variant","primary"),m.setAttribute("size","m"),m.textContent="선택",m.addEventListener("click",()=>{this.handleTimeChange(r,o,l,h),this.closePicker()}),d.append(u,m),e.appendChild(d),e}render(){const t=SIZES$4.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",e=this.getAttribute("dropdown-position")||"bottom-start",i=getDbComponentIconSize(t);if(this.className=[CLASS$o,`${CLASS$o}--${t}`,this.hasAttribute("full-width")&&`${CLASS$o}--full-width`,this.disabled&&`${CLASS$o}--disabled`,this.readonly&&`${CLASS$o}--readonly`,this.isOpen&&`${CLASS$o}--open`,this.hasAttribute("error")&&`${CLASS$o}--error`].filter(Boolean).join(" "),this.replaceChildren(),!(this.labelEl&&this.triggerEl&&this.inputEl&&this.dropdownEl))return;const s=this.getAttribute("label")||"";this.labelEl.textContent=s,this.labelEl.hidden=!s,this.inputEl.value=this.inputText,this.inputEl.placeholder=this.is12h?this.showSeconds?"12:00:00 PM":"12:00 PM":this.showSeconds?"12:00:00":"12:00",this.inputEl.disabled=this.disabled,this.inputEl.readOnly=this.readonly;const n=this.triggerEl.querySelector(`.${CLASS$o}__icon-display`);n&&(n.innerHTML="",n.appendChild(createDbIcon("clock",i)),n.disabled=this.disabled);const a=this.triggerEl.querySelector(`.${CLASS$o}__toggle`);if(a&&(a.innerHTML="",a.appendChild(createDbIcon("chevron-down",i)),a.disabled=this.disabled),this.dropdownEl.className=[`${CLASS$o}__dropdown`,`${CLASS$o}__dropdown--${e}`].filter(Boolean).join(" "),this.dropdownEl.hidden=!this.isOpen,this.isOpen&&"dropdown"===this.type&&this.dropdownEl.replaceChildren(this.renderSelector(!1)),this.append(this.labelEl,this.triggerEl),this.isOpen&&"dropdown"===this.type&&this.appendChild(this.dropdownEl),this.isOpen&&"modal"===this.type){const t=document.createElement("db-modal");t.setAttribute("open","true"),t.setAttribute("title","시간 선택"),t.setAttribute("size","s"),t.addEventListener("db-close",()=>this.closePicker());const e=this.renderSelector(!0),i=document.createElement("div");i.className=`${CLASS$o}__modal-footer`;const s=document.createElement("db-button");s.setAttribute("variant","secondary"),s.setAttribute("size","m"),s.textContent="취소",s.addEventListener("click",()=>this.closePicker());const n=document.createElement("db-button");n.setAttribute("variant","primary"),n.setAttribute("size","m"),n.textContent="적용",n.addEventListener("click",()=>{this.handleTimeChange(this.tempHours,this.tempMinutes,this.tempSeconds,this.tempPeriod),this.closePicker()}),i.append(s,n),t.append(e,i),this.appendChild(t)}}}customElements.get("db-time-picker")||customElements.define("db-time-picker",DbTimePicker);const CLASS$n="designbase-wc-calendar",EVENT_TYPE_OPTIONS=[{value:"meeting",label:"회의"},{value:"task",label:"업무"},{value:"reminder",label:"알림"},{value:"birthday",label:"생일"},{value:"holiday",label:"휴일"},{value:"custom",label:"기타"}],COLOR_OPTIONS=[{value:"#17a2b8",label:"청록"},{value:"#0d6efd",label:"파랑"},{value:"#198754",label:"초록"},{value:"#ffc107",label:"노랑"},{value:"#dc3545",label:"빨강"},{value:"#6f42c1",label:"보라"}];class DbCalendar extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.currentView="month",this.selectedDate=new Date,this._events=[],this.showEventModal=!1,this.selectedEvent=null,this.isEditing=!1,this.draggedEvent=null,this.dragOverDate=null,this.selectedDateRange={start:null,end:null},this.eventForm={title:"",description:"",startTime:"09:00",endTime:"10:00",type:"meeting",color:"#17a2b8",isAllDay:!1,location:""}}static get observedAttributes(){return["view","current-date","events","locale","show-weekends","highlight-today","show-outside-days"]}connectedCallback(){this.built||this.build(),this.readAttributes(),this.render()}attributeChangedCallback(){this.built&&(this.readAttributes(),this.render())}get locale(){return this.getAttribute("locale")||"ko-KR"}get showWeekends(){return"false"!==this.getAttribute("show-weekends")}get highlightToday(){return"false"!==this.getAttribute("highlight-today")}get showOutsideDays(){return"false"!==this.getAttribute("show-outside-days")}get events(){return this._events}set events(t){"string"!=typeof t?(this._events=Array.isArray(t)?t:[],this.setAttribute("events",JSON.stringify(this._events))):this.setAttribute("events",t)}build(){this.built=!0,this.headerEl=document.createElement("div"),this.headerEl.className=`${CLASS$n}__header`,this.bodyEl=document.createElement("div"),this.bodyEl.className=`${CLASS$n}__body`,this.modalEl=document.createElement("db-modal"),this.modalEl.setAttribute("size","m"),this.modalEl.addEventListener("db-close",()=>this.closeModal())}readAttributes(){this.currentView="month";const t=parseISODate(this.getAttribute("current-date"));t&&(this.selectedDate=t);const e=this.getAttribute("events");if(e)try{const t=JSON.parse(e);this._events=Array.isArray(t)?t:[]}catch{this._events=[]}else this._events=[]}isSameDate(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}eventsForDate(t){return this._events.filter(e=>{const i=parseISODate(e.date);return!!i&&this.isSameDate(i,t)})}emit(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}handleViewChange(t){this.currentView="month",this.emit("db-view-change",{view:t}),this.render()}shiftMonth(t){const e=new Date(this.selectedDate);e.setMonth(e.getMonth()+t),this.selectedDate=e,this.emit("db-month-change",{date:toISODate(e)}),this.render()}shiftYear(t){const e=new Date(this.selectedDate);e.setFullYear(e.getFullYear()+t),this.selectedDate=e,this.emit("db-month-change",{date:toISODate(e)}),this.render()}handleDateClick(t){this.selectedDate=t,this.emit("db-date-click",{date:toISODate(t)}),!this.selectedDateRange.start||this.selectedDateRange.start&&this.selectedDateRange.end?this.selectedDateRange={start:t,end:null}:this.selectedDateRange.start&&!this.selectedDateRange.end&&(t<this.selectedDateRange.start?this.selectedDateRange={start:t,end:this.selectedDateRange.start}:this.selectedDateRange={start:this.selectedDateRange.start,end:t}),this.openAddModal(t)}handleDragStart(t,e){this.draggedEvent=t,e.dataTransfer?.setData("text/plain",t.id),e.dataTransfer?.setData("application/json",JSON.stringify(t)),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")}handleDragOver(t,e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this.dragOverDate=t,this.render()}handleDragLeave(t){const e=t.relatedTarget,i=t.currentTarget;i&&e&&i.contains(e)||(this.dragOverDate=null,this.render())}handleDrop(t,e){if(e.preventDefault(),!this.draggedEvent)return;const i={...this.draggedEvent,date:toISODate(t)};this.emit("db-event-edit",{event:i}),this.draggedEvent=null,this.dragOverDate=null,this.render()}handleDragEnd(){this.draggedEvent=null,this.dragOverDate=null,this.render()}handleEventClick(t,e){e.stopPropagation(),this.selectedEvent=t,this.isEditing=!0;const i=parseISODate(t.date);i&&(this.selectedDate=i),this.eventForm={title:t.title,description:t.description||"",startTime:t.startTime||"09:00",endTime:t.endTime||"10:00",type:t.type,color:t.color||"#17a2b8",isAllDay:t.isAllDay||!1,location:t.location||""},this.emit("db-event-click",{event:t}),this.showEventModal=!0,this.render()}openAddModal(t){this.selectedDate=t,this.selectedEvent=null,this.isEditing=!1,this.eventForm={title:"",description:"",startTime:"09:00",endTime:"10:00",type:"meeting",color:"#17a2b8",isAllDay:!1,location:""},this.showEventModal=!0,this.render()}closeModal(){this.showEventModal=!1,this.selectedEvent=null,this.isEditing=!1,this.render()}saveEvent(){if(!this.eventForm.title.trim())return void window.alert("제목을 입력해주세요.");const t={title:this.eventForm.title.trim(),description:this.eventForm.description,date:toISODate(this.selectedDate),startTime:this.eventForm.startTime,endTime:this.eventForm.endTime,type:this.eventForm.type,color:this.eventForm.color,isAllDay:this.eventForm.isAllDay,location:this.eventForm.location};if(this.isEditing&&this.selectedEvent){const e={...this.selectedEvent,...t};this.emit("db-event-edit",{event:e})}else this.emit("db-event-add",{event:t});this.closeModal()}deleteEvent(){this.selectedEvent&&window.confirm("정말로 이 일정을 삭제하시겠습니까?")&&(this.emit("db-event-delete",{eventId:this.selectedEvent.id}),this.closeModal())}renderHeader(){if(!this.headerEl)return;this.headerEl.replaceChildren();const t=document.createElement("div");t.className=`${CLASS$n}__navigation`;const e=getDbComponentIconSize("m"),i=document.createElement("button");i.type="button",i.className=`${CLASS$n}__nav-button`,i.setAttribute("aria-label","이전"),i.appendChild(createDbIcon("chevron-left",e)),i.addEventListener("click",()=>{this.shiftMonth(-1)});const s=document.createElement("div");s.className=`${CLASS$n}__title`,s.textContent=this.selectedDate.toLocaleDateString(this.locale,{year:"numeric",month:"long"});const n=document.createElement("button");n.type="button",n.className=`${CLASS$n}__nav-button`,n.setAttribute("aria-label","다음"),n.appendChild(createDbIcon("chevron-right",e)),n.addEventListener("click",()=>{this.shiftMonth(1)}),t.append(i,s,n),this.headerEl.appendChild(t)}renderMonthView(){const t=document.createElement("div");t.className=`${CLASS$n}__month-view`;const e=document.createElement("div");e.className=`${CLASS$n}__weekdays`,["일","월","화","수","목","금","토"].forEach(t=>{const i=document.createElement("div");i.className=`${CLASS$n}__weekday`,i.textContent=t,e.appendChild(i)}),t.appendChild(e);const i=document.createElement("div");i.className=`${CLASS$n}__days`;const s=this.selectedDate.getFullYear(),n=this.selectedDate.getMonth(),a=new Date(s,n,1),r=new Date(a);r.setDate(r.getDate()-a.getDay());const o=new Date;for(let t=0;t<42;t+=1){const e=new Date(r);e.setDate(r.getDate()+t);const s=e.getMonth()===n;if(!this.showOutsideDays&&!s)continue;const a=0===e.getDay()||6===e.getDay();if(!this.showWeekends&&a)continue;const l=document.createElement("div"),h=this.selectedDateRange.start&&this.selectedDateRange.end&&e>=this.selectedDateRange.start&&e<=this.selectedDateRange.end,d=this.selectedDateRange.start&&e.toDateString()===this.selectedDateRange.start.toDateString(),u=this.selectedDateRange.end&&e.toDateString()===this.selectedDateRange.end.toDateString(),p=Boolean(h&&!d&&!u);l.className=[`${CLASS$n}__day`,s&&`${CLASS$n}__day--current-month`,this.highlightToday&&e.toDateString()===o.toDateString()&&`${CLASS$n}__day--today`,this.isSameDate(e,this.selectedDate)&&`${CLASS$n}__day--selected`,d&&`${CLASS$n}__day--selected--start`,u&&`${CLASS$n}__day--selected--end`,p&&`${CLASS$n}__day--selected--middle`,!this.showWeekends&&a&&`${CLASS$n}__day--weekend`].filter(Boolean).join(" "),l.addEventListener("click",()=>this.handleDateClick(e));const m=document.createElement("span");m.className=`${CLASS$n}__day-number`,m.textContent=String(e.getDate()),l.appendChild(m);const g=this.eventsForDate(e);if(g.length){const t=document.createElement("div");if(t.className=`${CLASS$n}__day-events`,g.slice(0,2).forEach(e=>{const i=document.createElement("div");i.className=[`${CLASS$n}__event-bar`,`${CLASS$n}__event-bar--${e.type}`].filter(Boolean).join(" "),e.color&&(i.style.backgroundColor=e.color),this.draggedEvent?.id===e.id&&i.classList.add(`${CLASS$n}__event-bar--dragging`),i.title=e.title,i.draggable=!0;const s=document.createElement("span");s.className=`${CLASS$n}__event-title`,s.textContent=e.title,i.appendChild(s),i.addEventListener("click",t=>this.handleEventClick(e,t)),i.addEventListener("dragstart",t=>this.handleDragStart(e,t)),i.addEventListener("dragend",()=>this.handleDragEnd()),t.appendChild(i)}),g.length>2){const e=document.createElement("div");e.className=`${CLASS$n}__more-events`,e.textContent=`+${g.length-2} more`,t.appendChild(e)}l.appendChild(t)}const b=document.createElement("div");b.className=[`${CLASS$n}__drop-zone`,this.dragOverDate&&this.isSameDate(this.dragOverDate,e)&&`${CLASS$n}__drop-zone--active`].filter(Boolean).join(" "),b.addEventListener("dragover",t=>this.handleDragOver(e,t)),b.addEventListener("dragleave",t=>this.handleDragLeave(t)),b.addEventListener("drop",t=>this.handleDrop(e,t)),l.appendChild(b),i.appendChild(l)}return t.appendChild(i),t}renderYearView(){const t=document.createElement("div");t.className=`${CLASS$n}__year-view`;const e=this.selectedDate.getFullYear();for(let i=0;i<12;i+=1){const s=new Date(e,i,1),n=this._events.filter(t=>{const s=parseISODate(t.date);return s&&s.getFullYear()===e&&s.getMonth()===i}),a=document.createElement("div");a.className=`${CLASS$n}__year-month`,a.addEventListener("click",()=>{this.selectedDate=s,this.handleViewChange("month")});const r=document.createElement("h3");if(r.className=`${CLASS$n}__year-month-title`,r.textContent=s.toLocaleDateString(this.locale,{month:"long"}),a.appendChild(r),n.length){const t=document.createElement("div");if(t.className=`${CLASS$n}__year-month-events`,n.slice(0,4).forEach(e=>{const i=document.createElement("span");i.className=[`${CLASS$n}__year-event`,`${CLASS$n}__year-event--${e.type}`].join(" "),e.color&&(i.style.backgroundColor=e.color),t.appendChild(i)}),n.length>4){const e=document.createElement("span");e.className=`${CLASS$n}__year-more-events`,e.textContent=`+${n.length-4} more`,t.appendChild(e)}a.appendChild(t)}t.appendChild(a)}return t}renderWeekView(){const t=document.createElement("div");t.className=`${CLASS$n}__week-view`;const e=new Date,i=new Date(this.selectedDate);i.setDate(this.selectedDate.getDate()-this.selectedDate.getDay());const s=document.createElement("div");s.className=`${CLASS$n}__week-header`;const n=document.createElement("div");n.className=`${CLASS$n}__time-column-header`,s.appendChild(n);for(let t=0;t<7;t+=1){const n=new Date(i);n.setDate(i.getDate()+t);const a=document.createElement("div");a.className=[`${CLASS$n}__week-day-header`,n.toDateString()===e.toDateString()&&`${CLASS$n}__week-day-header--today`].filter(Boolean).join(" ");const r=document.createElement("span");r.className=`${CLASS$n}__week-day-name`,r.textContent=n.toLocaleDateString(this.locale,{weekday:"short"});const o=document.createElement("span");o.className=`${CLASS$n}__week-day-number`,o.textContent=String(n.getDate()),a.append(r,o),s.appendChild(a)}t.appendChild(s);const a=document.createElement("div");a.className=`${CLASS$n}__week-grid`;const r=document.createElement("div");r.className=`${CLASS$n}__week-time-column`;for(let t=6;t<=22;t+=1){const e=document.createElement("div");e.className=`${CLASS$n}__time-slot`;const i=document.createElement("span");i.className=`${CLASS$n}__time-label`,i.textContent=`${String(t).padStart(2,"0")}:00`,e.appendChild(i),r.appendChild(e)}a.appendChild(r);const o=document.createElement("div");o.className=`${CLASS$n}__week-columns`;for(let t=0;t<7;t+=1){const e=new Date(i);e.setDate(i.getDate()+t);const s=document.createElement("div");s.className=`${CLASS$n}__week-column`;for(let t=6;t<=22;t+=1){const i=document.createElement("div");i.className=`${CLASS$n}__week-cell`,i.title=`${e.toLocaleDateString()} ${String(t).padStart(2,"0")}:00`,i.addEventListener("click",()=>{this.selectedDate=new Date(e),this.eventForm.startTime=`${String(t).padStart(2,"0")}:00`,this.eventForm.endTime=`${String(t+1).padStart(2,"0")}:00`,this.openAddModal(this.selectedDate)}),s.appendChild(i)}this.eventsForDate(e).forEach(t=>{if(!t.startTime)return;const[e,i]=t.startTime.split(":").map(Number),n=.8*(60*(e-6)+(i||0)),a=(t.endTime||t.startTime).split(":").map(Number),r=60*(a[0]||e)+(a[1]||0),o=60*e+(i||0),l=Math.max(20,48*(r-o)/60),h=document.createElement("div");h.className=[`${CLASS$n}__week-event`,`${CLASS$n}__week-event--${t.type}`].filter(Boolean).join(" "),h.textContent=t.title,h.title=t.title,h.style.backgroundColor=t.color||"#17a2b8",h.style.top=`${n}px`,h.style.height=`${l}px`,h.addEventListener("click",e=>this.handleEventClick(t,e)),s.appendChild(h)}),o.appendChild(s)}return a.appendChild(o),t.appendChild(a),t}renderModal(){if(!this.modalEl)return;if(this.modalEl.replaceChildren(),!this.showEventModal)return void this.modalEl.removeAttribute("open");this.modalEl.setAttribute("open","true"),this.modalEl.setAttribute("title",this.isEditing?"일정 편집":"새 일정 추가");const t=document.createElement("div");t.className=`${CLASS$n}__event-form`;const e=document.createElement("db-input");e.setAttribute("label","제목 *"),e.setAttribute("placeholder","일정 제목을 입력하세요"),e.setAttribute("full-width",""),e.setAttribute("value",this.eventForm.title),e.addEventListener("db-input",t=>{this.eventForm.title=t.detail.value});const i=document.createElement("db-input");i.setAttribute("label","설명"),i.setAttribute("placeholder","일정 설명을 입력하세요"),i.setAttribute("full-width",""),i.setAttribute("value",this.eventForm.description),i.addEventListener("db-input",t=>{this.eventForm.description=t.detail.value});const s=document.createElement("db-date-picker");s.setAttribute("label","날짜"),s.setAttribute("full-width",""),s.setAttribute("value",toISODate(this.selectedDate)),s.addEventListener("db-change",t=>{const e=parseISODate(t.detail.value);e&&(this.selectedDate=e)});const n=document.createElement("db-select");n.setAttribute("label","일정 타입"),n.setAttribute("full-width",""),n.setAttribute("options",JSON.stringify(EVENT_TYPE_OPTIONS)),n.setAttribute("value",this.eventForm.type),n.addEventListener("db-change",t=>{this.eventForm.type=t.detail.value});const a=document.createElement("db-select");a.setAttribute("label","색상"),a.setAttribute("full-width",""),a.setAttribute("options",JSON.stringify(COLOR_OPTIONS)),a.setAttribute("value",this.eventForm.color),a.addEventListener("db-change",t=>{this.eventForm.color=t.detail.value});const r=document.createElement("db-time-picker");r.setAttribute("label","시작 시간"),r.setAttribute("full-width",""),r.setAttribute("value",this.eventForm.startTime),r.addEventListener("db-change",t=>{this.eventForm.startTime=t.detail.value});const o=document.createElement("db-time-picker");o.setAttribute("label","종료 시간"),o.setAttribute("full-width",""),o.setAttribute("value",this.eventForm.endTime),o.addEventListener("db-change",t=>{this.eventForm.endTime=t.detail.value}),t.append(e,i,s,n,a,r,o);const l=document.createElement("div");if(l.className=`${CLASS$n}__event-form-footer`,l.style.display="flex",l.style.gap="8px",l.style.justifyContent="flex-end",l.style.marginTop="16px",this.isEditing){const t=document.createElement("db-button");t.setAttribute("variant","danger"),t.textContent="삭제",t.addEventListener("click",()=>this.deleteEvent()),l.appendChild(t)}const h=document.createElement("db-button");h.setAttribute("variant","secondary"),h.textContent="취소",h.addEventListener("click",()=>this.closeModal());const d=document.createElement("db-button");d.setAttribute("variant","primary"),d.textContent="저장",d.addEventListener("click",()=>this.saveEvent()),l.append(h,d),t.appendChild(l),this.modalEl.appendChild(t)}render(){this.className=CLASS$n,this.replaceChildren(),this.headerEl&&this.bodyEl&&(this.renderHeader(),this.bodyEl.replaceChildren(),this.bodyEl.appendChild(this.renderMonthView()),this.append(this.headerEl,this.bodyEl),this.renderModal(),this.showEventModal&&this.modalEl&&this.appendChild(this.modalEl))}}customElements.get("db-calendar")||customElements.define("db-calendar",DbCalendar);const SIZES$3=["xs","s","m","l","xl"],VARIANTS$2=["default","minimal","card","inline","large"],DISPLAYS=["stars","number","both","reviews","detailed"],TYPES$1=["star","number","percentage","text"],COLORS=["primary","secondary","success","warning","error","custom"];class DbRating extends HTMLElement{constructor(){super(...arguments),this.hoverValue=null}static get observedAttributes(){return["value","max-value","size","variant","type","display","review-count","rating-text","review-text","allow-half","readonly","disabled","clickable","color","custom-color","animated","hover-effect"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getNumberAttr(t,e){const i=this.getAttribute(t);if(null===i||""===i)return e;const s=Number(i);return Number.isFinite(s)?s:e}getBooleanAttr(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getOption(t,e,i){const s=this.getAttribute(t);return s&&e.includes(s)?s:i}formatRating(t,e,i,s){const n=t/e*5;return"percentage"===i?`${Math.round(t/e*100)}%`:"number"===i?s?n.toFixed(1):String(Math.round(n)):"text"===i?n>=4.5?"매우 좋음":n>=3?"보통":"낮음":`${n.toFixed(1)}/5`}createStar(t,e,i,s){const n=document.createElement("span");n.className=["designbase-wc-rating__star",i&&"designbase-wc-rating__star--clickable",this.getBooleanAttr("animated")&&"designbase-wc-rating__star--animated"].filter(Boolean).join(" ");const a=document.createElement("span");if(a.textContent="★",a.style.opacity=0===e?"0.25":"1",n.append(a),.5===e){const t=document.createElement("span");t.textContent="★",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="50%",t.style.overflow="hidden",n.style.position="relative",n.append(t),a.style.opacity="0.25"}return n.setAttribute("aria-hidden","true"),i&&(n.addEventListener("mouseenter",()=>{this.hoverValue=(t+1)/5*s,this.render(),this.dispatchEvent(new CustomEvent("db-hover",{detail:{value:this.hoverValue},bubbles:!0,composed:!0}))}),n.addEventListener("mouseleave",()=>{this.hoverValue=null,this.render()}),n.addEventListener("click",()=>{const e=(t+1)/5*s;this.setAttribute("value",String(e)),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e},bubbles:!0,composed:!0}))})),n}render(){const t=this.getNumberAttr("value",0),e=this.getNumberAttr("max-value",5),i=this.getOption("size",SIZES$3,"m"),s=this.getOption("variant",VARIANTS$2,"default"),n=this.getOption("type",TYPES$1,"star"),a=this.getOption("display",DISPLAYS,"stars"),r=this.getOption("color",COLORS,"primary"),o=this.getNumberAttr("review-count",0),l=this.getBooleanAttr("allow-half",!1),h=this.getBooleanAttr("readonly",!1),d=this.getBooleanAttr("disabled",!1),u=this.getBooleanAttr("clickable",!1),p=this.getBooleanAttr("hover-effect",!0),m=(null!==this.hoverValue&&p?this.hoverValue:t)/e*5;this.className=["designbase-wc-rating",`designbase-wc-rating--size-${i}`,`designbase-wc-rating--variant-${s}`,`designbase-wc-rating--type-${n}`,`designbase-wc-rating--display-${a}`,`designbase-wc-rating--color-${r}`,h&&"designbase-wc-rating--readonly",d&&"designbase-wc-rating--disabled",u&&"designbase-wc-rating--clickable",this.getBooleanAttr("animated")&&"designbase-wc-rating--animated",null!==this.hoverValue&&"designbase-wc-rating--hovering"].filter(Boolean).join(" ");const g=this.getAttribute("custom-color");g?this.style.setProperty("--rating-color",g):this.style.removeProperty("--rating-color");const b=document.createElement("div");b.setAttribute("role","img"),b.setAttribute("aria-label",`rating ${this.formatRating(t,e,n,l)}`);const f=u&&!h&&!d;if("stars"===a||"both"===a||"detailed"===a){const t=document.createElement("div");t.className="designbase-wc-rating__stars";for(let i=0;i<5;i+=1){let s=0;m>=i+1?s=1:l&&m>=i+.5&&(s=.5),t.append(this.createStar(i,s,f,e))}b.append(t)}const v=this.getAttribute("rating-text")||this.formatRating(t,e,n,l);if("number"===a||"both"===a){const t=document.createElement("div");t.className="designbase-wc-rating__number-container";const e=document.createElement("span");e.className="designbase-wc-rating__number",e.textContent=v,t.append(e),b.append(t)}if("reviews"===a||"detailed"===a){const t=document.createElement("span");t.className="designbase-wc-rating__review-count",t.textContent=this.getAttribute("review-text")||(o>0?`${o.toLocaleString()} 리뷰`:""),t.textContent&&b.append(t)}this.replaceChildren(b)}}customElements.get("db-rating")||customElements.define("db-rating",DbRating);const SIZES$2=["s","m","l"],VARIANTS$1=["default","compact","minimal"];class DbCountdown extends HTMLElement{constructor(){super(...arguments),this.timer=null,this.targetTime=Date.now()}static get observedAttributes(){return["end-date","duration","size","variant","show-days","show-hours","show-minutes","show-seconds","show-labels"]}connectedCallback(){this.setupTargetTime(),this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(){this.setupTargetTime(),this.render()}boolAttr(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}optionAttr(t,e,i){const s=this.getAttribute(t);return s&&e.includes(s)?s:i}setupTargetTime(){const t=this.getAttribute("end-date"),e=Number(this.getAttribute("duration"));if(t){const e=new Date(t).getTime();return void(this.targetTime=Number.isFinite(e)?e:Date.now())}Number.isFinite(e)&&e>0?this.targetTime=Date.now()+1e3*e:this.targetTime=Date.now()}getRemaining(){const t=this.targetTime-Date.now();return t<=0?{days:0,hours:0,minutes:0,seconds:0,total:0}:{days:Math.floor(t/864e5),hours:Math.floor(t/36e5%24),minutes:Math.floor(t/6e4%60),seconds:Math.floor(t/1e3%60),total:t}}stop(){null!==this.timer&&(window.clearInterval(this.timer),this.timer=null)}start(){this.stop(),this.render(),this.timer=window.setInterval(()=>{const t=this.getRemaining();this.render(),this.dispatchEvent(new CustomEvent("db-tick",{detail:t,bubbles:!0,composed:!0})),t.total<=0&&(this.stop(),this.dispatchEvent(new CustomEvent("db-complete",{bubbles:!0,composed:!0})))},1e3)}two(t){return String(t).padStart(2,"0")}render(){const t=this.optionAttr("size",SIZES$2,"m"),e=this.optionAttr("variant",VARIANTS$1,"default"),i=this.boolAttr("show-labels",!0),s=this.getRemaining();this.className=["designbase-wc-countdown",`designbase-wc-countdown--${t}`,`designbase-wc-countdown--${e}`,i&&"designbase-wc-countdown--with-labels",s.total<=0&&"designbase-wc-countdown--expired"].filter(Boolean).join(" ");const n={days:this.getAttribute("label-days")||"일",hours:this.getAttribute("label-hours")||"시간",minutes:this.getAttribute("label-minutes")||"분",seconds:this.getAttribute("label-seconds")||"초"},a=[{key:"days",value:s.days,show:this.boolAttr("show-days",!0)},{key:"hours",value:s.hours,show:this.boolAttr("show-hours",!0)},{key:"minutes",value:s.minutes,show:this.boolAttr("show-minutes",!0)},{key:"seconds",value:s.seconds,show:this.boolAttr("show-seconds",!0)}].filter(t=>t.show),r=[];for(let t=0;t<a.length;t+=1){const s=a[t],o=document.createElement("div");o.className="designbase-wc-countdown__unit";const l=document.createElement("div");if(l.className="designbase-wc-countdown__value",l.textContent=this.two(s.value),o.append(l),i){const t=document.createElement("div");t.className="designbase-wc-countdown__label",t.textContent=n[s.key],o.append(t)}if(r.push(o),t<a.length-1&&"minimal"!==e){const t=document.createElement("div");t.className="designbase-wc-countdown__separator",t.textContent=":",r.push(t)}}this.replaceChildren(...r)}}customElements.get("db-countdown")||customElements.define("db-countdown",DbCountdown);const COLUMNS=[1,2,3,4,5,6],SPACINGS=["xs","s","m","l","xl"];class DbMasonry extends HTMLElement{static get observedAttributes(){return["images","columns","spacing","hover","clickable"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}get images(){try{const t=JSON.parse(this.getAttribute("images")||"[]");return Array.isArray(t)?t.filter(t=>t&&"string"==typeof t.src):[]}catch{return[]}}set images(t){this.setAttribute("images","string"==typeof t?t:JSON.stringify(t))}boolAttr(t,e=!0){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}render(){const t=Number(this.getAttribute("columns")||3),e=COLUMNS.includes(t)?t:3,i=this.getAttribute("spacing")||"m",s=SPACINGS.includes(i)?i:"m",n=this.boolAttr("hover",!0),a=this.boolAttr("clickable",!0);this.className=["designbase-wc-masonry",`designbase-wc-masonry--columns-${e}`,`designbase-wc-masonry--spacing-${s}`,n&&"designbase-wc-masonry--hover",a&&"designbase-wc-masonry--clickable"].filter(Boolean).join(" ");const r=Array.from({length:e},()=>[]),o=new Array(e).fill(0);this.images.forEach(t=>{const e=o.indexOf(Math.min(...o));r[e].push(t),o[e]+=1});const l=document.createDocumentFragment();r.forEach(t=>{const e=document.createElement("div");e.className="designbase-wc-masonry__column",t.forEach(t=>{const i=this.images.indexOf(t),s=document.createElement("figure");s.className="designbase-wc-masonry__item";const n=document.createElement("img");if(n.className="designbase-wc-masonry__image",n.src=t.thumbnail||t.src,n.alt=t.alt||t.title||`image-${i+1}`,n.loading="lazy",n.addEventListener("load",()=>{this.dispatchEvent(new CustomEvent("db-image-load",{detail:{image:t,index:i},bubbles:!0,composed:!0}))}),n.addEventListener("error",()=>{this.dispatchEvent(new CustomEvent("db-image-error",{detail:{image:t,index:i},bubbles:!0,composed:!0}))}),s.append(n),t.title||t.description){const e=document.createElement("figcaption");if(e.className="designbase-wc-masonry__overlay",t.title){const i=document.createElement("h3");i.className="designbase-wc-masonry__title",i.textContent=t.title,e.append(i)}if(t.description){const i=document.createElement("p");i.className="designbase-wc-masonry__description",i.textContent=t.description,e.append(i)}s.append(e)}a&&(s.tabIndex=0,s.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-image-click",{detail:{image:t,index:i},bubbles:!0,composed:!0}))})),e.append(s)}),l.append(e)}),this.replaceChildren(l)}}customElements.get("db-masonry")||customElements.define("db-masonry",DbMasonry);class DbCarousel extends HTMLElement{constructor(){super(...arguments),this.currentIndex=0,this.timer=null,this.isAutoPlaying=!1}static get observedAttributes(){return["items","size","variant","theme","transition","auto-play","auto-play-interval","infinite","show-navigation","show-indicators","indicator-style","show-auto-play-control","show-title","show-description","disabled","readonly"]}get items(){try{const t=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.style.display="block",this.clampCurrentIndex(),this.isAutoPlaying=this.getBool("auto-play"),this.startAutoPlay(),this.render()}disconnectedCallback(){this.stopAutoPlay()}attributeChangedCallback(t){"items"===t&&this.clampCurrentIndex(),"auto-play"!==t&&"auto-play-interval"!==t||(this.isAutoPlaying=this.getBool("auto-play"),this.startAutoPlay()),this.render()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}clampCurrentIndex(){this.currentIndex>=this.items.length&&(this.currentIndex=0)}stopAutoPlay(){this.timer&&(window.clearInterval(this.timer),this.timer=null)}startAutoPlay(){if(this.stopAutoPlay(),!this.isAutoPlaying||this.items.length<=1)return;const t=Math.max(1e3,Number(this.getAttribute("auto-play-interval")||5e3));this.timer=window.setInterval(()=>this.goToNext(),t)}getIndicatorType(){if(this.getBool("show-auto-play-control",!0)&&this.getBool("show-indicators",!0)&&this.items.length>1)return"combined";const t=this.getAttribute("indicator-style")||"dots";return"lines"===t?"line":"numbers"===t?"numbers":"dots"}getIndicatorSize(){const t=this.getAttribute("size")||"m";return"l"===t||"xl"===t?"m":"s"}goTo(t){t<0||t>=this.items.length||(this.currentIndex=t,this.dispatchEvent(new CustomEvent("db-slide-change",{detail:{index:t},bubbles:!0,composed:!0})),this.render())}goToPrev(){if(0===this.items.length)return;const t=this.getBool("infinite",!0),e=this.currentIndex-1;e<0?this.goTo(t?this.items.length-1:0):this.goTo(e)}goToNext(){if(0===this.items.length)return;const t=this.getBool("infinite",!0),e=this.currentIndex+1;e>=this.items.length?this.goTo(t?0:this.items.length-1):this.goTo(e)}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"light",s=this.getAttribute("transition")||"slide",n=this.getBool("show-navigation",!0),a=this.getBool("show-indicators",!0),r=this.getBool("show-auto-play-control",!0),o=this.getBool("show-title",!0),l=this.getBool("show-description",!0),h=this.getBool("disabled"),d=this.getBool("readonly"),u=this.getAttribute("indicator-style")||"dots",p=r&&a&&this.items.length>1;this.className=["designbase-wc-carousel",`designbase-wc-carousel--size-${t}`,`designbase-wc-carousel--variant-${e}`,`designbase-wc-carousel--theme-${i}`,`designbase-wc-carousel--transition-${s}`,`designbase-wc-carousel--indicator-${u}`,h&&"designbase-wc-carousel--disabled",d&&"designbase-wc-carousel--readonly"].filter(Boolean).join(" ");const m=document.createElement("div");m.className="designbase-wc-carousel__container";const g=document.createElement("div");if(g.className="designbase-wc-carousel__track",g.style.transform=`translateX(-${100*this.currentIndex}%)`,this.items.forEach((t,e)=>{const i=document.createElement("div");i.className="designbase-wc-carousel__slide"+(e===this.currentIndex?" designbase-wc-carousel__slide--active":""),i.style.flex="0 0 100%",i.style.width="100%",i.style.height="100%",i.style.minWidth="0";const s=t.image?"#ffffff":"";if(s&&(i.style.color=s),t.image){const s=document.createElement("div");s.className="designbase-wc-carousel__slide-image";const n=document.createElement("img");n.className="designbase-wc-carousel__slide-img",n.src=t.image,n.alt=t.alt||t.title||`Slide ${e+1}`,s.append(n),i.append(s)}if(o&&t.title||l&&t.description){const e=document.createElement("div");if(e.className="designbase-wc-carousel__slide-info",s&&(e.style.color=s),o&&t.title){const i=document.createElement("h3");i.className="designbase-wc-carousel__slide-title",i.textContent=t.title,s&&(i.style.color=s),e.append(i)}if(l&&t.description){const i=document.createElement("p");i.className="designbase-wc-carousel__slide-description",i.textContent=t.description,s&&(i.style.color=s),e.append(i)}i.append(e)}i.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-item-click",{detail:{item:t,index:e},bubbles:!0,composed:!0}))}),g.append(i)}),m.append(g),n&&this.items.length>1){const t=document.createElement("button");t.className="designbase-wc-carousel__nav-button designbase-wc-carousel__nav-button--prev",t.type="button",t.append(createDbIcon("chevron-left",20)),t.disabled=h||d,t.addEventListener("click",()=>this.goToPrev());const e=document.createElement("button");e.className="designbase-wc-carousel__nav-button designbase-wc-carousel__nav-button--next",e.type="button",e.append(createDbIcon("chevron-right",20)),e.disabled=h||d,e.addEventListener("click",()=>this.goToNext()),m.append(t,e)}const b=[m];if(a&&this.items.length>1){const t=document.createElement("div");t.className="designbase-wc-carousel__controls";const e=document.createElement("div");e.className="designbase-wc-carousel__indicators";const i=document.createElement("db-indicator");i.setAttribute("current",String(this.currentIndex)),i.setAttribute("total",String(this.items.length)),i.setAttribute("type",this.getIndicatorType()),i.setAttribute("size",this.getIndicatorSize()),i.setAttribute("clickable",""),p&&(i.setAttribute("timer",""),i.setAttribute("timer-duration",String(Math.max(1e3,Number(this.getAttribute("auto-play-interval")||5e3)))),i.setAttribute("auto-roll","false"),this.isAutoPlaying?i.setAttribute("playing",""):i.removeAttribute("playing"),(h||d)&&i.setAttribute("playback-disabled","")),i.addEventListener("db-step-click",t=>{const e=t;this.goTo(e.detail.index)}),i.addEventListener("db-playing-change",t=>{const e=t;this.isAutoPlaying=e.detail.playing,this.startAutoPlay(),this.render()}),e.append(i),t.append(e),b.push(t)}this.replaceChildren(...b)}}customElements.get("db-carousel")||customElements.define("db-carousel",DbCarousel);const SIZES$1=["s","m","l"],TYPES=["dropdown","modal"],POSITIONS=["bottom-start","bottom-end","top-start","top-end"],FORMATS=["hex","rgb","rgba","hsl","hsla"],clamp=(t,e,i)=>Math.max(e,Math.min(i,t)),toHex=(t,e,i)=>`#${[t,e,i].map(t=>clamp(Math.round(t),0,255).toString(16).padStart(2,"0")).join("")}`.toUpperCase(),hexToRgb$1=t=>{const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t.trim());return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},rgbToHsv=(t,e,i)=>{t/=255,e/=255,i/=255;const s=Math.max(t,e,i),n=s-Math.min(t,e,i);let a=0;0!==n&&(a=s===t?60*((e-i)/n+(e<i?6:0)):s===e?60*((i-t)/n+2):60*((t-e)/n+4));return{h:a,s:0===s?0:n/s*100,v:100*s}},hsvToRgb=(t,e,i)=>{const s=(i/=100)*(e/=100),n=s*(1-Math.abs(t/60%2-1)),a=i-s;let r=0,o=0,l=0;return[r,o,l]=t>=0&&t<60?[s,n,0]:t<120?[n,s,0]:t<180?[0,s,n]:t<240?[0,n,s]:t<300?[n,0,s]:[s,0,n],{r:255*(r+a),g:255*(o+a),b:255*(l+a)}};class DbColorPicker extends HTMLElement{constructor(){super(...arguments),this.h=215,this.s=100,this.v=100,this.a=100,this.open=!1,this.format="hex",this.handleOutsideClick=t=>{this.open&&(this.contains(t.target)||(this.open=!1,this.render()))}}static get observedAttributes(){return["size","type","position","value","default-value","show-input","show-alpha","show-format-selector","show-copy-button","disabled","readonly","full-width","error"]}connectedCallback(){this.syncFromValue(),this.render(),document.addEventListener("mousedown",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleOutsideClick)}attributeChangedCallback(t){"value"!==t&&"default-value"!==t||this.syncFromValue(),this.render()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getOption(t,e,i){const s=this.getAttribute(t);return s&&e.includes(s)?s:i}syncFromValue(){const t=this.getAttribute("value")||this.getAttribute("default-value")||"#006FFF",e=hexToRgb$1(t);if(!e)return;const i=rgbToHsv(e.r,e.g,e.b);this.h=i.h,this.s=i.s,this.v=i.v}emitChange(){const t=hsvToRgb(this.h,this.s,this.v),e=toHex(t.r,t.g,t.b);this.setAttribute("value",e),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e},bubbles:!0,composed:!0}))}getUiText(){const t=hsvToRgb(this.h,this.s,this.v),e=toHex(t.r,t.g,t.b),i=this.a/100;return"rgb"===this.format?`rgb(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)})`:"rgba"===this.format?`rgba(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)}, ${i.toFixed(2)})`:e}render(){const t=this.getOption("size",SIZES$1,"m"),e=this.getOption("type",TYPES,"dropdown"),i=this.getOption("position",POSITIONS,"bottom-start"),s=this.getBool("disabled"),n=this.getBool("readonly"),a=this.getBool("show-input",!0),r=this.getBool("show-alpha",!0),o=this.getBool("show-format-selector",!0),l=this.getBool("show-copy-button",!0),h=hsvToRgb(this.h,this.s,this.v),d=toHex(h.r,h.g,h.b),u=["designbase-wc-color-picker",`designbase-wc-color-picker--${t}`,`designbase-wc-color-picker--${i}`,this.open&&"designbase-wc-color-picker--open",this.getBool("full-width")&&"designbase-wc-color-picker--full-width",this.getBool("error")&&"designbase-wc-color-picker--error",s&&"designbase-wc-color-picker--disabled",n&&"designbase-wc-color-picker--readonly",!a&&"designbase-wc-color-picker--no-input"].filter(Boolean).join(" ");this.className=u;const p=document.createElement("div");p.className="designbase-wc-color-picker__trigger",p.addEventListener("click",()=>{s||n||(this.open=!this.open,this.render())});const m=document.createElement("div");m.className="designbase-wc-color-picker__color-display";const g=document.createElement("div");if(g.className="designbase-wc-color-picker__color-box",g.style.backgroundColor=r?`rgba(${Math.round(h.r)}, ${Math.round(h.g)}, ${Math.round(h.b)}, ${this.a/100})`:d,m.append(g),p.append(m),a){const t=document.createElement("input");t.className="designbase-wc-color-picker__input",t.value=this.getUiText(),t.readOnly=!0,p.append(t)}const b=document.createElement("div");if(b.className="designbase-wc-color-picker__trigger-actions",l){const t=document.createElement("button");t.className="designbase-wc-color-picker__copy-button-inline",t.type="button",t.textContent="⧉",t.addEventListener("click",async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(this.getUiText())}catch{}}),b.append(t)}const f=document.createElement("button");f.type="button",f.className="designbase-wc-color-picker__toggle",f.textContent="▾",b.append(f),p.append(b);const v=[p];if(this.open){const t=document.createElement("div");t.className=`designbase-wc-color-picker__dropdown designbase-wc-color-picker__dropdown--${i}`;const s=document.createElement("div");s.className="designbase-wc-color-picker__selector";const n=document.createElement("input");if(n.type="color",n.value=d,n.className="designbase-wc-color-picker__value-input",n.addEventListener("input",()=>{const t=hexToRgb$1(n.value);if(!t)return;const e=rgbToHsv(t.r,t.g,t.b);this.h=e.h,this.s=e.s,this.v=e.v,this.emitChange(),this.render()}),s.append(n),r){const t=document.createElement("input");t.type="range",t.min="0",t.max="100",t.value=String(this.a),t.className="designbase-wc-color-picker__slider designbase-wc-color-picker__slider--alpha",t.addEventListener("input",()=>{this.a=clamp(Number(t.value),0,100),this.emitChange(),this.render()}),s.append(t)}if(o){const t=document.createElement("select");t.className="designbase-wc-color-picker__value-input",FORMATS.forEach(e=>{const i=document.createElement("option");i.value=e,i.textContent=e.toUpperCase(),i.selected=e===this.format,t.append(i)}),t.addEventListener("change",()=>{this.format=FORMATS.includes(t.value)?t.value:"hex",this.render()}),s.append(t)}t.append(s),v.push(t),"modal"===e&&this.dispatchEvent(new CustomEvent("db-open",{bubbles:!0,composed:!0}))}this.replaceChildren(...v)}}customElements.get("db-color-picker")||customElements.define("db-color-picker",DbColorPicker);const VARIANTS=["default","bordered","filled","minimal"],SIZES=["s","m","l"],ORIENTATIONS=["vertical","horizontal"];class DbReorder extends HTMLElement{constructor(){super(...arguments),this.draggedIndex=-1,this.dragOverIndex=-1}static get observedAttributes(){return["items","variant","size","orientation","selectable","multi-select","show-drag-handle","show-drag-icon","full-width","disabled"]}get items(){try{const t=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getOption(t,e,i){const s=this.getAttribute(t);return s&&e.includes(s)?s:i}emitReorder(t){this.items=t,this.dispatchEvent(new CustomEvent("db-reorder",{detail:{items:t},bubbles:!0,composed:!0}))}render(){const t=this.getOption("variant",VARIANTS,"default"),e=this.getOption("size",SIZES,"m"),i=this.getOption("orientation",ORIENTATIONS,"vertical"),s=this.getBool("disabled"),n=this.getBool("selectable"),a=this.getBool("multi-select"),r=this.getBool("show-drag-handle",!0),o=this.getBool("show-drag-icon",!0);this.className=["designbase-wc-reorder",`designbase-wc-reorder--${t}`,`designbase-wc-reorder--${e}`,`designbase-wc-reorder--${i}`,this.getBool("full-width")&&"designbase-wc-reorder--full-width",s&&"designbase-wc-reorder--disabled",n&&"designbase-wc-reorder--selectable"].filter(Boolean).join(" ");const l=document.createDocumentFragment();this.items.forEach((t,e)=>{const i=document.createElement("div"),h=s||!!t.disabled,d=this.dragOverIndex===e;if(i.className=["designbase-wc-reorder__item",t.selected&&"designbase-wc-reorder__item--selected",h&&"designbase-wc-reorder__item--disabled",d&&"designbase-wc-reorder__item--drag-over"].filter(Boolean).join(" "),i.draggable=!h,i.addEventListener("dragstart",t=>{h||(this.draggedIndex=e,t.dataTransfer?.setData("text/plain",String(e)))}),i.addEventListener("dragover",t=>{t.preventDefault(),this.dragOverIndex=e,this.render()}),i.addEventListener("dragleave",()=>{this.dragOverIndex=-1,this.render()}),i.addEventListener("drop",t=>{if(t.preventDefault(),this.draggedIndex<0||this.draggedIndex===e)return;const i=[...this.items],[s]=i.splice(this.draggedIndex,1);i.splice(e,0,s),this.draggedIndex=-1,this.dragOverIndex=-1,this.emitReorder(i)}),r&&!h){const t=document.createElement("div");t.className="designbase-wc-reorder__drag-handle",t.textContent=o?"⋮⋮":"≡",i.append(t)}if(n){const e=document.createElement("div");e.className="designbase-wc-reorder__checkbox";const s=document.createElement("input");s.type=a?"checkbox":"radio",s.checked=!!t.selected,s.disabled=h,s.className="designbase-wc-reorder__checkbox-input",s.addEventListener("change",()=>{const e=this.items.map(e=>e.id!==t.id?a?e:{...e,selected:!1}:{...e,selected:!a||!e.selected});this.items=e,this.dispatchEvent(new CustomEvent("db-select",{detail:{items:e.filter(t=>t.selected)},bubbles:!0,composed:!0})),this.render()}),e.append(s),i.append(e)}const u=document.createElement("div");u.className="designbase-wc-reorder__content",u.textContent=t.content,i.append(u),l.append(i)}),this.replaceChildren(l)}}customElements.get("db-reorder")||customElements.define("db-reorder",DbReorder);const DIRECTIONS=["both","horizontal","vertical"],HANDLE_POSITIONS=["bottom-right","bottom-left","top-right","top-left","right","bottom"];class DbResizablePanels extends HTMLElement{constructor(){super(...arguments),this.isResizing=!1,this.startSize={width:0,height:0},this.startPos={x:0,y:0},this.currentSize={width:0,height:0},this.onMouseDown=t=>{t.preventDefault(),this.startResize(t.clientX,t.clientY),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},this.onTouchStart=t=>{t.preventDefault();const e=t.touches[0];this.startResize(e.clientX,e.clientY),document.addEventListener("touchmove",this.onTouchMove,{passive:!1}),document.addEventListener("touchend",this.onTouchEnd)},this.onMouseMove=t=>{this.applyResize(t.clientX,t.clientY)},this.onTouchMove=t=>{t.preventDefault();const e=t.touches[0];this.applyResize(e.clientX,e.clientY)},this.onMouseUp=()=>{this.endResize(),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)},this.onTouchEnd=()=>{this.endResize(),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd)}}static get observedAttributes(){return["initial-width","initial-height","min-width","min-height","max-width","max-height","direction","handle-position","handle-size","handle-color","handle-hover-color","snap-to-grid","show-guides","show-size-indicator","show-constraints","show-border","shadow","background-color","border-radius"]}connectedCallback(){this.ensureStructure(),this.initializeSize(),this.render()}attributeChangedCallback(){this.render()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getNumber(t,e){const i=Number(this.getAttribute(t)??e);return Number.isFinite(i)?i:e}getDirection(){const t=this.getAttribute("direction");return t&&DIRECTIONS.includes(t)?t:"both"}getHandlePosition(){const t=this.getAttribute("handle-position");return t&&HANDLE_POSITIONS.includes(t)?t:"bottom-right"}initializeSize(){const t=this.parentElement?.getBoundingClientRect();if(!t)return;const e=this.getAttribute("initial-width")||"100%",i=this.getAttribute("initial-height")||"100%";this.currentSize={width:"string"==typeof e&&e.endsWith("%")?t.width*Number(e.replace("%",""))/100:Number(e)||t.width,height:"string"==typeof i&&i.endsWith("%")?t.height*Number(i.replace("%",""))/100:Number(i)||t.height}}getMinSize(){return{width:this.getNumber("min-width",200),height:this.getNumber("min-height",150)}}getMaxSize(){const t=this.parentElement?.getBoundingClientRect();if(!t)return{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY};const e=this.getAttribute("max-width")||"100vw",i=this.getAttribute("max-height")||"100vh",toSize=(t,e,i)=>{if("100vw"===t||"100vh"===t)return e;if("100%"===t)return i;const s=Number(t);return Number.isFinite(s)?s:Number.POSITIVE_INFINITY};return{width:toSize(e,window.innerWidth,t.width),height:toSize(i,window.innerHeight,t.height)}}ensureStructure(){if(this.container)return;this.container=document.createElement("div"),this.container.className="designbase-wc-resizable-panels",this.guidesEl=document.createElement("div"),this.guidesEl.className="designbase-wc-resizable-panels__guides";const t=document.createElement("div");t.className="designbase-wc-resizable-panels__guide designbase-wc-resizable-panels__guide--horizontal";const e=document.createElement("div");e.className="designbase-wc-resizable-panels__guide designbase-wc-resizable-panels__guide--vertical",this.guidesEl.append(t,e),this.sizeIndicatorEl=document.createElement("div"),this.sizeIndicatorEl.className="designbase-wc-resizable-panels__size-indicator",this.constraintsEl=document.createElement("div"),this.constraintsEl.className="designbase-wc-resizable-panels__constraints",this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-resizable-panels__content",this.handleEl=document.createElement("div"),this.handleEl.className="designbase-wc-resizable-panels__handle",this.handleEl.addEventListener("mousedown",this.onMouseDown),this.handleEl.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.container.append(this.guidesEl,this.sizeIndicatorEl,this.constraintsEl,this.contentEl,this.handleEl),this.replaceChildren(this.container)}startResize(t,e){this.isResizing=!0,this.startSize={...this.currentSize},this.startPos={x:t,y:e},this.dispatchEvent(new CustomEvent("db-resize-start",{detail:this.currentSize,bubbles:!0,composed:!0})),this.render()}applyResize(t,e){if(!this.isResizing)return;const i=t-this.startPos.x,s=e-this.startPos.y,n=this.getDirection();let a=this.startSize.width,r=this.startSize.height;"both"!==n&&"horizontal"!==n||(a+=i),"both"!==n&&"vertical"!==n||(r+=s);const o=this.getNumber("snap-to-grid",0);o>0&&(a=Math.round(a/o)*o,r=Math.round(r/o)*o);const l=this.getMinSize(),h=this.getMaxSize();a=Math.max(l.width,Math.min(h.width,a)),r=Math.max(l.height,Math.min(h.height,r)),this.currentSize={width:a,height:r},this.dispatchEvent(new CustomEvent("db-resize",{detail:this.currentSize,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-size-change",{detail:this.currentSize,bubbles:!0,composed:!0})),this.render()}endResize(){this.isResizing&&(this.isResizing=!1,this.dispatchEvent(new CustomEvent("db-resize-end",{detail:this.currentSize,bubbles:!0,composed:!0})),this.render())}renderHandleStyle(){if(!this.handleEl)return;const t=this.getDirection(),e=this.getHandlePosition(),i=this.getAttribute("handle-color"),s=this.getAttribute("handle-hover-color");i?this.handleEl.style.setProperty("--db-resize-handle-color",i):this.handleEl.style.removeProperty("--db-resize-handle-color"),s?this.handleEl.style.setProperty("--db-resize-handle-hover-color",s):this.handleEl.style.removeProperty("--db-resize-handle-hover-color"),this.handleEl.style.top="",this.handleEl.style.right="",this.handleEl.style.bottom="",this.handleEl.style.left="",this.handleEl.style.transform="",this.handleEl.style.width="",this.handleEl.style.height="",this.handleEl.style.backgroundColor="",this.handleEl.onmouseenter=null,this.handleEl.onmouseleave=null;let n=`corner-${e}`;"vertical"===t?n="edge-bottom":"horizontal"===t&&(n="edge-right"),this.handleEl.className=`designbase-wc-resizable-panels__handle designbase-wc-resizable-panels__handle--${n}`,this.handleEl.setAttribute("role","separator"),this.handleEl.setAttribute("aria-label","크기 조절"),this.handleEl.replaceChildren()}render(){if(this.ensureStructure(),!(this.container&&this.contentEl&&this.guidesEl&&this.sizeIndicatorEl&&this.constraintsEl))return;const t=["designbase-wc-resizable-panels",this.isResizing&&"designbase-wc-resizable-panels--resizing",this.getBool("show-border",!0)&&"designbase-wc-resizable-panels--border",this.getBool("shadow",!0)&&"designbase-wc-resizable-panels--shadow"].filter(Boolean).join(" ");this.container.className=t,this.container.style.width=`${this.currentSize.width}px`,this.container.style.height=`${this.currentSize.height}px`;const e=this.getAttribute("background-color");this.container.style.backgroundColor=e||"";const i=this.getAttribute("border-radius")||"8px";if(this.container.style.borderRadius=/^\d+$/.test(i)?`${i}px`:i,0===this.contentEl.children.length){const t=Array.from(this.childNodes).filter(t=>t!==this.container);this.contentEl.append(...t)}if(this.guidesEl.style.display=this.getBool("show-guides",!0)&&this.isResizing?"":"none",this.sizeIndicatorEl.style.display=this.getBool("show-size-indicator",!0)&&this.isResizing?"":"none",this.sizeIndicatorEl.textContent=`${Math.round(this.currentSize.width)} × ${Math.round(this.currentSize.height)}`,this.constraintsEl.style.display=this.getBool("show-constraints",!0)&&this.isResizing?"":"none",this.constraintsEl.replaceChildren(),"none"!==this.constraintsEl.style.display){const t=this.getMinSize(),e=this.getMaxSize();this.currentSize.width<=t.width&&this.constraintsEl.append(this.makeConstraint("최소 너비 도달","min")),this.currentSize.height<=t.height&&this.constraintsEl.append(this.makeConstraint("최소 높이 도달","min")),this.currentSize.width>=e.width&&this.constraintsEl.append(this.makeConstraint("최대 너비 도달","max")),this.currentSize.height>=e.height&&this.constraintsEl.append(this.makeConstraint("최대 높이 도달","max"))}this.renderHandleStyle()}makeConstraint(t,e){const i=document.createElement("div");return i.className=`designbase-wc-resizable-panels__constraint designbase-wc-resizable-panels__constraint--${e}`,i.textContent=t,i}}customElements.get("db-resizable-panels")||customElements.define("db-resizable-panels",DbResizablePanels);const CLASS$m="designbase-wc-video-player",CONTROL_ICON=20,CENTER_ICON=48;class DbVideoPlayer extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.rafId=null,this.playlistIndex=0,this.isFullscreen=!1,this.showControlsOverlay=!1,this.isPlaying=!1,this.isMuted=!1,this.volume=1,this.lastVolumeBeforeMute=1,this.currentTime=0,this.duration=0,this.isLoading=!1,this.error=null,this.onFullscreenChange=()=>{this.isFullscreen=document.fullscreenElement===this,this.dispatchEvent(new CustomEvent("db-fullscreen-change",{detail:{isFullscreen:this.isFullscreen},bubbles:!0,composed:!0})),this.updateUI()},this.onMouseEnter=()=>{this.showControlsOverlay=!0,this.updateUI()},this.onMouseLeave=()=>{this.showControlsOverlay=!1,this.updateUI()}}static get observedAttributes(){return["src","poster","title","description","size","variant","theme","auto-play","loop","muted","show-controls","enable-fullscreen","show-progress","show-time","show-volume","playlist","current-index"]}connectedCallback(){this.built||(this.built=!0,this.build(),this.bindVideoEvents()),this.syncFromAttributes(),this.updateUI(),document.addEventListener("fullscreenchange",this.onFullscreenChange),this.addEventListener("mouseenter",this.onMouseEnter),this.addEventListener("mouseleave",this.onMouseLeave)}disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.removeEventListener("mouseenter",this.onMouseEnter),this.removeEventListener("mouseleave",this.onMouseLeave),this.stopProgressAnimation()}attributeChangedCallback(t){this.built&&("src"!==t&&"playlist"!==t&&"current-index"!==t?("muted"===t&&this.videoEl&&(this.videoEl.muted=this.getBool("muted")),this.updateUI()):this.loadVideoSource())}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getPlaylist(){try{const t=this.getAttribute("playlist"),e=t?JSON.parse(t):[];return Array.isArray(e)?e:[]}catch{return[]}}getCurrentSrc(){const t=this.getPlaylist();if(t.length>0){const e=Number(this.getAttribute("current-index")||this.playlistIndex||0);return t[Math.max(0,Math.min(t.length-1,e))]}return this.getAttribute("src")||""}formatTime(t){if(!Number.isFinite(t)||t<0)return"0:00";return`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`}iconButton(t,e,i){const s=document.createElement("button");return s.type="button",s.className=`${CLASS$m}__control-button`,s.append(createDbIcon(t,e)),s.addEventListener("click",t=>{t.stopPropagation(),i()}),s}skipButton(t,e){const i=document.createElement("button");return i.type="button",i.className=`${CLASS$m}__skip-button`,i.textContent=t,i.setAttribute("aria-label",e<0?"10초 되감기":"10초 빨리감기"),i.addEventListener("click",t=>{t.stopPropagation(),this.seekBy(e)}),i}syncFromAttributes(){this.playlistIndex=Number(this.getAttribute("current-index")||0),this.isMuted=this.getBool("muted"),this.volume=this.isMuted?0:1,this.lastVolumeBeforeMute=this.volume>0?this.volume:1,this.loadVideoSource()}loadVideoSource(){if(!this.videoEl)return;const t=this.getCurrentSrc();if(!t)return;const e=new URL(t,window.location.href).href;this.videoEl.src!==e&&(this.videoEl.src=t,this.videoEl.load()),this.videoEl.poster=this.getAttribute("poster")||"",this.videoEl.autoplay=this.getBool("auto-play"),this.videoEl.loop=this.getBool("loop"),this.videoEl.muted=this.getBool("muted"),this.videoEl.playsInline=!0}bindVideoEvents(){const t=this.videoEl;t&&(t.addEventListener("play",()=>{this.isPlaying=!0,this.startProgressAnimation(),this.dispatchEvent(new CustomEvent("db-play",{bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("pause",()=>{this.isPlaying=!1,this.stopProgressAnimation(),this.dispatchEvent(new CustomEvent("db-pause",{bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("timeupdate",()=>{this.currentTime=t.currentTime,this.duration=Number.isFinite(t.duration)?t.duration:0,this.dispatchEvent(new CustomEvent("db-time-update",{detail:{currentTime:this.currentTime,duration:this.duration},bubbles:!0,composed:!0})),this.updateProgress(),this.updateTime()}),t.addEventListener("volumechange",()=>{this.volume=t.volume,this.isMuted=t.muted||0===t.volume,!this.isMuted&&this.volume>0&&(this.lastVolumeBeforeMute=this.volume),this.dispatchEvent(new CustomEvent("db-volume-change",{detail:{volume:this.volume},bubbles:!0,composed:!0})),this.updateVolumeUI()}),t.addEventListener("ended",()=>{this.isPlaying=!1,this.stopProgressAnimation(),this.dispatchEvent(new CustomEvent("db-ended",{bubbles:!0,composed:!0}));const e=this.getPlaylist(),i=this.playlistIndex+1;e.length>0&&i<e.length&&(this.playlistIndex=i,this.loadVideoSource(),t.play()),this.updateUI()}),t.addEventListener("error",()=>{this.error="비디오를 재생할 수 없습니다.",this.dispatchEvent(new CustomEvent("db-error",{detail:{error:this.error},bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("loadstart",()=>{this.isLoading=!0,this.error=null,this.updateUI()}),t.addEventListener("loadedmetadata",()=>{this.duration=Number.isFinite(t.duration)?t.duration:0,this.updateTime()}),t.addEventListener("canplay",()=>{this.isLoading=!1,this.updateUI()}),t.addEventListener("click",()=>this.togglePlay()))}togglePlay(){this.videoEl&&(this.videoEl.paused?this.videoEl.play():this.videoEl.pause())}toggleMute(){if(this.videoEl){if(this.isMuted)return this.videoEl.muted=!1,void(this.videoEl.volume=this.lastVolumeBeforeMute>0?this.lastVolumeBeforeMute:1);this.videoEl.volume>0&&(this.lastVolumeBeforeMute=this.videoEl.volume),this.videoEl.muted=!0,this.videoEl.volume=0}}seekBy(t){if(!this.videoEl)return;const e=Number.isFinite(this.videoEl.duration)?this.videoEl.duration:0,i=e>0?e:Number.MAX_SAFE_INTEGER,s=Math.max(0,Math.min(i,this.videoEl.currentTime+t));this.videoEl.currentTime=s}toggleFullscreen(){this.getBool("enable-fullscreen",!0)&&(this.isFullscreen?document.exitFullscreen?.():this.requestFullscreen?.())}build(){this.videoEl=document.createElement("video"),this.videoEl.className=`${CLASS$m}__video`;const t=document.createElement("div");t.className=`${CLASS$m}__loading`;const e=document.createElement("div");e.className=`${CLASS$m}__spinner`,t.append(e);const i=document.createElement("div");i.className=`${CLASS$m}__error`;const s=document.createElement("p");s.textContent="비디오를 재생할 수 없습니다.";const n=document.createElement("button");n.type="button",n.textContent="다시 시도",n.addEventListener("click",()=>{this.error=null,this.loadVideoSource(),this.updateUI()}),i.append(s,n),this.dimOverlayEl=document.createElement("div"),this.dimOverlayEl.className=`${CLASS$m}__dim-overlay`,this.overlayEl=document.createElement("div"),this.overlayEl.className=`${CLASS$m}__overlay`;const a=document.createElement("div");a.className=`${CLASS$m}__top-controls`;const r=document.createElement("div");r.className=`${CLASS$m}__title`;const o=document.createElement("h3"),l=document.createElement("p");r.append(o,l),a.append(r),this._titleEl=o,this._descEl=l;const h=document.createElement("div");h.className=`${CLASS$m}__center-controls`;const d=this.skipButton("-10",-10);this.centerPlayEl=document.createElement("button"),this.centerPlayEl.type="button",this.centerPlayEl.className=`${CLASS$m}__play-button`,this.centerPlayEl.addEventListener("click",t=>{t.stopPropagation(),this.togglePlay()});const u=this.skipButton("+10",10);h.append(d,this.centerPlayEl,u);const p=document.createElement("div");p.className=`${CLASS$m}__bottom-controls`,this.progressEl=document.createElement("div"),this.progressEl.className=`${CLASS$m}__progress`,this.progressBarEl=document.createElement("div"),this.progressBarEl.className=`${CLASS$m}__progress-bar`,this.progressHandleEl=document.createElement("div"),this.progressHandleEl.className=`${CLASS$m}__progress-handle`,this.progressEl.append(this.progressBarEl,this.progressHandleEl),this.progressEl.addEventListener("click",t=>{if(!this.videoEl||!Number.isFinite(this.duration)||this.duration<=0)return;const e=this.progressEl.getBoundingClientRect(),i=(t.clientX-e.left)/e.width;this.videoEl.currentTime=i*this.duration});const m=document.createElement("div");m.className=`${CLASS$m}__controls`;const g=document.createElement("div");g.className=`${CLASS$m}__left-controls`,this.togglePlayEl=this.iconButton("play",CONTROL_ICON,()=>this.togglePlay()),this.volumeWrapEl=document.createElement("div"),this.volumeWrapEl.className=`${CLASS$m}__volume`,this.muteButtonEl=this.iconButton("volume-up",CONTROL_ICON,()=>this.toggleMute());const b=document.createElement("div");b.className=`${CLASS$m}__volume-slider`,this.volumeInputEl=document.createElement("input"),this.volumeInputEl.type="range",this.volumeInputEl.min="0",this.volumeInputEl.max="1",this.volumeInputEl.step="0.1",this.volumeInputEl.addEventListener("input",()=>{if(!this.videoEl||!this.volumeInputEl)return;const t=parseFloat(this.volumeInputEl.value);t>0&&(this.lastVolumeBeforeMute=t),this.videoEl.volume=t,this.videoEl.muted=0===t}),b.append(this.volumeInputEl),this.volumeWrapEl.append(this.muteButtonEl,b),this.timeEl=document.createElement("div"),this.timeEl.className=`${CLASS$m}__time`,this.timeCurrentEl=document.createElement("span");const f=document.createElement("span");f.textContent="/",this.timeDurationEl=document.createElement("span"),this.timeEl.append(this.timeCurrentEl,f,this.timeDurationEl),g.append(this.togglePlayEl,this.volumeWrapEl,this.timeEl);const v=document.createElement("div");v.className=`${CLASS$m}__right-controls`,this.fullscreenButtonEl=this.iconButton("expand",CONTROL_ICON,()=>this.toggleFullscreen()),v.append(this.fullscreenButtonEl),m.append(g,v),p.append(this.progressEl,m),this.overlayEl.append(a,h,p),this.append(this.videoEl,t,i,this.dimOverlayEl,this.overlayEl)}get titleEl(){return this._titleEl}get descEl(){return this._descEl}updateProgress(){const t=this.duration>0?this.currentTime/this.duration*100:0;this.progressBarEl&&(this.progressBarEl.style.width=`${t}%`),this.progressHandleEl&&(this.progressHandleEl.style.left=`${t}%`)}updateTime(){this.timeCurrentEl&&(this.timeCurrentEl.textContent=this.formatTime(this.currentTime)),this.timeDurationEl&&(this.timeDurationEl.textContent=this.formatTime(this.duration))}updateVolumeUI(){const t=this.isMuted?0:this.volume;this.volumeInputEl&&(this.volumeInputEl.value=String(t)),this.muteButtonEl&&this.muteButtonEl.replaceChildren(createDbIcon(this.isMuted||0===t?"mute-filled":"volume-up",CONTROL_ICON))}startProgressAnimation(){this.stopProgressAnimation();const tick=()=>{!this.videoEl||this.videoEl.paused||this.videoEl.ended||(this.currentTime=this.videoEl.currentTime,this.duration=Number.isFinite(this.videoEl.duration)?this.videoEl.duration:0,this.updateProgress(),this.updateTime(),this.rafId=requestAnimationFrame(tick))};this.rafId=requestAnimationFrame(tick)}stopProgressAnimation(){null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}updatePlayIcons(){const t=this.isPlaying?"pause":"play";this.centerPlayEl&&this.centerPlayEl.replaceChildren(createDbIcon(t,CENTER_ICON)),this.togglePlayEl&&this.togglePlayEl.replaceChildren(createDbIcon(t,CONTROL_ICON))}updateUI(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"auto",s=this.getBool("show-controls",!0),n=this.getBool("show-progress",!0),a=this.getBool("show-time",!0),r=this.getBool("show-volume",!0),o=this.getBool("enable-fullscreen",!0);this.className=[CLASS$m,`${CLASS$m}--size-${t}`,`${CLASS$m}--variant-${e}`,`${CLASS$m}--theme-${i}`,this.isPlaying&&`${CLASS$m}--playing`,!this.isPlaying&&`${CLASS$m}--paused`,this.isMuted&&`${CLASS$m}--muted`,this.isLoading&&`${CLASS$m}--loading`,this.error&&`${CLASS$m}--error`,s&&this.showControlsOverlay&&`${CLASS$m}--show-controls`,this.isFullscreen&&`${CLASS$m}--fullscreen`].filter(Boolean).join(" ");const l=this.getAttribute("title"),h=this.getAttribute("description");this.titleEl&&(l?(this.titleEl.textContent=l,this.titleEl.hidden=!1):this.titleEl.hidden=!0),this.descEl&&(h?(this.descEl.textContent=h,this.descEl.hidden=!1):this.descEl.hidden=!0),this.overlayEl&&(this.overlayEl.hidden=!s),this.dimOverlayEl&&(this.dimOverlayEl.hidden=!s),this.progressEl&&(this.progressEl.hidden=!n),this.timeEl&&(this.timeEl.hidden=!a),this.volumeWrapEl&&(this.volumeWrapEl.hidden=!r),this.fullscreenButtonEl&&(this.fullscreenButtonEl.hidden=!o),this.fullscreenButtonEl&&this.fullscreenButtonEl.replaceChildren(createDbIcon(this.isFullscreen?"shrink":"expand",CONTROL_ICON)),this.updatePlayIcons(),this.updateProgress(),this.updateTime(),this.updateVolumeUI()}}customElements.get("db-video-player")||customElements.define("db-video-player",DbVideoPlayer);class DbYouTubePlayer extends HTMLElement{constructor(){super(...arguments),this.isFullscreen=!1,this.playlistIndex=0,this.onFullscreenChange=()=>{this.isFullscreen=!!document.fullscreenElement,this.dispatchEvent(new CustomEvent("db-fullscreen-change",{detail:{isFullscreen:this.isFullscreen},bubbles:!0,composed:!0})),this.render()}}static get observedAttributes(){return["video-id","title","description","size","variant","theme","auto-play","loop","muted","show-controls","enable-fullscreen","enable-keyboard","enable-touch","show-subtitles","default-subtitle-lang","playback-rate","start-time","end-time","show-related-videos","show-info","show-channel-info","show-like-buttons","show-comments","playlist","current-index"]}connectedCallback(){this.style.display="block",this.playlistIndex=Number(this.getAttribute("current-index")||0),this.render(),document.addEventListener("fullscreenchange",this.onFullscreenChange)}disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange)}attributeChangedCallback(){this.render()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}extractVideoId(t){if(!t)return"";if(11===t.length&&/^[a-zA-Z0-9_-]{11}$/.test(t))return t;const e=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/|youtube\.com\/v\/|youtube\.com\/watch\?.*&v=)([^&\n?#]+)/,/youtube\.com\/watch\?.*v=([^&\n?#]+)/];for(const i of e){const e=t.match(i);if(e)return e[1]}return t}getPlaylist(){try{const t=this.getAttribute("playlist"),e=t?JSON.parse(t):[];return Array.isArray(e)?e:[]}catch{return[]}}getCurrentVideoId(){const t=this.getPlaylist();if(t.length>0){const e=Math.max(0,Math.min(t.length-1,this.playlistIndex));return this.extractVideoId(t[e])}return this.extractVideoId(this.getAttribute("video-id")||"")}generateEmbedUrl(t){const e=new URLSearchParams;if(this.getBool("auto-play")&&e.append("autoplay","1"),this.getBool("loop")&&e.append("loop","1"),this.getBool("muted")&&e.append("mute","1"),this.getBool("show-controls",!0)||e.append("controls","0"),this.getBool("enable-fullscreen",!0)||e.append("fs","0"),this.getBool("enable-keyboard",!0)||e.append("disablekb","1"),this.getBool("enable-touch",!0)||e.append("modestbranding","1"),this.getBool("show-subtitles")){e.append("cc_load_policy","1");const t=this.getAttribute("default-subtitle-lang")||"ko";t&&e.append("cc_lang_pref",t)}const i=this.getAttribute("playback-rate")||"1";"1"!==i&&e.append("vq",i);const s=Number(this.getAttribute("start-time")||0);s>0&&e.append("start",String(s));const n=Number(this.getAttribute("end-time")||0);n>0&&e.append("end",String(n)),this.getBool("show-related-videos",!0)||e.append("rel","0"),this.getBool("show-info",!0)||e.append("showinfo","0"),this.getBool("show-channel-info",!0)||e.append("modestbranding","1"),this.getBool("show-like-buttons",!0)||e.append("modestbranding","1"),this.getBool("show-comments",!1)||e.append("modestbranding","1");const a=this.getPlaylist().map(t=>this.extractVideoId(t)).filter(Boolean);a.length>0?e.append("playlist",a.join(",")):this.getBool("loop")&&e.append("playlist",t);const r=e.toString();return`https://www.youtube.com/embed/${t}${r?`?${r}`:""}`}render(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"auto";this.className=["designbase-wc-youtube-player",`designbase-wc-youtube-player--${t}`,`designbase-wc-youtube-player--${e}`,`designbase-wc-youtube-player--${i}`,this.isFullscreen&&"designbase-wc-youtube-player--fullscreen"].filter(Boolean).join(" ");const s=this.getCurrentVideoId();if(!s){const t=document.createElement("div");return t.className="designbase-wc-youtube-player__error",t.textContent="동영상을 불러올 수 없습니다.",void this.replaceChildren(t)}const n=document.createElement("div");n.className="designbase-wc-youtube-player__container";const a=document.createElement("iframe");a.className="designbase-wc-youtube-player__iframe",a.src=this.generateEmbedUrl(s),a.title=this.getAttribute("title")||`YouTube 동영상: ${s}`,a.setAttribute("frameborder","0"),a.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"),a.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),a.referrerPolicy="strict-origin-when-cross-origin",a.allowFullscreen=!0,n.append(a);const r=this.getAttribute("description"),o=document.createDocumentFragment();if(o.append(n),r&&"minimal"!==e){const t=document.createElement("div");t.className="designbase-wc-youtube-player__description";const e=document.createElement("p");e.textContent=r,t.append(e),o.append(t)}this.replaceChildren(o)}}customElements.get("db-youtube-player")||customElements.define("db-youtube-player",DbYouTubePlayer);const CLASS$l="designbase-wc-audio-player";class DbAudioPlayer extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.isPlaying=!1,this.isMuted=!1,this.volume=1,this.currentTime=0,this.duration=0,this.showSettingsMenu=!1,this.playbackRate=1,this.currentRepeatMode="none",this.isShuffle=!1,this.isLoading=!1,this.error=null,this.playlistIndex=0,this.shuffledPlaylist=[],this.boundKeyDown=t=>this.handleKeyDown(t)}static get observedAttributes(){return["src","title","artist","album","album-art","size","variant","theme","auto-play","loop","muted","show-controls","enable-keyboard","show-progress","show-time","show-volume","show-settings","playlist","current-index","playback-rates","default-playback-rate","repeat-mode","shuffle"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build(),this.bindAudioEvents()),this.syncFromAttributes(),this.updateUI(),this.getBool("enable-keyboard",!0)&&document.addEventListener("keydown",this.boundKeyDown)}disconnectedCallback(){document.removeEventListener("keydown",this.boundKeyDown)}attributeChangedCallback(t){if(this.built){if("current-index"===t)return this.playlistIndex=Number(this.getAttribute("current-index")||0),void this.loadCurrentTrack();"repeat-mode"===t&&(this.currentRepeatMode=this.getAttribute("repeat-mode")||"none"),"shuffle"===t&&(this.isShuffle=this.getBool("shuffle"),this.refreshShuffledPlaylist()),"default-playback-rate"===t&&(this.playbackRate=Number(this.getAttribute("default-playback-rate")||1),this.audioEl&&(this.audioEl.playbackRate=this.playbackRate)),this.updateUI()}}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getPlaylist(){try{const t=this.getAttribute("playlist"),e=t?JSON.parse(t):[];return Array.isArray(e)?e:[]}catch{return[]}}getPlaybackRates(){try{const t=this.getAttribute("playback-rates"),e=t?JSON.parse(t):[.5,.75,1,1.25,1.5,2];return Array.isArray(e)&&e.length>0?e:[.5,.75,1,1.25,1.5,2]}catch{return[.5,.75,1,1.25,1.5,2]}}getIconSize(){const t=this.getAttribute("size")||"m";return"s"===t?16:"l"===t?24:"xl"===t?32:20}getCurrentTrack(){const t=this.getPlaylist();if(t.length>0){return t[this.isShuffle&&this.shuffledPlaylist.length>0?this.shuffledPlaylist[this.playlistIndex]??this.playlistIndex:this.playlistIndex]||t[0]}return{src:this.getAttribute("src")||"",title:this.getAttribute("title")||void 0,artist:this.getAttribute("artist")||void 0,album:this.getAttribute("album")||void 0,albumArt:this.getAttribute("album-art")||void 0}}refreshShuffledPlaylist(){const t=this.getPlaylist();if(t.length>0&&this.isShuffle){const e=Array.from({length:t.length},(t,e)=>e);this.shuffledPlaylist=[...e].sort(()=>Math.random()-.5)}else this.shuffledPlaylist=[]}formatTime(t){return`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`}syncFromAttributes(){this.playlistIndex=Number(this.getAttribute("current-index")||0),this.currentRepeatMode=this.getAttribute("repeat-mode")||"none",this.isShuffle=this.getBool("shuffle"),this.playbackRate=Number(this.getAttribute("default-playback-rate")||1),this.isMuted=this.getBool("muted"),this.volume=this.isMuted?0:1,this.refreshShuffledPlaylist(),this.loadCurrentTrack()}loadCurrentTrack(){if(!this.audioEl)return;const t=this.getCurrentTrack(),e=t?.src||this.getAttribute("src")||"";this.audioEl.src!==e&&e&&(this.audioEl.src=e,this.audioEl.load()),this.updateTrackInfo(),this.updatePlaylistActive()}bindAudioEvents(){const t=this.audioEl;t&&(t.addEventListener("play",()=>{this.isPlaying=!0,this.dispatchEvent(new CustomEvent("db-play",{bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("pause",()=>{this.isPlaying=!1,this.dispatchEvent(new CustomEvent("db-pause",{bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("timeupdate",()=>{this.currentTime=t.currentTime,this.duration=t.duration||0,this.dispatchEvent(new CustomEvent("db-time-update",{detail:{currentTime:this.currentTime,duration:this.duration},bubbles:!0,composed:!0})),this.updateProgress(),this.updateTime()}),t.addEventListener("volumechange",()=>{this.volume=t.volume,this.isMuted=t.muted,this.dispatchEvent(new CustomEvent("db-volume-change",{detail:{volume:this.volume},bubbles:!0,composed:!0})),this.updateVolumeUI()}),t.addEventListener("ended",()=>this.handleEnded()),t.addEventListener("error",()=>{this.error="오디오를 재생할 수 없습니다.",this.dispatchEvent(new CustomEvent("db-error",{detail:{error:this.error},bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("loadstart",()=>{this.isLoading=!0,this.error=null,this.updateUI()}),t.addEventListener("canplay",()=>{this.isLoading=!1,this.updateUI()}))}handleEnded(){this.isPlaying=!1,this.dispatchEvent(new CustomEvent("db-ended",{bubbles:!0,composed:!0}));const t=this.getPlaylist();if(t.length>0){if("one"===this.currentRepeatMode)this.audioEl&&(this.audioEl.currentTime=0,this.audioEl.play());else if("all"===this.currentRepeatMode||this.playlistIndex<t.length-1){const e=this.playlistIndex+1;e<t.length?this.setPlaylistIndex(e):"all"===this.currentRepeatMode&&this.setPlaylistIndex(0)}}else this.getBool("loop")&&this.audioEl&&(this.audioEl.currentTime=0,this.audioEl.play());this.updateUI()}setPlaylistIndex(t){this.playlistIndex=t,this.dispatchEvent(new CustomEvent("db-playlist-change",{detail:{index:t},bubbles:!0,composed:!0})),this.loadCurrentTrack(),this.audioEl&&this.audioEl.play()}togglePlay(){this.audioEl&&(this.isPlaying?this.audioEl.pause():this.audioEl.play())}toggleMute(){this.audioEl&&(this.audioEl.muted=!this.isMuted)}toggleRepeatMode(){const t=["none","one","all"],e=t[(t.indexOf(this.currentRepeatMode)+1)%t.length];this.currentRepeatMode=e,this.dispatchEvent(new CustomEvent("db-repeat-mode-change",{detail:{mode:e},bubbles:!0,composed:!0})),this.updateUI()}toggleShuffle(){this.isShuffle=!this.isShuffle,this.refreshShuffledPlaylist(),this.dispatchEvent(new CustomEvent("db-shuffle-change",{detail:{shuffle:this.isShuffle},bubbles:!0,composed:!0})),this.updateUI()}handlePlaybackRateChange(t){this.audioEl&&(this.audioEl.playbackRate=t,this.playbackRate=t,this.dispatchEvent(new CustomEvent("db-playback-rate-change",{detail:{rate:t},bubbles:!0,composed:!0})))}handleKeyDown(t){if(this.audioEl&&this.getBool("enable-keyboard",!0))switch(t.code){case"Space":t.preventDefault(),this.togglePlay();break;case"ArrowLeft":t.preventDefault(),this.audioEl.currentTime=Math.max(0,this.currentTime-10);break;case"ArrowRight":t.preventDefault(),this.audioEl.currentTime=Math.min(this.duration,this.currentTime+10);break;case"ArrowUp":t.preventDefault(),this.audioEl.volume=Math.min(1,this.volume+.1),this.audioEl.muted=!1;break;case"ArrowDown":t.preventDefault(),this.audioEl.volume=Math.max(0,this.volume-.1),this.audioEl.muted=0===this.audioEl.volume;break;case"KeyM":t.preventDefault(),this.toggleMute();break;case"KeyR":t.preventDefault(),this.toggleRepeatMode();break;case"KeyS":t.preventDefault(),this.toggleShuffle()}}iconButton(t,e,i){const s=document.createElement("button");return s.type="button",s.className=`${CLASS$l}__control-button`,s.append(createDbIcon(t,this.getIconSize())),i?.disabled&&(s.disabled=!0),i?.data&&Object.entries(i.data).forEach(([t,e])=>s.setAttribute(`data-${t}`,e)),s.addEventListener("click",e),s}build(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"auto";this.className=[CLASS$l,`${CLASS$l}--size-${t}`,`${CLASS$l}--variant-${e}`,`${CLASS$l}--theme-${i}`].join(" "),this.audioEl=document.createElement("audio"),this.audioEl.preload="metadata",this.audioEl.hidden=!0;const s=document.createElement("div");s.className=`${CLASS$l}__loading`;const n=document.createElement("div");n.className=`${CLASS$l}__spinner`,s.append(n);const a=document.createElement("div");a.className=`${CLASS$l}__error`;const r=document.createElement("p");r.textContent="오디오를 재생할 수 없습니다.";const o=document.createElement("button");o.type="button",o.textContent="다시 시도",o.addEventListener("click",()=>window.location.reload()),a.append(r,o);const l=document.createElement("div");l.className=`${CLASS$l}__album-art`,this.albumImgEl=document.createElement("img"),this.albumImgEl.addEventListener("error",()=>{this.albumImgEl&&(this.albumImgEl.style.display="none"),this.albumPlaceholderEl?.classList.remove("album-placeholder")}),this.albumPlaceholderEl=document.createElement("div"),this.albumPlaceholderEl.className="album-placeholder",this.albumPlaceholderEl.textContent="🎵",l.append(this.albumImgEl,this.albumPlaceholderEl);const h=document.createElement("div");h.className=`${CLASS$l}__main`;const d=document.createElement("div");d.className=`${CLASS$l}__info`,this.titleEl=document.createElement("div"),this.titleEl.className=`${CLASS$l}__title`,this.artistEl=document.createElement("div"),this.artistEl.className=`${CLASS$l}__artist`,this.albumEl=document.createElement("div"),this.albumEl.className=`${CLASS$l}__album`,d.append(this.titleEl,this.artistEl,this.albumEl),this.progressEl=document.createElement("div"),this.progressEl.className=`${CLASS$l}__progress`,this.progressBarEl=document.createElement("div"),this.progressBarEl.className=`${CLASS$l}__progress-bar`,this.progressHandleEl=document.createElement("div"),this.progressHandleEl.className=`${CLASS$l}__progress-handle`,this.progressEl.append(this.progressBarEl,this.progressHandleEl),this.progressEl.addEventListener("click",t=>{if(!this.audioEl||!this.progressEl)return;const e=this.progressEl.getBoundingClientRect(),i=(t.clientX-e.left)/e.width;this.audioEl.currentTime=i*(this.duration||0)});const u=document.createElement("div");u.className=`${CLASS$l}__controls`;const p=document.createElement("div");p.className=`${CLASS$l}__left-controls`;const m=document.createElement("div");m.className=`${CLASS$l}__center-controls`;const g=document.createElement("div");g.className=`${CLASS$l}__right-controls`,this.playButtonEl=document.createElement("button"),this.playButtonEl.type="button",this.playButtonEl.className=`${CLASS$l}__play-button`,this.playButtonEl.addEventListener("click",()=>this.togglePlay()),m.append(this.playButtonEl),u.append(p,m,g);const b=document.createElement("div");b.className=`${CLASS$l}__bottom-controls`;const f=document.createElement("div");f.className=`${CLASS$l}__left-bottom`;const v=document.createElement("div");v.className=`${CLASS$l}__right-bottom`;const y=document.createElement("div");y.className=`${CLASS$l}__time`,this.timeCurrentEl=document.createElement("span");const E=document.createElement("span");E.textContent="/",this.timeDurationEl=document.createElement("span"),y.append(this.timeCurrentEl,E,this.timeDurationEl),f.append(y);const S=document.createElement("div");S.className=`${CLASS$l}__volume`;const w=this.iconButton(this.isMuted||0===this.volume?"mute-filled":"volume-up",()=>this.toggleMute());w.title=this.isMuted||0===this.volume?"음소거 해제":"음소거";const _=document.createElement("div");_.className=`${CLASS$l}__volume-slider`;const x=document.createElement("div");x.className="volume-label";const k=document.createElement("span");k.textContent="🔊";const L=document.createElement("span");x.append(k,L),this.volumeInputEl=document.createElement("input"),this.volumeInputEl.type="range",this.volumeInputEl.min="0",this.volumeInputEl.max="1",this.volumeInputEl.step="0.1",this.volumeInputEl.addEventListener("input",()=>{if(!this.audioEl||!this.volumeInputEl)return;const t=parseFloat(this.volumeInputEl.value);this.audioEl.volume=t,this.audioEl.muted=0===t}),_.append(x,this.volumeInputEl),S.append(w,_);const P=document.createElement("div");P.className=`${CLASS$l}__settings`;const T=this.iconButton("settings",()=>{this.showSettingsMenu=!this.showSettingsMenu,this.updateSettingsMenu()});this.settingsMenuEl=document.createElement("div"),this.settingsMenuEl.className=`${CLASS$l}__settings-menu`,this.settingsMenuEl.hidden=!0;const D=document.createElement("div");D.className=`${CLASS$l}__setting-group`;const I=document.createElement("label");I.textContent="재생 속도";const $=document.createElement("select");$.addEventListener("change",()=>this.handlePlaybackRateChange(parseFloat($.value))),D.append(I,$),this.settingsMenuEl.append(D),P.append(T,this.settingsMenuEl),v.append(S,P),b.append(f,v),h.append(d,this.progressEl,u,b);const M=document.createElement("div");M.className=`${CLASS$l}__playlist`,M.hidden=!0;const N=document.createElement("h4");N.textContent="플레이리스트",this.playlistTracksEl=document.createElement("div"),this.playlistTracksEl.className=`${CLASS$l}__playlist-tracks`,M.append(N,this.playlistTracksEl),this.append(this.audioEl,s,a,l,h,M),this._leftControls=p,this._rightControls=g,this._controls=u,this._time=y,this._volumeWrap=S,this._settings=P,this._playlist=M,this._rateSelect=$,this._volumePercent=L,this._muteButton=w}get leftControls(){return this._leftControls}get rightControls(){return this._rightControls}get controlsEl(){return this._controls}get timeEl(){return this._time}get volumeWrap(){return this._volumeWrap}get settingsEl(){return this._settings}get playlistEl(){return this._playlist}get rateSelect(){return this._rateSelect}get volumePercent(){return this._volumePercent}get muteButton(){return this._muteButton}updateTrackInfo(){const t=this.getCurrentTrack();this.titleEl&&(this.titleEl.textContent=t?.title||"Unknown Track"),this.artistEl&&(this.artistEl.textContent=t?.artist||"Unknown Artist"),this.albumEl&&(t?.album?(this.albumEl.textContent=t.album,this.albumEl.hidden=!1):this.albumEl.hidden=!0),this.albumImgEl&&this.albumPlaceholderEl&&(t?.albumArt?(this.albumImgEl.src=t.albumArt,this.albumImgEl.alt=t.title||"Album Art",this.albumImgEl.style.display=""):(this.albumImgEl.removeAttribute("src"),this.albumImgEl.style.display="none"),this.albumPlaceholderEl.className="album-placeholder")}updateProgress(){const t=this.duration>0?this.currentTime/this.duration*100:0;this.progressBarEl&&(this.progressBarEl.style.width=`${t}%`),this.progressHandleEl&&(this.progressHandleEl.style.left=`${t}%`,this.progressHandleEl.style.transform=t<=0?"translate(0, -50%)":t>=100?"translate(-100%, -50%)":"translate(-50%, -50%)")}updateTime(){this.timeCurrentEl&&(this.timeCurrentEl.textContent=this.formatTime(this.currentTime)),this.timeDurationEl&&(this.timeDurationEl.textContent=this.formatTime(this.duration))}updateVolumeUI(){this.volumeInputEl&&(this.volumeInputEl.value=String(this.volume)),this.volumePercent&&(this.volumePercent.textContent=`${Math.round(100*this.volume)}%`),this.muteButton&&(this.muteButton.replaceChildren(createDbIcon(this.isMuted||0===this.volume?"mute-filled":"volume-up",this.getIconSize())),this.muteButton.title=this.isMuted||0===this.volume?"음소거 해제":"음소거")}updateSettingsMenu(){this.settingsMenuEl&&(this.settingsMenuEl.hidden=!this.showSettingsMenu)}rebuildControlButtons(){const t=this.getPlaylist(),e=1.2*this.getIconSize();this.leftControls.replaceChildren(),this.rightControls.replaceChildren(),t.length>0&&this.leftControls.append(this.iconButton("refresh",()=>this.toggleShuffle(),{data:{shuffle:"true"}})),this.leftControls.append(this.iconButton("chevron-left",()=>{if(t.length>0){const t=this.playlistIndex-1;t>=0&&this.setPlaylistIndex(t)}else this.audioEl&&(this.audioEl.currentTime=0)},{disabled:t.length>0&&0===this.playlistIndex})),this.playButtonEl&&this.playButtonEl.replaceChildren(createDbIcon(this.isPlaying?"pause":"play",e)),this.rightControls.append(this.iconButton("chevron-right",()=>{if(t.length>0){const e=this.playlistIndex+1;e<t.length&&this.setPlaylistIndex(e)}},{disabled:t.length>0&&this.playlistIndex===t.length-1})),t.length>0&&this.rightControls.append(this.iconButton("repeat",()=>this.toggleRepeatMode(),{data:{repeat:"true"}}))}rebuildPlaylist(){if(!this.playlistTracksEl)return;const t=this.getPlaylist(),e=this.getAttribute("variant")||"default";this.playlistEl.hidden=!("full"===e&&t.length>0),this.playlistTracksEl.replaceChildren(),t.forEach((t,e)=>{const i=document.createElement("div");if(i.className=`${CLASS$l}__playlist-track${e===this.playlistIndex?` ${CLASS$l}__playlist-track--active`:""}`,i.addEventListener("click",()=>this.setPlaylistIndex(e)),t.albumArt){const e=document.createElement("img");e.src=t.albumArt,e.alt=t.title||"Album Art",i.append(e)}const s=document.createElement("div");s.className=`${CLASS$l}__playlist-track-info`;const n=document.createElement("div");n.className=`${CLASS$l}__playlist-track-title`,n.textContent=t.title||"Unknown Track";const a=document.createElement("div");a.className=`${CLASS$l}__playlist-track-artist`,a.textContent=t.artist||"Unknown Artist",s.append(n,a),i.append(s),this.playlistTracksEl?.append(i)})}updatePlaylistActive(){this.playlistTracksEl&&Array.from(this.playlistTracksEl.children).forEach((t,e)=>{t.classList.toggle(`${CLASS$l}__playlist-track--active`,e===this.playlistIndex)})}updateUI(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"auto",s=this.getBool("show-controls",!0),n=this.getBool("show-progress",!0),a=this.getBool("show-time",!0),r=this.getBool("show-volume",!0),o=this.getBool("show-settings",!1);this.className=[CLASS$l,`${CLASS$l}--size-${t}`,`${CLASS$l}--variant-${e}`,`${CLASS$l}--theme-${i}`,this.isPlaying&&`${CLASS$l}--playing`,!this.isPlaying&&`${CLASS$l}--paused`,this.isMuted&&`${CLASS$l}--muted`,this.isLoading&&`${CLASS$l}--loading`,this.error&&`${CLASS$l}--error`,this.isShuffle&&`${CLASS$l}--shuffle`,`${CLASS$l}--repeat-${this.currentRepeatMode}`].filter(Boolean).join(" "),this.audioEl&&(this.audioEl.autoplay=this.getBool("auto-play"),this.audioEl.loop=this.getBool("loop"),this.audioEl.muted=this.getBool("muted"),this.audioEl.playbackRate=this.playbackRate),this.progressEl&&(this.progressEl.hidden=!n),this.controlsEl&&(this.controlsEl.hidden=!s),this.timeEl&&(this.timeEl.hidden=!a),this.volumeWrap&&(this.volumeWrap.hidden=!r),this.settingsEl&&(this.settingsEl.hidden=!o),this.rateSelect.replaceChildren(...this.getPlaybackRates().map(t=>{const e=document.createElement("option");return e.value=String(t),e.textContent=`${t}x`,t===this.playbackRate&&(e.selected=!0),e})),this.rebuildControlButtons(),this.updateTrackInfo(),this.updateProgress(),this.updateTime(),this.updateVolumeUI(),this.updateSettingsMenu(),this.rebuildPlaylist()}}customElements.get("db-audio-player")||customElements.define("db-audio-player",DbAudioPlayer);const LANGUAGE_ALIASES={js:"javascript",ts:"typescript",sh:"bash",shell:"bash",html:"markup",xml:"markup",svg:"markup"},LANGUAGE_LABELS={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",css:"CSS",scss:"SCSS",json:"JSON",bash:"Bash",markup:"HTML"};let prismModule=null,prismLoadPromise=null;const loadPrism=async()=>prismModule||(prismLoadPromise||(prismLoadPromise=(async()=>{const t=await Promise.resolve().then(function(){return prism$1}),e=t.default??t;return await Promise.all([Promise.resolve().then(function(){return prismClike}),Promise.resolve().then(function(){return prismBash}),Promise.resolve().then(function(){return prismCss}),Promise.resolve().then(function(){return prismJavascript}),Promise.resolve().then(function(){return prismJsx}),Promise.resolve().then(function(){return prismJson}),Promise.resolve().then(function(){return prismMarkup}),Promise.resolve().then(function(){return prismScss}),Promise.resolve().then(function(){return prismTsx}),Promise.resolve().then(function(){return prismTypescript})]),prismModule=e,e})()),prismLoadPromise),resolvePrismLanguage=t=>{const e=t.toLowerCase().trim();return LANGUAGE_ALIASES[e]??e},formatLanguageLabel=t=>{const e=resolvePrismLanguage(t);return LANGUAGE_LABELS[e]??t.toUpperCase()},highlightWithPrism=(t,e,i)=>{const s=resolvePrismLanguage(i),n=t.languages[s];return n?t.highlight(e,n,s):null},ensureHighlightReady=()=>loadPrism().then(()=>{}),highlightCodeSync=(t,e)=>prismModule?highlightWithPrism(prismModule,t,e):null,highlightCode=async(t,e)=>{const i=await loadPrism();return highlightWithPrism(i,t,e)},CLASS$k="designbase-wc-code-block";class DbCodeBlock extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.renderToken=0,this.internalActiveId="",this.copied=!1,this.editedCodes={},this.handleSegmentChange=t=>{const e=t,i=e.detail?.value;i&&(this.hasAttribute("active-id")||(this.internalActiveId=i),this.dispatchEvent(new CustomEvent("db-active-id-change",{detail:{activeId:i},bubbles:!0,composed:!0})),this.render())}}static get observedAttributes(){return["items","code","language","default-active-id","active-id","show-language","highlight","theme","show-copy","copied-label","copy-label","min-height","max-height","overflow","editable"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.internalActiveId=this.getAttribute("default-active-id")||this.getResolvedItems()[0]?.id||""),this.render(),ensureHighlightReady().then(()=>{this.isConnected&&this.built&&this.render()}),this.addEventListener("db-change",this.handleSegmentChange)}disconnectedCallback(){this.removeEventListener("db-change",this.handleSegmentChange),this.copyTimeout&&window.clearTimeout(this.copyTimeout)}attributeChangedCallback(t){if(this.built)if("active-id"!==t){if("items"===t||"code"===t||"language"===t){const t=this.getResolvedItems();t.find(t=>t.id===this.getActiveId())||(this.internalActiveId=t[0]?.id||"")}this.render()}else this.render()}getBool(t,e=!0){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getResolvedItems(){const t=this.getAttribute("items");if(t)try{const e=JSON.parse(t);if(Array.isArray(e)&&e.length>0)return e}catch{}const e=this.getAttribute("code");if(e){const t=this.getAttribute("language")||"tsx";return[{id:"default",label:t,code:e,language:t}]}return[]}getActiveId(){return this.getAttribute("active-id")||this.internalActiveId}getActiveItem(){const t=this.getResolvedItems();return t.find(t=>t.id===this.getActiveId())||t[0]}toCssSize(t){if(t)return/^\d+$/.test(t)?`${t}px`:t}async handleCopy(){const t=this.getActiveItem(),e=this.getBool("editable",!1),i=(e?this.editedCodes[t?.id??""]??t?.code:t?.code)?.trim();if(i){try{await navigator.clipboard.writeText(i)}catch{const t=document.createElement("textarea");t.value=i,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}this.copied=!0,this.render(),this.copyTimeout&&window.clearTimeout(this.copyTimeout),this.copyTimeout=window.setTimeout(()=>{this.copied=!1,this.render()},1600)}}render(){this.renderAsync(++this.renderToken)}async renderAsync(t){const e=this.getActiveItem();if(!e)return void this.replaceChildren();const i=this.getResolvedItems(),s=i.length>1,n=this.getAttribute("language")||"tsx",a=e.language??n,r=this.getBool("show-language",!0),o=this.getBool("highlight",!0),l=this.getAttribute("theme")||"auto",h=this.getBool("show-copy",!0),d=this.getAttribute("copied-label")||"복사됨",u=this.getAttribute("copy-label")||"복사",p=this.getAttribute("overflow")||"scroll-x",m=this.getBool("editable",!1),g=m?this.editedCodes[e.id]??e.code:e.code,b=g.trim(),f=o&&g?await highlightCode(g,a):null;if(t!==this.renderToken)return;const v=this.toCssSize(this.getAttribute("min-height")),y=this.toCssSize(this.getAttribute("max-height"));v?this.style.setProperty("--db-code-block-min-height",v):this.style.removeProperty("--db-code-block-min-height"),y?this.style.setProperty("--db-code-block-max-height",y):this.style.removeProperty("--db-code-block-max-height"),this.className=[CLASS$k,`${CLASS$k}--overflow-${p}`,"auto"!==l&&`${CLASS$k}--theme-${l}`,m&&`${CLASS$k}--editable`].filter(Boolean).join(" ");const E=document.createElement("div");E.className=`${CLASS$k}__toolbar`;const S=document.createElement("div");if(S.className=`${CLASS$k}__toolbar-left`,s){const t=document.createElement("db-segment-control");t.setAttribute("size","s"),t.setAttribute("options",JSON.stringify(i.map(t=>({value:t.id,label:t.label})))),t.setAttribute("value",this.getActiveId()),S.append(t)}if(r){const t=document.createElement("span");t.className=`${CLASS$k}__language`,t.textContent=formatLanguageLabel(a),S.append(t)}if(E.append(S),h){const t=document.createElement("db-button");t.setAttribute("type","button"),t.setAttribute("variant","tertiary"),t.setAttribute("size","s"),t.setAttribute("start-icon",this.copied?"done":"copy"),t.textContent=this.copied?d:u,t.addEventListener("db-click",()=>this.handleCopy()),E.append(t)}const w=document.createElement("div");if(w.className=`${CLASS$k}__body`,s&&e.description){const t=document.createElement("p");t.className=`${CLASS$k}__caption`,t.textContent=e.description,w.append(t)}if(m){void 0===this.editedCodes[e.id]&&(this.editedCodes[e.id]=e.code);const t=document.createElement("div");t.className=`${CLASS$k}__editor`;const i=document.createElement("pre");i.className=`${CLASS$k}__pre ${CLASS$k}__pre--mirror`,i.setAttribute("aria-hidden","true");const s=document.createElement("code");s.className=`${CLASS$k}__code language-${a}`,f?s.innerHTML=f:s.textContent=g,i.append(s);const n=document.createElement("textarea");n.className=`${CLASS$k}__textarea`,n.value=g,n.spellcheck=!1,n.setAttribute("autocapitalize","off"),n.setAttribute("autocorrect","off"),n.setAttribute("aria-label",`${formatLanguageLabel(a)} 코드 편집`),n.addEventListener("input",()=>{this.editedCodes[e.id]=n.value;const t=o&&n.value?highlightCodeSync(n.value,a):null;t?s.innerHTML=t:s.textContent=n.value,this.dispatchEvent(new CustomEvent("db-code-change",{detail:{code:n.value,itemId:e.id},bubbles:!0,composed:!0}))}),t.append(i,n),w.append(t)}else{const t=document.createElement("pre");t.className=`${CLASS$k}__pre`;const e=document.createElement("code");e.className=`${CLASS$k}__code language-${a}`,f?e.innerHTML=f:e.textContent=b,t.append(e),w.append(t)}this.replaceChildren(E,w)}}customElements.get("db-code-block")||customElements.define("db-code-block",DbCodeBlock);const CLASS$j="designbase-wc-markdown-editor";class DbMarkdownEditor extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.internalValue="",this.currentMode="preview",this.isFocused=!1,this.wordCount=0,this.lineCount=0,this.lastSaved=null,this.isSaving=!1,this.handleKeyDown=t=>{if(this.getBool("disabled")||this.getBool("readonly"))return;const{ctrlKey:e,shiftKey:i,key:s}=t;e&&"b"===s?(t.preventDefault(),this.insertText("**","**","**")):e&&"i"===s?(t.preventDefault(),this.insertText("*","*","*")):e&&"k"===s?(t.preventDefault(),this.insertText("[","](",")")):e&&"`"===s?(t.preventDefault(),this.insertText("`","`","`")):e&&i&&"S"===s?(t.preventDefault(),this.insertText("~~","~~","~~")):"Tab"===s&&(t.preventDefault(),this.insertText(" ","",""))}}static get observedAttributes(){return["size","variant","mode","theme","value","placeholder","min-height","max-height","auto-height","readonly","disabled","show-toolbar","show-status","show-word-count","show-line-count","auto-save","auto-save-interval","file-upload"]}connectedCallback(){this.built||(this.built=!0,this.build()),this.syncFromAttributes(),this.renderMode(),this.updateCounts(),this.updateStatus(),this.setupAutoSave()}disconnectedCallback(){this.autoSaveTimer&&window.clearInterval(this.autoSaveTimer)}attributeChangedCallback(t){if(this.built){if("value"===t&&this.textareaEl)return this.internalValue=this.getAttribute("value")||"",this.textareaEl.value=this.internalValue,this.updatePreview(),this.updateCodeView(),void this.updateCounts();if("mode"===t)return this.currentMode=this.getAttribute("mode")||"preview",void this.renderMode();"auto-save"!==t&&"auto-save-interval"!==t||this.setupAutoSave(),this.updateRootClasses()}}get value(){return this.internalValue}set value(t){this.internalValue=t,this.setAttribute("value",t),this.textareaEl&&(this.textareaEl.value=t),this.updatePreview(),this.updateCodeView(),this.updateCounts()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}syncFromAttributes(){if(this.internalValue=this.getAttribute("value")||"",this.currentMode=this.getAttribute("mode")||"preview",this.textareaEl){this.textareaEl.value=this.internalValue,this.textareaEl.placeholder=this.getAttribute("placeholder")||"마크다운을 입력하세요...",this.textareaEl.readOnly=this.getBool("readonly"),this.textareaEl.disabled=this.getBool("disabled");const t=Number(this.getAttribute("min-height")||200),e=Number(this.getAttribute("max-height")||600),i=this.getBool("auto-height");this.textareaEl.style.minHeight=i?"auto":`${t}px`,this.textareaEl.style.maxHeight=i?"none":`${e}px`}this.updateRootClasses(),this.updatePreview(),this.updateCodeView()}updateRootClasses(){const t=this.getAttribute("size")||"m",e=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"light";this.className=[CLASS$j,`${CLASS$j}--size-${t}`,`${CLASS$j}--variant-${e}`,`${CLASS$j}--mode-${this.currentMode}`,`${CLASS$j}--theme-${i}`,this.isFocused&&`${CLASS$j}--focused`,this.getBool("disabled")&&`${CLASS$j}--disabled`,this.getBool("readonly")&&`${CLASS$j}--readonly`].filter(Boolean).join(" ")}markdownToHtml(t){return t.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/~~(.*)~~/gim,"<del>$1</del>").replace(/`(.*)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/!\[([^\]]*)\]\(([^)]+)\)/gim,'<img alt="$1" src="$2" />').replace(/^> (.*$)/gim,"<blockquote>$1</blockquote>").replace(/^- (.*$)/gim,"<ul><li>$1</li></ul>").replace(/^(\d+)\. (.*$)/gim,"<ol><li>$2</li></ol>").replace(/\n/gim,"<br />")}updatePreview(){this.previewEl&&(this.previewEl.innerHTML=this.markdownToHtml(this.internalValue))}updateCodeView(){if(this.codeViewEl){const t=this.codeViewEl.querySelector("code");t&&(t.textContent=this.internalValue)}}updateCounts(){this.wordCount=this.internalValue.trim()?this.internalValue.trim().split(/\s+/).length:0,this.lineCount=this.internalValue?this.internalValue.split("\n").length:0,this.wordCountEl&&(this.wordCountEl.textContent=`단어: ${this.wordCount}`),this.lineCountEl&&(this.lineCountEl.textContent=`라인: ${this.lineCount}`)}updateStatus(){if(!this.statusEl)return;const t=this.getBool("show-status",!0);this.statusEl.hidden=!t,this.wordCountEl&&(this.wordCountEl.hidden=!this.getBool("show-word-count",!0)),this.lineCountEl&&(this.lineCountEl.hidden=!this.getBool("show-line-count",!0)),this.lastSavedEl&&(this.lastSavedEl.hidden=!this.lastSaved,this.lastSaved&&(this.lastSavedEl.textContent=`저장됨: ${this.lastSaved.toLocaleTimeString()}`)),this.savingEl&&(this.savingEl.hidden=!this.isSaving)}emitChange(){this.dispatchEvent(new CustomEvent("db-change",{detail:{value:this.internalValue},bubbles:!0,composed:!0}))}insertText(t,e="",i=""){if(!this.textareaEl||this.getBool("disabled")||this.getBool("readonly"))return;const{selectionStart:s,selectionEnd:n}=this.textareaEl,a=this.internalValue.substring(s,n),r=e+(a||t)+i,o=this.internalValue.substring(0,s)+r+this.internalValue.substring(n);this.internalValue=o,this.textareaEl.value=o,this.emitChange(),this.updatePreview(),this.updateCodeView(),this.updateCounts();const l=s+e.length+(a?a.length:t.length);window.setTimeout(()=>{this.textareaEl&&(this.textareaEl.setSelectionRange(l,l),this.textareaEl.focus())},0)}getDefaultToolbarActions(){return[{id:"bold",label:"B",tooltip:"굵게 (Ctrl+B)",shortcut:"Ctrl+B",action:()=>this.insertText("**","**","**")},{id:"italic",label:"I",tooltip:"기울임 (Ctrl+I)",shortcut:"Ctrl+I",action:()=>this.insertText("*","*","*")},{id:"strikethrough",label:"S",tooltip:"취소선 (Ctrl+Shift+S)",shortcut:"Ctrl+Shift+S",action:()=>this.insertText("~~","~~","~~")},{id:"separator1",label:"|",separator:!0,action:()=>{}},{id:"heading1",label:"H1",tooltip:"제목 1",action:()=>this.insertText("# ","","")},{id:"heading2",label:"H2",tooltip:"제목 2",action:()=>this.insertText("## ","","")},{id:"heading3",label:"H3",tooltip:"제목 3",action:()=>this.insertText("### ","","")},{id:"separator2",label:"|",separator:!0,action:()=>{}},{id:"link",label:"",icon:"share-alt",tooltip:"링크 (Ctrl+K)",shortcut:"Ctrl+K",action:()=>this.insertText("[","](",")")},{id:"image",label:"",icon:"video",tooltip:"이미지",action:()=>this.insertText("")},{id:"code",label:"",icon:"code",tooltip:"인라인 코드 (Ctrl+`)",shortcut:"Ctrl+`",action:()=>this.insertText("`","`","`")},{id:"codeBlock",label:"```",tooltip:"코드 블록",action:()=>this.insertText("\n```\n","","\n```\n")},{id:"separator3",label:"|",separator:!0,action:()=>{}},{id:"list",label:"•",tooltip:"순서 없는 목록",action:()=>this.insertText("- ","","")},{id:"orderedList",label:"1.",tooltip:"순서 있는 목록",action:()=>this.insertText("1. ","","")},{id:"quote",label:'"',tooltip:"인용구",action:()=>this.insertText("> ","","")},{id:"separator4",label:"|",separator:!0,action:()=>{}},{id:"table",label:"⊞",tooltip:"테이블",action:()=>this.insertText("\n| 헤더1 | 헤더2 | 헤더3 |\n|-------|-------|-------|\n| 셀1 | 셀2 | 셀3 |\n","","")},{id:"horizontalRule",label:"—",tooltip:"수평선",action:()=>this.insertText("\n---\n","","")}]}renderToolbar(){if(!this.toolbarEl)return;const t=this.getBool("show-toolbar",!0);this.toolbarEl.hidden=!t,this.toolbarEl.replaceChildren();const e=document.createElement("div");e.className=`${CLASS$j}__mode-buttons`;[{mode:"edit",icon:"write",title:"편집 모드"},{mode:"preview",icon:"show",title:"미리보기 모드"},{mode:"split",icon:"hide",title:"분할 모드"},{mode:"code",icon:"code",title:"코드 보기"}].forEach(({mode:t,icon:i,title:s})=>{const n=document.createElement("button");n.type="button",n.className=`${CLASS$j}__mode-button${this.currentMode===t?` ${CLASS$j}__mode-button--active`:""}`,n.title=s,n.append(createDbIcon(i,16)),n.addEventListener("click",()=>{this.currentMode=t,this.updateRootClasses(),this.renderMode(),this.renderToolbar()}),e.append(n)}),this.toolbarEl.append(e);const i=document.createElement("div");if(i.className=`${CLASS$j}__toolbar-separator`,this.toolbarEl.append(i),"code"!==this.currentMode&&(this.getDefaultToolbarActions().forEach(t=>{const e=document.createElement("button");if(e.type="button",e.className=`${CLASS$j}__toolbar-item`,e.disabled=this.getBool("disabled"),t.tooltip&&(e.title=t.tooltip),t.icon)e.append(createDbIcon(t.icon,16));else if("bold"===t.id){const i=document.createElement("strong");i.textContent=t.label,e.append(i)}else if("italic"===t.id){const i=document.createElement("em");i.textContent=t.label,e.append(i)}else if("strikethrough"===t.id){const i=document.createElement("span");i.style.textDecoration="line-through",i.textContent=t.label,e.append(i)}else e.textContent=t.label;if(t.shortcut){const i=document.createElement("span");i.className=`${CLASS$j}__toolbar-shortcut`,i.textContent=t.shortcut,e.append(i)}e.addEventListener("click",t.action),this.toolbarEl?.append(e)}),this.getBool("file-upload"))){const t=document.createElement("label");t.className=`${CLASS$j}__file-upload`;const e=document.createElement("input");e.type="file",e.accept="image/*",e.hidden=!0,e.addEventListener("change",async()=>{const t=e.files?.[0];if(!t)return;const i=new CustomEvent("db-file-upload",{detail:{file:t},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(i),!i.defaultPrevented){const e=URL.createObjectURL(t);this.insertText(``)}e.value=""}),t.append(e,createDbIcon("upload",16)),this.toolbarEl.append(t)}}renderMode(){if(!this.editPanelEl||!this.previewPanelEl||!this.codePanelEl)return;const t="edit"===this.currentMode||"split"===this.currentMode,e="preview"===this.currentMode||"split"===this.currentMode,i="code"===this.currentMode;this.editPanelEl.hidden=!t,this.previewPanelEl.hidden=!e,this.codePanelEl.hidden=!i,this.updateRootClasses(),this.renderToolbar()}setupAutoSave(){if(this.autoSaveTimer&&window.clearInterval(this.autoSaveTimer),!this.getBool("auto-save"))return;const t=Number(this.getAttribute("auto-save-interval")||3e4);this.autoSaveTimer=window.setInterval(()=>{const t=this.getAttribute("value")||"";this.internalValue&&this.internalValue!==t&&(this.isSaving=!0,this.updateStatus(),this.dispatchEvent(new CustomEvent("db-save",{detail:{value:this.internalValue},bubbles:!0,composed:!0})),this.isSaving=!1,this.lastSaved=new Date,this.updateStatus())},t)}build(){this.toolbarEl=document.createElement("div"),this.toolbarEl.className=`${CLASS$j}__toolbar`,this.contentEl=document.createElement("div"),this.contentEl.className=`${CLASS$j}__content`,this.editPanelEl=document.createElement("div"),this.editPanelEl.className=`${CLASS$j}__edit-panel`,this.textareaEl=document.createElement("textarea"),this.textareaEl.className=`${CLASS$j}__textarea`,this.textareaEl.addEventListener("input",()=>{this.internalValue=this.textareaEl?.value||"",this.emitChange(),this.updatePreview(),this.updateCodeView(),this.updateCounts()}),this.textareaEl.addEventListener("focus",()=>{this.isFocused=!0,this.updateRootClasses(),this.dispatchEvent(new CustomEvent("db-focus",{bubbles:!0,composed:!0}))}),this.textareaEl.addEventListener("blur",()=>{this.isFocused=!1,this.updateRootClasses(),this.dispatchEvent(new CustomEvent("db-blur",{bubbles:!0,composed:!0}))}),this.textareaEl.addEventListener("keydown",this.handleKeyDown),this.editPanelEl.append(this.textareaEl),this.previewPanelEl=document.createElement("div"),this.previewPanelEl.className=`${CLASS$j}__preview-panel`,this.previewEl=document.createElement("div"),this.previewEl.className=`${CLASS$j}__preview`,this.previewPanelEl.append(this.previewEl),this.codePanelEl=document.createElement("div"),this.codePanelEl.className=`${CLASS$j}__code-panel`,this.codeViewEl=document.createElement("pre"),this.codeViewEl.className=`${CLASS$j}__code-view`;const t=document.createElement("code");this.codeViewEl.append(t),this.codePanelEl.append(this.codeViewEl),this.contentEl.append(this.editPanelEl,this.previewPanelEl,this.codePanelEl),this.statusEl=document.createElement("div"),this.statusEl.className=`${CLASS$j}__status`,this.wordCountEl=document.createElement("span"),this.wordCountEl.className=`${CLASS$j}__word-count`,this.lineCountEl=document.createElement("span"),this.lineCountEl.className=`${CLASS$j}__line-count`,this.lastSavedEl=document.createElement("span"),this.lastSavedEl.className=`${CLASS$j}__last-saved`,this.savingEl=document.createElement("span"),this.savingEl.className=`${CLASS$j}__saving`,this.savingEl.textContent="저장 중...",this.statusEl.append(this.wordCountEl,this.lineCountEl,this.lastSavedEl,this.savingEl),this.append(this.toolbarEl,this.contentEl,this.statusEl)}}customElements.get("db-markdown-editor")||customElements.define("db-markdown-editor",DbMarkdownEditor);const CLASS$i="designbase-wc-testimonial";function clampRating(t,e){if("number"==typeof t&&!Number.isNaN(t))return t<0?0:t>e?e:Math.round(10*t)/10}class DbTestimonial extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["quote","author","role","company","avatar","avatar-initials","rating","max-rating","size","align","badge","badge-variant","badge-size"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}build(){this.figureEl=document.createElement("figure"),this.badgeEl=document.createElement("db-badge"),this.badgeEl.className=`${CLASS$i}__badge`,this.badgeEl.hidden=!0,this.quoteEl=document.createElement("blockquote"),this.quoteEl.className=`${CLASS$i}__quote`,this.footerEl=document.createElement("figcaption"),this.footerEl.className=`${CLASS$i}__footer`,this.avatarWrapEl=document.createElement("div"),this.avatarWrapEl.className=`${CLASS$i}__avatar`,this.avatarEl=document.createElement("db-avatar"),this.avatarEl.className=`${CLASS$i}__avatar-image`,this.avatarWrapEl.append(this.avatarEl);const t=document.createElement("div");t.className=`${CLASS$i}__meta`,this.authorEl=document.createElement("span"),this.authorEl.className=`${CLASS$i}__author`,this.roleEl=document.createElement("span"),this.roleEl.className=`${CLASS$i}__role`,t.append(this.authorEl,this.roleEl),this.ratingEl=document.createElement("db-rating"),this.ratingEl.className=`${CLASS$i}__rating`,this.ratingEl.setAttribute("display","both"),this.ratingEl.setAttribute("allow-half",""),this.ratingEl.setAttribute("readonly",""),this.ratingEl.setAttribute("color","primary"),this.ratingEl.hidden=!0,this.footerEl.append(this.avatarWrapEl,t,this.ratingEl),this.extraEl=document.createElement("div"),this.extraEl.className=`${CLASS$i}__extra`,this.extraEl.hidden=!0,this.figureEl.append(this.badgeEl,this.quoteEl,this.footerEl,this.extraEl),this.append(this.figureEl)}getAvatarSize(){const t=this.getAttribute("size")||"m";return"s"===t?"s":"l"===t?"l":"m"}getRatingSize(){const t=this.getAttribute("size")||"m";return"s"===t?"s":"l"===t?"l":"m"}syncExtraContent(){if(!this.extraEl)return;const t=Array.from(this.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent?.trim());if(0===t.length)return this.extraEl.hidden=!0,void this.extraEl.replaceChildren();this.extraEl.hidden=!1,this.extraEl.replaceChildren(...t.map(t=>t.cloneNode(!0)))}updateUI(){const t=this.getAttribute("quote")||"",e=this.getAttribute("author")||"",i=this.getAttribute("role")||"",s=this.getAttribute("company")||"",n=this.getAttribute("avatar")||"",a=this.getAttribute("avatar-initials")||"",r=this.getAttribute("rating"),o=Number(this.getAttribute("max-rating")||5),l=null!==r&&""!==r?clampRating(Number(r),o):void 0,h=this.getAttribute("size")||"m",d=this.getAttribute("align")||"left",u=this.getAttribute("badge")||"",p=[CLASS$i,`${CLASS$i}--size-${h}`,`${CLASS$i}--align-${d}`].join(" ");this.className="",this.figureEl&&(this.figureEl.className=p),this.badgeEl&&(u?(this.badgeEl.hidden=!1,this.badgeEl.setAttribute("size",this.getAttribute("badge-size")||"s"),this.badgeEl.setAttribute("variant",this.getAttribute("badge-variant")||"primary"),this.badgeEl.setAttribute("badge-style","text"),this.badgeEl.textContent=u):this.badgeEl.hidden=!0),this.quoteEl&&(this.quoteEl.textContent=t?`“${t}”`:""),this.authorEl&&(this.authorEl.textContent=e);const m=[i,s].filter(Boolean).join(" · ");this.roleEl&&(this.roleEl.textContent=m,this.roleEl.hidden=!m);const g=Boolean(n||a);this.avatarWrapEl&&(this.avatarWrapEl.hidden=!g),this.avatarEl&&g&&(this.avatarEl.setAttribute("size",this.getAvatarSize()),n?this.avatarEl.setAttribute("src",n):this.avatarEl.removeAttribute("src"),a?this.avatarEl.setAttribute("initials",a):this.avatarEl.removeAttribute("initials"),this.avatarEl.setAttribute("alt",`${e} 프로필 이미지`)),this.ratingEl&&("number"==typeof l?(this.ratingEl.hidden=!1,this.ratingEl.setAttribute("value",String(l)),this.ratingEl.setAttribute("max-value",String(o)),this.ratingEl.setAttribute("size",this.getRatingSize())):this.ratingEl.hidden=!0),this.syncExtraContent()}}customElements.get("db-testimonial")||customElements.define("db-testimonial",DbTestimonial);const CLASS$h="designbase-wc-section-hero";function mapButtonVariant(t){return"outline"===t?"tertiary":"ghost"===t?"ghost":"secondary"===t?"secondary":"tertiary"===t?"tertiary":"primary"}class DbSectionHero extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["title","subtitle","description","background-image","background-video","overlay-color","overlay-opacity","buttons","variant","theme","alignment","animated","full-height","min-height","max-height","content-max-width"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}parseButtons(){try{const t=JSON.parse(this.getAttribute("buttons")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}build(){this.backgroundVideoEl=document.createElement("video"),this.backgroundVideoEl.className=`${CLASS$h}__background-video`,this.backgroundVideoEl.autoplay=!0,this.backgroundVideoEl.muted=!0,this.backgroundVideoEl.loop=!0,this.backgroundVideoEl.playsInline=!0,this.backgroundVideoEl.hidden=!0,this.backgroundImageEl=document.createElement("div"),this.backgroundImageEl.className=`${CLASS$h}__background-image`,this.backgroundImageEl.hidden=!0,this.overlayEl=document.createElement("div"),this.overlayEl.className=`${CLASS$h}__overlay`,this.overlayEl.hidden=!0;const t=document.createElement("div");t.className=`${CLASS$h}__container`;const e=document.createElement("div");e.className=`${CLASS$h}__content`,this.titleEl=document.createElement("h1"),this.titleEl.className=`${CLASS$h}__title`,this.subtitleEl=document.createElement("p"),this.subtitleEl.className=`${CLASS$h}__subtitle`,this.descriptionEl=document.createElement("p"),this.descriptionEl.className=`${CLASS$h}__description`,this.buttonsEl=document.createElement("div"),this.buttonsEl.className=`${CLASS$h}__buttons`,e.append(this.titleEl,this.subtitleEl,this.descriptionEl,this.buttonsEl),t.append(e),this.append(this.backgroundVideoEl,this.backgroundImageEl,this.overlayEl,t)}updateUI(){const t=this.getAttribute("title")||"",e=this.getAttribute("subtitle")||"",i=this.getAttribute("description")||"",s=this.getAttribute("background-image")||"",n=this.getAttribute("background-video")||"",a=this.getAttribute("overlay-color")||"",r=Number(this.getAttribute("overlay-opacity")||.5),o=this.getAttribute("variant")||"default",l=this.getAttribute("theme")||"light",h=this.getAttribute("alignment")||"left",d=this.hasAttribute("animated"),u=this.hasAttribute("full-height"),p=this.getAttribute("min-height"),m=this.getAttribute("max-height"),g=this.getAttribute("content-max-width"),b=this.parseButtons(),f=Boolean(s||n),v="dark"===l||"gradient"===l||f&&("overlay"===o||"image"===l);this.className=[CLASS$h,`${CLASS$h}--variant-${o}`,`${CLASS$h}--theme-${l}`,`${CLASS$h}--alignment-${h}`,d&&`${CLASS$h}--animated`,u&&`${CLASS$h}--full-height`,v&&`${CLASS$h}--on-media`].filter(Boolean).join(" "),this.style.minHeight=p||"",this.style.maxHeight=m||"",this.titleEl&&(this.titleEl.textContent=t),this.subtitleEl&&(this.subtitleEl.textContent=e,this.subtitleEl.hidden=!e),this.descriptionEl&&(this.descriptionEl.textContent=i,this.descriptionEl.hidden=!i);const y=this.querySelector(`.${CLASS$h}__content`);if(y&&(g?y.style.maxWidth=/^\d+$/.test(g)?`${g}px`:g:y.style.removeProperty("max-width")),this.backgroundVideoEl)if(n){this.backgroundVideoEl.hidden=!1,this.backgroundVideoEl.replaceChildren();const t=document.createElement("source");t.src=n,t.type="video/mp4",this.backgroundVideoEl.append(t)}else this.backgroundVideoEl.hidden=!0;this.backgroundImageEl&&(s?(this.backgroundImageEl.hidden=!1,this.backgroundImageEl.style.backgroundImage=`url(${s})`,this.backgroundImageEl.style.backgroundSize="cover",this.backgroundImageEl.style.backgroundPosition="center",this.backgroundImageEl.style.backgroundRepeat="no-repeat"):this.backgroundImageEl.hidden=!0),this.overlayEl&&(f?(this.overlayEl.hidden=!1,a?(this.overlayEl.style.background=a,this.overlayEl.style.opacity=String(r)):(this.overlayEl.style.background=`linear-gradient(180deg, rgba(0, 0, 0, ${.35*r}) 0%, rgba(0, 0, 0, ${r}) 100%)`,this.overlayEl.style.opacity="1")):this.overlayEl.hidden=!0),this.buttonsEl&&(this.buttonsEl.replaceChildren(),b.length>0?(b.forEach(t=>{const e=document.createElement("db-button");if(e.setAttribute("variant",mapButtonVariant(t.variant)),e.setAttribute("size",t.size||"m"),t.href&&e.setAttribute("href",t.href),t.external&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")),t.startIcon)e.setAttribute("start-icon",t.startIcon),e.textContent=t.text;else if(t.icon){const i=document.createElement("span");i.className=`${CLASS$h}__button-content`;const s=document.createElement("span");s.className=`${CLASS$h}__button-icon`,s.setAttribute("aria-hidden","true"),s.textContent=t.icon;const n=document.createElement("span");n.textContent=t.text,i.append(s,n),e.append(i)}else e.textContent=t.text;e.addEventListener("click",e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("db-button-click",{detail:{button:t},bubbles:!0,composed:!0}))}),this.buttonsEl.append(e)}),this.buttonsEl.hidden=!1):this.buttonsEl.hidden=!0)}}customElements.get("db-section-hero")||customElements.define("db-section-hero",DbSectionHero);const CLASS$g="designbase-wc-section-feature";class DbSectionFeature extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["headline","subtitle","description","badge","image","image-alt","media-position","actions","tinted","content-padding","size","full-width","full-height","overflow-visible"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}parseBadge(){try{const t=this.getAttribute("badge");return t?JSON.parse(t):null}catch{return null}}parseActions(){try{const t=JSON.parse(this.getAttribute("actions")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}build(){this.sectionEl=document.createElement("db-section"),this.sectionEl.setAttribute("no-padding",""),this.sectionEl.setAttribute("data-wc-internal",""),this.featureWrapEl=document.createElement("div"),this.featureWrapEl.className=CLASS$g;const t=document.createElement("div");t.className=`${CLASS$g}__inner`;const e=document.createElement("div");e.className=`${CLASS$g}__content`,this.badgeEl=document.createElement("db-badge"),this.badgeEl.className=`${CLASS$g}__badge`,this.badgeEl.hidden=!0,this.headlineEl=document.createElement("h2"),this.headlineEl.className=`${CLASS$g}__headline`,this.subtitleEl=document.createElement("p"),this.subtitleEl.className=`${CLASS$g}__subtitle`,this.descriptionEl=document.createElement("p"),this.descriptionEl.className=`${CLASS$g}__description`,this.actionsEl=document.createElement("div"),this.actionsEl.className=`${CLASS$g}__actions`,e.append(this.badgeEl,this.headlineEl,this.subtitleEl,this.descriptionEl,this.actionsEl),this.mediaEl=document.createElement("div"),this.mediaEl.className=`${CLASS$g}__media`,this.imageEl=document.createElement("img"),this.imageEl.className=`${CLASS$g}__image`,this.mediaEl.append(this.imageEl),t.append(e,this.mediaEl),this.featureWrapEl.append(t),this.sectionEl.append(this.featureWrapEl),this.append(this.sectionEl)}updateUI(){const t=this.getAttribute("headline")||"",e=this.getAttribute("subtitle")||"",i=this.getAttribute("description")||"",s=this.getAttribute("image")||"",n=this.getAttribute("image-alt")||t||"feature",a=this.getAttribute("media-position")||"right",r=this.getAttribute("content-padding")||"l",o=this.getAttribute("size")||"l",l=this.hasAttribute("tinted"),h=this.parseBadge(),d=this.parseActions(),u=[CLASS$g,`${CLASS$g}--media-${a}`,`${CLASS$g}--padding-${r}`,l&&`${CLASS$g}--tinted`].filter(Boolean).join(" ");this.className=CLASS$g,this.featureWrapEl&&(this.featureWrapEl.className=u),this.sectionEl&&(this.sectionEl.setAttribute("size",o),this.hasAttribute("full-width")?this.sectionEl.setAttribute("full-width",""):this.sectionEl.removeAttribute("full-width"),this.hasAttribute("full-height")?this.sectionEl.setAttribute("full-height",""):this.sectionEl.removeAttribute("full-height"),this.hasAttribute("overflow-visible")?this.sectionEl.setAttribute("overflow-visible",""):this.sectionEl.removeAttribute("overflow-visible")),this.badgeEl&&(h?.text?(this.badgeEl.hidden=!1,this.badgeEl.setAttribute("variant",h.variant||"primary"),this.badgeEl.setAttribute("badge-style",h.style||"text"),this.badgeEl.setAttribute("size",h.size||"m"),this.badgeEl.textContent=h.text):this.badgeEl.hidden=!0),this.headlineEl&&(this.headlineEl.textContent=t),this.subtitleEl&&(this.subtitleEl.textContent=e,this.subtitleEl.hidden=!e),this.descriptionEl&&(this.descriptionEl.textContent=i,this.descriptionEl.hidden=!i),this.mediaEl&&this.imageEl&&(s?(this.mediaEl.hidden=!1,this.imageEl.src=s,this.imageEl.alt=n):this.mediaEl.hidden=!0),this.actionsEl&&(this.actionsEl.replaceChildren(),d.length>0?(d.forEach(t=>{const e=document.createElement("db-button");e.setAttribute("variant",t.variant||"primary"),e.setAttribute("size",t.size||"m"),t.href&&e.setAttribute("href",t.href),e.textContent=t.label,e.addEventListener("click",e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("db-action",{detail:{action:t},bubbles:!0,composed:!0}))}),this.actionsEl.append(e)}),this.actionsEl.hidden=!1):this.actionsEl.hidden=!0)}}customElements.get("db-section-feature")||customElements.define("db-section-feature",DbSectionFeature);const CLASS$f="designbase-wc-app-badge",STORE_DEFAULTS={"app-store":{label:"다운로드",storeName:"App Store"},"google-play":{label:"다운로드",storeName:"Google Play"}};class DbAppBadge extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["store","href","label","store-name","size","theme"]}connectedCallback(){this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}getStore(){return"google-play"===(this.getAttribute("store")||"app-store")?"google-play":"app-store"}getIconSize(){const t=this.getAttribute("size")||"m";return"s"===t?18:"l"===t?24:20}build(){this.iconWrapEl=document.createElement("span"),this.iconWrapEl.className=`${CLASS$f}__icon`,this.iconWrapEl.setAttribute("aria-hidden","true");const t=document.createElement("span");t.className=`${CLASS$f}__text`,this.labelEl=document.createElement("span"),this.labelEl.className=`${CLASS$f}__label`,this.storeEl=document.createElement("span"),this.storeEl.className=`${CLASS$f}__store`,t.append(this.labelEl,this.storeEl),this.append(this.iconWrapEl,t),this.addEventListener("click",t=>{this.getAttribute("href")||this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0,detail:{event:t}}))})}updateUI(){const t=this.getStore(),e=STORE_DEFAULTS[t],i=this.getAttribute("size")||"m",s=this.getAttribute("theme")||"dark",n=this.getAttribute("label")||e.label,a=this.getAttribute("store-name")||e.storeName,r=this.getAttribute("href");this.className=[CLASS$f,`${CLASS$f}--${i}`,`${CLASS$f}--${s}`,`${CLASS$f}--${t}`].join(" "),r?(this.setAttribute("role","link"),this.tabIndex=0,this.onclick=()=>window.open(r,"_blank","noopener,noreferrer")):(this.setAttribute("role","button"),this.tabIndex=0),this.iconWrapEl&&this.iconWrapEl.replaceChildren(createDbIcon("app-store"===t?"apple":"play-store",this.getIconSize())),this.labelEl&&(this.labelEl.textContent=n),this.storeEl&&(this.storeEl.textContent=a)}}customElements.get("db-app-badge")||customElements.define("db-app-badge",DbAppBadge);const CLASS$e="designbase-wc-section-contact",DEFAULT_EMAIL="contact@designbase.co.kr";class DbSectionContact extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["title","description","action","align","accent","content-padding","size","full-width","full-height","overflow-visible"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}parseAction(){try{const t=this.getAttribute("action");if(t)return JSON.parse(t)}catch{}return{label:DEFAULT_EMAIL,href:`mailto:${DEFAULT_EMAIL}`}}build(){this.sectionEl=document.createElement("db-section"),this.sectionEl.setAttribute("no-padding",""),this.sectionEl.setAttribute("data-wc-internal",""),this.wrapEl=document.createElement("div"),this.wrapEl.className=CLASS$e,this.contactWrapEl=document.createElement("div"),this.contactWrapEl.className=`${CLASS$e}__inner`,this.titleEl=document.createElement("h2"),this.titleEl.className=`${CLASS$e}__title`,this.descriptionEl=document.createElement("p"),this.descriptionEl.className=`${CLASS$e}__description`,this.actionEl=document.createElement("db-button"),this.actionEl.className=`${CLASS$e}__action`,this.actionEl.setAttribute("variant","primary"),this.actionEl.setAttribute("size","m"),this.actionEl.setAttribute("radius","pill"),this.actionEl.setAttribute("start-icon","mail"),this.actionEl.addEventListener("click",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("db-action",{detail:{action:this.parseAction()},bubbles:!0,composed:!0}))}),this.contactWrapEl.append(this.titleEl,this.descriptionEl,this.actionEl),this.wrapEl.append(this.contactWrapEl),this.sectionEl.append(this.wrapEl),this.append(this.sectionEl)}updateUI(){const t=this.getAttribute("title")||"문의하기",e=this.getAttribute("description")||"궁금한 점이 있으시면 언제든지 연락주세요.",i=this.getAttribute("align")||"center",s=this.getAttribute("content-padding")||"l",n=this.getAttribute("size")||"l",a=!this.hasAttribute("accent")||"false"!==this.getAttribute("accent"),r=this.parseAction(),o=[CLASS$e,`${CLASS$e}--${i}`,`${CLASS$e}--padding-${s}`,a&&`${CLASS$e}--accent`].filter(Boolean).join(" ");this.className=CLASS$e,this.wrapEl&&(this.wrapEl.className=o),this.contactWrapEl&&(this.contactWrapEl.className=`${CLASS$e}__inner`),this.sectionEl&&(this.sectionEl.setAttribute("size",n),this.hasAttribute("full-width")?this.sectionEl.setAttribute("full-width",""):this.sectionEl.removeAttribute("full-width"),this.hasAttribute("full-height")?this.sectionEl.setAttribute("full-height",""):this.sectionEl.removeAttribute("full-height"),this.hasAttribute("overflow-visible")?this.sectionEl.setAttribute("overflow-visible",""):this.sectionEl.removeAttribute("overflow-visible")),this.titleEl&&(this.titleEl.textContent=t),this.descriptionEl&&(this.descriptionEl.textContent=e,this.descriptionEl.hidden=!e),this.actionEl&&(this.actionEl.textContent=r.label,r.href?this.actionEl.setAttribute("href",r.href):this.actionEl.removeAttribute("href"))}}customElements.get("db-section-contact")||customElements.define("db-section-contact",DbSectionContact);const CLASS$d="designbase-wc-section-app-download";class DbSectionAppDownload extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["title","description","stores","align","size","full-width","full-height","overflow-visible"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}parseStores(){try{const t=JSON.parse(this.getAttribute("stores")||"[]");if(Array.isArray(t)&&t.length>0)return t}catch{}return[{store:"app-store",href:"#"},{store:"google-play",href:"#"}]}build(){this.sectionEl=document.createElement("db-section"),this.sectionEl.setAttribute("no-padding",""),this.sectionEl.setAttribute("data-wc-internal",""),this.wrapEl=document.createElement("div"),this.wrapEl.className=CLASS$d,this.innerEl=document.createElement("div"),this.innerEl.className=`${CLASS$d}__inner`,this.titleEl=document.createElement("h2"),this.titleEl.className=`${CLASS$d}__title`,this.descriptionEl=document.createElement("p"),this.descriptionEl.className=`${CLASS$d}__description`,this.badgesEl=document.createElement("div"),this.badgesEl.className=`${CLASS$d}__badges`,this.innerEl.append(this.titleEl,this.descriptionEl,this.badgesEl),this.wrapEl.append(this.innerEl),this.sectionEl.append(this.wrapEl),this.append(this.sectionEl)}updateUI(){const t=this.getAttribute("title")||"지금 바로 시작하세요",e=this.getAttribute("description")||"앱을 다운로드하고 바로 이용해 보세요.",i=this.getAttribute("align")||"center",s=this.getAttribute("size")||"l",n=this.parseStores(),a=[CLASS$d,`${CLASS$d}--${i}`].join(" ");this.className=CLASS$d,this.wrapEl&&(this.wrapEl.className=a),this.sectionEl&&(this.sectionEl.setAttribute("size",s),this.hasAttribute("full-width")?this.sectionEl.setAttribute("full-width",""):this.sectionEl.removeAttribute("full-width"),this.hasAttribute("full-height")?this.sectionEl.setAttribute("full-height",""):this.sectionEl.removeAttribute("full-height"),this.hasAttribute("overflow-visible")?this.sectionEl.setAttribute("overflow-visible",""):this.sectionEl.removeAttribute("overflow-visible")),this.titleEl&&(this.titleEl.textContent=t),this.descriptionEl&&(this.descriptionEl.textContent=e,this.descriptionEl.hidden=!e),this.badgesEl&&(this.badgesEl.replaceChildren(),n.forEach(t=>{const e=document.createElement("db-app-badge");e.setAttribute("store",t.store),e.setAttribute("size",t.size||"m"),e.setAttribute("theme",t.theme||"dark"),t.href&&e.setAttribute("href",t.href),t.label&&e.setAttribute("label",t.label),t.storeName&&e.setAttribute("store-name",t.storeName),this.badgesEl.append(e)}))}}customElements.get("db-section-app-download")||customElements.define("db-section-app-download",DbSectionAppDownload);const CLASS$c="designbase-wc-marquee";class DbMarquee extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.containerWidth=0,this.baseGroupWidth=0,this.boundMeasure=()=>this.measure()}static get observedAttributes(){return["items","direction","duration","speed","size","variant","bordered","pause-on-hover","fade-edges","fade-width","edge-padding","gap","align-y","aria-label"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build(),this.bindResize()),this.updateUI()}disconnectedCallback(){this.resizeObserver?.disconnect(),this.unbindImageListeners()}attributeChangedCallback(){this.built&&this.updateUI()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}parseItems(){try{const t=this.getAttribute("items"),e=t?JSON.parse(t):[];if(Array.isArray(e)&&e.length>0)return e}catch{}const t=Array.from(this.children).filter(t=>!t.hasAttribute("data-wc-internal"));return t.length>0?t.map(t=>t.textContent?.trim()||""):[]}build(){this.containerEl=document.createElement("div"),this.srOnlyEl=document.createElement("span"),this.srOnlyEl.className=`${CLASS$c}__sr-only`,this.trackEl=document.createElement("div"),this.trackEl.className=`${CLASS$c}__track`,this.baseGroupEl=document.createElement("div"),this.baseGroupEl.className=`${CLASS$c}__group`,this.baseGroupEl.setAttribute("aria-hidden","true"),this.trackEl.append(this.baseGroupEl),this.containerEl.append(this.srOnlyEl,this.trackEl),this.append(this.containerEl)}bindResize(){this.resizeObserver=new ResizeObserver(()=>this.measure()),this.containerEl&&this.resizeObserver.observe(this.containerEl),this.baseGroupEl&&this.resizeObserver.observe(this.baseGroupEl)}measure(){this.containerWidth=Math.ceil(this.containerEl?.clientWidth??0),this.baseGroupWidth=Math.ceil(this.baseGroupEl?.scrollWidth??0),this.renderDuplicates(),this.bindImageListeners(),this.syncReadyState()}unbindImageListeners(){this.baseGroupEl&&this.baseGroupEl.querySelectorAll("img").forEach(t=>{t.removeEventListener("load",this.boundMeasure),t.removeEventListener("error",this.boundMeasure)})}bindImageListeners(){this.baseGroupEl&&(this.unbindImageListeners(),this.baseGroupEl.querySelectorAll("img").forEach(t=>{t.complete||(t.addEventListener("load",this.boundMeasure),t.addEventListener("error",this.boundMeasure))}))}renderItem(t){const e=document.createElement("div");return e.className=`${CLASS$c}__item`,e.textContent=t,e}renderGroup(t,e){const i=e??document.createElement("div");return i.className=`${CLASS$c}__group`,i.setAttribute("aria-hidden","true"),i.replaceChildren(...t.map(t=>this.renderItem(t))),i}renderDuplicates(){if(!this.trackEl||!this.baseGroupEl)return;const t=this.parseItems();this.renderGroup(t,this.baseGroupEl);const e=this.baseGroupWidth>0?Math.max(1,Math.ceil(this.containerWidth/this.baseGroupWidth)):1,i=[];for(let s=0;s<e;s+=1)i.push(this.renderGroup(t));this.trackEl.replaceChildren(this.baseGroupEl,...i)}syncReadyState(){this.containerEl&&this.containerEl.classList.toggle(`${CLASS$c}--ready`,this.baseGroupWidth>0)}updateUI(){const t=this.parseItems();if(0===t.length)return void(this.hidden=!0);this.hidden=!1;const e=this.getAttribute("direction")||"left",i=Math.max(Number(this.getAttribute("duration")||20),1),s=Number(this.getAttribute("speed")||1),n=i/(Number.isFinite(s)&&s>0?s:1),a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"default",o=this.getAttribute("align-y")||"center",l=this.getBool("fade-edges"),h=Math.max(Number(this.getAttribute("fade-width")||48),0),d=this.getAttribute("edge-padding"),u=null!==d&&""!==d?Math.max(Number(d),0):l?h:0,p=Math.max(Number(this.getAttribute("gap")||24),0),m=this.getBool("pause-on-hover",!0),g=this.hasAttribute("bordered")?this.getBool("bordered"):"outlined"===r,b=this.getAttribute("aria-label")||"Scrolling content";this.containerEl&&(this.containerEl.className=[CLASS$c,`${CLASS$c}--size-${a}`,`${CLASS$c}--variant-${r}`,`${CLASS$c}--align-${o}`,m&&`${CLASS$c}--pause-on-hover`,l&&`${CLASS$c}--fade-edges`,"right"===e&&`${CLASS$c}--right`,g&&`${CLASS$c}--bordered`].filter(Boolean).join(" "),this.containerEl.style.setProperty("--db-marquee-duration",`${n}s`),this.containerEl.style.setProperty("--db-marquee-shift",`${this.baseGroupWidth+p}px`),this.containerEl.style.setProperty("--db-marquee-gap",`${p}px`),this.containerEl.style.setProperty("--db-marquee-fade-width",`${h}px`),this.containerEl.style.setProperty("--db-marquee-edge-padding",`${u}px`),this.containerEl.setAttribute("role","region"),this.containerEl.setAttribute("aria-label",b)),this.srOnlyEl&&(this.srOnlyEl.textContent=t.join(" • ")||b),this.renderDuplicates(),this.measure()}}customElements.get("db-marquee")||customElements.define("db-marquee",DbMarquee);const CLASS$b="designbase-wc-gradient";class DbGradient extends HTMLElement{static get observedAttributes(){return["colors","direction","size","variant","animation-duration","animation-delay","full-width","full-height"]}connectedCallback(){this.style.display="flex",this.updateUI()}attributeChangedCallback(){this.updateUI()}getBool(t){return this.hasAttribute(t)&&"false"!==this.getAttribute(t)}parseColors(){try{const t=JSON.parse(this.getAttribute("colors")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}directionMap(t){return{"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left","to-top-right":"to top right","to-top-left":"to top left",radial:"circle"}[t]}colorStops(t){return t.map(t=>{const e=void 0!==t.position?`${t.position}%`:"";return e?`${t.color} ${e}`:t.color}).join(", ")}generateGradientStyle(t,e){if(0===t.length)return{};const i=this.colorStops(t);return"radial"===e?{background:`radial-gradient(circle, ${i})`}:{background:`linear-gradient(${this.directionMap(e)}, ${i})`}}generateAnimatedStyle(t,e,i,s){const n=t.map((t,e)=>{const i=((void 0!==t.position?t.position:0)+20*e)%100;return`${t.color} ${i}%`}).join(", ");return{background:"radial"===e?`radial-gradient(circle, ${n})`:`linear-gradient(${this.directionMap(e)}, ${n})`,animation:`gradient-shift ${i}s ease-in-out ${s}s infinite`,backgroundSize:"200% 200%"}}generateMeshStyle(t){return{background:`conic-gradient(from 0deg, ${t.slice(0,4).map((t,e)=>{const i=void 0!==t.position?t.position:33.33*e;return`${t.color} ${i}%`}).join(", ")})`}}updateUI(){const t=this.parseColors(),e=this.getAttribute("direction")||"to-right",i=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",n=Number(this.getAttribute("animation-duration")||3),a=Number(this.getAttribute("animation-delay")||0),r=this.getBool("full-width"),o=this.getBool("full-height");this.className=[CLASS$b,`${CLASS$b}--size-${i}`,`${CLASS$b}--variant-${s}`,`${CLASS$b}--direction-${e}`,r&&`${CLASS$b}--full-width`,o&&`${CLASS$b}--full-height`].filter(Boolean).join(" ");let l={};l="animated"===s?this.generateAnimatedStyle(t,e,n,a):"mesh"===s?this.generateMeshStyle(t):this.generateGradientStyle(t,e),Object.assign(this.style,l)}}customElements.get("db-gradient")||customElements.define("db-gradient",DbGradient);const COLOR_PALETTES={primary:{light:["#eff6ff","#dbeafe","#bfdbfe","#93c5fd"],vivid:["#3b82f6","#2563eb","#1d4ed8","#1e40af","#1e3a8a"],dark:["#0f172a","#1e293b","#334155","#475569","#64748b"]},secondary:{light:["#f8fafc","#f1f5f9","#e2e8f0","#cbd5e1"],vivid:["#6b7280","#4b5563","#374151","#1f2937","#111827"],dark:["#0f0f0f","#1a1a1a","#262626","#404040","#525252"]},success:{light:["#f0fdf4","#dcfce7","#bbf7d0","#86efac"],vivid:["#22c55e","#16a34a","#15803d","#166534","#14532d"],dark:["#052e16","#14532d","#166534","#15803d","#16a34a"]},warning:{light:["#fffbeb","#fef3c7","#fde68a"],vivid:["#f59e0b","#d97706","#b45309","#92400e","#78350f"],dark:["#451a03","#78350f","#92400e","#b45309","#d97706"]},error:{light:["#fef2f2","#fecaca","#fca5a5"],vivid:["#ef4444","#dc2626","#b91c1c","#991b1b","#7f1d1d"],dark:["#450a0a","#7f1d1d","#991b1b","#b91c1c","#dc2626"]},info:{light:["#eff6ff","#dbeafe","#bfdbfe","#93c5fd"],vivid:["#3b82f6","#2563eb","#1d4ed8","#1e40af","#1e3a8a"],dark:["#0f172a","#1e293b","#334155","#475569","#64748b"]},purple:{light:["#faf5ff","#f3e8ff","#e9d5ff","#d8b4fe"],vivid:["#a855f7","#9333ea","#7c3aed","#6d28d9","#5b21b6"],dark:["#3b0764","#581c87","#6b21a8","#7c3aed","#9333ea"]},ocean:{light:["#f0fdfa","#ccfbf1","#99f6e4"],vivid:["#14b8a6","#0d9488","#0f766e","#115e59","#134e4a"],dark:["#042f2e","#134e4a","#115e59","#0f766e","#0d9488"]},sunset:{light:["#fff7ed","#fed7aa","#fdba74"],vivid:["#f97316","#ea580c","#c2410c","#9a3412","#7c2d12"],dark:["#431407","#7c2d12","#9a3412","#c2410c","#ea580c"]}};function createRandomGradientStyle(t,e,i,s,n,a){const r=COLOR_PALETTES[t][e],o=Math.min(6,Math.max(3,i)),l=[];for(let t=0;t<o;t+=1)l.push(r[Math.floor(Math.random()*r.length)]);const h=Array.from({length:o},()=>100*Math.random()).sort((t,e)=>t-e),d=l.map((t,e)=>`${t} ${h[e]}%`).join(", ");return{background:`radial-gradient(circle at ${100*Math.random()}% ${100*Math.random()}%, ${d})`,filter:`blur(${Math.max(80,s)}px)`,transition:n?`background ${a}s ease-in-out`:"none"}}const CLASS$a="designbase-wc-random-gradient";class DbRandomGradient extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["scheme","tone","width","height","blur","color-count","animated","animation-duration","overlay","overlay-opacity"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}disconnectedCallback(){this.stopAnimation()}attributeChangedCallback(){this.built&&this.updateUI()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}build(){this.backgroundEl=document.createElement("div"),this.backgroundEl.className=`${CLASS$a}__background`,this.overlayEl=document.createElement("div"),this.overlayEl.className=`${CLASS$a}__overlay`,this.contentEl=document.createElement("div"),this.contentEl.className=`${CLASS$a}__content`,this.append(this.backgroundEl,this.overlayEl,this.contentEl)}stopAnimation(){this.animationTimer&&(window.clearInterval(this.animationTimer),this.animationTimer=void 0)}applyGradient(){const t=createRandomGradientStyle(this.getAttribute("scheme")||"primary",this.getAttribute("tone")||"vivid",Number(this.getAttribute("color-count")||4),Number(this.getAttribute("blur")||80),this.getBool("animated"),Number(this.getAttribute("animation-duration")||10));this.backgroundEl&&Object.assign(this.backgroundEl.style,t)}syncContent(){if(!this.contentEl)return;Array.from(this.childNodes).filter(t=>t!==this.backgroundEl&&t!==this.overlayEl&&t!==this.contentEl&&!(t instanceof HTMLElement&&t.hasAttribute("data-wc-internal"))).forEach(t=>this.contentEl.append(t)),this.contentEl.hidden=0===this.contentEl.childNodes.length}updateUI(){const t=this.getAttribute("scheme")||"primary",e=this.getAttribute("tone")||"vivid",i=this.getAttribute("width")||"100%",s=this.getAttribute("height")||"600px",n=!this.hasAttribute("overlay")||"false"!==this.getAttribute("overlay"),a=Number(this.getAttribute("overlay-opacity")||.2),r=this.getBool("animated");if(this.className=[CLASS$a,r&&`${CLASS$a}--animated`,n&&`${CLASS$a}--with-overlay`].filter(Boolean).join(" "),this.style.width=/^\d+$/.test(i)?`${i}px`:i,this.style.height=/^\d+$/.test(s)?`${s}px`:s,this.overlayEl&&(this.overlayEl.hidden=!n,n)){const i=COLOR_PALETTES[t][e];Object.assign(this.overlayEl.style,{background:`linear-gradient(45deg, ${i[0]}, ${i[1]})`,opacity:String(a)})}if(this.stopAnimation(),this.applyGradient(),r){const t=Number(this.getAttribute("animation-duration")||10);this.animationTimer=window.setInterval(()=>this.applyGradient(),1e3*t)}this.syncContent()}}customElements.get("db-random-gradient")||customElements.define("db-random-gradient",DbRandomGradient);const CLASS$9="designbase-wc-ad-banner",DEFAULT_TITLES={hero:"지금 바로 시작하세요",topbar:"🎉 신규 가입 시 10,000원 적립금 증정!",card:"프리미엄 멤버십",floating:"오늘만 특가!"},DEFAULT_SUBTITLES={hero:"최대 50% 할인된 가격으로 프리미엄 서비스를 경험해보세요. 기간 한정 특별 혜택!",topbar:"오늘 하루만 특별 혜택",card:"무제한 서비스 이용권을 특별가에 만나보세요",floating:"장바구니에 담긴 상품 추가 20% 할인"},DEFAULT_CTA={hero:"자세히 보기",topbar:"지금 가입하기",card:"알아보기",floating:"할인받기"},TYPE_ICONS={hero:"star",topbar:"trending-up",card:"star-filled",floating:"cart"},VARIANT_SCHEMES={primary:"primary",secondary:"secondary",success:"success",warning:"warning",error:"error"};class DbAdBanner extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.visible=!0,this.progress=100}static get observedAttributes(){return["type","variant","title","subtitle","cta-text","auto-close","close-delay","use-random-gradient","gradient-scheme","gradient-tone","gradient-animated","countdown-end-date","show-countdown","open"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}disconnectedCallback(){this.stopAutoClose()}attributeChangedCallback(t){this.built&&("open"===t&&(this.visible="false"!==this.getAttribute("open")),this.updateUI())}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getType(){const t=this.getAttribute("type")||"hero";return["hero","topbar","card","floating"].includes(t)?t:"hero"}getVariant(){const t=this.getAttribute("variant")||"primary";return["primary","secondary","success","warning","error"].includes(t)?t:"primary"}build(){this.rootEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.contentEl.className=`${CLASS$9}__content`,this.closeBtn=document.createElement("button"),this.closeBtn.type="button",this.closeBtn.className=`${CLASS$9}__close`,this.closeBtn.setAttribute("aria-label","닫기"),this.closeBtn.append(createDbIcon("close",20)),this.closeBtn.addEventListener("click",()=>this.handleClose());const t=document.createElement("div");t.className=`${CLASS$9}__main`,this.iconEl=document.createElement("div"),this.iconEl.className=`${CLASS$9}__icon`,this.labelEl=document.createElement("span"),this.labelEl.className=`${CLASS$9}__label`,this.labelEl.textContent="특별 이벤트",this.badgeEl=document.createElement("span"),this.badgeEl.className=`${CLASS$9}__badge`,this.badgeEl.textContent="HOT DEAL",this.titleEl=document.createElement("h2"),this.titleEl.className=`${CLASS$9}__title`,this.subtitleEl=document.createElement("p"),this.subtitleEl.className=`${CLASS$9}__subtitle`;const e=document.createElement("div");e.className=`${CLASS$9}__text`,this.countdownWrapEl=document.createElement("div"),this.countdownWrapEl.className=`${CLASS$9}__countdown`,this.countdownEl=document.createElement("db-countdown"),this.countdownEl.setAttribute("size","s"),this.countdownEl.setAttribute("variant","compact"),this.countdownEl.setAttribute("show-labels","false"),this.countdownWrapEl.append(this.countdownEl),e.append(this.titleEl,this.subtitleEl,this.countdownWrapEl),this.actionsEl=document.createElement("div"),this.actionsEl.className=`${CLASS$9}__actions`,this.ctaEl=document.createElement("db-button"),this.ctaEl.className=`${CLASS$9}__cta`,this.ctaEl.setAttribute("variant","primary"),this.ctaEl.setAttribute("end-icon","arrow-right"),this.ctaEl.addEventListener("click",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("db-cta-click",{bubbles:!0,composed:!0}))}),this.actionsEl.append(this.ctaEl),t.append(this.iconEl,e,this.actionsEl),this.progressEl=document.createElement("div"),this.progressEl.className=`${CLASS$9}__progress`,this.progressBarEl=document.createElement("div"),this.progressBarEl.className=`${CLASS$9}__progress-bar`,this.progressEl.append(this.progressBarEl),this.contentEl.append(this.closeBtn,t,this.progressEl),this.rootEl.append(this.contentEl),this.append(this.rootEl)}handleClose(){this.visible=!1,this.hidden=!0,this.stopAutoClose(),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}stopAutoClose(){this.autoCloseTimer&&(window.clearInterval(this.autoCloseTimer),this.autoCloseTimer=void 0)}startAutoClose(t){this.stopAutoClose(),this.progress=100,this.autoCloseTimer=window.setInterval(()=>{this.progress-=100/(t/100),this.progressBarEl&&(this.progressBarEl.style.width=`${Math.max(this.progress,0)}%`),this.progress<=0&&this.handleClose()},100)}renderGradientWrapper(t){this.rootEl&&this.contentEl&&(t?(this.gradientEl||(this.gradientEl=document.createElement("db-random-gradient"),this.gradientEl.className=`${CLASS$9}__gradient-bg`,this.gradientEl.setAttribute("height","100%"),this.gradientEl.setAttribute("width","100%")),this.gradientEl.parentElement!==this.rootEl&&this.rootEl.replaceChildren(this.gradientEl),this.contentEl.parentElement!==this.gradientEl&&this.gradientEl.append(this.contentEl)):(this.gradientEl&&(this.gradientEl.remove(),this.gradientEl=void 0),this.contentEl.parentElement!==this.rootEl&&this.rootEl.replaceChildren(this.contentEl)))}updateUI(){if(!this.visible||"false"===this.getAttribute("open"))return void(this.hidden=!0);this.hidden=!1;const t=this.getType(),e=this.getVariant(),i=this.getAttribute("title")||DEFAULT_TITLES[t],s=this.getAttribute("subtitle")||DEFAULT_SUBTITLES[t],n=this.getAttribute("cta-text")||DEFAULT_CTA[t],a=this.getBool("auto-close"),r=Math.max(Number(this.getAttribute("close-delay")||5e3),1e3),o=this.getBool("use-random-gradient"),l=this.getAttribute("gradient-tone")||"vivid",h=!this.hasAttribute("gradient-animated")||"false"!==this.getAttribute("gradient-animated"),d=this.getBool("show-countdown"),u=this.getAttribute("countdown-end-date");this.rootEl&&(this.rootEl.className=[CLASS$9,`${CLASS$9}--type-${t}`,`${CLASS$9}--variant-${e}`,a&&`${CLASS$9}--auto-close`,o&&`${CLASS$9}--with-gradient`,o&&"light"===l&&`${CLASS$9}--gradient-light`].filter(Boolean).join(" ")),o&&this.gradientEl&&(this.gradientEl.setAttribute("scheme",this.getAttribute("gradient-scheme")||VARIANT_SCHEMES[e]),this.gradientEl.setAttribute("tone",l),this.gradientEl.setAttribute("animated",h?"true":"false")),this.renderGradientWrapper(o),this.iconEl&&(this.iconEl.replaceChildren(createDbIcon(TYPE_ICONS[t],"card"===t?32:"floating"===t?28:24)),this.labelEl&&this.iconEl.append(this.labelEl),this.badgeEl&&this.iconEl.append(this.badgeEl),this.labelEl&&(this.labelEl.hidden="topbar"!==t),this.badgeEl&&(this.badgeEl.hidden="floating"!==t)),this.titleEl&&(this.titleEl.textContent=i),this.subtitleEl&&(this.subtitleEl.textContent=s),this.countdownWrapEl&&this.countdownEl&&(this.countdownWrapEl.hidden=!(d&&u),d&&u&&this.countdownEl.setAttribute("end-date",u)),this.ctaEl&&(this.ctaEl.textContent=n,this.ctaEl.setAttribute("size","hero"===t?"l":"card"===t?"s":"m"),"floating"===t?this.ctaEl.setAttribute("full-width",""):this.ctaEl.removeAttribute("full-width")),this.progressEl&&(this.progressEl.hidden=!a),this.progressBarEl&&a&&(this.progressBarEl.style.width=`${this.progress}%`),this.stopAutoClose(),a&&this.startAutoClose(r)}}customElements.get("db-ad-banner")||customElements.define("db-ad-banner",DbAdBanner);const CLASS$8="designbase-wc-timeline";class DbTimeline extends HTMLElement{static get observedAttributes(){return["items","type","variant","size","color","clickable","full-width","disabled"]}connectedCallback(){this.style.display="block",this.render()}attributeChangedCallback(){this.isConnected&&this.render()}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}getItemPosition(t){return"left"===(this.getAttribute("type")||"alternate")||t%2==0?"left":"right"}handleItemClick(t,e){this.hasAttribute("disabled")||t.disabled||!this.hasAttribute("clickable")||this.dispatchEvent(new CustomEvent("db-item-click",{bubbles:!0,composed:!0,detail:{item:t,index:e}}))}render(){const t=this.getAttribute("type")||"alternate",e=this.getAttribute("variant")||"default",i=this.getAttribute("size")||"m",s=this.getAttribute("color")||"primary",n=this.hasAttribute("clickable"),a=this.hasAttribute("disabled"),r=this.items;this.className=[CLASS$8,`${CLASS$8}--${t}`,`${CLASS$8}--${e}`,`${CLASS$8}--${i}`,n&&`${CLASS$8}--clickable`,this.hasAttribute("full-width")&&`${CLASS$8}--full-width`,a&&`${CLASS$8}--disabled`].filter(Boolean).join(" "),this.replaceChildren();const o=document.createElement("div");o.className=`${CLASS$8}__container`,r.forEach((t,l)=>{const h=this.getItemPosition(l),d=l===r.length-1,u=n&&!a&&!t.disabled,p=t.color||s,m=t.status||"pending",g=document.createElement("div");g.className=[`${CLASS$8}__item`,`${CLASS$8}__item--${h}`,`${CLASS$8}__item--${p}`,u&&`${CLASS$8}__item--clickable`,t.disabled&&`${CLASS$8}__item--disabled`].filter(Boolean).join(" ");const b=document.createElement("div");if(b.className=`${CLASS$8}__indicator-container`,"active"===m&&!t.icon&&void 0===t.number){const t=document.createElement("div");t.className=`${CLASS$8}__pulse`,b.append(t)}const f=document.createElement("div");if(f.className=[`${CLASS$8}__dot`,`${CLASS$8}__dot--${p}`,`${CLASS$8}__dot--${e}`,`${CLASS$8}__dot--${m}`,u&&`${CLASS$8}__dot--clickable`,t.icon&&`${CLASS$8}__dot--with-icon`,void 0!==t.number&&!t.icon&&`${CLASS$8}__dot--with-number`].filter(Boolean).join(" "),u&&(f.tabIndex=0,f.setAttribute("role","button"),f.setAttribute("aria-label",t.title?`${t.title} 타임라인 점`:`타임라인 점 ${l+1}`),f.addEventListener("click",()=>this.handleItemClick(t,l)),f.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleItemClick(t,l))})),t.icon){const e=document.createElement("div");e.className=`${CLASS$8}__icon`,e.append(createDbIcon(t.icon,"s"===i?14:"l"===i?20:16)),f.append(e)}else if(void 0!==t.number){const e=document.createElement("span");e.className=`${CLASS$8}__number`,e.textContent=String(t.number),f.append(e)}if(b.append(f),!d){const t=document.createElement("div");t.className=`${CLASS$8}__connector`,b.append(t)}const v=document.createElement("div");if(v.className=[`${CLASS$8}__content`,`${CLASS$8}__content--${h}`].join(" "),t.timestamp){const e=document.createElement("div");e.className=`${CLASS$8}__timestamp`,e.textContent=t.timestamp,v.append(e)}const y=document.createElement("div");if(y.className=`${CLASS$8}__content-inner`,u&&(y.tabIndex=0,y.setAttribute("role","button"),y.setAttribute("aria-label",t.title?`${t.title} 타임라인 아이템`:`타임라인 아이템 ${l+1}`),y.addEventListener("click",()=>this.handleItemClick(t,l)),y.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleItemClick(t,l))})),t.title){const e=document.createElement("h3");e.className=`${CLASS$8}__title`,e.textContent=t.title,y.append(e)}if(t.description){const e=document.createElement("p");e.className=`${CLASS$8}__description`,e.textContent=t.description,y.append(e)}v.append(y),g.append(b,v),o.append(g)}),this.append(o)}}customElements.get("db-timeline")||customElements.define("db-timeline",DbTimeline);const CLASS$7="designbase-wc-animation-text";class DbAnimationText extends HTMLElement{constructor(){super(...arguments),this.timers=[],this.displayText="",this.isVisible=!1,this.isAnimating=!1}static get observedAttributes(){return["text","trigger","type","speed","repeat","delay","direction","size","color","custom-color","weight","align","gradient-colors","wave-colors","glow-color","clickable","disabled"]}connectedCallback(){this.style.display="inline-block",this.ensureStructure(),this.syncFromAttributes(),this.setupTrigger()}disconnectedCallback(){this.clearTimers(),this.observer?.disconnect()}attributeChangedCallback(){this.isConnected&&(this.syncFromAttributes(),this.setupTrigger())}getText(){return this.getAttribute("text")||this.textContent?.trim()||""}getType(){const t=this.getAttribute("type")||"fade";return["typing","fade","slide","bounce","shake","glow","gradient","wave","flip","scale","decode"].includes(t)?t:"fade"}getTrigger(){const t=this.getAttribute("trigger")||"mount";return["mount","hover","click","in-view"].includes(t)?t:"mount"}ensureStructure(){this.ghostEl||(this.ghostEl=document.createElement("span"),this.ghostEl.setAttribute("aria-hidden","true"),this.ghostEl.style.visibility="hidden",this.ghostEl.style.pointerEvents="none",this.ghostEl.style.userSelect="none",this.layerEl=document.createElement("span"),this.layerEl.style.position="absolute",this.layerEl.style.top="0",this.layerEl.style.left="0",this.append(this.ghostEl,this.layerEl),this.addEventListener("mouseenter",()=>{"hover"!==this.getTrigger()||this.hasAttribute("disabled")||(this.isVisible=!0,this.startAnimation(),this.syncClasses())}),this.addEventListener("mouseleave",()=>{if("hover"!==this.getTrigger())return;this.isVisible=!1,this.isAnimating=!1,this.clearTimers();const t=this.getType();"typing"!==t&&"decode"!==t||(this.displayText=this.getText()),this.renderLayer(),this.syncClasses()}),this.addEventListener("click",()=>{if(!this.hasAttribute("disabled")){if("click"===this.getTrigger()){if(this.isVisible=!this.isVisible,this.isVisible)this.startAnimation();else{this.isAnimating=!1,this.clearTimers();const t=this.getType();"typing"!==t&&"decode"!==t||(this.displayText=this.getText()),this.renderLayer()}this.syncClasses()}this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))}}))}clearTimers(){this.timers.forEach(t=>window.clearInterval(t)),this.timers.forEach(t=>window.clearTimeout(t)),this.timers=[]}syncFromAttributes(){const t=this.getText(),e=this.getType(),i=this.getTrigger(),s=Number(this.getAttribute("speed")||1e3),n=Number(this.getAttribute("repeat")||1),a=this.getAttribute("custom-color"),r=(this.getAttribute("gradient-colors")||"#667eea,#764ba2").split(","),o=(this.getAttribute("wave-colors")||"#ff6b6b,#4ecdc4,#45b7d1,#96ceb4,#feca57").split(","),l=this.getAttribute("glow-color")||"#667eea";this.className=[CLASS$7,"typing"!==e&&`${CLASS$7}--${e}`,`${CLASS$7}--${this.getAttribute("size")||"m"}`,`${CLASS$7}--${this.getAttribute("color")||"primary"}`,`${CLASS$7}--${this.getAttribute("weight")||"normal"}`,`${CLASS$7}--${this.getAttribute("align")||"left"}`,`${CLASS$7}--${this.getAttribute("direction")||"left"}`,this.isVisible&&`${CLASS$7}--visible`,this.isAnimating&&`${CLASS$7}--animating`,(this.hasAttribute("clickable")||"click"===i)&&`${CLASS$7}--clickable`,this.hasAttribute("disabled")&&`${CLASS$7}--disabled`].filter(Boolean).join(" "),this.style.setProperty("--db-animation-speed",`${Number.isFinite(s)?s:1e3}ms`),this.style.setProperty("--db-animation-iteration-count",0===n?"infinite":String(n)),a&&this.style.setProperty("--db-text-custom",a),this.style.setProperty("--db-wave-colors",o.join(", ")),this.style.setProperty("--db-glow-color",l),"gradient"===e&&r.length>=2?(this.style.background=`linear-gradient(45deg, ${r.join(", ")})`,this.style.backgroundSize="200% 200%",this.style.webkitBackgroundClip="text",this.style.webkitTextFillColor="transparent",this.style.backgroundClip="text"):(this.style.removeProperty("background"),this.style.removeProperty("background-size"),this.style.removeProperty("-webkit-background-clip"),this.style.removeProperty("-webkit-text-fill-color"),this.style.removeProperty("background-clip")),"typing"!==e&&"decode"!==e||"mount"!==i||this.isAnimating?this.isAnimating||(this.displayText=t):this.displayText="",this.ghostEl&&(this.ghostEl.textContent=t,this.ghostEl.style.whiteSpace="typing"===e?"pre-wrap":""),this.layerEl&&(this.layerEl.className=["typing"===e&&`${CLASS$7}--typing`,this.isAnimating&&"typing"===e&&`${CLASS$7}--animating`].filter(Boolean).join(" "),this.layerEl.style.width="typing"===e?"auto":"100%",this.layerEl.style.height="100%",this.layerEl.style.whiteSpace="typing"===e?"pre-wrap":""),this.renderLayer()}syncClasses(){this.classList.toggle(`${CLASS$7}--visible`,this.isVisible),this.classList.toggle(`${CLASS$7}--animating`,this.isAnimating)}setupTrigger(){this.clearTimers(),this.observer?.disconnect();const t=this.getTrigger(),e=Number(this.getAttribute("delay")||0);if("mount"===t){const t=window.setTimeout(()=>{this.isVisible=!0,this.syncClasses(),this.startAnimation()},e);return void this.timers.push(t)}"in-view"===t&&(this.observer=new IntersectionObserver(t=>{t[0]?.isIntersecting&&(window.setTimeout(()=>{this.isVisible=!0,this.syncClasses(),this.startAnimation()},e),this.observer?.disconnect())}),this.observer.observe(this))}startAnimation(){const t=this.getType(),e=this.getText();if(this.isAnimating=!0,this.syncClasses(),this.syncFromAttributes(),"typing"===t)return void this.startTyping(0);if("decode"===t)return void this.startDecoding(0);this.displayText=e,this.renderLayer();const i=Number(this.getAttribute("speed")||1e3),s=window.setTimeout(()=>{this.isAnimating=!1,this.syncClasses(),this.syncFromAttributes()},i);this.timers.push(s)}startTyping(t){const e=this.getText(),i=Number(this.getAttribute("speed")||1e3),s=Number(this.getAttribute("repeat")||1);this.displayText="",this.renderLayer();let n=0;const a=window.setInterval(()=>{if(n>=e.length)if(window.clearInterval(a),0===s||t<s-1){const e=window.setTimeout(()=>this.startTyping(t+1),500);this.timers.push(e)}else this.isAnimating=!1,this.syncClasses();else this.displayText=e.slice(0,n+1),this.renderLayer(),n+=1},Math.max(16,i/Math.max(e.length,1)));this.timers.push(a)}startDecoding(t){const e=this.getText(),i=Number(this.getAttribute("repeat")||1),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+";let n=0;const a=window.setInterval(()=>{if(this.displayText=e.split("").map((t,i)=>i<n?e[i]:s[Math.floor(74*Math.random())]||t).join(""),this.renderLayer(),n>=e.length)if(window.clearInterval(a),this.displayText=e,this.renderLayer(),0===i||t<i-1){const e=window.setTimeout(()=>this.startDecoding(t+1),500);this.timers.push(e)}else this.isAnimating=!1,this.syncClasses();n+=1/3},30);this.timers.push(a)}renderLayer(){if(!this.layerEl)return;const t=this.getType(),e=this.getText(),i=this.isVisible||this.isAnimating;"wave"!==t&&"shake"!==t||!i?this.layerEl.textContent=this.displayText||(i?e:""):this.layerEl.replaceChildren(...e.split("").map((t,e)=>{const i=document.createElement("span");return i.style.animationDelay=.05*e+"s",i.style.display="inline-block",i.textContent=" "===t?" ":t,i}))}}customElements.get("db-animation-text")||customElements.define("db-animation-text",DbAnimationText);const CLASS$6="designbase-wc-tutorial";class DbTutorial extends HTMLElement{constructor(){super(...arguments),this.internalStep=0,this.targetElement=null,this.keyHandler=null,this.resizeHandler=null,this.isMounted=!1}static get observedAttributes(){return["open","steps","current-step","indicator-type","indicator-size"]}connectedCallback(){this.style.display="contents",this.syncStepFromAttribute(),this.syncOpenState()}disconnectedCallback(){this.detachListeners(),this.clearTargetHighlight(),this.unmount()}attributeChangedCallback(t){this.isConnected&&("open"!==t?("current-step"===t&&this.syncStepFromAttribute(),this.isMounted&&this.render()):this.syncOpenState())}parseSteps(){try{const t=JSON.parse(this.getAttribute("steps")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}syncStepFromAttribute(){if(!this.hasAttribute("current-step"))return;const t=Number(this.getAttribute("current-step")||0);Number.isFinite(t)&&(this.internalStep=Math.max(0,t))}isOpenRequested(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}getCurrentStepData(){const t=this.parseSteps();if(!t.length)return;const e=Math.min(Math.max(this.internalStep,0),t.length-1);return{step:t[e],index:e,steps:t}}syncOpenState(){if(this.isOpenRequested())return this.mount(),void this.attachListeners();this.detachListeners(),this.clearTargetHighlight(),this.unmount()}mount(){this.root||(this.root=document.createElement("div"),this.root.className=CLASS$6,this.root.setAttribute("role","dialog"),this.root.setAttribute("aria-modal","true"),this.root.tabIndex=-1,this.ensureStructure()),this.root.isConnected||document.body.append(this.root),this.isMounted=!0,this.render()}unmount(){this.isMounted=!1,this.root?.remove()}ensureStructure(){if(!this.root||this.popoverEl)return;this.overlayEl=document.createElement("div"),this.overlayEl.className=`${CLASS$6}__overlay`,this.overlayEl.addEventListener("click",()=>this.handleEnd()),this.popoverEl=document.createElement("div"),this.popoverEl.className=`${CLASS$6}__popover`,this.closeButtonEl=document.createElement("button"),this.closeButtonEl.type="button",this.closeButtonEl.className=`${CLASS$6}__close-button`,this.closeButtonEl.setAttribute("aria-label","튜토리얼 종료"),this.closeButtonEl.append(createDbIcon("close",16)),this.closeButtonEl.addEventListener("click",()=>this.handleEnd());const t=document.createElement("div");t.className=`${CLASS$6}__content`;const e=document.createElement("div");e.className=`${CLASS$6}__text`,this.titleEl=document.createElement("h3"),this.titleEl.id="tutorial-title",this.titleEl.className=`${CLASS$6}__title`,this.descriptionEl=document.createElement("p"),this.descriptionEl.id="tutorial-content",this.descriptionEl.className=`${CLASS$6}__description`,e.append(this.titleEl,this.descriptionEl);const i=document.createElement("div");i.className=`${CLASS$6}__navigation`,this.prevButtonEl=document.createElement("db-button"),this.prevButtonEl.setAttribute("variant","secondary"),this.prevButtonEl.setAttribute("size","s"),this.prevButtonEl.setAttribute("start-icon","chevron-left"),this.prevButtonEl.textContent="이전",this.prevButtonEl.addEventListener("db-click",()=>this.handlePrev()),this.indicatorEl=document.createElement("db-indicator"),this.indicatorEl.addEventListener("db-step-click",t=>{const e=t.detail;"number"==typeof e.index&&this.goToStep(e.index)}),this.nextButtonEl=document.createElement("db-button"),this.nextButtonEl.setAttribute("variant","primary"),this.nextButtonEl.setAttribute("size","s"),this.nextButtonEl.addEventListener("db-click",()=>this.handleNext()),i.append(this.prevButtonEl,this.indicatorEl,this.nextButtonEl),t.append(e,i),this.popoverEl.append(this.closeButtonEl,t),this.root.append(this.overlayEl,this.popoverEl)}attachListeners(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key?this.handleEnd():"ArrowLeft"===t.key?this.handlePrev():"ArrowRight"===t.key&&this.handleNext()},document.addEventListener("keydown",this.keyHandler)),this.resizeHandler||(this.resizeHandler=()=>this.updateTargetElement(),window.addEventListener("resize",this.resizeHandler))}detachListeners(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null)}clearTargetHighlight(){this.targetElement&&(this.targetElement.classList.remove(`${CLASS$6}__target`),this.targetElement.style.position="",this.targetElement.style.zIndex="",this.targetElement=null)}updateTargetElement(){const t=this.getCurrentStepData();if(!t?.step.target||!this.popoverEl)return;this.clearTargetHighlight();const e=document.querySelector(t.step.target);if(!e)return;this.targetElement=e,e.style.position="relative",e.style.zIndex="1000",e.classList.add(`${CLASS$6}__target`);const i=e.getBoundingClientRect(),s=window.innerWidth,n=window.innerHeight,a=300,r=200,o=16;let l="auto"!==t.step.placement&&t.step.placement?t.step.placement:"bottom",h=i.bottom+o,d=i.left+i.width/2-150;if("auto"===t.step.placement)i.top-r-o>0?(l="top",h=i.top-r-o):i.bottom+r+o<n?(l="bottom",h=i.bottom+o):i.left-a-o>0?(l="left",h=i.top+i.height/2-100,d=i.left-a-o):(l="right",h=i.top+i.height/2-100,d=i.right+o);else switch(l){case"top":h=i.top-r-o;break;case"bottom":h=i.bottom+o;break;case"left":h=i.top+i.height/2-100,d=i.left-a-o;break;case"right":h=i.top+i.height/2-100,d=i.right+o}d=Math.max(o,Math.min(d,s-a-o)),h=Math.max(o,Math.min(h,n-r-o)),this.popoverEl.className=[`${CLASS$6}__popover`,`${CLASS$6}__popover--${l}`].join(" "),this.popoverEl.style.top=`${h}px`,this.popoverEl.style.left=`${d}px`}emitStepChange(t){this.dispatchEvent(new CustomEvent("db-step-change",{bubbles:!0,composed:!0,detail:{step:t}}))}goToStep(t){const e=this.parseSteps();e.length&&(this.clearTargetHighlight(),this.internalStep=Math.min(Math.max(t,0),e.length-1),this.setAttribute("current-step",String(this.internalStep)),this.emitStepChange(this.internalStep),this.render())}handlePrev(){const t=this.getCurrentStepData();!t||t.index<=0||(this.dispatchEvent(new CustomEvent("db-prev",{bubbles:!0,composed:!0})),this.goToStep(t.index-1))}handleNext(){const t=this.getCurrentStepData();t&&(t.index>=t.steps.length-1?this.handleEnd():(this.dispatchEvent(new CustomEvent("db-next",{bubbles:!0,composed:!0})),this.goToStep(t.index+1)))}handleEnd(){this.dispatchEvent(new CustomEvent("db-end",{bubbles:!0,composed:!0})),this.setAttribute("open","false")}render(){const t=this.getCurrentStepData();if(!t||!this.root)return;const{step:e,index:i,steps:s}=t,n=0===i,a=i===s.length-1;this.titleEl&&(this.titleEl.textContent=e.title||"",this.titleEl.hidden=!e.title),this.descriptionEl&&(this.descriptionEl.textContent=e.content||"",this.descriptionEl.hidden=!e.content),this.prevButtonEl&&(this.prevButtonEl.hidden=n),this.nextButtonEl&&(this.nextButtonEl.textContent=a?"완료":"다음",a?this.nextButtonEl.removeAttribute("end-icon"):this.nextButtonEl.setAttribute("end-icon","chevron-right")),this.indicatorEl&&(this.indicatorEl.setAttribute("current",String(i)),this.indicatorEl.setAttribute("total",String(s.length)),this.indicatorEl.setAttribute("type",this.getAttribute("indicator-type")||"numbers"),this.indicatorEl.setAttribute("size",this.getAttribute("indicator-size")||"m")),this.updateTargetElement()}}customElements.get("db-tutorial")||customElements.define("db-tutorial",DbTutorial);const LUMINA_ANIMATION_DURATION_SEC=60,LUMINA_ANIMATION_TYPES=["plasma","mesh-flow","fluid","radiant","ethereal"];function isLuminaType(t){return LUMINA_ANIMATION_TYPES.includes(t)}function toLuminaSpeed(t){return Math.max(.1,t/3e3)}function toLuminaSoftness(t){return Math.min(1,t/200)}function clampZoom(t){return Math.min(4,Math.max(.25,t))}function hexToRgb(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255]:[0,0,0]}function padColors(t,e=5){return 0===t.length?["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]:Array.from({length:e},(e,i)=>t[i%t.length])}const FLUID_DEFAULT_COLORS=["#0d0221","#5b21b6","#db2777","#38bdf8","#e9d5ff"],LUMINA_NOISE_SVG="data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E",LUMINA_COLOR_PRESETS=[{id:"neon_dream",name:"Neon Dream",colors:["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]},{id:"sunset_bliss",name:"Sunset Bliss",colors:["#FF9900","#FF00CC","#6600FF","#FF5500","#220055"]},{id:"deep_ocean",name:"Deep Ocean",colors:["#001133","#0044FF","#00DDFF","#00FFAA","#000066"]},{id:"forest_mist",name:"Forest Mist",colors:["#002200","#00FF44","#AAFF00","#006622","#CCFFCC"]},{id:"northern_lights",name:"Northern Lights",colors:["#000000","#00FF99","#AA00FF","#0044FF","#FFFFFF"]},{id:"monochrome_fog",name:"Monochrome Fog",colors:["#000000","#333333","#888888","#CCCCCC","#FFFFFF"]},{id:"cotton_candy",name:"Cotton Candy",colors:["#FFC0CB","#87CEFA","#E0FFFF","#DDA0DD","#FF69B4"]},{id:"cyber_glitch",name:"Cyber Glitch",colors:["#1A1A1D","#C3073F","#6F2232","#950740","#4E4E50"]},{id:"golden_hour",name:"Golden Hour",colors:["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"]}];function getLuminaPresetColors(t){const e=LUMINA_COLOR_PRESETS.find(e=>e.id===t);return e?.colors??LUMINA_COLOR_PRESETS[0].colors}const SNOW_DEFAULT_COLORS=["#ffffff","#f0f9ff","#e0f2fe"],FLOWERS_DEFAULT_COLORS=["#ffb7c5","#ff91a4","#f8c8dc","#ffc0cb","#fda4af"],CONFETTI_DEFAULT_COLORS=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#4caf50","#ffeb3b","#ffc107","#ff9800"];function getFallingParticleDefaults(t){switch(t){case"snow":default:return SNOW_DEFAULT_COLORS;case"flowers":return FLOWERS_DEFAULT_COLORS;case"confetti":return CONFETTI_DEFAULT_COLORS}}function createFallingParticle(t,e,i,s=!1){return{x:Math.random()*t,y:s?Math.random()*e:-20,size:Math.random()*(i.maxSize-i.minSize)+i.minSize,speedX:(Math.random()-.5)*i.wind,speedY:Math.random()*(i.maxSpeedY-i.minSpeedY)+i.minSpeedY,opacity:.5*Math.random()+.3,rotation:Math.random()*Math.PI*2,rotationSpeed:.05*(Math.random()-.5),color:i.colors[Math.floor(Math.random()*i.colors.length)]}}function drawFallingParticleShape(t,e,i){return"snow"===e?(t.beginPath(),t.arc(0,0,i,0,2*Math.PI),void t.fill()):"flowers"===e?(t.beginPath(),t.moveTo(0,0),t.bezierCurveTo(i,-i,2*i,i,0,2*i),t.bezierCurveTo(2*-i,i,-i,-i,0,0),void t.fill()):void t.fillRect(-i/2,-i/2,i,i)}const drawFallingParticles=(t,e,i,s,n,a)=>{const r=3e3/(a.speed||3e3),o=Math.max(1,.5*a.size),l={minSize:o,maxSize:Math.max(o+.5,1.5*a.size),minSpeedY:.4*r,maxSpeedY:1.2*r,wind:a.wind*r,colors:a.colors};s.current.length!==a.count&&(s.current=Array.from({length:a.count},()=>createFallingParticle(e,i,l,!0))),s.current.forEach(s=>{s.y+=s.speedY,s.x+=s.speedX+.5*Math.sin(s.y/50)*r,s.rotation+=s.rotationSpeed,s.y>i+20&&Object.assign(s,createFallingParticle(e,i,l)),s.x>e+20&&(s.x=-20),s.x<-20&&(s.x=e+20),t.save(),t.translate(s.x,s.y),t.rotate(s.rotation),t.fillStyle=s.color,t.globalAlpha=s.opacity*a.layerOpacity,drawFallingParticleShape(t,n,s.size),t.restore()}),t.globalAlpha=1},drawParticles=(t,e,i,s,n)=>{s.current.length!==n.count&&(s.current=Array.from({length:n.count}).map(()=>({x:Math.random()*e,y:Math.random()*i,vx:1.5*(Math.random()-.5),vy:1.5*(Math.random()-.5),size:Math.random()*n.size+1,color:n.colors[Math.floor(Math.random()*n.colors.length)]})));const a=s.current;a.forEach((s,r)=>{if(s.x+=s.vx,s.y+=s.vy,(s.x<0||s.x>e)&&(s.vx*=-1),(s.y<0||s.y>i)&&(s.vy*=-1),n.clickable){const t=n.mouse.x-s.x,e=n.mouse.y-s.y,i=Math.sqrt(t*t+e*e);if(i<150){const n=(150-i)/150;s.vx+=t/i*n*.5,s.vy+=e/i*n*.5}const a=3,r=Math.sqrt(s.vx*s.vx+s.vy*s.vy);r>a&&(s.vx=s.vx/r*a,s.vy=s.vy/r*a)}t.beginPath(),t.arc(s.x,s.y,s.size,0,2*Math.PI),t.fillStyle=s.color,t.fill();for(let e=r+1;e<a.length;e++){const i=a[e],n=s.x-i.x,r=s.y-i.y,o=Math.sqrt(n*n+r*r);o<100&&(t.beginPath(),t.strokeStyle=s.color,t.globalAlpha=1-o/100,t.lineWidth=.5,t.moveTo(s.x,s.y),t.lineTo(i.x,i.y),t.stroke(),t.globalAlpha=1)}})},drawStars=(t,e,i,s,n)=>{s.current.length!==n.count&&(s.current=Array.from({length:n.count}).map(()=>({x:Math.random()*e,y:Math.random()*i,size:Math.random()*n.size,blinkSpeed:.05*Math.random()+.01,color:n.colors[Math.floor(Math.random()*n.colors.length)]}))),s.current.forEach(e=>{e.y-=.05,e.y<0&&(e.y=i);const s=.5+.5*Math.sin(n.time*e.blinkSpeed);t.beginPath(),t.arc(e.x,e.y,e.size,0,2*Math.PI),t.fillStyle=e.color,t.globalAlpha=s,t.fill(),t.globalAlpha=1})},CLASS$5="designbase-wc-animation-background",FALLING_TYPES=["snow","flowers","confetti"];function isFallingType(t){return FALLING_TYPES.includes(t)}class CanvasAnimationController{constructor(t,e){this.options=e,this.raf=0,this.frameCount=0,this.mouse={x:-9999,y:-9999},this.particlesRef={current:[]},this.starsRef={current:[]},this.fallingRef={current:[]},this.tick=()=>{const t=this.canvas.getContext("2d");if(!t)return void(this.raf=requestAnimationFrame(this.tick));const e=window.devicePixelRatio||1,i=this.canvas.width/e,s=this.canvas.height/e,{type:n,colors:a,speed:r,particleCount:o,particleSize:l,starCount:h,starSize:d,clickable:u,wind:p,layerOpacity:m}=this.options;t.clearRect(0,0,i,s);const g=this.frameCount*(3e3/(r||3e3));switch(this.frameCount+=1,n){case"particles":drawParticles(t,i,s,this.particlesRef,{count:o,colors:a,size:l,mouse:this.mouse,clickable:u});break;case"stars":drawStars(t,i,s,this.starsRef,{count:h,colors:a,size:d,time:g});break;case"snow":case"flowers":case"confetti":isFallingType(n)&&drawFallingParticles(t,i,s,this.fallingRef,n,{count:o,colors:a,size:l,speed:r,wind:p,layerOpacity:m})}this.raf=requestAnimationFrame(this.tick)},this.container=t,this.canvas=document.createElement("canvas"),this.canvas.className=`${CLASS$5}__canvas`,t.appendChild(this.canvas),this.onResize=()=>this.resize(),this.onMouseMove=i=>{if("particles"!==e.type)return;const s=t.getBoundingClientRect();this.mouse={x:i.clientX-s.left,y:i.clientY-s.top}},this.onMouseLeave=()=>{this.mouse={x:-9999,y:-9999}},t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mouseleave",this.onMouseLeave),window.addEventListener("resize",this.onResize),this.particlesRef.current=[],this.starsRef.current=[],this.fallingRef.current=[],this.frameCount=0,this.resize(),this.tick()}destroy(){cancelAnimationFrame(this.raf),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseleave",this.onMouseLeave),window.removeEventListener("resize",this.onResize),this.canvas.remove()}resize(){const t=window.devicePixelRatio||1,e=this.container.getBoundingClientRect();this.canvas.width=e.width*t,this.canvas.height=e.height*t,this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`;const i=this.canvas.getContext("2d");i&&i.setTransform(t,0,0,t,0,0)}}const VS_SOURCE="\n attribute vec4 aVertexPosition;\n void main() {\n gl_Position = aVertexPosition;\n }\n",FS_MESH_FLOW="\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uSpeed;\n uniform float uSoftness;\n void main() {\n vec2 uv = gl_FragCoord.xy / uResolution.xy;\n float aspect = uResolution.x / uResolution.y;\n vec2 p = uv;\n p.x *= aspect;\n float t = uTime * uSpeed * 0.1;\n vec3 col = mix(uColors[0], uColors[4], uv.y * 0.6 + 0.2);\n for(int i = 1; i < 4; i++) {\n float fi = float(i);\n float offset = fi * 4.0;\n vec2 q = p;\n q.x += sin(q.y * 1.5 + t + offset) * 0.2;\n q.y += cos(q.x * 0.8 - t + offset) * 0.1;\n float waveCenterY = 0.5 + 0.3 * sin(q.x * 1.0 + t * 0.8 + offset);\n float thickness = 0.15 + 0.15 * sin(q.x * 2.5 + t * 1.2 + offset);\n float w = thickness * (1.0 + uSoftness * 3.0);\n float dist = abs(q.y - waveCenterY);\n float blurAmount = 0.1 + uSoftness * 0.4;\n float intensity = smoothstep(w + blurAmount, w - blurAmount, dist);\n intensity *= 0.7;\n vec3 bandColor = uColors[i];\n bandColor = mix(bandColor, uColors[i+1], sin(p.x + t)*0.2 + 0.2);\n col = mix(col, bandColor, intensity);\n }\n float noise = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453);\n col += (noise - 0.5) * 0.03;\n gl_FragColor = vec4(col, 1.0);\n }\n",FS_FLUID="\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n void main() {\n vec2 uv = (gl_FragCoord.xy - 0.5 * uResolution.xy) / min(uResolution.y, uResolution.x);\n float t = uTime * 0.2;\n float scale = mix(1.8, 0.45, uSoftness) / max(0.25, uZoom);\n vec2 p = uv * scale;\n for(float i = 1.0; i <= 4.0; i++){\n p.x += 0.6 / i * sin(i * 3.0 * p.y + t);\n p.y += 0.6 / i * cos(i * 3.0 * p.x + t);\n }\n float w1 = 0.5 + 0.5 * sin(p.x + t);\n float w2 = 0.5 + 0.5 * sin(p.y + t * 0.8);\n float w3 = 0.5 + 0.5 * sin(p.x + p.y);\n vec3 col = uColors[0];\n col = mix(col, uColors[1], smoothstep(0.1, 0.9, w1));\n col = mix(col, uColors[2], smoothstep(0.1, 0.9, w2));\n col = mix(col, uColors[3], smoothstep(0.1, 0.9, w3));\n float w4 = w1 * w2 * w3;\n col = mix(col, uColors[4], w4);\n float grain = random(gl_FragCoord.xy + uTime);\n col += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(col, 1.0);\n }\n",FS_RADIANT="\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n void main() {\n vec2 uv = gl_FragCoord.xy / uResolution.xy;\n float aspect = uResolution.x / uResolution.y;\n uv.x *= aspect;\n float t = uTime * 0.15;\n vec3 col = uColors[0];\n for(int i = 1; i < 5; i++) {\n float fi = float(i);\n vec2 pos = vec2(\n 0.5 * aspect + 0.4 * sin(t * (0.5 + fi * 0.2) + fi * 1.5),\n 0.5 + 0.4 * cos(t * (0.4 + fi * 0.15) + fi)\n );\n float d = length(uv - pos);\n float radius = 0.6 + uSoftness * 1.0;\n float intensity = smoothstep(radius, 0.0, d);\n col = mix(col, uColors[i], intensity * 0.7);\n }\n float grain = random(gl_FragCoord.xy + uTime);\n col += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(col, 1.0);\n }\n",FS_ETHEREAL="\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n float random (in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))*43758.5453123);\n }\n float noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n vec2 u = f*f*(3.0-2.0*f);\n return mix( mix( random( i + vec2(0.0,0.0) ),\n random( i + vec2(1.0,0.0) ), u.x),\n mix( random( i + vec2(0.0,1.0) ),\n random( i + vec2(1.0,1.0) ), u.x), u.y);\n }\n #define OCTAVES 5\n float fbm (in vec2 st) {\n float value = 0.0;\n float amplitude = 0.5;\n for (int i = 0; i < OCTAVES; i++) {\n value += amplitude * noise(st);\n st *= 2.0;\n amplitude *= 0.5;\n }\n return value;\n }\n void main() {\n vec2 uv = gl_FragCoord.xy/uResolution.xy;\n float aspect = uResolution.x/uResolution.y;\n uv.x *= aspect;\n float t = uTime * 0.05;\n float scale = 5.0 - uSoftness * 3.0;\n vec2 st = uv * scale;\n vec2 q = vec2(0.);\n q.x = fbm( st + 0.00*t );\n q.y = fbm( st + vec2(1.0) );\n vec2 r = vec2(0.);\n r.x = fbm( st + 1.0*q + vec2(1.7,9.2)+ 0.15*t );\n r.y = fbm( st + 1.0*q + vec2(8.3,2.8)+ 0.126*t );\n float f = fbm(st + r);\n vec3 color = mix(uColors[0], uColors[1], clamp((f*f)*4.0,0.0,1.0));\n color = mix(color, uColors[2], clamp(length(q),0.0,1.0));\n color = mix(color, uColors[3], clamp(length(r.x),0.0,1.0));\n color = mix(color, uColors[4], clamp(r.y*r.y, 0.0, 1.0));\n float grain = random(gl_FragCoord.xy + uTime);\n color += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(color,1.0);\n }\n";function getLuminaFragmentShader(t){switch(t){case"mesh-flow":return FS_MESH_FLOW;case"radiant":return FS_RADIANT;case"ethereal":return FS_ETHEREAL;default:return FS_FLUID}}const CLASS$4="designbase-wc-animation-background";function loadShader(t,e,i){const s=t.createShader(e);return s?(t.shaderSource(s,i),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS)?s:(t.deleteShader(s),null)):null}class ShaderAnimationController{constructor(t,e){this.options=e,this.raf=0,this.startTime=performance.now(),this.render=()=>{const t=this.gl,e=this.program,i=this.positionBuffer;if(!t||!e||!i)return;const{colors:s,speed:n,blur:a,noise:r,zoom:o,variant:l}=this.options,{width:h,height:d}=this.resizeCanvas();if(0===h||0===d)return void(this.raf=requestAnimationFrame(this.render));t.viewport(0,0,h,d),t.useProgram(e);const u=t.getAttribLocation(e,"aVertexPosition"),p=t.getUniformLocation(e,"uResolution"),m=t.getUniformLocation(e,"uTime"),g=t.getUniformLocation(e,"uColors"),b=t.getUniformLocation(e,"uSpeed"),f=t.getUniformLocation(e,"uSoftness"),v=t.getUniformLocation(e,"uNoiseStrength"),y=t.getUniformLocation(e,"uZoom");t.enableVertexAttribArray(u),t.bindBuffer(t.ARRAY_BUFFER,i),t.vertexAttribPointer(u,2,t.FLOAT,!1,0,0),t.uniform2f(p,h,d);const E=padColors(s),S=toLuminaSpeed(n),w=toLuminaSoftness(a),_=.6*S,x=clampZoom(o),k=(performance.now()-this.startTime)/1e3;"mesh-flow"===l?(m&&t.uniform1f(m,k),b&&t.uniform1f(b,_),f&&t.uniform1f(f,w)):(m&&t.uniform1f(m,k*S),f&&t.uniform1f(f,w),v&&t.uniform1f(v,r),"fluid"===l&&y&&t.uniform1f(y,x));const L=new Float32Array(15);for(let t=0;t<5;t++){const e=hexToRgb(E[t]);L[3*t]=e[0],L[3*t+1]=e[1],L[3*t+2]=e[2]}g&&t.uniform3fv(g,L),t.drawArrays(t.TRIANGLE_STRIP,0,4),this.raf=requestAnimationFrame(this.render)},this.container=t,this.canvas=document.createElement("canvas"),this.canvas.className=`${CLASS$4}__shader-canvas`,t.appendChild(this.canvas),this.init()}resizeCanvas(){const t=this.container.getBoundingClientRect(),e=window.devicePixelRatio||1;return this.canvas.width=Math.max(1,t.width*e),this.canvas.height=Math.max(1,t.height*e),this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`,{width:this.canvas.width,height:this.canvas.height}}init(){const t=this.canvas.getContext("webgl");if(!t)return;this.gl=t;const{variant:e}=this.options,i=getLuminaFragmentShader(e),s=t.createProgram();if(!s)return;const n=loadShader(t,t.VERTEX_SHADER,VS_SOURCE),a=loadShader(t,t.FRAGMENT_SHADER,i);if(!n||!a)return;if(t.attachShader(s,n),t.attachShader(s,a),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))return;this.program=s,this.vertexShader=n,this.fragmentShader=a;const r=t.createBuffer();r&&(this.positionBuffer=r,t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),this.observer=new ResizeObserver(()=>this.resizeCanvas()),this.observer.observe(this.container),this.startTime=performance.now(),this.render())}destroy(){cancelAnimationFrame(this.raf),this.observer?.disconnect();const t=this.gl;t&&this.program&&(this.vertexShader&&t.deleteShader(this.vertexShader),this.fragmentShader&&t.deleteShader(this.fragmentShader),this.positionBuffer&&t.deleteBuffer(this.positionBuffer),t.deleteProgram(this.program)),this.canvas.remove()}}const CLASS$3="designbase-wc-animation-background";function parseColors(t,e){if(!t)return e;try{const i=JSON.parse(t);return Array.isArray(i)&&i.length?i:e}catch{return t.split(",").map(t=>t.trim()).filter(Boolean)}}function parseAnimationBackgroundConfig(t){return{type:t.getAttribute("type")||"gradient",theme:"light"===t.getAttribute("theme")?"light":"dark",intensity:t.getAttribute("intensity")||"subtle",blur:Number(t.getAttribute("blur")||80),speed:Number(t.getAttribute("speed")||3e3),direction:t.getAttribute("direction")||"left",colors:parseColors(t.getAttribute("colors"),["#667eea","#764ba2","#f093fb"]),opacity:Number(t.getAttribute("opacity")||1),particleCount:Number(t.getAttribute("particle-count")||50),particleSize:Number(t.getAttribute("particle-size")||2),starCount:Number(t.getAttribute("star-count")||100),starSize:Number(t.getAttribute("star-size")||1.5),clickable:t.hasAttribute("clickable")&&"false"!==t.getAttribute("clickable"),wind:Number(t.getAttribute("wind")||.5),showGrid:t.hasAttribute("show-grid")&&"false"!==t.getAttribute("show-grid"),gridSize:Number(t.getAttribute("grid-size")||40),gridColor:t.getAttribute("grid-color")||void 0,gridOpacity:Number(t.getAttribute("grid-opacity")||.1),noise:Number(t.getAttribute("noise")||.05),showVignette:!t.hasAttribute("show-vignette")||"false"!==t.getAttribute("show-vignette"),preset:t.getAttribute("preset")||void 0,zoom:Number(t.getAttribute("zoom")||1),disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")}}function resolveColors(t){const{type:e,preset:i,colors:s}=t;if(i)return getLuminaPresetColors(i);if("fluid"===e&&s.length<5)return FLUID_DEFAULT_COLORS;if("snow"===e||"flowers"===e||"confetti"===e){const t=getFallingParticleDefaults(e);return 3===s.length&&"#667eea"===s[0]&&"#764ba2"===s[1]?t:s}return s}function createGradientLayer(t,e,i){const s=document.createDocumentFragment(),n=document.createElement("style");n.textContent="@keyframes designbase-wc-gradient-move {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }",s.appendChild(n);const a=document.createElement("div");a.className=`${CLASS$3}__css-layer`;const r=(e.length>0?e:["#ccc"]).join(", ");let o="90deg",l="";switch(t){case"up":o="0deg";break;case"down":o="180deg";break;case"left":o="270deg";break;case"right":o="90deg";break;case"diagonal":o="45deg";break;case"radial":l=`radial-gradient(circle, ${r})`}l||(l=`linear-gradient(${o}, ${r})`);const h=`${Math.max(2,i/1e3)}s`;return a.style.backgroundImage=l,a.style.backgroundSize="200% 200%",a.style.animation=`designbase-wc-gradient-move ${h} ease infinite`,s.appendChild(a),s}function createMeshAuroraLayer(t,e,i,s,n){const a=document.createElement("div");a.className=`${CLASS$3}__aurora-mesh`;const r="subtle"===s?.3:"medium"===s?.6:.8,o=Math.max(5,e/1e3),l=t.length>=3?t:["#4f46e5","#ec4899","#06b6d4","#8b5cf6"],h="dark"===n?"screen":"multiply",d=`blur(${i}px)`,u=`${CLASS$3}__aurora-blob`,p=[{backgroundColor:l[0],top:"-10%",left:"-10%",animationDuration:`${o}s`,animationDelay:"0s"},{backgroundColor:l[1],top:"-10%",right:"-10%",animationDuration:1.2*o+"s",animationDelay:"2s"},{backgroundColor:l[2],bottom:"-20%",left:"20%",animationDuration:1.5*o+"s",animationDelay:"4s"}];l[3]&&p.push({backgroundColor:l[3],bottom:"-10%",right:"-10%",animationDuration:1.1*o+"s",animationDelay:"1s"}),p.forEach(t=>{const e=document.createElement("div");e.className=u,Object.assign(e.style,{filter:d,opacity:String(r),mixBlendMode:h,...t}),a.appendChild(e)});const m=document.createElement("div");return m.className=`${CLASS$3}__aurora-noise`,m.style.opacity="dark"===n?"0.03":"0.05",m.style.backgroundImage="url(\"data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E\")",a.appendChild(m),a}function createPlasmaLayer(t,e,i){const s=document.createElement("div");s.className=`${CLASS$3}__plasma`;const n=Math.random().toString(36).slice(2,11),a=padColors(t),c=t=>a[t%a.length],r=toLuminaSpeed(e),o=LUMINA_ANIMATION_DURATION_SEC/r,l=document.createElement("style");l.textContent=`\n @keyframes designbase-wc-plasma-move-1-${n} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1); }\n 25% { transform: translate(10%, 10%) rotate(90deg) scale(1.2); }\n 50% { transform: translate(0, 20%) rotate(180deg) scale(1); }\n 75% { transform: translate(-10%, 10%) rotate(270deg) scale(0.9); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1); }\n }\n @keyframes designbase-wc-plasma-move-2-${n} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1.2); }\n 33% { transform: translate(-20%, 0) rotate(120deg) scale(1); }\n 66% { transform: translate(20%, -10%) rotate(240deg) scale(0.8); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1.2); }\n }\n @keyframes designbase-wc-plasma-move-3-${n} {\n 0% { transform: translate(0, 0) scale(0.8); }\n 50% { transform: translate(15%, -15%) scale(1.4); }\n 100% { transform: translate(0, 0) scale(0.8); }\n }\n @keyframes designbase-wc-plasma-rotate-${n} {\n 0% { transform: rotate(0deg) scale(1.5); }\n 50% { transform: rotate(180deg) scale(2.0); }\n 100% { transform: rotate(360deg) scale(1.5); }\n }`,s.appendChild(l);const h=document.createElement("div");h.className=`${CLASS$3}__plasma-base`,h.style.backgroundColor=c(0),s.appendChild(h);return[{top:"-10%",left:"-10%",width:"70%",height:"70%",background:`radial-gradient(circle, ${c(1)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-1-${n} ${o}s infinite linear`},{bottom:"-20%",right:"-10%",width:"80%",height:"80%",background:`radial-gradient(circle, ${c(2)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-2-${n} ${o}s infinite linear`},{top:"20%",left:"20%",width:"60%",height:"60%",background:`radial-gradient(circle, ${c(3)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-rotate-${n} ${o}s infinite linear`,extraClass:`${CLASS$3}__plasma-blob--exclusion`},{top:"40%",right:"20%",width:"40%",height:"40%",background:c(4),animation:`designbase-wc-plasma-move-3-${n} ${o}s infinite ease-in-out`,extraClass:`${CLASS$3}__plasma-blob--accent`,filter:`blur(${i}px)`,opacity:"0.6"}].forEach(t=>{const e=document.createElement("div");e.className=`${CLASS$3}__plasma-blob${t.extraClass?` ${t.extraClass}`:""}`,Object.assign(e.style,{filter:t.filter||`blur(${i}px)`,opacity:t.opacity||"0.9",...t}),s.appendChild(e)}),s}function createLuminaOverlays(t,e){const i=document.createDocumentFragment();if(t>0){const e=document.createElement("div");e.className=`${CLASS$3}__lumina-noise`,e.style.backgroundImage=`url("${LUMINA_NOISE_SVG}")`,e.style.opacity=String(t),i.appendChild(e)}if(e){const t=document.createElement("div");t.className=`${CLASS$3}__lumina-vignette`,i.appendChild(t)}return i}function mountAnimationLayers(t,e){const i=resolveColors(e);let s={};if(e.disabled)return s;switch(e.type){case"particles":case"stars":case"snow":case"flowers":case"confetti":{const n=document.createElement("div");n.className=`${CLASS$3}__canvas-layer`,t.appendChild(n);const a=new CanvasAnimationController(n,{type:e.type,colors:i,speed:e.speed,particleCount:e.particleCount,particleSize:e.particleSize,starCount:e.starCount,starSize:e.starSize,clickable:e.clickable,wind:e.wind,layerOpacity:e.opacity});s={destroy:()=>a.destroy()};break}case"aurora":t.appendChild(createMeshAuroraLayer(i,e.speed,e.blur,e.intensity,e.theme));break;case"plasma":t.appendChild(createPlasmaLayer(i,e.speed,e.blur)),t.appendChild(createLuminaOverlays(e.noise,e.showVignette));break;case"mesh-flow":case"fluid":case"radiant":case"ethereal":{const n=document.createElement("div");n.className=`${CLASS$3}__shader-layer`,t.appendChild(n);const a=new ShaderAnimationController(n,{variant:e.type,colors:i,speed:e.speed,blur:e.blur,noise:e.noise,zoom:e.zoom});t.appendChild(createLuminaOverlays(e.noise,e.showVignette)),s={destroy:()=>a.destroy()};break}case"gradient":t.appendChild(createGradientLayer(e.direction,i,e.speed))}return s}function applyContainerStyles(t,e){const i=isLuminaType(e.type)?"#000000":"dark"===e.theme?"var(--db-surface-base, #0f172a)":"var(--db-surface-base, #ffffff)";t.style.position="relative",t.style.overflow="hidden","gradient"!==e.type?t.style.backgroundColor=i:t.style.backgroundColor=""}function getEffectiveGridColor(t){return t.gridColor??("dark"===t.theme?"#ffffff":"#000000")}const CLASS$2=CLASS$3;class DbAnimationBackground extends HTMLElement{static get observedAttributes(){return["type","theme","intensity","blur","speed","direction","colors","width","height","border-radius","opacity","blend-mode","particle-count","particle-size","star-count","star-size","wind","clickable","disabled","show-grid","grid-size","grid-color","grid-opacity","noise","show-vignette","preset","zoom"]}connectedCallback(){this.style.display="block",this.render()}disconnectedCallback(){this.teardownLayers(),this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0)}attributeChangedCallback(){this.isConnected&&this.render()}teardownLayers(){this.layerHandle?.destroy?.(),this.layerHandle=void 0,this.layersEl&&this.layersEl.replaceChildren()}getSizeStyle(t){if(!t)return;const e=Number(t);return Number.isFinite(e)?`${e}px`:t}render(){const t=parseAnimationBackgroundConfig(this);this.className=[CLASS$2,`${CLASS$2}--${t.type}`,t.clickable&&!t.disabled&&`${CLASS$2}--clickable`,t.disabled&&`${CLASS$2}--disabled`].filter(Boolean).join(" "),applyContainerStyles(this,t);const e=this.getSizeStyle(this.getAttribute("width")),i=this.getSizeStyle(this.getAttribute("height")),s=this.getSizeStyle(this.getAttribute("border-radius"));e&&(this.style.width=e),i&&(this.style.height=i),s&&(this.style.borderRadius=s),this.style.opacity=String(t.opacity);const n=this.getAttribute("blend-mode");if(n&&(this.style.mixBlendMode=n),!this.layersEl){this.layersEl=document.createElement("div"),this.layersEl.className=`${CLASS$2}__layers`,Object.assign(this.layersEl.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"0"}),this.contentEl=document.createElement("div"),this.contentEl.className=`${CLASS$2}__content`,Object.assign(this.contentEl.style,{position:"relative",zIndex:"10",width:"100%",height:"100%"});const t=document.createElement("slot");this.contentEl.appendChild(t),this.append(this.layersEl,this.contentEl)}this.teardownLayers();const a=this.querySelector(`.${CLASS$2}__grid-overlay`);if(a?.remove(),this.layerHandle=mountAnimationLayers(this.layersEl,t),t.showGrid&&!t.disabled){const e=document.createElement("div");e.className=`${CLASS$2}__grid-overlay`,Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",pointerEvents:"none",zIndex:"1",backgroundImage:`linear-gradient(to right, ${getEffectiveGridColor(t)} 1px, transparent 1px), linear-gradient(to bottom, ${getEffectiveGridColor(t)} 1px, transparent 1px)`,backgroundSize:`${t.gridSize}px ${t.gridSize}px`,opacity:String(t.gridOpacity),maskImage:"linear-gradient(to bottom, black 0%, black 92%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, black 92%, transparent 100%)"}),this.insertBefore(e,this.contentEl??null)}this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0),t.clickable&&!t.disabled&&(this.clickHandler=()=>{this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.addEventListener("click",this.clickHandler))}}customElements.get("db-animation-background")||customElements.define("db-animation-background",DbAnimationBackground);const CLASS$1="designbase-wc-cursor-follower",SCOPE_CLASS="designbase-wc-cursor-follower-scope",HIDE_CLASS="designbase-wc-cursor-follower--hide-native",DESKTOP_MEDIA="(pointer: fine) and (hover: hover) and (min-width: 769px)",DEFAULT_SELECTOR='a[href], button:not(:disabled), [role="button"]:not([aria-disabled="true"]), [data-cursor], [data-cursor-label], input[type="submit"], input[type="button"]';function getLabelFromElement(t,e){return t.getAttribute("data-cursor-label")||t.getAttribute("data-cursor")||t.getAttribute("aria-label")||e}function parseOffset(t){if(!t)return{x:18,y:18};try{const e=JSON.parse(t);return{x:Number(e.x??18),y:Number(e.y??18)}}catch{const[e,i]=t.split(",").map(t=>Number(t.trim()));return{x:Number.isFinite(e)?e:18,y:Number.isFinite(i)?i:18}}}class DbCursorFollower extends HTMLElement{constructor(){super(...arguments),this.target={x:-9999,y:-9999},this.current={x:-9999,y:-9999},this.raf=0,this.enabled=!1,this.isScoped=!1}static get observedAttributes(){return["default-label","selector","smoothness","offset","hide-native-cursor","show-icon"]}connectedCallback(){this.style.display="contents",this.setupDesktopGate()}disconnectedCallback(){this.teardown()}attributeChangedCallback(){this.isConnected&&this.enabled&&this.mountLayer()}setupDesktopGate(){"undefined"!=typeof window&&(this.desktopMq=window.matchMedia(DESKTOP_MEDIA),this.onDesktopChange=()=>{const t=this.desktopMq?.matches??!1;t!==this.enabled&&(this.enabled=t,t?(this.ensureScope(),this.mountLayer()):this.teardownLayer())},this.onDesktopChange(),this.desktopMq.addEventListener("change",this.onDesktopChange))}ensureScope(){if(this.scopeEl)return;if(this.childElementCount>0||this.textContent?.trim()){this.isScoped=!0,this.scopeEl=document.createElement("div"),this.scopeEl.className=SCOPE_CLASS;const t=document.createElement("slot");this.scopeEl.appendChild(t),this.appendChild(this.scopeEl)}}isInScope(t){return!!t&&(!this.isScoped||!this.scopeEl||this.scopeEl.contains(t))}mountLayer(){this.teardownLayer(),this.ensureScope();const t=this.getAttribute("default-label")||"See the project",e=this.getAttribute("selector")||DEFAULT_SELECTOR,i=Math.min(1,Math.max(.05,Number(this.getAttribute("smoothness")||.14))),s=parseOffset(this.getAttribute("offset")),n=this.hasAttribute("hide-native-cursor")&&"false"!==this.getAttribute("hide-native-cursor"),a=!this.hasAttribute("show-icon")||"false"!==this.getAttribute("show-icon");n&&document.documentElement.classList.add(HIDE_CLASS),this.portalRoot=document.createElement("div"),this.portalRoot.className=CLASS$1,this.portalRoot.setAttribute("aria-hidden","true"),this.pillEl=document.createElement("div"),this.pillEl.className=`${CLASS$1}__pill`,this.labelEl=document.createElement("span"),this.labelEl.textContent=t,this.pillEl.appendChild(this.labelEl),a&&(this.iconEl=document.createElement("span"),this.iconEl.className=`${CLASS$1}__icon`,this.iconEl.appendChild(createDbIcon("arrow-right",14)),this.pillEl.appendChild(this.iconEl)),this.portalRoot.appendChild(this.pillEl),document.body.appendChild(this.portalRoot),this.onMouseMove=i=>{this.target={x:i.clientX+s.x,y:i.clientY+s.y};const n=document.elementFromPoint(i.clientX,i.clientY),a=n?.closest(e)??null;this.isInScope(a)&&a?(this.labelEl&&(this.labelEl.textContent=getLabelFromElement(a,t)),this.pillEl?.classList.add(`${CLASS$1}__pill--visible`)):this.pillEl?.classList.remove(`${CLASS$1}__pill--visible`)},window.addEventListener("mousemove",this.onMouseMove,{passive:!0});const tick=()=>{this.current.x+=(this.target.x-this.current.x)*i,this.current.y+=(this.target.y-this.current.y)*i,this.portalRoot&&(this.portalRoot.style.transform=`translate3d(${this.current.x}px, ${this.current.y}px, 0)`),this.raf=requestAnimationFrame(tick)};this.raf=requestAnimationFrame(tick)}teardownLayer(){cancelAnimationFrame(this.raf),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=void 0),document.documentElement.classList.remove(HIDE_CLASS),this.portalRoot?.remove(),this.portalRoot=void 0,this.pillEl=void 0,this.labelEl=void 0,this.iconEl=void 0}teardown(){this.teardownLayer(),this.desktopMq&&this.onDesktopChange&&this.desktopMq.removeEventListener("change",this.onDesktopChange),this.scopeEl?.remove(),this.scopeEl=void 0,this.isScoped=!1,this.enabled=!1}}customElements.get("db-cursor-follower")||customElements.define("db-cursor-follower",DbCursorFollower);const CLASS="designbase-wc-lottie";class DbLottie extends HTMLElement{constructor(){super(...arguments),this.loadToken=0}static get observedAttributes(){return["src","animation-data","loop","autoplay","speed","width","height","renderer"]}connectedCallback(){this.style.display="inline-block",this.renderAnimation()}disconnectedCallback(){this.destroyAnimation(),this.container?.remove(),this.container=void 0}attributeChangedCallback(){this.isConnected&&this.renderAnimation()}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const i=this.getAttribute(t);return""===i||"true"===i}getSizeStyle(t){if(!t)return;const e=Number(t);return Number.isFinite(e)?`${e}px`:t}destroyAnimation(){this.animation?.destroy(),this.animation=void 0}async renderAnimation(){const t=++this.loadToken;this.destroyAnimation(),this.container?this.container.replaceChildren():(this.container=document.createElement("div"),this.container.className=`${CLASS}__container`,this.appendChild(this.container));const e=this.getSizeStyle(this.getAttribute("width")),i=this.getSizeStyle(this.getAttribute("height"));if(e&&(this.style.width=e),i&&(this.style.height=i),t!==this.loadToken||!this.container)return;const s=this.getBool("loop",!0),n=!this.hasAttribute("autoplay")||this.getBool("autoplay",!0),a=Number(this.getAttribute("speed")||1),r=this.getAttribute("renderer")||"svg";let o;const l=this.getAttribute("animation-data");if(l)try{o=JSON.parse(l)}catch{o=void 0}const h=this.getAttribute("src");if(!o&&!h){const t=document.createElement("div");return t.className=`${CLASS}__fallback`,t.textContent="src 또는 animation-data 속성이 필요합니다.",void this.container.appendChild(t)}const d=await Promise.resolve().then(function(){return lottie$1}),u=d.default??d;t===this.loadToken&&this.container&&(this.animation=u.loadAnimation({container:this.container,renderer:r,loop:s,autoplay:n,...o?{animationData:o}:{path:h}}),Number.isFinite(a)&&a>0&&this.animation.setSpeed(a))}}customElements.get("db-lottie")||customElements.define("db-lottie",DbLottie);var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var prism$2={exports:{}};!function(t){var e=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},n={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function encode(t){return t instanceof Token?new Token(t.type,encode(t.content),t.alias):Array.isArray(t)?t.map(encode):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++i}),t.__id},clone:function deepClone(t,e){var i,s;switch(e=e||{},n.util.type(t)){case"Object":if(s=n.util.objId(t),e[s])return e[s];for(var a in i={},e[s]=i,t)t.hasOwnProperty(a)&&(i[a]=deepClone(t[a],e));return i;case"Array":return s=n.util.objId(t),e[s]?e[s]:(i=[],e[s]=i,t.forEach(function(t,s){i[s]=deepClone(t,e)}),i);default:return t}},getLanguage:function(t){for(;t;){var i=e.exec(t.className);if(i)return i[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,i){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+i)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(s){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack)||[])[1];if(t){var e=document.getElementsByTagName("script");for(var i in e)if(e[i].src==t)return e[i]}return null}},isActive:function(t,e,i){for(var s="no-"+e;t;){var n=t.classList;if(n.contains(e))return!0;if(n.contains(s))return!1;t=t.parentElement}return!!i}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(t,e){var i=n.util.clone(n.languages[t]);for(var s in e)i[s]=e[s];return i},insertBefore:function(t,e,i,s){var a=(s=s||n.languages)[t],r={};for(var o in a)if(a.hasOwnProperty(o)){if(o==e)for(var l in i)i.hasOwnProperty(l)&&(r[l]=i[l]);i.hasOwnProperty(o)||(r[o]=a[o])}var h=s[t];return s[t]=r,n.languages.DFS(n.languages,function(e,i){i===h&&e!=t&&(this[e]=r)}),r},DFS:function DFS(t,e,i,s){s=s||{};var a=n.util.objId;for(var r in t)if(t.hasOwnProperty(r)){e.call(t,r,t[r],i||r);var o=t[r],l=n.util.type(o);"Object"!==l||s[a(o)]?"Array"!==l||s[a(o)]||(s[a(o)]=!0,DFS(o,e,r,s)):(s[a(o)]=!0,DFS(o,e,null,s))}}},plugins:{},highlightAll:function(t,e){n.highlightAllUnder(document,t,e)},highlightAllUnder:function(t,e,i){var s={callback:i,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};n.hooks.run("before-highlightall",s),s.elements=Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)),n.hooks.run("before-all-elements-highlight",s);for(var a,r=0;a=s.elements[r++];)n.highlightElement(a,!0===e,s.callback)},highlightElement:function(e,i,s){var a=n.util.getLanguage(e),r=n.languages[a];n.util.setLanguage(e,a);var o=e.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&n.util.setLanguage(o,a);var l={element:e,language:a,grammar:r,code:e.textContent};function insertHighlightedCode(t){l.highlightedCode=t,n.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,n.hooks.run("after-highlight",l),n.hooks.run("complete",l),s&&s.call(l.element)}if(n.hooks.run("before-sanity-check",l),(o=l.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!l.code)return n.hooks.run("complete",l),void(s&&s.call(l.element));if(n.hooks.run("before-highlight",l),l.grammar)if(i&&t.Worker){var h=new Worker(n.filename);h.onmessage=function(t){insertHighlightedCode(t.data)},h.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else insertHighlightedCode(n.highlight(l.code,l.grammar,l.language));else insertHighlightedCode(n.util.encode(l.code))},highlight:function(t,e,i){var s={code:t,grammar:e,language:i};if(n.hooks.run("before-tokenize",s),!s.grammar)throw new Error('The language "'+s.language+'" has no grammar.');return s.tokens=n.tokenize(s.code,s.grammar),n.hooks.run("after-tokenize",s),Token.stringify(n.util.encode(s.tokens),s.language)},tokenize:function(t,e){var i=e.rest;if(i){for(var s in i)e[s]=i[s];delete e.rest}var n=new LinkedList;return addAfter(n,n.head,t),matchGrammar(t,n,e,n.head,0),function toArray(t){var e=[],i=t.head.next;for(;i!==t.tail;)e.push(i.value),i=i.next;return e}(n)},hooks:{all:{},add:function(t,e){var i=n.hooks.all;i[t]=i[t]||[],i[t].push(e)},run:function(t,e){var i=n.hooks.all[t];if(i&&i.length)for(var s,a=0;s=i[a++];)s(e)}},Token:Token};function Token(t,e,i,s){this.type=t,this.content=e,this.alias=i,this.length=0|(s||"").length}function matchPattern(t,e,i,s){t.lastIndex=e;var n=t.exec(i);if(n&&s&&n[1]){var a=n[1].length;n.index+=a,n[0]=n[0].slice(a)}return n}function matchGrammar(t,e,i,s,a,r){for(var o in i)if(i.hasOwnProperty(o)&&i[o]){var l=i[o];l=Array.isArray(l)?l:[l];for(var h=0;h<l.length;++h){if(r&&r.cause==o+","+h)return;var d=l[h],u=d.inside,p=!!d.lookbehind,m=!!d.greedy,g=d.alias;if(m&&!d.pattern.global){var b=d.pattern.toString().match(/[imsuy]*$/)[0];d.pattern=RegExp(d.pattern.source,b+"g")}for(var f=d.pattern||d,v=s.next,y=a;v!==e.tail&&!(r&&y>=r.reach);y+=v.value.length,v=v.next){var E=v.value;if(e.length>t.length)return;if(!(E instanceof Token)){var S,w=1;if(m){if(!(S=matchPattern(f,y,t,p))||S.index>=t.length)break;var _=S.index,x=S.index+S[0].length,k=y;for(k+=v.value.length;_>=k;)k+=(v=v.next).value.length;if(y=k-=v.value.length,v.value instanceof Token)continue;for(var L=v;L!==e.tail&&(k<x||"string"==typeof L.value);L=L.next)w++,k+=L.value.length;w--,E=t.slice(y,k),S.index-=y}else if(!(S=matchPattern(f,0,E,p)))continue;_=S.index;var P=S[0],T=E.slice(0,_),D=E.slice(_+P.length),I=y+E.length;r&&I>r.reach&&(r.reach=I);var $=v.prev;if(T&&($=addAfter(e,$,T),y+=T.length),removeRange(e,$,w),v=addAfter(e,$,new Token(o,u?n.tokenize(P,u):P,g,P)),D&&addAfter(e,v,D),w>1){var M={cause:o+","+h,reach:I};matchGrammar(t,e,i,v.prev,y,M),r&&M.reach>r.reach&&(r.reach=M.reach)}}}}}}function LinkedList(){var t={value:null,prev:null,next:null},e={value:null,prev:t,next:null};t.next=e,this.head=t,this.tail=e,this.length=0}function addAfter(t,e,i){var s=e.next,n={value:i,prev:e,next:s};return e.next=n,s.prev=n,t.length++,n}function removeRange(t,e,i){for(var s=e.next,n=0;n<i&&s!==t.tail;n++)s=s.next;e.next=s,s.prev=e,t.length-=n}if(t.Prism=n,Token.stringify=function stringify(t,e){if("string"==typeof t)return t;if(Array.isArray(t)){var i="";return t.forEach(function(t){i+=stringify(t,e)}),i}var s={type:t.type,content:stringify(t.content,e),tag:"span",classes:["token",t.type],attributes:{},language:e},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(s.classes,a):s.classes.push(a)),n.hooks.run("wrap",s);var r="";for(var o in s.attributes)r+=" "+o+'="'+(s.attributes[o]||"").replace(/"/g,""")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+r+">"+s.content+"</"+s.tag+">"},!t.document)return t.addEventListener?(n.disableWorkerMessageHandler||t.addEventListener("message",function(e){var i=JSON.parse(e.data),s=i.language,a=i.code,r=i.immediateClose;t.postMessage(n.highlight(a,n.languages[s],s)),r&&t.close()},!1),n):n;var a=n.util.currentScript();function highlightAutomaticallyCallback(){n.manual||n.highlightAll()}if(a&&(n.filename=a.src,a.hasAttribute("data-manual")&&(n.manual=!0)),!n.manual){var r=document.readyState;"loading"===r||"interactive"===r&&a&&a.defer?document.addEventListener("DOMContentLoaded",highlightAutomaticallyCallback):window.requestAnimationFrame?window.requestAnimationFrame(highlightAutomaticallyCallback):window.setTimeout(highlightAutomaticallyCallback,16)}return n}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});t.exports&&(t.exports=e),void 0!==commonjsGlobal&&(commonjsGlobal.Prism=e),e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function addInlined(t,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var n={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};n["language-"+i]={pattern:/[\s\S]+/,inside:e.languages[i]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:n},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,i){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:e.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var i=t.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))}(e),e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript,function(){if(void 0!==e&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},i="data-src-status",s="loading",n="loaded",a="pre[data-src]:not(["+i+'="'+n+'"]):not(['+i+'="'+s+'"])';e.hooks.add("before-highlightall",function(t){t.selector+=", "+a}),e.hooks.add("before-sanity-check",function(r){var o=r.element;if(o.matches(a)){r.code="",o.setAttribute(i,s);var l=o.appendChild(document.createElement("CODE"));l.textContent="Loading…";var h=o.getAttribute("data-src"),d=r.language;if("none"===d){var u=(/\.(\w+)$/.exec(h)||[,"none"])[1];d=t[u]||u}e.util.setLanguage(l,d),e.util.setLanguage(o,d);var p=e.plugins.autoloader;p&&p.loadLanguages(d),function loadFile(t,e,i){var s=new XMLHttpRequest;s.open("GET",t,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?e(s.responseText):s.status>=400?i("✖ Error "+s.status+" while fetching file: "+s.statusText):i("✖ Error: File does not exist or is empty"))},s.send(null)}(h,function(t){o.setAttribute(i,n);var s=function parseRange(t){var e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(t||"");if(e){var i=Number(e[1]),s=e[2],n=e[3];return s?n?[i,Number(n)]:[i,void 0]:[i,i]}}(o.getAttribute("data-range"));if(s){var a=t.split(/\r\n?|\n/g),r=s[0],h=null==s[1]?a.length:s[1];r<0&&(r+=a.length),r=Math.max(0,Math.min(r-1,a.length)),h<0&&(h+=a.length),h=Math.max(0,Math.min(h,a.length)),t=a.slice(r,h).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(r+1))}l.textContent=t,e.highlightElement(l)},function(t){o.setAttribute(i,"failed"),l.textContent=t})}}),e.plugins.fileHighlight={highlight:function highlight(t){for(var i,s=(t||document).querySelectorAll(a),n=0;i=s[n++];)e.highlightElement(i)}};var r=!1;e.fileHighlight=function(){r||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),r=!0),e.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(prism$2);var prismExports=prism$2.exports,prism=getDefaultExportFromCjs(prismExports),prism$1=_mergeNamespaces({__proto__:null,default:prism},[prismExports]);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};var prismClike=Object.freeze({__proto__:null});!function(t){var e="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",i={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:i,environment:{pattern:RegExp("\\$"+e),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+e),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+e),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:i}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+e),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},i.inside=t.languages.bash;for(var n=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,r=0;r<n.length;r++)a[n[r]]=t.languages.bash[n[r]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash}(Prism);var prismBash=Object.freeze({__proto__:null});!function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var i=t.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))}(Prism);var prismCss=Object.freeze({__proto__:null});Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript;var prismJavascript=Object.freeze({__proto__:null});!function(t){var e=t.util.clone(t.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,n=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function re(t,e){return t=t.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return n}),RegExp(t,e)}n=re(n).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=re(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:re(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:re(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var stringifyToken=function(t){return t?"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(stringifyToken).join(""):""},walkTokens=function(e){for(var i=[],s=0;s<e.length;s++){var n=e[s],a=!1;if("string"!=typeof n&&("tag"===n.type&&n.content[0]&&"tag"===n.content[0].type?"</"===n.content[0].content[0].content?i.length>0&&i[i.length-1].tagName===stringifyToken(n.content[0].content[1])&&i.pop():"/>"===n.content[n.content.length-1].content||i.push({tagName:stringifyToken(n.content[0].content[1]),openedBraces:0}):i.length>0&&"punctuation"===n.type&&"{"===n.content?i[i.length-1].openedBraces++:i.length>0&&i[i.length-1].openedBraces>0&&"punctuation"===n.type&&"}"===n.content?i[i.length-1].openedBraces--:a=!0),(a||"string"==typeof n)&&i.length>0&&0===i[i.length-1].openedBraces){var r=stringifyToken(n);s<e.length-1&&("string"==typeof e[s+1]||"plain-text"===e[s+1].type)&&(r+=stringifyToken(e[s+1]),e.splice(s+1,1)),s>0&&("string"==typeof e[s-1]||"plain-text"===e[s-1].type)&&(r=stringifyToken(e[s-1])+r,e.splice(s-1,1),s--),e[s]=new t.Token("plain-text",r,null,r)}n.content&&"string"!=typeof n.content&&walkTokens(n.content)}};t.hooks.add("after-tokenize",function(t){"jsx"!==t.language&&"tsx"!==t.language||walkTokens(t.tokens)})}(Prism);var prismJsx=Object.freeze({__proto__:null});Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;var prismJson=Object.freeze({__proto__:null});Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function addInlined(t,e){var i={};i["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};s["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:s},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml;var prismMarkup=Object.freeze({__proto__:null});Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),Prism.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.languages.scss;var prismScss=Object.freeze({__proto__:null});!function(t){var e=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var i=t.languages.tsx.tag;i.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+i.pattern.source+")",i.pattern.flags),i.lookbehind=!0}(Prism);var prismTsx=Object.freeze({__proto__:null});!function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Prism);var prismTypescript=Object.freeze({__proto__:null}),lottie$2={exports:{}};(function(module,exports){var factory;"undefined"!=typeof document&&"undefined"!=typeof navigator&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function setWebWorker(t){_useWebWorker=!!t},getWebWorker=function getWebWorker(){return _useWebWorker},setLocationHref=function setLocationHref(t){locationHref=t},getLocationHref=function getLocationHref(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,s,n=t.length;for(i=0;i<n;i+=1)for(var a in s=t[i].prototype)Object.prototype.hasOwnProperty.call(s,a)&&(e.prototype[a]=s[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function ProxyFunction(){}return ProxyFunction.prototype=t,ProxyFunction}var audioControllerFactory=function(){function AudioController(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return AudioController.prototype={addAudio:function addAudio(t){this.audios.push(t)},pause:function pause(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function resume(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function setRate(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].setRate(t)},createAudio:function createAudio(t){return this.audioFactory?this.audioFactory(t):window.Howl?new window.Howl({src:[t]}):{isPlaying:!1,play:function play(){this.isPlaying=!0},seek:function seek(){this.isPlaying=!1},playing:function playing(){},rate:function rate(){},setVolume:function setVolume(){}}},setAudioFactory:function setAudioFactory(t){this.audioFactory=t},setVolume:function setVolume(t){this._volume=t,this._updateVolume()},mute:function mute(){this._isMuted=!0,this._updateVolume()},unmute:function unmute(){this._isMuted=!1,this._updateVolume()},getVolume:function getVolume(){return this._volume},_updateVolume:function _updateVolume(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new AudioController}}(),createTypedArray=function(){function createRegularArray(t,e){var i,s=0,n=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(s=0;s<e;s+=1)n.push(i);return n}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function createTypedArrayFactory(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):createRegularArray(t,e)}:createRegularArray}();function createSizedArray(t){return Array.apply(null,{length:t})}function _typeof$6(t){return _typeof$6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$6(t)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};!function(){var t,e=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],i=e.length;for(t=0;t<i;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===_typeof$6(t)&&t.length){var e,i=createSizedArray(t.length),s=t.length;for(e=0;e<s;e+=1)i[e]=Math.abs(t[e]);return i}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}var createElementID=(_count=0,function createID(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(t,e,i){var s,n,a,r,o,l,h,d;switch(l=i*(1-e),h=i*(1-(o=6*t-(r=Math.floor(6*t)))*e),d=i*(1-(1-o)*e),r%6){case 0:s=i,n=d,a=l;break;case 1:s=h,n=i,a=l;break;case 2:s=l,n=i,a=d;break;case 3:s=l,n=h,a=i;break;case 4:s=d,n=l,a=i;break;case 5:s=i,n=l,a=h}return[s,n,a]}function RGBtoHSV(t,e,i){var s,n=Math.max(t,e,i),a=Math.min(t,e,i),r=n-a,o=0===n?0:r/n,l=n/255;switch(n){case a:s=0;break;case t:s=e-i+r*(e<i?6:0),s/=6*r;break;case e:s=i-t+2*r,s/=6*r;break;case i:s=t-e+4*r,s/=6*r}return[s,o,l]}function addSaturationToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,s){return t<0&&(t=0),e<0&&(e=0),s<0&&(s=0),"#"+i[t]+i[e]+i[s]}}(),setSubframeEnabled=function setSubframeEnabled(t){subframeEnabled=!!t},getSubframeEnabled=function getSubframeEnabled(){return subframeEnabled},setExpressionsPlugin=function setExpressionsPlugin(t){expressionsPlugin=t},getExpressionsPlugin=function getExpressionsPlugin(){return expressionsPlugin},setExpressionInterfaces=function setExpressionInterfaces(t){expressionsInterfaces=t},getExpressionInterfaces=function getExpressionInterfaces(){return expressionsInterfaces},setDefaultCurveSegments=function setDefaultCurveSegments(t){defaultCurveSegments=t},getDefaultCurveSegments=function getDefaultCurveSegments(){return defaultCurveSegments},setIdPrefix=function setIdPrefix(t){idPrefix$1=t};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$5(t)}var dataManager=function(){var t,e,i=1,s=[],n={onmessage:function onmessage(){},postMessage:function postMessage(e){t({data:e})}},a={postMessage:function postMessage(t){n.onmessage({data:t})}};function setupWorker(){e||((e=function createWorker(e){if(window.Worker&&window.Blob&&getWebWorker()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),s=URL.createObjectURL(i);return new Worker(s)}return t=e,n}(function workerStart(t){if(a.dataManager||(a.dataManager=function dataFunctionManager(){function completeLayers(t,e){var i,s,n,a,r,o,l=t.length;for(s=0;s<l;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.hasMask){var h=i.masksProperties;for(a=h.length,n=0;n<a;n+=1)if(h[n].pt.k.i)convertPathsToAbsoluteValues(h[n].pt.k);else for(o=h[n].pt.k.length,r=0;r<o;r+=1)h[n].pt.k[r].s&&convertPathsToAbsoluteValues(h[n].pt.k[r].s[0]),h[n].pt.k[r].e&&convertPathsToAbsoluteValues(h[n].pt.k[r].e[0])}0===i.ty?(i.layers=findCompLayers(i.refId,e),completeLayers(i.layers,e)):4===i.ty?completeShapes(i.shapes):5===i.ty&&completeText(i)}}function findCompLayers(t,e){var i=function findComp(t,e){for(var i=0,s=e.length;i<s;){if(e[i].id===t)return e[i];i+=1}return null}(t,e);return i?i.layers.__used?JSON.parse(JSON.stringify(i.layers)):(i.layers.__used=!0,i.layers):null}function completeShapes(t){var e,i,s;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)convertPathsToAbsoluteValues(t[e].ks.k);else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&convertPathsToAbsoluteValues(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&convertPathsToAbsoluteValues(t[e].ks.k[i].e[0]);else"gr"===t[e].ty&&completeShapes(t[e].it)}function convertPathsToAbsoluteValues(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function checkVersion(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var t,e=function(){var t=[4,4,14];function updateTextLayer(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function iterateLayers(t){var e,i=t.length;for(e=0;e<i;e+=1)5===t[e].ty&&updateTextLayer(t[e])}return function(e){if(checkVersion(t,e.v)&&(iterateLayers(e.layers),e.assets)){var i,s=e.assets.length;for(i=0;i<s;i+=1)e.assets[i].layers&&iterateLayers(e.assets[i].layers)}}}(),i=(t=[4,7,99],function(e){if(e.chars&&!checkVersion(t,e.v)){var i,s=e.chars.length;for(i=0;i<s;i+=1){var n=e.chars[i];n.data&&n.data.shapes&&(completeShapes(n.data.shapes),n.data.ip=0,n.data.op=99999,n.data.st=0,n.data.sr=1,n.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[i].t||(n.data.shapes.push({ty:"no"}),n.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),s=function(){var t=[5,7,15];function updateTextLayer(t){var e=t.t.p;"number"==typeof e.a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r&&(e.r={a:0,k:e.r})}function iterateLayers(t){var e,i=t.length;for(e=0;e<i;e+=1)5===t[e].ty&&updateTextLayer(t[e])}return function(e){if(checkVersion(t,e.v)&&(iterateLayers(e.layers),e.assets)){var i,s=e.assets.length;for(i=0;i<s;i+=1)e.assets[i].layers&&iterateLayers(e.assets[i].layers)}}}(),n=function(){var t=[4,1,9];function iterateShapes(t){var e,i,s,n=t.length;for(e=0;e<n;e+=1)if("gr"===t[e].ty)iterateShapes(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(s=t[e].c.k.length,i=0;i<s;i+=1)t[e].c.k[i].s&&(t[e].c.k[i].s[0]/=255,t[e].c.k[i].s[1]/=255,t[e].c.k[i].s[2]/=255,t[e].c.k[i].s[3]/=255),t[e].c.k[i].e&&(t[e].c.k[i].e[0]/=255,t[e].c.k[i].e[1]/=255,t[e].c.k[i].e[2]/=255,t[e].c.k[i].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function iterateLayers(t){var e,i=t.length;for(e=0;e<i;e+=1)4===t[e].ty&&iterateShapes(t[e].shapes)}return function(e){if(checkVersion(t,e.v)&&(iterateLayers(e.layers),e.assets)){var i,s=e.assets.length;for(i=0;i<s;i+=1)e.assets[i].layers&&iterateLayers(e.assets[i].layers)}}}(),a=function(){var t=[4,4,18];function completeClosingShapes(t){var e,i,s;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&(t[e].ks.k[i].s[0].c=t[e].closed),t[e].ks.k[i].e&&(t[e].ks.k[i].e[0].c=t[e].closed);else"gr"===t[e].ty&&completeClosingShapes(t[e].it)}function iterateLayers(t){var e,i,s,n,a,r,o=t.length;for(i=0;i<o;i+=1){if((e=t[i]).hasMask){var l=e.masksProperties;for(n=l.length,s=0;s<n;s+=1)if(l[s].pt.k.i)l[s].pt.k.c=l[s].cl;else for(r=l[s].pt.k.length,a=0;a<r;a+=1)l[s].pt.k[a].s&&(l[s].pt.k[a].s[0].c=l[s].cl),l[s].pt.k[a].e&&(l[s].pt.k[a].e[0].c=l[s].cl)}4===e.ty&&completeClosingShapes(e.shapes)}}return function(e){if(checkVersion(t,e.v)&&(iterateLayers(e.layers),e.assets)){var i,s=e.assets.length;for(i=0;i<s;i+=1)e.assets[i].layers&&iterateLayers(e.assets[i].layers)}}}();function completeText(t){0===t.t.a.length&&t.t.p}var r={completeData:function completeData(t){t.__complete||(n(t),e(t),i(t),s(t),a(t),completeLayers(t.layers,t.assets),function completeChars(t,e){if(t){var i=0,s=t.length;for(i=0;i<s;i+=1)1===t[i].t&&(t[i].data.layers=findCompLayers(t[i].data.refId,e),completeLayers(t[i].data.layers,e))}}(t.chars,t.assets),t.__complete=!0)}};return r.checkColors=n,r.checkChars=i,r.checkPathProperties=s,r.checkShapes=a,r.completeLayers=completeLayers,r}()),a.assetLoader||(a.assetLoader=function(){function formatResponse(t){var e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&-1!==e.indexOf("json")||t.response&&"object"===_typeof$5(t.response)?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function loadAsset(t,e,i,s){var n,a=new XMLHttpRequest;try{a.responseType="json"}catch(t){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)n=formatResponse(a),i(n);else try{n=formatResponse(a),i(n)}catch(t){s&&s(t)}};try{a.open(["G","E","T"].join(""),t,!0)}catch(i){a.open(["G","E","T"].join(""),e+"/"+t,!0)}a.send()}}}()),"loadAnimation"===t.data.type)a.assetLoader.load(t.data.path,t.data.fullPath,function(e){a.dataManager.completeData(e),a.postMessage({id:t.data.id,payload:e,status:"success"})},function(){a.postMessage({id:t.data.id,status:"error"})});else if("complete"===t.data.type){var e=t.data.animation;a.dataManager.completeData(e),a.postMessage({id:t.data.id,payload:e,status:"success"})}else"loadData"===t.data.type&&a.assetLoader.load(t.data.path,t.data.fullPath,function(e){a.postMessage({id:t.data.id,payload:e,status:"success"})},function(){a.postMessage({id:t.data.id,status:"error"})})})).onmessage=function(t){var e=t.data,i=e.id,n=s[i];s[i]=null,"success"===e.status?n.onComplete(e.payload):n.onError&&n.onError()})}function createProcess(t,e){var n="processId_"+(i+=1);return s[n]={onComplete:t,onError:e},n}return{loadAnimation:function loadAnimation(t,i,s){setupWorker();var n=createProcess(i,s);e.postMessage({type:"loadAnimation",path:t,fullPath:window.location.origin+window.location.pathname,id:n})},loadData:function loadData(t,i,s){setupWorker();var n=createProcess(i,s);e.postMessage({type:"loadData",path:t,fullPath:window.location.origin+window.location.pathname,id:n})},completeAnimation:function completeAnimation(t,i,s){setupWorker();var n=createProcess(i,s);e.postMessage({type:"complete",animation:t,id:n})}}}(),ImagePreloader=function(){var t=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function imageLoaded(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function footageLoaded(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function getAssetsPath(t,e,i){var s="";if(t.e)s=t.p;else if(e){var n=t.p;-1!==n.indexOf("images/")&&(n=n.split("/")[1]),s=e+n}else s=i,s+=t.u?t.u:"",s+=t.p;return s}function testImageLoaded(t){var e=0,i=setInterval(function(){(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function createFootageData(t){var e={assetData:t},i=getAssetsPath(t,this.assetsPath,this.path);return dataManager.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function ImagePreloaderFactory(){this._imageLoaded=imageLoaded.bind(this),this._footageLoaded=footageLoaded.bind(this),this.testImageLoaded=testImageLoaded.bind(this),this.createFootageData=createFootageData.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return ImagePreloaderFactory.prototype={loadAssets:function loadAssets(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;i<s;i+=1)t[i].layers||(t[i].t&&"seq"!==t[i].t?3===t[i].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(t[i]))):(this.totalImages+=1,this.images.push(this._createImageData(t[i]))))},setAssetsPath:function setAssetsPath(t){this.assetsPath=t||""},setPath:function setPath(t){this.path=t||""},loadedImages:function loadedImages(){return this.totalImages===this.loadedAssets},loadedFootages:function loadedFootages(){return this.totalFootages===this.loadedFootagesCount},destroy:function destroy(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function getAsset(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function createImgData(e){var i=getAssetsPath(e,this.assetsPath,this.path),s=createTag("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){n.img=t,this._imageLoaded()}.bind(this),!1),s.src=i;var n={img:s,assetData:e};return n},createImageData:function createImageData(e){var i=getAssetsPath(e,this.assetsPath,this.path),s=createNS("image");isSafari?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){n.img=t,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(s):this._elementHelper.appendChild(s);var n={img:s,assetData:e};return n},imageLoaded:imageLoaded,footageLoaded:footageLoaded,setCacheType:function setCacheType(t,e){"svg"===t?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},ImagePreloaderFactory}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function triggerEvent(t,e){if(this._cbs[t])for(var i=this._cbs[t],s=0;s<i.length;s+=1)i[s](e)},addEventListener:function addEventListener(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function removeEventListener(t,e){if(e){if(this._cbs[t]){for(var i=0,s=this._cbs[t].length;i<s;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,s-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var markerParser=function(){function parsePayloadLines(t){for(var e,i=t.split("\r\n"),s={},n=0,a=0;a<i.length;a+=1)2===(e=i[a].split(":")).length&&(s[e[0]]=e[1].trim(),n+=1);if(0===n)throw new Error;return s}return function(t){for(var e=[],i=0;i<t.length;i+=1){var s=t[i],n={time:s.tm,duration:s.dr};try{n.payload=JSON.parse(t[i].cm)}catch(e){try{n.payload=parsePayloadLines(t[i].cm)}catch(e){n.payload={name:t[i].cm}}}e.push(n)}return e}}(),ProjectInterface=function(){function registerComposition(t){this.compositions.push(t)}return function(){function _thisProjectFunction(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return _thisProjectFunction.compositions=[],_thisProjectFunction.currentFrame=0,_thisProjectFunction.registerComposition=registerComposition,_thisProjectFunction}}(),renderers={},registerRenderer=function registerRenderer(t,e){renderers[t]=e};function getRenderer(t){return renderers[t]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var t in renderers)if(renderers[t])return t;return""}function _typeof$4(t){return _typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$4(t)}var AnimationItem=function AnimationItem(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var i=getRenderer(e);this.renderer=new i(this,t.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(t.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(t){dataManager.completeAnimation(t,this.configAnimation)},AnimationItem.prototype.setData=function(t,e){e&&"object"!==_typeof$4(e)&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},s=t.attributes;i.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",i.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var n=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";"false"===n?i.loop=!1:"true"===n?i.loop=!0:""!==n&&(i.loop=parseInt(n,10));var a=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:!s.getNamedItem("bm-autoplay")||s.getNamedItem("bm-autoplay").value;i.autoplay="false"!==a,i.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"","false"===(s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,n=s.length,a=t.layers,r=a.length;for(i=0;i<r;i+=1)for(e=0;e<n;){if(s[e].id===a[i].id){s[e]=a[i];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(n=t.assets.length,e=0;e<n;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(t){this.animationData=t;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.markers=markerParser(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(t,e){var i="number"==typeof t?t:void 0,s="number"==typeof e?e:void 0;this.renderer.updateContainerSize(i,s)},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i<this.markers.length;i+=1)if((e=this.markers[i]).payload&&e.payload.name===t)return e;return null},AnimationItem.prototype.goToAndStop=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var n=this.getMarkerData(t);n&&this.goToAndStop(n.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var n=this.getMarkerData(t);n&&(n.duration?this.playSegments([n.time,n.time+n.duration],!0):this.goToAndStop(n.time,!0))}else this.goToAndStop(s,e,i);this.play()}},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===_typeof$4(t[0])){var i,s=t.length;for(i=0;i<s;i+=1)this.segments.push(t[i])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(t){this.loop=t},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(t,e,i){try{this.renderer.getElementByPath(t).updateDocumentData(e,i)}catch(t){}},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(t,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var animationManager=function(){var t={},e=[],i=0,s=0,n=0,a=!0,r=!1;function removeElement(t){for(var i=0,n=t.target;i<s;)e[i].animation===n&&(e.splice(i,1),i-=1,s-=1,n.isPaused||subtractPlayingCount()),i+=1}function registerAnimation(t,i){if(!t)return null;for(var n=0;n<s;){if(e[n].elem===t&&null!==e[n].elem)return e[n].animation;n+=1}var a=new AnimationItem;return setupAnimation(a,t),a.setData(t,i),a}function addPlayingCount(){n+=1,activate()}function subtractPlayingCount(){n-=1}function setupAnimation(t,i){t.addEventListener("destroy",removeElement),t.addEventListener("_active",addPlayingCount),t.addEventListener("_idle",subtractPlayingCount),e.push({elem:i,animation:t}),s+=1}function resume(t){var o,l=t-i;for(o=0;o<s;o+=1)e[o].animation.advanceTime(l);i=t,n&&!r?window.requestAnimationFrame(resume):a=!0}function first(t){i=t,window.requestAnimationFrame(resume)}function activate(){!r&&n&&a&&(window.requestAnimationFrame(first),a=!1)}return t.registerAnimation=registerAnimation,t.loadAnimation=function loadAnimation(t){var e=new AnimationItem;return setupAnimation(e,null),e.setParams(t),e},t.setSpeed=function setSpeed(t,i){var n;for(n=0;n<s;n+=1)e[n].animation.setSpeed(t,i)},t.setDirection=function setDirection(t,i){var n;for(n=0;n<s;n+=1)e[n].animation.setDirection(t,i)},t.play=function play(t){var i;for(i=0;i<s;i+=1)e[i].animation.play(t)},t.pause=function pause(t){var i;for(i=0;i<s;i+=1)e[i].animation.pause(t)},t.stop=function stop(t){var i;for(i=0;i<s;i+=1)e[i].animation.stop(t)},t.togglePause=function togglePause(t){var i;for(i=0;i<s;i+=1)e[i].animation.togglePause(t)},t.searchAnimations=function searchAnimations(t,e,i){var s,n=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=n.length;for(s=0;s<a;s+=1)i&&n[s].setAttribute("data-bm-type",i),registerAnimation(n[s],t);if(e&&0===a){i||(i="svg");var r=document.getElementsByTagName("body")[0];r.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),r.appendChild(o),registerAnimation(o,t)}},t.resize=function resize(){var t;for(t=0;t<s;t+=1)e[t].animation.resize()},t.goToAndStop=function goToAndStop(t,i,n){var a;for(a=0;a<s;a+=1)e[a].animation.goToAndStop(t,i,n)},t.destroy=function destroy(t){var i;for(i=s-1;i>=0;i-=1)e[i].animation.destroy(t)},t.freeze=function freeze(){r=!0},t.unfreeze=function unfreeze(){r=!1,activate()},t.setVolume=function setVolume(t,i){var n;for(n=0;n<s;n+=1)e[n].animation.setVolume(t,i)},t.mute=function mute(t){var i;for(i=0;i<s;i+=1)e[i].animation.mute(t)},t.unmute=function unmute(t){var i;for(i=0;i<s;i+=1)e[i].animation.unmute(t)},t.getRegisteredAnimations=function getRegisteredAnimations(){var t,i=e.length,s=[];for(t=0;t<i;t+=1)s.push(e[t].animation);return s},t}(),BezierFactory=function(){var t={getBezierEasing:function getBezierEasing(t,i,s,n,a){var r=a||("bez_"+t+"_"+i+"_"+s+"_"+n).replace(/\./g,"p");if(e[r])return e[r];var o=new BezierEasing([t,i,s,n]);return e[r]=o,o}},e={},i=11,s=1/(i-1),n="function"==typeof Float32Array;function A(t,e){return 1-3*e+3*t}function B(t,e){return 3*e-6*t}function C(t){return 3*t}function calcBezier(t,e,i){return((A(e,i)*t+B(e,i))*t+C(e))*t}function getSlope(t,e,i){return 3*A(e,i)*t*t+2*B(e,i)*t+C(e)}function BezierEasing(t){this._p=t,this._mSampleValues=n?new Float32Array(i):new Array(i),this._precomputed=!1,this.get=this.get.bind(this)}return BezierEasing.prototype={get:function get(t){var e=this._p[0],i=this._p[1],s=this._p[2],n=this._p[3];return this._precomputed||this._precompute(),e===i&&s===n?t:0===t?0:1===t?1:calcBezier(this._getTForX(t),i,n)},_precompute:function _precompute(){var t=this._p[0],e=this._p[1],i=this._p[2],s=this._p[3];this._precomputed=!0,t===e&&i===s||this._calcSampleValues()},_calcSampleValues:function _calcSampleValues(){for(var t=this._p[0],e=this._p[2],n=0;n<i;++n)this._mSampleValues[n]=calcBezier(n*s,t,e)},_getTForX:function _getTForX(t){for(var e=this._p[0],n=this._p[2],a=this._mSampleValues,r=0,o=1,l=i-1;o!==l&&a[o]<=t;++o)r+=s;var h=r+(t-a[--o])/(a[o+1]-a[o])*s,d=getSlope(h,e,n);return d>=.001?function newtonRaphsonIterate(t,e,i,s){for(var n=0;n<4;++n){var a=getSlope(e,i,s);if(0===a)return e;e-=(calcBezier(e,i,s)-t)/a}return e}(t,h,e,n):0===d?h:function binarySubdivide(t,e,i,s,n){var a,r,o=0;do{(a=calcBezier(r=e+(i-e)/2,s,n)-t)>0?i=r:e=r}while(Math.abs(a)>1e-7&&++o<10);return r}(t,r,r+s,e,n)}},t}(),pooling={double:function _double(t){return t.concat(createSizedArray(t.length))}},poolFactory=function(t,e,i){var s=0,n=t,a=createSizedArray(n);return{newElement:function newElement(){return s?a[s-=1]:e()},release:function release(t){s===n&&(a=pooling.double(a),n*=2),i&&i(t),a[s]=t,s+=1}}},bezierLengthPool=poolFactory(8,function create(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}),segmentsLengthPool=poolFactory(8,function create(){return{lengths:[],totalLength:0}},function release(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)bezierLengthPool.release(t.lengths[e]);t.lengths.length=0});function bezFunction(){var t=Math;function pointOnLine2D(t,e,i,s,n,a){var r=t*s+e*n+i*a-n*s-a*t-i*e;return r>-.001&&r<.001}var getBezierLength=function(t,e,i,s){var n,a,r,o,l,h,d=getDefaultCurveSegments(),u=0,p=[],m=[],g=bezierLengthPool.newElement();for(r=i.length,n=0;n<d;n+=1){for(l=n/(d-1),h=0,a=0;a<r;a+=1)o=bmPow(1-l,3)*t[a]+3*bmPow(1-l,2)*l*i[a]+3*(1-l)*bmPow(l,2)*s[a]+bmPow(l,3)*e[a],p[a]=o,null!==m[a]&&(h+=bmPow(p[a]-m[a],2)),m[a]=p[a];h&&(u+=h=bmSqrt(h)),g.percents[n]=l,g.lengths[n]=u}return g.addedLength=u,g};function BezierData(t){this.segmentLength=0,this.points=new Array(t)}function PointData(t,e){this.partialLength=t,this.point=e}var e,i=(e={},function(t,i,s,n){var a=(t[0]+"_"+t[1]+"_"+i[0]+"_"+i[1]+"_"+s[0]+"_"+s[1]+"_"+n[0]+"_"+n[1]).replace(/\./g,"p");if(!e[a]){var r,o,l,h,d,u,p,m=getDefaultCurveSegments(),g=0,b=null;2===t.length&&(t[0]!==i[0]||t[1]!==i[1])&&pointOnLine2D(t[0],t[1],i[0],i[1],t[0]+s[0],t[1]+s[1])&&pointOnLine2D(t[0],t[1],i[0],i[1],i[0]+n[0],i[1]+n[1])&&(m=2);var f=new BezierData(m);for(l=s.length,r=0;r<m;r+=1){for(p=createSizedArray(l),d=r/(m-1),u=0,o=0;o<l;o+=1)h=bmPow(1-d,3)*t[o]+3*bmPow(1-d,2)*d*(t[o]+s[o])+3*(1-d)*bmPow(d,2)*(i[o]+n[o])+bmPow(d,3)*i[o],p[o]=h,null!==b&&(u+=bmPow(p[o]-b[o],2));g+=u=bmSqrt(u),f.points[r]=new PointData(u,p),b=p}f.segmentLength=g,e[a]=f}return e[a]});function getDistancePerc(t,e){var i=e.percents,s=e.lengths,n=i.length,a=bmFloor((n-1)*t),r=t*e.addedLength,o=0;if(a===n-1||0===a||r===s[a])return i[a];for(var l=s[a]>r?-1:1,h=!0;h;)if(s[a]<=r&&s[a+1]>r?(o=(r-s[a])/(s[a+1]-s[a]),h=!1):a+=l,a<0||a>=n-1){if(a===n-1)return i[a];h=!1}return i[a]+(i[a+1]-i[a])*o}var s=createTypedArray("float32",8);return{getSegmentsLength:function getSegmentsLength(t){var e,i=segmentsLengthPool.newElement(),s=t.c,n=t.v,a=t.o,r=t.i,o=t._length,l=i.lengths,h=0;for(e=0;e<o-1;e+=1)l[e]=getBezierLength(n[e],n[e+1],a[e],r[e+1]),h+=l[e].addedLength;return s&&o&&(l[e]=getBezierLength(n[e],n[0],a[e],r[0]),h+=l[e].addedLength),i.totalLength=h,i},getNewSegment:function getNewSegment(e,i,n,a,r,o,l){r<0?r=0:r>1&&(r=1);var h,d=getDistancePerc(r,l),u=getDistancePerc(o=o>1?1:o,l),p=e.length,m=1-d,g=1-u,b=m*m*m,f=d*m*m*3,v=d*d*m*3,y=d*d*d,E=m*m*g,S=d*m*g+m*d*g+m*m*u,w=d*d*g+m*d*u+d*m*u,_=d*d*u,x=m*g*g,k=d*g*g+m*u*g+m*g*u,L=d*u*g+m*u*u+d*g*u,P=d*u*u,T=g*g*g,D=u*g*g+g*u*g+g*g*u,I=u*u*g+g*u*u+u*g*u,$=u*u*u;for(h=0;h<p;h+=1)s[4*h]=t.round(1e3*(b*e[h]+f*n[h]+v*a[h]+y*i[h]))/1e3,s[4*h+1]=t.round(1e3*(E*e[h]+S*n[h]+w*a[h]+_*i[h]))/1e3,s[4*h+2]=t.round(1e3*(x*e[h]+k*n[h]+L*a[h]+P*i[h]))/1e3,s[4*h+3]=t.round(1e3*(T*e[h]+D*n[h]+I*a[h]+$*i[h]))/1e3;return s},getPointInSegment:function getPointInSegment(e,i,s,n,a,r){var o=getDistancePerc(a,r),l=1-o;return[t.round(1e3*(l*l*l*e[0]+(o*l*l+l*o*l+l*l*o)*s[0]+(o*o*l+l*o*o+o*l*o)*n[0]+o*o*o*i[0]))/1e3,t.round(1e3*(l*l*l*e[1]+(o*l*l+l*o*l+l*l*o)*s[1]+(o*o*l+l*o*o+o*l*o)*n[1]+o*o*o*i[1]))/1e3]},buildBezierData:i,pointOnLine2D:pointOnLine2D,pointOnLine3D:function pointOnLine3D(e,i,s,n,a,r,o,l,h){if(0===s&&0===r&&0===h)return pointOnLine2D(e,i,n,a,o,l);var d,u=t.sqrt(t.pow(n-e,2)+t.pow(a-i,2)+t.pow(r-s,2)),p=t.sqrt(t.pow(o-e,2)+t.pow(l-i,2)+t.pow(h-s,2)),m=t.sqrt(t.pow(o-n,2)+t.pow(l-a,2)+t.pow(h-r,2));return(d=u>p?u>m?u-p-m:m-p-u:m>p?m-p-u:p-u-m)>-1e-4&&d<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var i,s=this.offsetTime;"multidimensional"===this.propType&&(i=createTypedArray("float32",this.pv.length));for(var n,a,r,o,l,h,d,u,p,m=e.lastIndex,g=m,b=this.keyframes.length-1,f=!0;f;){if(n=this.keyframes[g],a=this.keyframes[g+1],g===b-1&&t>=a.t-s){n.h&&(n=a),m=0;break}if(a.t-s>t){m=g;break}g<b-1?g+=1:(m=0,f=!1)}r=this.keyframesMetadata[g]||{};var v,y=a.t-s,E=n.t-s;if(n.to){r.bezierData||(r.bezierData=bez.buildBezierData(n.s,a.s||n.e,n.to,n.ti));var S=r.bezierData;if(t>=y||t<E){var w=t>=y?S.points.length-1:0;for(l=S.points[w].point.length,o=0;o<l;o+=1)i[o]=S.points[w].point[o]}else{r.__fnct?p=r.__fnct:(p=BezierFactory.getBezierEasing(n.o.x,n.o.y,n.i.x,n.i.y,n.n).get,r.__fnct=p),h=p((t-E)/(y-E));var _,x=S.segmentLength*h,k=e.lastFrame<t&&e._lastKeyframeIndex===g?e._lastAddedLength:0;for(u=e.lastFrame<t&&e._lastKeyframeIndex===g?e._lastPoint:0,f=!0,d=S.points.length;f;){if(k+=S.points[u].partialLength,0===x||0===h||u===S.points.length-1){for(l=S.points[u].point.length,o=0;o<l;o+=1)i[o]=S.points[u].point[o];break}if(x>=k&&x<k+S.points[u+1].partialLength){for(_=(x-k)/S.points[u+1].partialLength,l=S.points[u].point.length,o=0;o<l;o+=1)i[o]=S.points[u].point[o]+(S.points[u+1].point[o]-S.points[u].point[o])*_;break}u<d-1?u+=1:f=!1}e._lastPoint=u,e._lastAddedLength=k-S.points[u].partialLength,e._lastKeyframeIndex=g}}else{var L,P,T,D,I;if(b=n.s.length,v=a.s||n.e,this.sh&&1!==n.h)t>=y?(i[0]=v[0],i[1]=v[1],i[2]=v[2]):t<=E?(i[0]=n.s[0],i[1]=n.s[1],i[2]=n.s[2]):quaternionToEuler(i,slerp(createQuaternion(n.s),createQuaternion(v),(t-E)/(y-E)));else for(g=0;g<b;g+=1)1!==n.h&&(t>=y?h=1:t<E?h=0:(n.o.x.constructor===Array?(r.__fnct||(r.__fnct=[]),r.__fnct[g]?p=r.__fnct[g]:(L=void 0===n.o.x[g]?n.o.x[0]:n.o.x[g],P=void 0===n.o.y[g]?n.o.y[0]:n.o.y[g],T=void 0===n.i.x[g]?n.i.x[0]:n.i.x[g],D=void 0===n.i.y[g]?n.i.y[0]:n.i.y[g],p=BezierFactory.getBezierEasing(L,P,T,D).get,r.__fnct[g]=p)):r.__fnct?p=r.__fnct:(L=n.o.x,P=n.o.y,T=n.i.x,D=n.i.y,p=BezierFactory.getBezierEasing(L,P,T,D).get,n.keyframeMetadata=p),h=p((t-E)/(y-E)))),v=a.s||n.e,I=1===n.h?n.s[g]:n.s[g]+(v[g]-n.s[g])*h,"multidimensional"===this.propType?i[g]=I:i=I}return e.lastIndex=m,i}function slerp(t,e,i){var s,n,a,r,o,l=[],h=t[0],d=t[1],u=t[2],p=t[3],m=e[0],g=e[1],b=e[2],f=e[3];return(n=h*m+d*g+u*b+p*f)<0&&(n=-n,m=-m,g=-g,b=-b,f=-f),1-n>1e-6?(s=Math.acos(n),a=Math.sin(s),r=Math.sin((1-i)*s)/a,o=Math.sin(i*s)/a):(r=1-i,o=i),l[0]=r*h+o*m,l[1]=r*d+o*g,l[2]=r*u+o*b,l[3]=r*p+o*f,l}function quaternionToEuler(t,e){var i=e[0],s=e[1],n=e[2],a=e[3],r=Math.atan2(2*s*a-2*i*n,1-2*s*s-2*n*n),o=Math.asin(2*i*s+2*n*a),l=Math.atan2(2*i*a-2*s*n,1-2*i*i-2*n*n);t[0]=r/degToRads,t[1]=o/degToRads,t[2]=l/degToRads}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,n=Math.cos(e/2),a=Math.cos(i/2),r=Math.cos(s/2),o=Math.sin(e/2),l=Math.sin(i/2),h=Math.sin(s/2);return[o*l*r+n*a*h,o*a*r+n*l*h,n*l*r-o*a*h,n*a*r-o*l*h]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if("unidimensional"===this.propType)e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i<s;)e=t[i]*this.mult,mathAbs(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function ValueProperty(t,e,i,s){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(t,e,i,s){var n;this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),n=0;n<a;n+=1)this.v[n]=e.k[n]*this.mult,this.pv[n]=e.k[n];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(t,e,i,s){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(t,e,i,s){var n;this.propType="multidimensional";var a,r,o,l,h=e.k.length;for(n=0;n<h-1;n+=1)e.k[n].to&&e.k[n].s&&e.k[n+1]&&e.k[n+1].s&&(a=e.k[n].s,r=e.k[n+1].s,o=e.k[n].to,l=e.k[n].ti,(2===a.length&&(a[0]!==r[0]||a[1]!==r[1])&&bez.pointOnLine2D(a[0],a[1],r[0],r[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],r[0],r[1],r[0]+l[0],r[1]+l[1])||3===a.length&&(a[0]!==r[0]||a[1]!==r[1]||a[2]!==r[2])&&bez.pointOnLine3D(a[0],a[1],a[2],r[0],r[1],r[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],r[0],r[1],r[2],r[0]+l[0],r[1]+l[1],r[2]+l[2]))&&(e.k[n].to=null,e.k[n].ti=null),a[0]===r[0]&&a[1]===r[1]&&0===o[0]&&0===o[1]&&0===l[0]&&0===l[1]&&(2===a.length||a[2]===r[2]&&0===o[2]&&0===l[2])&&(e.k[n].to=null,e.k[n].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var d=e.k[0].s.length;for(this.v=createTypedArray("float32",d),this.pv=createTypedArray("float32",d),n=0;n<d;n+=1)this.v[n]=initFrame,this.pv[n]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",d)},this.addEffect=addEffect}var PropertyFactory={getProp:function getProp(t,e,i,s,n){var a;if(e.sid&&(e=t.globalData.slotManager.getProp(e)),e.k.length)if("number"==typeof e.k[0])a=new MultiDimensionalProperty(t,e,s,n);else switch(i){case 0:a=new KeyframedValueProperty(t,e,s,n);break;case 1:a=new KeyframedMultidimensionalProperty(t,e,s,n)}else a=new ValueProperty(t,e,s,n);return a.effectsSequence.length&&n.addDynamicProperty(a),a}};function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function iterateDynamicProperties(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function initDynamicPropertyContainer(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,function create(){return createTypedArray("float32",2)});function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=pointPool.newElement(),this.o[i]=pointPool.newElement(),this.i[i]=pointPool.newElement(),i+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,i,s,n){var a;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[s]||a[s]&&!n)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,s,n,a,r,o){this.setXYAt(t,e,"v",r,o),this.setXYAt(i,s,"o",r,o),this.setXYAt(n,a,"i",r,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,n=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),n=1);var a,r=this._length-1,o=this._length;for(a=n;a<o;a+=1)t.setTripleAt(e[r][0],e[r][1],s[r][0],s[r][1],i[r][0],i[r][1],a,!1),r-=1;return t},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,function create(){return new ShapePath},function release(t){var e,i=t._length;for(e=0;e<i;e+=1)pointPool.release(t.v[e]),pointPool.release(t.i[e]),pointPool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),factory.clone=function clone(t){var e,i=factory.newElement(),s=void 0===t._length?t.v.length:t._length;for(i.setLength(s),i.c=t.c,e=0;e<s;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shapePool.release(this.shapes[t]);this._length=0};var shapeCollectionPool=(ob={newShapeCollection:function newShapeCollection(){return _length?pool[_length-=1]:new ShapeCollection},release:function release(t){var e,i=t._length;for(e=0;e<i;e+=1)shapePool.release(t.shapes[e]);t._length=0,_length===_maxLength&&(pool=pooling.double(pool),_maxLength*=2),pool[_length]=t,_length+=1}},_length=0,_maxLength=4,pool=createSizedArray(_maxLength),ob),ob,_length,_maxLength,pool,ShapePropertyFactory=function(){var t=-999999;function interpolateShape(t,e,i){var s,n,a,r,o,l,h,d,u,p=i.lastIndex,m=this.keyframes;if(t<m[0].t-this.offsetTime)s=m[0].s[0],a=!0,p=0;else if(t>=m[m.length-1].t-this.offsetTime)s=m[m.length-1].s?m[m.length-1].s[0]:m[m.length-2].e[0],a=!0;else{for(var g,b,f,v=p,y=m.length-1,E=!0;E&&(g=m[v],!((b=m[v+1]).t-this.offsetTime>t));)v<y-1?v+=1:E=!1;if(f=this.keyframesMetadata[v]||{},p=v,!(a=1===g.h)){if(t>=b.t-this.offsetTime)d=1;else if(t<g.t-this.offsetTime)d=0;else{var S;f.__fnct?S=f.__fnct:(S=BezierFactory.getBezierEasing(g.o.x,g.o.y,g.i.x,g.i.y).get,f.__fnct=S),d=S((t-(g.t-this.offsetTime))/(b.t-this.offsetTime-(g.t-this.offsetTime)))}n=b.s?b.s[0]:g.e[0]}s=g.s[0]}for(l=e._length,h=s.i[0].length,i.lastIndex=p,r=0;r<l;r+=1)for(o=0;o<h;o+=1)u=a?s.i[r][o]:s.i[r][o]+(n.i[r][o]-s.i[r][o])*d,e.i[r][o]=u,u=a?s.o[r][o]:s.o[r][o]+(n.o[r][o]-s.o[r][o])*d,e.o[r][o]=u,u=a?s.v[r][o]:s.v[r][o]+(n.v[r][o]-s.v[r][o])*d,e.v[r][o]=u}function interpolateShapeCurrentTime(){var e=this.comp.renderedFrame-this.offsetTime,i=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,n=this._caching.lastFrame;return n!==t&&(n<i&&e<i||n>s&&e>s)||(this._caching.lastIndex=n<e?this._caching.lastIndex:0,this.interpolateShape(e,this.pv,this._caching)),this._caching.lastFrame=e,this.pv}function resetShape(){this.paths=this.localShapeCollection}function setVValue(t){(function shapesEqual(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,s=t._length;for(i=0;i<s;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0})(this.v,t)||(this.v=shapePool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var i=this.effectsSequence.length;for(e=0;e<i;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function ShapeProperty(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var s=3===i?e.pt.k:e.ks.k;this.v=shapePool.clone(s),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=resetShape,this.effectsSequence=[]}function addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function KeyframedShapeProperty(e,i,s){this.propType="shape",this.comp=e.comp,this.elem=e,this.container=e,this.offsetTime=e.data.st,this.keyframes=3===s?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var n=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,n),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=t,this.reset=resetShape,this._caching={lastFrame:t,lastIndex:0},this.effectsSequence=[interpolateShapeCurrentTime.bind(this)]}ShapeProperty.prototype.interpolateShape=interpolateShape,ShapeProperty.prototype.getValue=processEffectsSequence,ShapeProperty.prototype.setVValue=setVValue,ShapeProperty.prototype.addEffect=addEffect,KeyframedShapeProperty.prototype.getValue=processEffectsSequence,KeyframedShapeProperty.prototype.interpolateShape=interpolateShape,KeyframedShapeProperty.prototype.setVValue=setVValue,KeyframedShapeProperty.prototype.addEffect=addEffect;var e=function(){var t=roundCorner;function EllShapePropertyFactory(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return EllShapePropertyFactory.prototype={reset:resetShape,getValue:function getValue(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function convertEllToPath(){var e=this.p.v[0],i=this.p.v[1],s=this.s.v[0]/2,n=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=e,r.v[0][1]=i-n,r.v[1][0]=a?e+s:e-s,r.v[1][1]=i,r.v[2][0]=e,r.v[2][1]=i+n,r.v[3][0]=a?e-s:e+s,r.v[3][1]=i,r.i[0][0]=a?e-s*t:e+s*t,r.i[0][1]=i-n,r.i[1][0]=a?e+s:e-s,r.i[1][1]=i-n*t,r.i[2][0]=a?e+s*t:e-s*t,r.i[2][1]=i+n,r.i[3][0]=a?e-s:e+s,r.i[3][1]=i+n*t,r.o[0][0]=a?e+s*t:e-s*t,r.o[0][1]=i-n,r.o[1][0]=a?e+s:e-s,r.o[1][1]=i+n*t,r.o[2][0]=a?e-s*t:e+s*t,r.o[2][1]=i+n,r.o[3][0]=a?e-s:e+s,r.o[3][1]=i-n*t}},extendPrototype([DynamicPropertyContainer],EllShapePropertyFactory),EllShapePropertyFactory}(),i=function(){function StarShapePropertyFactory(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return StarShapePropertyFactory.prototype={reset:resetShape,getValue:function getValue(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function convertStarToPath(){var t,e,i,s,n=2*Math.floor(this.pt.v),a=2*Math.PI/n,r=!0,o=this.or.v,l=this.ir.v,h=this.os.v,d=this.is.v,u=2*Math.PI*o/(2*n),p=2*Math.PI*l/(2*n),m=-Math.PI/2;m+=this.r.v;var g=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<n;t+=1){i=r?h:d,s=r?u:p;var b=(e=r?o:l)*Math.cos(m),f=e*Math.sin(m),v=0===b&&0===f?0:f/Math.sqrt(b*b+f*f),y=0===b&&0===f?0:-b/Math.sqrt(b*b+f*f);b+=+this.p.v[0],f+=+this.p.v[1],this.v.setTripleAt(b,f,b-v*s*i*g,f-y*s*i*g,b+v*s*i*g,f+y*s*i*g,t,!0),r=!r,m+=a*g}},convertPolygonToPath:function convertPolygonToPath(){var t,e=Math.floor(this.pt.v),i=2*Math.PI/e,s=this.or.v,n=this.os.v,a=2*Math.PI*s/(4*e),r=.5*-Math.PI,o=3===this.data.d?-1:1;for(r+=this.r.v,this.v._length=0,t=0;t<e;t+=1){var l=s*Math.cos(r),h=s*Math.sin(r),d=0===l&&0===h?0:h/Math.sqrt(l*l+h*h),u=0===l&&0===h?0:-l/Math.sqrt(l*l+h*h);l+=+this.p.v[0],h+=+this.p.v[1],this.v.setTripleAt(l,h,l-d*a*n*o,h-u*a*n*o,l+d*a*n*o,h+u*a*n*o,t,!0),r+=i*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],StarShapePropertyFactory),StarShapePropertyFactory}(),s=function(){function RectShapePropertyFactory(t,e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return RectShapePropertyFactory.prototype={convertRectToPath:function convertRectToPath(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,s=this.s.v[1]/2,n=bmMin(i,s,this.r.v),a=n*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-s+n,t+i,e-s+n,t+i,e-s+a,0,!0),this.v.setTripleAt(t+i,e+s-n,t+i,e+s-a,t+i,e+s-n,1,!0),0!==n?(this.v.setTripleAt(t+i-n,e+s,t+i-n,e+s,t+i-a,e+s,2,!0),this.v.setTripleAt(t-i+n,e+s,t-i+a,e+s,t-i+n,e+s,3,!0),this.v.setTripleAt(t-i,e+s-n,t-i,e+s-n,t-i,e+s-a,4,!0),this.v.setTripleAt(t-i,e-s+n,t-i,e-s+a,t-i,e-s+n,5,!0),this.v.setTripleAt(t-i+n,e-s,t-i+n,e-s,t-i+a,e-s,6,!0),this.v.setTripleAt(t+i-n,e-s,t+i-a,e-s,t+i-n,e-s,7,!0)):(this.v.setTripleAt(t-i,e+s,t-i+a,e+s,t-i,e+s,2),this.v.setTripleAt(t-i,e-s,t-i,e-s+a,t-i,e-s,3))):(this.v.setTripleAt(t+i,e-s+n,t+i,e-s+a,t+i,e-s+n,0,!0),0!==n?(this.v.setTripleAt(t+i-n,e-s,t+i-n,e-s,t+i-a,e-s,1,!0),this.v.setTripleAt(t-i+n,e-s,t-i+a,e-s,t-i+n,e-s,2,!0),this.v.setTripleAt(t-i,e-s+n,t-i,e-s+n,t-i,e-s+a,3,!0),this.v.setTripleAt(t-i,e+s-n,t-i,e+s-a,t-i,e+s-n,4,!0),this.v.setTripleAt(t-i+n,e+s,t-i+n,e+s,t-i+a,e+s,5,!0),this.v.setTripleAt(t+i-n,e+s,t+i-a,e+s,t+i-n,e+s,6,!0),this.v.setTripleAt(t+i,e+s-n,t+i,e+s-n,t+i,e+s-a,7,!0)):(this.v.setTripleAt(t-i,e-s,t-i+a,e-s,t-i,e-s,1,!0),this.v.setTripleAt(t-i,e+s,t-i,e+s-a,t-i,e+s,2,!0),this.v.setTripleAt(t+i,e+s,t+i-a,e+s,t+i,e+s,3,!0)))},getValue:function getValue(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:resetShape},extendPrototype([DynamicPropertyContainer],RectShapePropertyFactory),RectShapePropertyFactory}(),n={getShapeProp:function getShapeProp(t,n,a){var r;return 3===a||4===a?r=(3===a?n.pt:n.ks).k.length?new KeyframedShapeProperty(t,n,a):new ShapeProperty(t,n,a):5===a?r=new s(t,n):6===a?r=new e(t,n):7===a&&(r=new i(t,n)),r.k&&t.addDynamicProperty(r),r},getConstructorFunction:function getConstructorFunction(){return ShapeProperty},getKeyframedConstructorFunction:function getKeyframedConstructorFunction(){return KeyframedShapeProperty}};return n}(),Matrix=function(){var t=Math.cos,e=Math.sin,i=Math.tan,s=Math.round;function reset(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function rotate(i){if(0===i)return this;var s=t(i),n=e(i);return this._t(s,-n,0,0,n,s,0,0,0,0,1,0,0,0,0,1)}function rotateX(i){if(0===i)return this;var s=t(i),n=e(i);return this._t(1,0,0,0,0,s,-n,0,0,n,s,0,0,0,0,1)}function rotateY(i){if(0===i)return this;var s=t(i),n=e(i);return this._t(s,0,n,0,0,1,0,0,-n,0,s,0,0,0,0,1)}function rotateZ(i){if(0===i)return this;var s=t(i),n=e(i);return this._t(s,-n,0,0,n,s,0,0,0,0,1,0,0,0,0,1)}function shear(t,e){return this._t(1,e,t,1,0,0)}function skew(t,e){return this.shear(i(t),i(e))}function skewFromAxis(s,n){var a=t(n),r=e(n);return this._t(a,r,0,0,-r,a,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,i(s),1,0,0,0,0,1,0,0,0,0,1)._t(a,-r,0,0,r,a,0,0,0,0,1,0,0,0,0,1)}function scale(t,e,i){return i||0===i||(i=1),1===t&&1===e&&1===i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}function setTransform(t,e,i,s,n,a,r,o,l,h,d,u,p,m,g,b){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=s,this.props[4]=n,this.props[5]=a,this.props[6]=r,this.props[7]=o,this.props[8]=l,this.props[9]=h,this.props[10]=d,this.props[11]=u,this.props[12]=p,this.props[13]=m,this.props[14]=g,this.props[15]=b,this}function translate(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}function transform(t,e,i,s,n,a,r,o,l,h,d,u,p,m,g,b){var f=this.props;if(1===t&&0===e&&0===i&&0===s&&0===n&&1===a&&0===r&&0===o&&0===l&&0===h&&1===d&&0===u)return f[12]=f[12]*t+f[15]*p,f[13]=f[13]*a+f[15]*m,f[14]=f[14]*d+f[15]*g,f[15]*=b,this._identityCalculated=!1,this;var v=f[0],y=f[1],E=f[2],S=f[3],w=f[4],_=f[5],x=f[6],k=f[7],L=f[8],P=f[9],T=f[10],D=f[11],I=f[12],$=f[13],M=f[14],N=f[15];return f[0]=v*t+y*n+E*l+S*p,f[1]=v*e+y*a+E*h+S*m,f[2]=v*i+y*r+E*d+S*g,f[3]=v*s+y*o+E*u+S*b,f[4]=w*t+_*n+x*l+k*p,f[5]=w*e+_*a+x*h+k*m,f[6]=w*i+_*r+x*d+k*g,f[7]=w*s+_*o+x*u+k*b,f[8]=L*t+P*n+T*l+D*p,f[9]=L*e+P*a+T*h+D*m,f[10]=L*i+P*r+T*d+D*g,f[11]=L*s+P*o+T*u+D*b,f[12]=I*t+$*n+M*l+N*p,f[13]=I*e+$*a+M*h+N*m,f[14]=I*i+$*r+M*d+N*g,f[15]=I*s+$*o+M*u+N*b,this._identityCalculated=!1,this}function multiply(t){var e=t.props;return this.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function isIdentity(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function equals(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function clone(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function cloneFromProps(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function applyToPoint(t,e,i){return{x:t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}}function applyToX(t,e,i){return t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12]}function applyToY(t,e,i){return t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13]}function applyToZ(t,e,i){return t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}function getInverseMatrix(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,i=-this.props[1]/t,s=-this.props[4]/t,n=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,r=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=i,o.props[4]=s,o.props[5]=n,o.props[12]=a,o.props[13]=r,o}function inversePoint(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function inversePoints(t){var e,i=t.length,s=[];for(e=0;e<i;e+=1)s[e]=inversePoint(t[e]);return s}function applyToTriplePoints(t,e,i){var s=createTypedArray("float32",6);if(this.isIdentity())s[0]=t[0],s[1]=t[1],s[2]=e[0],s[3]=e[1],s[4]=i[0],s[5]=i[1];else{var n=this.props[0],a=this.props[1],r=this.props[4],o=this.props[5],l=this.props[12],h=this.props[13];s[0]=t[0]*n+t[1]*r+l,s[1]=t[0]*a+t[1]*o+h,s[2]=e[0]*n+e[1]*r+l,s[3]=e[0]*a+e[1]*o+h,s[4]=i[0]*n+i[1]*r+l,s[5]=i[0]*a+i[1]*o+h}return s}function applyToPointArray(t,e,i){return this.isIdentity()?[t,e,i]:[t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]]}function applyToPointStringified(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}function toCSS(){for(var t=0,e=this.props,i="matrix3d(";t<16;)i+=s(1e4*e[t])/1e4,i+=15===t?")":",",t+=1;return i}function roundMatrixProperty(t){return t<1e-6&&t>0||t>-1e-6&&t<0?s(1e4*t)/1e4:t}function to2dCSS(){var t=this.props;return"matrix("+roundMatrixProperty(t[0])+","+roundMatrixProperty(t[1])+","+roundMatrixProperty(t[4])+","+roundMatrixProperty(t[5])+","+roundMatrixProperty(t[12])+","+roundMatrixProperty(t[13])+")"}return function(){this.reset=reset,this.rotate=rotate,this.rotateX=rotateX,this.rotateY=rotateY,this.rotateZ=rotateZ,this.skew=skew,this.skewFromAxis=skewFromAxis,this.shear=shear,this.scale=scale,this.setTransform=setTransform,this.translate=translate,this.transform=transform,this.multiply=multiply,this.applyToPoint=applyToPoint,this.applyToX=applyToX,this.applyToY=applyToY,this.applyToZ=applyToZ,this.applyToPointArray=applyToPointArray,this.applyToTriplePoints=applyToTriplePoints,this.applyToPointStringified=applyToPointStringified,this.toCSS=toCSS,this.to2dCSS=to2dCSS,this.clone=clone,this.cloneFromProps=cloneFromProps,this.equals=equals,this.inversePoints=inversePoints,this.inversePoint=inversePoint,this.getInverseMatrix=getInverseMatrix,this._t=this.transform,this.isIdentity=isIdentity,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(t){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(t){setSubframeEnabled(t)}function setPrefix(t){setIdPrefix(t)}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(t)&&t>1&&setDefaultCurveSegments(t)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&setExpressionsPlugin(e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i<e.length;i+=1){var s=e[i].split("=");if(decodeURIComponent(s[0])==t)return decodeURIComponent(s[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";var queryString="",scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer");var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports)&&(window.bodymovin=lottie)}catch(t){}var ShapeModifiers=function(){var t={},e={};return t.registerModifier=function registerModifier(t,i){e[t]||(e[t]=i)},t.getModifier=function getModifier(t,i,s){return new e[t](i,s)},t}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,n){var a=[];e<=1?a.push({s:t,e:e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var r,o,l=[],h=a.length;for(r=0;r<h;r+=1){var d,u;(o=a[r]).e*n<s||o.s*n>s+i||(d=o.s*n<=s?0:(o.s*n-s)/i,u=o.e*n>=s+i?1:(o.e*n-s)/i,l.push([d,u]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e<i;e+=1)segmentsLengthPool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,i,s,n;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),(e=this.s.v>1?1+a:this.s.v<0?0+a:this.s.v+a)>(i=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var r=e;e=i,i=r}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var o,l,h,d,u,p=this.shapes.length,m=0;if(i===e)for(n=0;n<p;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(n=0;n<p;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var g,b,f=[];for(n=0;n<p;n+=1)if((g=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(l=(s=g.shape.paths)._length,u=0,!g.shape._mdf&&g.pathsData.length)u=g.totalShapeLength;else{for(h=this.releasePathsData(g.pathsData),o=0;o<l;o+=1)d=bez.getSegmentsLength(s.shapes[o]),h.push(d),u+=d.totalLength;g.totalShapeLength=u,g.pathsData=h}m+=u,g.shape._mdf=!0}else g.shape.paths=g.localShapeCollection;var v,y=e,E=i,S=0;for(n=p-1;n>=0;n-=1)if((g=this.shapes[n]).shape._mdf){for((b=g.localShapeCollection).releaseShapes(),2===this.m&&p>1?(v=this.calculateShapeEdges(e,i,g.totalShapeLength,S,m),S+=g.totalShapeLength):v=[[y,E]],l=v.length,o=0;o<l;o+=1){y=v[o][0],E=v[o][1],f.length=0,E<=1?f.push({s:g.totalShapeLength*y,e:g.totalShapeLength*E}):y>=1?f.push({s:g.totalShapeLength*(y-1),e:g.totalShapeLength*(E-1)}):(f.push({s:g.totalShapeLength*y,e:g.totalShapeLength}),f.push({s:0,e:g.totalShapeLength*(E-1)}));var w=this.addShapes(g,f[0]);if(f[0].s!==f[0].e){if(f.length>1)if(g.shape.paths.shapes[g.shape.paths._length-1].c){var _=w.pop();this.addPaths(w,b),w=this.addShapes(g,f[1],_)}else this.addPaths(w,b),w=this.addShapes(g,f[1]);this.addPaths(w,b)}}g.shape.paths=b}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)e.addShape(t[i])},TrimModifier.prototype.addSegment=function(t,e,i,s,n,a,r){n.setXYAt(e[0],e[1],"o",a),n.setXYAt(i[0],i[1],"i",a+1),r&&n.setXYAt(t[0],t[1],"v",a),n.setXYAt(s[0],s[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,i,s){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),s&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)},TrimModifier.prototype.addShapes=function(t,e,i){var s,n,a,r,o,l,h,d,u=t.pathsData,p=t.shape.paths.shapes,m=t.shape.paths._length,g=0,b=[],f=!0;for(i?(o=i._length,d=i._length):(i=shapePool.newElement(),o=0,d=0),b.push(i),s=0;s<m;s+=1){for(l=u[s].lengths,i.c=p[s].c,a=p[s].c?l.length:l.length+1,n=1;n<a;n+=1)if(g+(r=l[n-1]).addedLength<e.s)g+=r.addedLength,i.c=!1;else{if(g>e.e){i.c=!1;break}e.s<=g&&e.e>=g+r.addedLength?(this.addSegment(p[s].v[n-1],p[s].o[n-1],p[s].i[n],p[s].v[n],i,o,f),f=!1):(h=bez.getNewSegment(p[s].v[n-1],p[s].v[n],p[s].o[n-1],p[s].i[n],(e.s-g)/r.addedLength,(e.e-g)/r.addedLength,l[n-1]),this.addSegmentFromArray(h,i,o,f),f=!1,i.c=!1),g+=r.addedLength,o+=1}if(p[s].c&&l.length){if(r=l[n-1],g<=e.e){var v=l[n-1].addedLength;e.s<=g&&e.e>=g+v?(this.addSegment(p[s].v[n-1],p[s].o[n-1],p[s].i[0],p[s].v[0],i,o,f),f=!1):(h=bez.getNewSegment(p[s].v[n-1],p[s].v[0],p[s].o[n-1],p[s].i[0],(e.s-g)/v,(e.e-g)/v,l[n-1]),this.addSegmentFromArray(h,i,o,f),f=!1,i.c=!1)}else i.c=!1;g+=r.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[d][0],i.v[d][1],"i",d),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),g>e.e)break;s<m-1&&(i=shapePool.newElement(),f=!0,b.push(i),o=0)}return b},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var i=e/100,s=[0,0],n=t._length,a=0;for(a=0;a<n;a+=1)s[0]+=t.v[a][0],s[1]+=t.v[a][1];s[0]/=n,s[1]/=n;var r,o,l,h,d,u,p=shapePool.newElement();for(p.c=t.c,a=0;a<n;a+=1)r=t.v[a][0]+(s[0]-t.v[a][0])*i,o=t.v[a][1]+(s[1]-t.v[a][1])*i,l=t.o[a][0]+(s[0]-t.o[a][0])*-i,h=t.o[a][1]+(s[1]-t.o[a][1])*-i,d=t.i[a][0]+(s[0]-t.i[a][0])*-i,u=t.i[a][1]+(s[1]-t.i[a][1])*-i,p.setTripleAt(r,o,l,h,d,u,a);return p},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,i,s,n,a,r,o=this.shapes.length,l=this.amount.v;if(0!==l)for(i=0;i<o;i+=1){if(r=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||t)for(r.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,n=a.shape.paths._length,s=0;s<n;s+=1)r.addShape(this.processPath(e[s],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var t=[0,0];function TransformProperty(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var s,n=e.or.k.length;for(s=0;s<n;s+=1)e.or.k[s].to=null,e.or.k[s].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return TransformProperty.prototype={applyToMatrix:function applyToMatrix(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function processKeys(e){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||e){var i;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var s,n;if(i=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),n=this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),n=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(s=this.p.pv,n=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],n=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(s[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),s[1]=r.getValueAtTime((r.keyframes[0].t+.01)/i,0),n[0]=a.getValueAtTime(a.keyframes[0].t/i,0),n[1]=r.getValueAtTime(r.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(s[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),s[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/i,0),n[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),n[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/i,0)):(s=[a.pv,r.pv],n[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),n[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/i,r.offsetTime))}else s=n=t;this.v.rotate(-Math.atan2(s[1]-n[1],s[0]-n[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function precalculateMatrix(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function autoOrient(){}},extendPrototype([DynamicPropertyContainer],TransformProperty),TransformProperty.prototype.addDynamicProperty=function addDynamicProperty(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},TransformProperty.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function getTransformProperty(t,e,i){return new TransformProperty(t,e,i)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(t,e){return 1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e))}function floatZero(t){return Math.abs(t)<=1e-5}function lerp(t,e,i){return t*(1-i)+e*i}function lerpPoint(t,e,i){return[lerp(t[0],e[0],i),lerp(t[1],e[1],i)]}function quadRoots(t,e,i){if(0===t)return[];var s=e*e-4*t*i;if(s<0)return[];var n=-e/(2*t);if(0===s)return[n];var a=Math.sqrt(s)/(2*t);return[n-a,n+a]}function polynomialCoefficients(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function singlePoint(t){return new PolynomialBezier(t,t,t,t,!1)}function PolynomialBezier(t,e,i,s,n){n&&pointEqual(t,e)&&(e=lerpPoint(t,s,1/3)),n&&pointEqual(i,s)&&(i=lerpPoint(t,s,2/3));var a=polynomialCoefficients(t[0],e[0],i[0],s[0]),r=polynomialCoefficients(t[1],e[1],i[1],s[1]);this.a=[a[0],r[0]],this.b=[a[1],r[1]],this.c=[a[2],r[2]],this.d=[a[3],r[3]],this.points=[t,e,i,s]}function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var n=s;s=i,i=n}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),r=0;r<a.length;r+=1)if(a[r]>0&&a[r]<1){var o=t.point(a[r])[e];o<i?i=o:o>s&&(s=o)}return{min:i,max:s}}function intersectData(t,e,i){var s=t.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return[intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return 2*Math.abs(t.cx-e.cx)<t.width+e.width&&2*Math.abs(t.cy-e.cy)<t.height+e.height}function intersectsImpl(t,e,i,s,n,a){if(boxIntersect(t,e))if(i>=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s)n.push([t.t,e.t]);else{var r=splitData(t),o=splitData(e);intersectsImpl(r[0],o[0],i+1,s,n,a),intersectsImpl(r[0],o[1],i+1,s,n,a),intersectsImpl(r[1],o[0],i+1,s,n,a),intersectsImpl(r[1],o[1],i+1,s,n,a)}}function crossProduct(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var n=[t[0],t[1],1],a=[e[0],e[1],1],r=[i[0],i[1],1],o=[s[0],s[1],1],l=crossProduct(crossProduct(n,a),crossProduct(r,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(t,e,i){return[t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}function setPoint(t,e,i,s,n,a,r){var o=i-Math.PI/2,l=i+Math.PI/2,h=e[0]+Math.cos(i)*s*n,d=e[1]-Math.sin(i)*s*n;t.setTripleAt(h,d,h+Math.cos(o)*a,d-Math.sin(o)*a,h+Math.cos(l)*r,d-Math.sin(l)*r,t.length())}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=.5*-Math.PI;return[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]]}function getProjectingAngle(t,e){var i=0===e?t.length()-1:e-1,s=(e+1)%t.length(),n=getPerpendicularVector(t.v[i],t.v[s]);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,n,a,r){var o=getProjectingAngle(e,i),l=e.v[i%e._length],h=e.v[0===i?e._length-1:i-1],d=e.v[(i+1)%e._length],u=2===a?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0,p=2===a?Math.sqrt(Math.pow(l[0]-d[0],2)+Math.pow(l[1]-d[1],2)):0;setPoint(t,e.v[i%e._length],o,r,s,p/(2*(n+1)),u/(2*(n+1)))}function zigZagSegment(t,e,i,s,n,a){for(var r=0;r<s;r+=1){var o=(r+1)/(s+1),l=2===n?Math.sqrt(Math.pow(e.points[3][0]-e.points[0][0],2)+Math.pow(e.points[3][1]-e.points[0][1],2)):0,h=e.normalAngle(o);setPoint(t,e.point(o),h,a,i,l/(2*(s+1)),l/(2*(s+1))),a=-a}return a}function linearOffset(t,e,i){var s=Math.atan2(e[0]-t[0],e[1]-t[1]);return[polarOffset(t,s,i),polarOffset(e,s,i)]}function offsetSegment(t,e){var i,s,n,a,r,o,l;i=(l=linearOffset(t.points[0],t.points[1],e))[0],s=l[1],n=(l=linearOffset(t.points[1],t.points[2],e))[0],a=l[1],r=(l=linearOffset(t.points[2],t.points[3],e))[0],o=l[1];var h=lineIntersection(i,s,n,a);null===h&&(h=s);var d=lineIntersection(r,o,n,a);return null===d&&(d=r),new PolynomialBezier(i,h,d,o)}function joinLines(t,e,i,s,n){var a=e.points[3],r=i.points[0];if(3===s)return a;if(pointEqual(a,r))return a;if(2===s){var o=-e.tangentAngle(1),l=-i.tangentAngle(0)+Math.PI,h=lineIntersection(a,polarOffset(a,o+Math.PI/2,100),r,polarOffset(r,o+Math.PI/2,100)),d=h?pointDistance(h,a):pointDistance(a,r)/2,u=polarOffset(a,o,2*d*roundCorner);return t.setXYAt(u[0],u[1],"o",t.length()-1),u=polarOffset(r,l,2*d*roundCorner),t.setTripleAt(r[0],r[1],r[0],r[1],u[0],u[1],t.length()),r}var p=lineIntersection(pointEqual(a,e.points[2])?e.points[0]:e.points[2],a,r,pointEqual(r,i.points[1])?i.points[3]:i.points[1]);return p&&pointDistance(p,a)<n?(t.setTripleAt(p[0],p[1],p[0],p[1],p[0],p[1],t.length()),p):a}function getIntersection(t,e){var i=t.intersections(e);return i.length&&floatEqual(i[0][0],1)&&i.shift(),i.length?i[0]:null}function pruneSegmentIntersection(t,e){var i=t.slice(),s=e.slice(),n=getIntersection(t[t.length-1],e[0]);return n&&(i[t.length-1]=t[t.length-1].split(n[0])[0],s[0]=e[0].split(n[1])[1]),t.length>1&&e.length>1&&(n=getIntersection(t[0],e[e.length-1]))?[[t[0].split(n[0])[0]],[e[e.length-1].split(n[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i<t.length;i+=1)e=pruneSegmentIntersection(t[i-1],t[i]),t[i-1]=e[0],t[i]=e[1];return t.length>1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i,s,n,a,r=t.inflectionPoints();if(0===r.length)return[offsetSegment(t,e)];if(1===r.length||floatEqual(r[1],1))return i=(n=t.split(r[0]))[0],s=n[1],[offsetSegment(i,e),offsetSegment(s,e)];i=(n=t.split(r[0]))[0];var o=(r[1]-r[0])/(1-r[0]);return a=(n=n[1].split(o))[0],s=n[1],[offsetSegment(i,e),offsetSegment(a,e),offsetSegment(s,e)]}function OffsetPathModifier(){}function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],i="normal",s="normal",n=e.length,a=0;a<n;a+=1)switch(e[a].toLowerCase()){case"italic":s="italic";break;case"bold":i="700";break;case"black":i="900";break;case"medium":i="500";break;case"regular":case"normal":i="400";break;case"light":case"thin":i="200"}return{style:s,weight:t.fWeight||i}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,i,s,n,a){var r=a?-1:1,o=s.s.v[0]+(1-s.s.v[0])*(1-n),l=s.s.v[1]+(1-s.s.v[1])*(1-n);t.translate(s.p.v[0]*r*n,s.p.v[1]*r*n,s.p.v[2]),e.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),e.rotate(-s.r.v*r*n),e.translate(s.a.v[0],s.a.v[1],s.a.v[2]),i.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),i.scale(a?1/o:o,a?1/l:l),i.translate(s.a.v[0],s.a.v[1],s.a.v[2])},RepeaterModifier.prototype.init=function(t,e,i,s){for(this.elem=t,this.arr=e,this.pos=i,this.elemsData=s,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);i>0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,i,s,n,a,r=!1;if(this._mdf||t){var o,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes(),r=!0}for(a=0,s=0;s<=this._groups.length-1;s+=1){if(o=a<l,this._groups[s]._render=o,this.changeGroupRender(this._groups[s].it,o),!o){var d=this.elemsData[s].it,u=d[d.length-1];0!==u.transform.op.v?(u.transform.op._mdf=!0,u.transform.op.v=0):u.transform.op._mdf=!1}a+=1}this._currentCopies=l;var p=this.o.v,m=p%1,g=p>0?Math.floor(p):Math.ceil(p),b=this.pMatrix.props,f=this.rMatrix.props,v=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var y,E,S=0;if(p>0){for(;S<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),S+=1;m&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,m,!1),S+=m)}else if(p<0){for(;S>g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),S-=1;m&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-m,!0),S-=m)}for(s=1===this.data.m?0:this._currentCopies-1,n=1===this.data.m?1:-1,a=this._currentCopies;a;){if(E=(i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),0!==S){for((0!==s&&1===n||s!==this._currentCopies-1&&-1===n)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),this.matrix.transform(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15]),y=0;y<E;y+=1)i[y]=this.matrix.props[y];this.matrix.reset()}else for(this.matrix.reset(),y=0;y<E;y+=1)i[y]=this.matrix.props[y];S+=1,a-=1,s+=n}}else for(a=this._currentCopies,s=0,n=1;a;)i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=n;return r},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var i,s=shapePool.newElement();s.c=t.c;var n,a,r,o,l,h,d,u,p,m,g,b,f=t._length,v=0;for(i=0;i<f;i+=1)n=t.v[i],r=t.o[i],a=t.i[i],n[0]===r[0]&&n[1]===r[1]&&n[0]===a[0]&&n[1]===a[1]?0!==i&&i!==f-1||t.c?(o=0===i?t.v[f-1]:t.v[i-1],h=(l=Math.sqrt(Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)))?Math.min(l/2,e)/l:0,d=g=n[0]+(o[0]-n[0])*h,u=b=n[1]-(n[1]-o[1])*h,p=d-(d-n[0])*roundCorner,m=u-(u-n[1])*roundCorner,s.setTripleAt(d,u,p,m,g,b,v),v+=1,o=i===f-1?t.v[0]:t.v[i+1],h=(l=Math.sqrt(Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)))?Math.min(l/2,e)/l:0,d=p=n[0]+(o[0]-n[0])*h,u=m=n[1]+(o[1]-n[1])*h,g=d-(d-n[0])*roundCorner,b=u-(u-n[1])*roundCorner,s.setTripleAt(d,u,p,m,g,b,v),v+=1):(s.setTripleAt(n[0],n[1],r[0],r[1],a[0],a[1],v),v+=1):(s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],v),v+=1);return s},RoundCornersModifier.prototype.processShapes=function(t){var e,i,s,n,a,r,o=this.shapes.length,l=this.rd.v;if(0!==l)for(i=0;i<o;i+=1){if(r=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||t)for(r.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,n=a.shape.paths._length,s=0;s<n;s+=1)r.addShape(this.processPath(e[s],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(t){return[((this.a[0]*t+this.b[0])*t+this.c[0])*t+this.d[0],((this.a[1]*t+this.b[1])*t+this.c[1])*t+this.d[1]]},PolynomialBezier.prototype.derivative=function(t){return[(3*t*this.a[0]+2*this.b[0])*t+this.c[0],(3*t*this.a[1]+2*this.b[1])*t+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(t){var e=this.derivative(t);return Math.atan2(e[1],e[0])},PolynomialBezier.prototype.normalAngle=function(t){var e=this.derivative(t);return Math.atan2(e[0],e[1])},PolynomialBezier.prototype.inflectionPoints=function(){var t=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(t))return[];var e=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/t,i=e*e-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/t;if(i<0)return[];var s=Math.sqrt(i);return floatZero(s)?s>0&&s<1?[e]:[]:[e-s,e+s].filter(function(t){return t>0&&t<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return[singlePoint(this.points[0]),this];if(t>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),n=lerpPoint(e,i,t),a=lerpPoint(i,s,t),r=lerpPoint(n,a,t);return[new PolynomialBezier(this.points[0],e,n,r,!0),new PolynomialBezier(r,a,s,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return{left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}},PolynomialBezier.prototype.intersections=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(t,e,i,s){var n=t._length,a=shapePool.newElement();if(a.c=t.c,t.c||(n-=1),0===n)return a;var r=-1,o=PolynomialBezier.shapeSegment(t,0);zigZagCorner(a,t,0,e,i,s,r);for(var l=0;l<n;l+=1)r=zigZagSegment(a,o,e,i,s,-r),o=l!==n-1||t.c?PolynomialBezier.shapeSegment(t,(l+1)%n):null,zigZagCorner(a,t,l+1,e,i,s,r);return a},ZigZagModifier.prototype.processShapes=function(t){var e,i,s,n,a,r,o=this.shapes.length,l=this.amplitude.v,h=Math.max(0,Math.round(this.frequency.v)),d=this.pointsType.v;if(0!==l)for(i=0;i<o;i+=1){if(r=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||t)for(r.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,n=a.shape.paths._length,s=0;s<n;s+=1)r.addShape(this.processPath(e[s],l,h,d));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var n=shapePool.newElement();n.c=t.c;var a,r,o,l=t.length();t.c||(l-=1);var h=[];for(a=0;a<l;a+=1)o=PolynomialBezier.shapeSegment(t,a),h.push(offsetSegmentSplit(o,e));if(!t.c)for(a=l-1;a>=0;a-=1)o=PolynomialBezier.shapeSegmentInverted(t,a),h.push(offsetSegmentSplit(o,e));h=pruneIntersections(h);var d=null,u=null;for(a=0;a<h.length;a+=1){var p=h[a];for(u&&(d=joinLines(n,u,p[0],i,s)),u=p[p.length-1],r=0;r<p.length;r+=1)o=p[r],d&&pointEqual(o.points[0],d)?n.setXYAt(o.points[1][0],o.points[1][1],"o",n.length()-1):n.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],n.length()),n.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],n.length()),d=o.points[3]}return h.length&&joinLines(n,u,h[0][0],i,s),n},OffsetPathModifier.prototype.processShapes=function(t){var e,i,s,n,a,r,o=this.shapes.length,l=this.amount.v,h=this.miterLimit.v,d=this.lineJoin;if(0!==l)for(i=0;i<o;i+=1){if(r=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||t)for(r.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,n=a.shape.paths._length,s=0;s<n;s+=1)r.addShape(this.processPath(e[s],l,d,h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var t={w:0,size:0,shapes:[],data:{shapes:[]}},e=[];e=e.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var i=127988,s=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function setUpNode(t,e){var i=createTag("span");i.setAttribute("aria-hidden",!0),i.style.fontFamily=e;var s=createTag("span");s.innerText="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(s),document.body.appendChild(i);var n=s.offsetWidth;return s.style.fontFamily=function trimFontOptions(t){var e,i=t.split(","),s=i.length,n=[];for(e=0;e<s;e+=1)"sans-serif"!==i[e]&&"monospace"!==i[e]&&n.push(i[e]);return n.join(",")}(t)+", "+e,{node:s,w:n,parent:i}}function createHelper(t,e){var i,s=document.body&&e?"svg":"canvas",n=getFontProperties(t);if("svg"===s){var a=createNS("text");a.style.fontSize="100px",a.setAttribute("font-family",t.fFamily),a.setAttribute("font-style",n.style),a.setAttribute("font-weight",n.weight),a.textContent="1",t.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",t.fClass)):a.style.fontFamily=t.fFamily,e.appendChild(a),i=a}else{var r=new OffscreenCanvas(500,500).getContext("2d");r.font=n.style+" "+n.weight+" 100px "+t.fFamily,i=r}return{measureText:function measure(t){return"svg"===s?(i.textContent=t,i.getComputedTextLength()):i.measureText(t).width}}}function getCodePoint(t){var e=0,i=t.charCodeAt(0);if(i>=55296&&i<=56319){var s=t.charCodeAt(1);s>=56320&&s<=57343&&(e=1024*(i-55296)+s-56320+65536)}return e}function isRegionalCode(t){var e=getCodePoint(t);return e>=127462&&e<=127487}var n=function Font(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};n.isModifier=function isModifier(t,e){var i=t.toString(16)+e.toString(16);return-1!==s.indexOf(i)},n.isZeroWidthJoiner=function isZeroWidthJoiner(t){return 8205===t},n.isFlagEmoji=function isFlagEmoji(t){return isRegionalCode(t.substr(0,2))&&isRegionalCode(t.substr(2,2))},n.isRegionalCode=isRegionalCode,n.isCombinedCharacter=function isCombinedCharacter(t){return-1!==e.indexOf(t)},n.isRegionalFlag=function isRegionalFlag(t,e){var s=getCodePoint(t.substr(e,2));if(s!==i)return!1;var n=0;for(e+=2;n<5;){if((s=getCodePoint(t.substr(e,2)))<917601||s>917626)return!1;n+=1,e+=2}return 917631===getCodePoint(t.substr(e,2))},n.isVariationSelector=function isVariationSelector(t){return 65039===t},n.BLACK_FLAG_CODE_POINT=i;var a={addChars:function addChars(t){if(t){var e;this.chars||(this.chars=[]);var i,s,n=t.length,a=this.chars.length;for(e=0;e<n;e+=1){for(i=0,s=!1;i<a;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(s=!0),i+=1;s||(this.chars.push(t[e]),a+=1)}}},addFonts:function addFonts(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);if(!document.body)return this.isLoaded=!0,t.list.forEach(function(t){t.helper=createHelper(t),t.cache={}}),void(this.fonts=t.list);var i,s=t.list,n=s.length,a=n;for(i=0;i<n;i+=1){var r,o,l=!0;if(s[i].loaded=!1,s[i].monoCase=setUpNode(s[i].fFamily,"monospace"),s[i].sansCase=setUpNode(s[i].fFamily,"sans-serif"),s[i].fPath){if("p"===s[i].fOrigin||3===s[i].origin){if((r=document.querySelectorAll('style[f-forigin="p"][f-family="'+s[i].fFamily+'"], style[f-origin="3"][f-family="'+s[i].fFamily+'"]')).length>0&&(l=!1),l){var h=createTag("style");h.setAttribute("f-forigin",s[i].fOrigin),h.setAttribute("f-origin",s[i].origin),h.setAttribute("f-family",s[i].fFamily),h.type="text/css",h.innerText="@font-face {font-family: "+s[i].fFamily+"; font-style: normal; src: url('"+s[i].fPath+"');}",e.appendChild(h)}}else if("g"===s[i].fOrigin||1===s[i].origin){for(r=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<r.length;o+=1)-1!==r[o].href.indexOf(s[i].fPath)&&(l=!1);if(l){var d=createTag("link");d.setAttribute("f-forigin",s[i].fOrigin),d.setAttribute("f-origin",s[i].origin),d.type="text/css",d.rel="stylesheet",d.href=s[i].fPath,document.body.appendChild(d)}}else if("t"===s[i].fOrigin||2===s[i].origin){for(r=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<r.length;o+=1)s[i].fPath===r[o].src&&(l=!1);if(l){var u=createTag("link");u.setAttribute("f-forigin",s[i].fOrigin),u.setAttribute("f-origin",s[i].origin),u.setAttribute("rel","stylesheet"),u.setAttribute("href",s[i].fPath),e.appendChild(u)}}}else s[i].loaded=!0,a-=1;s[i].helper=createHelper(s[i],e),s[i].cache={},this.fonts.push(s[i])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function getCharData(e,i,s){for(var n=0,a=this.chars.length;n<a;){if(this.chars[n].ch===e&&this.chars[n].style===i&&this.chars[n].fFamily===s)return this.chars[n];n+=1}return("string"==typeof e&&13!==e.charCodeAt(0)||!e)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",e,i,s)),t},getFontByName:function getFontByName(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function measureText(t,e,i){var s=this.getFontByName(e),n=t;if(!s.cache[n]){var a=s.helper;if(" "===t){var r=a.measureText("|"+t+"|"),o=a.measureText("||");s.cache[n]=(r-o)/100}else s.cache[n]=a.measureText(t)/100}return s.cache[n]*i},checkLoadedFonts:function checkLoadedFonts(){var t,e,i,s=this.fonts.length,n=s;for(t=0;t<s;t+=1)this.fonts[t].loaded?n-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,i=this.fonts[t].monoCase.w,e.offsetWidth!==i?(n-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,i=this.fonts[t].sansCase.w,e.offsetWidth!==i&&(n-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==n&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function setIsLoaded(){this.isLoaded=!0}};return n.prototype=a,n}();function SlotManager(t){this.animationData=t}function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t},RenderableElement.prototype={initRenderable:function initRenderable(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function addRenderableComponent(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function removeRenderableComponent(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function prepareRenderableFrame(t){this.checkLayerLimits(t)},checkTransparency:function checkTransparency(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function checkLayerLimits(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function renderRenderable(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function sourceRectAtTime(){return{top:0,left:0,width:100,height:100}},getLayerSize:function getLayerSize(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return blendModeEnums[t]||""}),blendModeEnums;function SliderEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function AngleEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function ColorEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function PointEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function LayerIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function MaskIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function CheckboxEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var i,s=t.ef||[];this.effectElements=[];var n,a=s.length;for(i=0;i<a;i+=1)n=new GroupEffect(s[i],e),this.effectElements.push(n)}function GroupEffect(t,e){this.init(t,e)}function BaseElement(){}function FrameElement(){}function FootageElement(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(t,e,i)}function AudioElement(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,i),this._isPlaying=!1,this._canPlay=!1;var s=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(s),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,t.au&&t.au.lv?t.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){var i;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var s,n=this.data.ef.length,a=this.data.ef;for(i=0;i<n;i+=1){switch(s=null,a[i].ty){case 0:s=new SliderEffect(a[i],e,this);break;case 1:s=new AngleEffect(a[i],e,this);break;case 2:s=new ColorEffect(a[i],e,this);break;case 3:s=new PointEffect(a[i],e,this);break;case 4:case 7:s=new CheckboxEffect(a[i],e,this);break;case 10:s=new LayerIndexEffect(a[i],e,this);break;case 11:s=new MaskIndexEffect(a[i],e,this);break;case 5:s=new EffectsManager(a[i],e);break;default:s=new NoValueEffect(a[i])}s&&this.effectElements.push(s)}},BaseElement.prototype={checkMasks:function checkMasks(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function initExpressions(){var t=getExpressionInterfaces();if(t){var e=t("layer"),i=t("effects"),s=t("shape"),n=t("text"),a=t("comp");this.layerInterface=e(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var r=i.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(r),0===this.data.ty||this.data.xt?this.compInterface=a(this):4===this.data.ty?(this.layerInterface.shapeInterface=s(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=n(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function setBlendMode(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function initBaseData(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function getType(){return this.type},sourceRectAtTime:function sourceRectAtTime(){}},FrameElement.prototype={initFrame:function initFrame(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function prepareProperties(t,e){var i,s=this.dynamicProperties.length;for(i=0;i<s;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function addDynamicProperty(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var t=getExpressionInterfaces();if(t){var e=t("footage");this.layerInterface=e(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}this._volume=this.lv.v[0];var i=this._volume*this._volumeMultiplier;this._previousVolume!==i&&(this._previousVolume=i,this.audio.volume(i))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(t){var e,i,s=this.layers.length;for(this.completeLayers=!0,e=s-1;e>=0;e-=1)this.elements[e]||(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var i,s=t.length,n=this.layers.length;for(e=0;e<s;e+=1)for(i=0;i<n;){if(this.layers[i].id===t[e].id){this.layers[i]=t[e];break}i+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,i){for(var s=this.elements,n=this.layers,a=0,r=n.length;a<r;)n[a].ind==e&&(s[a]&&!0!==s[a]?(i.push(s[a]),s[a].setAsParent(),void 0!==n[a].parent?this.buildElementParenting(t,n[a].parent,i):t.setHierarchy(i)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e]);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},BaseRenderer.prototype.getElementById=function(t){var e,i=this.elements.length;for(e=0;e<i;e+=1)if(this.elements[e].data.ind===t)return this.elements[e];return null},BaseRenderer.prototype.getElementByPath=function(t){var e,i=t.shift();if("number"==typeof i)e=this.elements[i];else{var s,n=this.elements.length;for(s=0;s<n;s+=1)if(this.elements[s].data.nm===i){e=this.elements[s];break}}return 0===t.length?e:e.getElementByPath(t)},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(t),this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}function MaskElement(t,e,i){this.data=t,this.element=e,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var s,n,a=this.globalData.defs,r=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(r),this.solidPath="";var o,l,h,d,u,p,m=this.masksProperties,g=0,b=[],f=createElementID(),v="clipPath",y="clip-path";for(s=0;s<r;s+=1)if(("a"!==m[s].mode&&"n"!==m[s].mode||m[s].inv||100!==m[s].o.k||m[s].o.x)&&(v="mask",y="mask"),"s"!==m[s].mode&&"i"!==m[s].mode||0!==g?h=null:((h=createNS("rect")).setAttribute("fill","#ffffff"),h.setAttribute("width",this.element.comp.data.w||0),h.setAttribute("height",this.element.comp.data.h||0),b.push(h)),n=createNS("path"),"n"===m[s].mode)this.viewData[s]={op:PropertyFactory.getProp(this.element,m[s].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,m[s],3),elem:n,lastPath:""},a.appendChild(n);else{var E;if(g+=1,n.setAttribute("fill","s"===m[s].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==m[s].x.k?(v="mask",y="mask",p=PropertyFactory.getProp(this.element,m[s].x,0,null,this.element),E=createElementID(),(d=createNS("filter")).setAttribute("id",E),(u=createNS("feMorphology")).setAttribute("operator","erode"),u.setAttribute("in","SourceGraphic"),u.setAttribute("radius","0"),d.appendChild(u),a.appendChild(d),n.setAttribute("stroke","s"===m[s].mode?"#000000":"#ffffff")):(u=null,p=null),this.storedData[s]={elem:n,x:p,expan:u,lastPath:"",lastOperator:"",filterId:E,lastRadius:0},"i"===m[s].mode){l=b.length;var S=createNS("g");for(o=0;o<l;o+=1)S.appendChild(b[o]);var w=createNS("mask");w.setAttribute("mask-type","alpha"),w.setAttribute("id",f+"_"+g),w.appendChild(n),a.appendChild(w),S.setAttribute("mask","url("+getLocationHref()+"#"+f+"_"+g+")"),b.length=0,b.push(S)}else b.push(n);m[s].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[s]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,m[s].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,m[s],3),invRect:h},this.viewData[s].prop.k||this.drawPath(m[s],this.viewData[s].prop.v,this.viewData[s])}for(this.maskElement=createNS(v),r=b.length,s=0;s<r;s+=1)this.maskElement.appendChild(b[s]);g>0&&(this.maskElement.setAttribute("id",f),this.element.maskedElement.setAttribute(y,"url("+getLocationHref()+"#"+f+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function initTransform(){var t=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:t,localMat:t,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function renderTransform(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,s=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<s;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<s;i+=1)e.multiply(this.hierarchy[i].finalTransform.mProp.v)}this.localTransforms&&!this.finalTransform._matMdf||(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function renderLocalTransform(){if(this.localTransforms){var t=0,e=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;t<e;)this.localTransforms[t]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[t]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),t+=1;if(this.finalTransform._localMatMdf){var i=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(i),t=1;t<e;t+=1){var s=this.localTransforms[t].matrix;i.multiply(s)}i.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var n=this.finalTransform.localOpacity;for(t=0;t<e;t+=1)n*=.01*this.localTransforms[t].opacity;this.finalTransform.localOpacity=n}}},searchEffectTransforms:function searchEffectTransforms(){if(this.renderableEffectsManager){var t=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(t.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var e=0,i=t.length;for(e=0;e<i;e+=1)this.localTransforms.push(t[e])}}},globalToLocal:function globalToLocal(t){var e=[];e.push(this.finalTransform);for(var i,s=!0,n=this.comp;s;)n.finalTransform?(n.data.hasMask&&e.splice(0,0,n.finalTransform),n=n.comp):s=!1;var a,r=e.length;for(i=0;i<r;i+=1)a=e[i].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,i=this.element.finalTransform.mat,s=this.masksProperties.length;for(e=0;e<s;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",i.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var n=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[e].filterId+")")),n.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,i){var s,n,a=" M"+e.v[0][0]+","+e.v[0][1];for(n=e._length,s=1;s<n;s+=1)a+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[s][0]+","+e.i[s][1]+" "+e.v[s][0]+","+e.v[s][1];if(e.c&&n>1&&(a+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==a){var r="";i.elem&&(e.c&&(r=t.inv?this.solidPath+a:a),i.elem.setAttribute("d",r)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var t={createFilter:function createFilter(t,e){var i=createNS("filter");return i.setAttribute("id",t),!0!==e&&(i.setAttribute("filterUnits","objectBoundingBox"),i.setAttribute("x","0%"),i.setAttribute("y","0%"),i.setAttribute("width","100%"),i.setAttribute("height","100%")),i},createAlphaToLuminanceFilter:function createAlphaToLuminanceFilter(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t}};return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i,s="SourceGraphic",n=t.data.ef?t.data.ef.length:0,a=createElementID(),r=filtersFactory.createFilter(a,!0),o=0;for(this.filters=[],e=0;e<n;e+=1){i=null;var l=t.data.ef[e].ty;registeredEffects$1[l]&&(i=new(0,registeredEffects$1[l].effect)(r,t.effectsManager.effectElements[e],t,idPrefix+o,s),s=idPrefix+o,registeredEffects$1[l].countsAsEffect&&(o+=1)),i&&this.filters.push(i)}o&&(t.globalData.defs.appendChild(r),t.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+a+")")),this.filters.length&&t.addRenderableComponent(this)}function registerEffect$1(t,e,i){registeredEffects$1[t]={effect:e,countsAsEffect:i}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.assetData&&this.assetData.sid&&(this.assetData=e.slotManager.getProp(this.assetData)),this.initElement(t,e,i),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(t,e){this.elem=t,this.pos=e}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)},SVGEffects.prototype.getEffects=function(t){var e,i=this.filters.length,s=[];for(e=0;e<i;e+=1)this.filters[e].type===t&&s.push(this.filters[e]);return s},SVGBaseElement.prototype={initRendererElement:function initRendererElement(){this.layerElement=createNS("g")},createContainerElements:function createContainerElements(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t=null;if(this.data.td){this.matteMasks={};var e=createNS("g");e.setAttribute("id",this.layerId),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var i=createNS("clipPath"),s=createNS("path");s.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var n=createElementID();if(i.setAttribute("id",n),i.appendChild(s),this.globalData.defs.appendChild(i),this.checkMasks()){var a=createNS("g");a.setAttribute("clip-path","url("+getLocationHref()+"#"+n+")"),a.appendChild(this.layerElement),this.transformedElement=a,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+n+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function renderElement(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function destroyBaseElement(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function getBaseElement(){return this.data.hd?null:this.baseElement},createRenderableComponents:function createRenderableComponents(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function getMatte(t){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[t]){var e,i,s,n,a=this.layerId+"_"+t;if(1===t||3===t){var r=createNS("mask");r.setAttribute("id",a),r.setAttribute("mask-type",3===t?"luminance":"alpha"),(s=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),r.appendChild(s),this.globalData.defs.appendChild(r),featureSupport.maskType||1!==t||(r.setAttribute("mask-type","luminance"),e=createElementID(),i=filtersFactory.createFilter(e),this.globalData.defs.appendChild(i),i.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(n=createNS("g")).appendChild(s),r.appendChild(n),n.setAttribute("filter","url("+getLocationHref()+"#"+e+")"))}else if(2===t){var o=createNS("mask");o.setAttribute("id",a),o.setAttribute("mask-type","alpha");var l=createNS("g");o.appendChild(l),e=createElementID(),i=filtersFactory.createFilter(e);var h=createNS("feComponentTransfer");h.setAttribute("in","SourceGraphic"),i.appendChild(h);var d=createNS("feFuncA");d.setAttribute("type","table"),d.setAttribute("tableValues","1.0 0.0"),h.appendChild(d),this.globalData.defs.appendChild(i);var u=createNS("rect");u.setAttribute("width",this.comp.data.w),u.setAttribute("height",this.comp.data.h),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("fill","#ffffff"),u.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+e+")"),l.appendChild(u),(s=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(s),featureSupport.maskType||(o.setAttribute("mask-type","luminance"),i.appendChild(filtersFactory.createAlphaToLuminanceFilter()),n=createNS("g"),l.appendChild(u),n.appendChild(this.layerElement),l.appendChild(n)),this.globalData.defs.appendChild(o)}this.matteMasks[t]=a}return this.matteMasks[t]},setMatte:function setMatte(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+t+")")}},HierarchyElement.prototype={initHierarchy:function initHierarchy(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function setHierarchy(t){this.hierarchy=t},setAsParent:function setAsParent(){this._isParent=!0},checkParenting:function checkParenting(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function initElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function hide(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function show(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function renderFrame(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function renderInnerContent(){},prepareFrame:function prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function destroy(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function addShapeToModifiers(t){var e,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function isShapeInAnimatedModifiers(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function renderModifiers(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;t>=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function searchProcessedElement(t){for(var e=this.processedElements,i=0,s=e.length;i<s;){if(e[i].elem===t)return e[i].pos;i+=1}return 0},addProcessedElement:function addProcessedElement(t,e){for(var i=this.processedElements,s=i.length;s;)if(i[s-=1].elem===t)return void(i[s].pos=e);i.push(new ProcessedElement(t,e))},prepareFrame:function prepareFrame(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var s=0,n=t.length;s<n;){if(t[s].mProps.dynamicProperties.length){this._isAnimated=!0;break}s+=1}}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(t,e,i,s){var n;this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(s);var a,r=e.length||0;for(n=0;n<r;n+=1)a=PropertyFactory.getProp(t,e[n].v,0,0,this),this.k=a.k||this.k,this.dataProps[n]={n:e[n].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i}function SVGNoStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.style=i}function GradientProperty(t,e,i){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var s=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",s),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=s,this.initDynamicPropertyContainer(i),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,i)}function SVGGradientStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,i),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(t,e,i){this.transform={mProps:t,op:e,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(t,e){for(var i=0,s=this.o.length/2;i<s;){if(Math.abs(t[4*i]-t[4*e+2*i])>.01)return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,i,s,n=4*this.data.p;for(e=0;e<n;e+=1)i=e%4==0?100:255,s=Math.round(this.prop.v[e]*i),this.c[e]!==s&&(this.c[e]=s,this._cmdf=!t);if(this.o.length)for(n=this.prop.v.length,e=4*this.data.p;e<n;e+=1)i=e%2==0?100:1,s=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==s&&(this.o[e-4*this.data.p]=s,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,i){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,e),this.setGradientOpacity(e,i),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var i=createElementID(),s=createNS(1===e.t?"linearGradient":"radialGradient");s.setAttribute("id",i),s.setAttribute("spreadMethod","pad"),s.setAttribute("gradientUnits","userSpaceOnUse");var n,a,r,o=[];for(r=4*e.g.p,a=0;a<r;a+=4)n=createNS("stop"),s.appendChild(n),o.push(n);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+i+")"),this.gf=s,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var i,s,n,a=createNS("mask"),r=createNS("path");a.appendChild(r);var o=createElementID(),l=createElementID();a.setAttribute("id",l);var h=createNS(1===t.t?"linearGradient":"radialGradient");h.setAttribute("id",o),h.setAttribute("spreadMethod","pad"),h.setAttribute("gradientUnits","userSpaceOnUse"),n=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var d=this.stops;for(s=4*t.g.p;s<n;s+=2)(i=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),h.appendChild(i),d.push(i);r.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),"gs"===t.ty&&(r.setAttribute("stroke-linecap",lineCapEnum[t.lc||2]),r.setAttribute("stroke-linejoin",lineJoinEnum[t.lj||2]),1===t.lj&&r.setAttribute("stroke-miterlimit",t.ml)),this.of=h,this.ms=a,this.ost=d,this.maskId=l,e.msElem=r}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function buildShapeString(t,e,i,s){if(0===e)return"";var n,a=t.o,r=t.i,o=t.v,l=" M"+s.applyToPointStringified(o[0][0],o[0][1]);for(n=1;n<e;n+=1)l+=" C"+s.applyToPointStringified(a[n-1][0],a[n-1][1])+" "+s.applyToPointStringified(r[n][0],r[n][1])+" "+s.applyToPointStringified(o[n][0],o[n][1]);return i&&e&&(l+=" C"+s.applyToPointStringified(a[n-1][0],a[n-1][1])+" "+s.applyToPointStringified(r[0][0],r[0][1])+" "+s.applyToPointStringified(o[0][0],o[0][1]),l+="z"),l},SVGElementsRenderer=function(){var t=new Matrix,e=new Matrix;function renderContentTransform(t,e,i){(i||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(i||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function renderNoop(){}function renderPath(i,s,n){var a,r,o,l,h,d,u,p,m,g,b=s.styles.length,f=s.lvl;for(d=0;d<b;d+=1){if(l=s.sh._mdf||n,s.styles[d].lvl<f){for(p=e.reset(),m=f-s.styles[d].lvl,g=s.transformers.length-1;!l&&m>0;)l=s.transformers[g].mProps._mdf||l,m-=1,g-=1;if(l)for(m=f-s.styles[d].lvl,g=s.transformers.length-1;m>0;)p.multiply(s.transformers[g].mProps.v),m-=1,g-=1}else p=t;if(r=(u=s.sh.paths)._length,l){for(o="",a=0;a<r;a+=1)(h=u.shapes[a])&&h._length&&(o+=buildShapeString(h,h._length,h.c,p));s.caches[d]=o}else o=s.caches[d];s.styles[d].d+=!0===i.hd?"":o,s.styles[d]._mdf=l||s.styles[d]._mdf}}function renderFill(t,e,i){var s=e.style;(e.c._mdf||i)&&s.pElem.setAttribute("fill","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("fill-opacity",e.o.v)}function renderGradientStroke(t,e,i){renderGradient(t,e,i),renderStroke(0,e,i)}function renderGradient(t,e,i){var s,n,a,r,o,l=e.gf,h=e.g._hasOpacity,d=e.s.v,u=e.e.v;if(e.o._mdf||i){var p="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(p,e.o.v)}if(e.s._mdf||i){var m=1===t.t?"x1":"cx",g="x1"===m?"y1":"cy";l.setAttribute(m,d[0]),l.setAttribute(g,d[1]),h&&!e.g._collapsable&&(e.of.setAttribute(m,d[0]),e.of.setAttribute(g,d[1]))}if(e.g._cmdf||i){s=e.cst;var b=e.g.c;for(a=s.length,n=0;n<a;n+=1)(r=s[n]).setAttribute("offset",b[4*n]+"%"),r.setAttribute("stop-color","rgb("+b[4*n+1]+","+b[4*n+2]+","+b[4*n+3]+")")}if(h&&(e.g._omdf||i)){var f=e.g.o;for(a=(s=e.g._collapsable?e.cst:e.ost).length,n=0;n<a;n+=1)r=s[n],e.g._collapsable||r.setAttribute("offset",f[2*n]+"%"),r.setAttribute("stop-opacity",f[2*n+1])}if(1===t.t)(e.e._mdf||i)&&(l.setAttribute("x2",u[0]),l.setAttribute("y2",u[1]),h&&!e.g._collapsable&&(e.of.setAttribute("x2",u[0]),e.of.setAttribute("y2",u[1])));else if((e.s._mdf||e.e._mdf||i)&&(o=Math.sqrt(Math.pow(d[0]-u[0],2)+Math.pow(d[1]-u[1],2)),l.setAttribute("r",o),h&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.s._mdf||e.e._mdf||e.h._mdf||e.a._mdf||i){o||(o=Math.sqrt(Math.pow(d[0]-u[0],2)+Math.pow(d[1]-u[1],2)));var v=Math.atan2(u[1]-d[1],u[0]-d[0]),y=e.h.v;y>=1?y=.99:y<=-1&&(y=-.99);var E=o*y,S=Math.cos(v+e.a.v)*E+d[0],w=Math.sin(v+e.a.v)*E+d[1];l.setAttribute("fx",S),l.setAttribute("fy",w),h&&!e.g._collapsable&&(e.of.setAttribute("fx",S),e.of.setAttribute("fy",w))}}function renderStroke(t,e,i){var s=e.style,n=e.d;n&&(n._mdf||i)&&n.dashStr&&(s.pElem.setAttribute("stroke-dasharray",n.dashStr),s.pElem.setAttribute("stroke-dashoffset",n.dashoffset[0])),e.c&&(e.c._mdf||i)&&s.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function createRenderFunction(t){switch(t.ty){case"fl":return renderFill;case"gf":return renderGradient;case"gs":return renderGradientStroke;case"st":return renderStroke;case"sh":case"el":case"rc":case"sr":return renderPath;case"tr":return renderContentTransform;case"no":return renderNoop;default:return null}}}}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function LetterProps(t,e,i,s,n,a){this.o=t,this.sw=e,this.sc=i,this.fc=s,this.m=n,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!s,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=t.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,i,s,n=this.shapes.length,a=this.stylesList.length,r=[],o=!1;for(i=0;i<a;i+=1){for(s=this.stylesList[i],o=!1,r.length=0,t=0;t<n;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(s)&&(r.push(e),o=e._isAnimated||o);r.length>1&&o&&this.setShapesAsAnimated(r)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var i,s=new SVGStyleData(t,e),n=s.pElem;return"st"===t.ty?i=new SVGStrokeStyleData(this,t,s):"fl"===t.ty?i=new SVGFillStyleData(this,t,s):"gf"===t.ty||"gs"===t.ty?(i=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,s),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),n.setAttribute("mask","url("+getLocationHref()+"#"+i.maskId+")"))):"no"===t.ty&&(i=new SVGNoStyleData(this,t,s)),"st"!==t.ty&&"gs"!==t.ty||(n.setAttribute("stroke-linecap",lineCapEnum[t.lc||2]),n.setAttribute("stroke-linejoin",lineJoinEnum[t.lj||2]),n.setAttribute("fill-opacity","0"),1===t.lj&&n.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&n.setAttribute("fill-rule","evenodd"),t.ln&&n.setAttribute("id",t.ln),t.cl&&n.setAttribute("class",t.cl),t.bm&&(n.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(s),this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var i=TransformPropertyFactory.getTransformProperty(this,t,this),s=new SVGTransformData(i,i.o,e);return this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.createShapeElement=function(t,e,i){var s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7);var n=new SVGShapeData(e,i,ShapePropertyFactory.getShapeProp(this,t,s,this));return this.shapes.push(n),this.addShapeToModifiers(n),this.addToAnimatedContents(t,n),n},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var i=0,s=this.animatedContents.length;i<s;){if(this.animatedContents[i].element===e)return;i+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,i=t.styles,s=this.stylesList.length;for(e=0;e<s;e+=1)-1!==i.indexOf(this.stylesList[e])||this.stylesList[e].closed||i.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,i,s,n,a,r){var o,l,h,d,u,p,m=[].concat(a),g=t.length-1,b=[],f=[];for(o=g;o>=0;o-=1){if((p=this.searchProcessedElement(t[o]))?e[o]=i[p-1]:t[o]._render=r,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty||"no"===t[o].ty)p?e[o].style.closed=t[o].hd:e[o]=this.createStyleElement(t[o],n),t[o]._render&&e[o].style.pElem.parentNode!==s&&s.appendChild(e[o].style.pElem),b.push(e[o].style);else if("gr"===t[o].ty){if(p)for(h=e[o].it.length,l=0;l<h;l+=1)e[o].prevViewData[l]=e[o].it[l];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,n+1,m,r),t[o]._render&&e[o].gr.parentNode!==s&&s.appendChild(e[o].gr)}else"tr"===t[o].ty?(p||(e[o]=this.createTransformElement(t[o],s)),d=e[o].transform,m.push(d)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(p||(e[o]=this.createShapeElement(t[o],m,n)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty||"zz"===t[o].ty||"op"===t[o].ty?(p?(u=e[o]).closed=!1:((u=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=u,this.shapeModifiers.push(u)),f.push(u)):"rp"===t[o].ty&&(p?(u=e[o]).closed=!0:(u=ShapeModifiers.getModifier(t[o].ty),e[o]=u,u.init(this,t,o,e),this.shapeModifiers.push(u),r=!1),f.push(u));this.addProcessedElement(t[o],o+1)}for(g=b.length,o=0;o<g;o+=1)b[o].closed=!0;for(g=f.length,o=0;o<g;o+=1)f[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,i=this.animatedContents.length;for(t=0;t<i;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(t,e,i,s,n,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var r=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,r=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,r=!0),this.sc!==i&&(this.sc=i,this._mdf.sc=!0,r=!0),this.fc!==s&&(this.fc=s,this._mdf.fc=!0,r=!0),this.m!==n&&(this.m=n,this._mdf.m=!0,r=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,this._mdf.p=!0,r=!0),r},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var s;this.lock=!0,this._mdf=!1;var n=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;s<n;s+=1)a=i!==this.keysIndex?this.effectsSequence[s](a,a.t):this.effectsSequence[s](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,i=0,s=t.length;i<=s-1&&!(i===s-1||t[i+1].t>e);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,i,s=[],n=0,a=t.length,r=!1,o=!1,l="";n<a;)r=o,o=!1,e=t.charCodeAt(n),l=t.charAt(n),FontManager.isCombinedCharacter(e)?r=!0:e>=55296&&e<=56319?FontManager.isRegionalFlag(t,n)?l=t.substr(n,14):(i=t.charCodeAt(n+1))>=56320&&i<=57343&&(FontManager.isModifier(e,i)?(l=t.substr(n,2),r=!0):l=FontManager.isFlagEmoji(t.substr(n,4))?t.substr(n,4):t.substr(n,2)):e>56319?(i=t.charCodeAt(n+1),FontManager.isVariationSelector(e)&&(r=!0)):FontManager.isZeroWidthJoiner(e)&&(r=!0,o=!0),r?(s[s.length-1]+=l,r=!1):s.push(l),n+=l.length;return s},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,i,s,n,a,r,o,l=this.elem.globalData.fontManager,h=this.data,d=[],u=0,p=h.m.g,m=0,g=0,b=0,f=[],v=0,y=0,E=l.getFontByName(t.f),S=0,w=getFontProperties(E);t.fWeight=w.weight,t.fStyle=w.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var _,x=t.tr/1e3*t.finalSize;if(t.sz)for(var k,L,P=!0,T=t.sz[0],D=t.sz[1];P;){k=0,v=0,i=(L=this.buildFinalText(t.t)).length,x=t.tr/1e3*t.finalSize;var I=-1;for(e=0;e<i;e+=1)_=L[e].charCodeAt(0),s=!1," "===L[e]?I=e:13!==_&&3!==_||(v=0,s=!0,k+=t.finalLineHeight||1.2*t.finalSize),l.chars?(o=l.getCharData(L[e],E.fStyle,E.fFamily),S=s?0:o.w*t.finalSize/100):S=l.measureText(L[e],t.f,t.finalSize),v+S>T&&" "!==L[e]?(-1===I?i+=1:e=I,k+=t.finalLineHeight||1.2*t.finalSize,L.splice(e,I===e?1:0,"\r"),I=-1,v=0):(v+=S,v+=x);k+=E.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&D<k?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=L,i=t.finalText.length,P=!1)}v=-x,S=0;var $,M=0;for(e=0;e<i;e+=1)if(s=!1,13===(_=($=t.finalText[e]).charCodeAt(0))||3===_?(M=0,f.push(v),y=v>y?v:y,v=-2*x,n="",s=!0,b+=1):n=$,l.chars?(o=l.getCharData($,E.fStyle,l.getFontByName(t.f).fFamily),S=s?0:o.w*t.finalSize/100):S=l.measureText(n,t.f,t.finalSize)," "===$?M+=S+x:(v+=S+x+M,M=0),d.push({l:S,an:S,add:m,n:s,anIndexes:[],val:n,line:b,animatorJustifyOffset:0}),2==p){if(m+=S,""===n||" "===n||e===i-1){for(""!==n&&" "!==n||(m-=S);g<=e;)d[g].an=m,d[g].ind=u,d[g].extra=S,g+=1;u+=1,m=0}}else if(3==p){if(m+=S,""===n||e===i-1){for(""===n&&(m-=S);g<=e;)d[g].an=m,d[g].ind=u,d[g].extra=S,g+=1;m=0,u+=1}}else d[u].ind=u,d[u].extra=0,u+=1;if(t.l=d,y=v>y?v:y,f.push(v),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=y,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=f;var N,F,z,R,O=h.a;r=O.length;var V=[];for(a=0;a<r;a+=1){for((N=O[a]).a.sc&&(t.strokeColorAnim=!0),N.a.sw&&(t.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(t.fillColorAnim=!0),R=0,z=N.s.b,e=0;e<i;e+=1)(F=d[e]).anIndexes[a]=R,(1==z&&""!==F.val||2==z&&""!==F.val&&" "!==F.val||3==z&&(F.n||" "==F.val||e==i-1)||4==z&&(F.n||e==i-1))&&(1===N.s.rn&&V.push(R),R+=1);h.a[a].s.totalChars=R;var H,G=-1;if(1===N.s.rn)for(e=0;e<i;e+=1)G!=(F=d[e]).anIndexes[a]&&(G=F.anIndexes[a],H=V.splice(Math.floor(Math.random()*V.length),1)[0]),F.anIndexes[a]=H}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=E.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var i=this.copyData({},this.data.d.k[e].s);i=this.copyData(i,t),this.data.d.k[e].s=i,this.recalculate(e),this.setCurrentData(i),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var t=Math.max,e=Math.min,i=Math.floor;function TextSelectorPropFactory(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(t,e.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return TextSelectorPropFactory.prototype={getMult:function getMult(s){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var n=0,a=0,r=1,o=1;this.ne.v>0?n=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?r=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(n,a,r,o).get,h=0,d=this.finalS,u=this.finalE,p=this.data.sh;if(2===p)h=l(h=u===d?s>=u?1:0:t(0,e(.5/(u-d)+(s-d)/(u-d),1)));else if(3===p)h=l(h=u===d?s>=u?0:1:1-t(0,e(.5/(u-d)+(s-d)/(u-d),1)));else if(4===p)u===d?h=0:(h=t(0,e(.5/(u-d)+(s-d)/(u-d),1)))<.5?h*=2:h=1-2*(h-.5),h=l(h);else if(5===p){if(u===d)h=0;else{var m=u-d,g=-m/2+(s=e(t(0,s+.5-d),u-d)),b=m/2;h=Math.sqrt(1-g*g/(b*b))}h=l(h)}else 6===p?(u===d?h=0:(s=e(t(0,s+.5-d),u-d),h=(1+Math.cos(Math.PI+2*Math.PI*s/(u-d)))/2),h=l(h)):(s>=i(d)&&(h=t(0,e(s-d<0?e(u,1)-(d-s):u-s,1))),h=l(h));if(100!==this.sm.v){var f=.01*this.sm.v;0===f&&(f=1e-8);var v=.5-.5*f;h<v?h=0:(h=(h-v)/f)>1&&(h=1)}return h*this.a.v},getValue:function getValue(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,s=this.s.v/e+i,n=this.e.v/e+i;if(s>n){var a=s;s=n,n=a}this.finalS=s,this.finalE=n}},extendPrototype([DynamicPropertyContainer],TextSelectorPropFactory),{getTextSelectorProp:function getTextSelectorProp(t,e,i){return new TextSelectorPropFactory(t,e)}}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},n=PropertyFactory.getProp,a=e.a;this.a={r:a.r?n(t,a.r,0,degToRads,i):s,rx:a.rx?n(t,a.rx,0,degToRads,i):s,ry:a.ry?n(t,a.ry,0,degToRads,i):s,sk:a.sk?n(t,a.sk,0,degToRads,i):s,sa:a.sa?n(t,a.sa,0,degToRads,i):s,s:a.s?n(t,a.s,1,.01,i):s,a:a.a?n(t,a.a,1,0,i):s,o:a.o?n(t,a.o,0,.01,i):s,p:a.p?n(t,a.p,1,0,i):s,sw:a.sw?n(t,a.sw,0,0,i):s,sc:a.sc?n(t,a.sc,1,0,i):s,fc:a.fc?n(t,a.fc,1,0,i):s,fh:a.fh?n(t,a.fh,0,0,i):s,fs:a.fs?n(t,a.fs,0,.01,i):s,fb:a.fb?n(t,a.fb,0,.01,i):s,t:a.t?n(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,s=PropertyFactory.getProp;for(t=0;t<i;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:s(this._elem,this._textData.p.a,0,0,this),f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),r:s(this._elem,this._textData.p.r,0,0,this),p:s(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,s,n,a,r,o,l,h,d,u,p,m,g,b,f,v,y,E,S,w=this._moreOptions.alignment.v,_=this._animatorsData,x=this._textData,k=this.mHelper,L=this._renderType,P=this.renderedLetters.length,T=t.l;if(this._hasMaskedPath){if(S=this._pathData.m,!this._pathData.n||this._pathData._mdf){var D,I=S.v;for(this._pathData.r.v&&(I=I.reverse()),r={tLength:0,segments:[]},a=I._length-1,v=0,n=0;n<a;n+=1)D=bez.buildBezierData(I.v[n],I.v[n+1],[I.o[n][0]-I.v[n][0],I.o[n][1]-I.v[n][1]],[I.i[n+1][0]-I.v[n+1][0],I.i[n+1][1]-I.v[n+1][1]]),r.tLength+=D.segmentLength,r.segments.push(D),v+=D.segmentLength;n=a,S.v.c&&(D=bez.buildBezierData(I.v[n],I.v[0],[I.o[n][0]-I.v[n][0],I.o[n][1]-I.v[n][1]],[I.i[0][0]-I.v[0][0],I.i[0][1]-I.v[0][1]]),r.tLength+=D.segmentLength,r.segments.push(D),v+=D.segmentLength),this._pathData.pi=r}if(r=this._pathData.pi,o=this._pathData.f.v,p=0,u=1,h=0,d=!0,b=r.segments,o<0&&S.v.c)for(r.tLength<Math.abs(o)&&(o=-Math.abs(o)%r.tLength),u=(g=b[p=b.length-1].points).length-1;o<0;)o+=g[u].partialLength,(u-=1)<0&&(u=(g=b[p-=1].points).length-1);m=(g=b[p].points)[u-1],f=(l=g[u]).partialLength}a=T.length,i=0,s=0;var $,M,N,F,z,R=1.2*t.finalSize*.714,O=!0;N=_.length;var V,H,G,q,j,W,U,Y,K,Z,J,X,Q=-1,tt=o,et=p,it=u,st=-1,nt="",at=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,ot=0,lt=2===t.j?-.5:-1,ht=0,ct=!0;for(n=0;n<a;n+=1)if(T[n].n){for(rt&&(rt+=ot);ht<n;)T[ht].animatorJustifyOffset=rt,ht+=1;rt=0,ct=!0}else{for(M=0;M<N;M+=1)($=_[M].a).t.propType&&(ct&&2===t.j&&(ot+=$.t.v*lt),(z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars)).length?rt+=$.t.v*z[0]*lt:rt+=$.t.v*z*lt);ct=!1}for(rt&&(rt+=ot);ht<n;)T[ht].animatorJustifyOffset=rt,ht+=1}for(n=0;n<a;n+=1){if(k.reset(),q=1,T[n].n)i=0,s+=t.yOffset,s+=O?1:0,o=tt,O=!1,this._hasMaskedPath&&(u=it,m=(g=b[p=et].points)[u-1],f=(l=g[u]).partialLength,h=0),nt="",J="",K="",X="",at=this.defaultPropsArray;else{if(this._hasMaskedPath){if(st!==T[n].line){switch(t.j){case 1:o+=v-t.lineWidths[T[n].line];break;case 2:o+=(v-t.lineWidths[T[n].line])/2}st=T[n].line}Q!==T[n].ind&&(T[Q]&&(o+=T[Q].extra),o+=T[n].an/2,Q=T[n].ind),o+=w[0]*T[n].an*.005;var dt=0;for(M=0;M<N;M+=1)($=_[M].a).p.propType&&((z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars)).length?dt+=$.p.v[0]*z[0]:dt+=$.p.v[0]*z),$.a.propType&&((z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars)).length?dt+=$.a.v[0]*z[0]:dt+=$.a.v[0]*z);for(d=!0,this._pathData.a.v&&(o=.5*T[0].an+(v-this._pathData.f.v-.5*T[0].an-.5*T[T.length-1].an)*Q/(a-1),o+=this._pathData.f.v);d;)h+f>=o+dt||!g?(y=(o+dt-h)/l.partialLength,H=m.point[0]+(l.point[0]-m.point[0])*y,G=m.point[1]+(l.point[1]-m.point[1])*y,k.translate(-w[0]*T[n].an*.005,-w[1]*R*.01),d=!1):g&&(h+=l.partialLength,(u+=1)>=g.length&&(u=0,b[p+=1]?g=b[p].points:S.v.c?(u=0,g=b[p=0].points):(h-=l.partialLength,g=null)),g&&(m=l,f=(l=g[u]).partialLength));V=T[n].an/2-T[n].add,k.translate(-V,0,0)}else V=T[n].an/2-T[n].add,k.translate(-V,0,0),k.translate(-w[0]*T[n].an*.005,-w[1]*R*.01,0);for(M=0;M<N;M+=1)($=_[M].a).t.propType&&(z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars),0===i&&0===t.j||(this._hasMaskedPath?z.length?o+=$.t.v*z[0]:o+=$.t.v*z:z.length?i+=$.t.v*z[0]:i+=$.t.v*z));for(t.strokeWidthAnim&&(W=t.sw||0),t.strokeColorAnim&&(j=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(U=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<N;M+=1)($=_[M].a).a.propType&&((z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars)).length?k.translate(-$.a.v[0]*z[0],-$.a.v[1]*z[1],$.a.v[2]*z[2]):k.translate(-$.a.v[0]*z,-$.a.v[1]*z,$.a.v[2]*z));for(M=0;M<N;M+=1)($=_[M].a).s.propType&&((z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars)).length?k.scale(1+($.s.v[0]-1)*z[0],1+($.s.v[1]-1)*z[1],1):k.scale(1+($.s.v[0]-1)*z,1+($.s.v[1]-1)*z,1));for(M=0;M<N;M+=1){if($=_[M].a,z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars),$.sk.propType&&(z.length?k.skewFromAxis(-$.sk.v*z[0],$.sa.v*z[1]):k.skewFromAxis(-$.sk.v*z,$.sa.v*z)),$.r.propType&&(z.length?k.rotateZ(-$.r.v*z[2]):k.rotateZ(-$.r.v*z)),$.ry.propType&&(z.length?k.rotateY($.ry.v*z[1]):k.rotateY($.ry.v*z)),$.rx.propType&&(z.length?k.rotateX($.rx.v*z[0]):k.rotateX($.rx.v*z)),$.o.propType&&(z.length?q+=($.o.v*z[0]-q)*z[0]:q+=($.o.v*z-q)*z),t.strokeWidthAnim&&$.sw.propType&&(z.length?W+=$.sw.v*z[0]:W+=$.sw.v*z),t.strokeColorAnim&&$.sc.propType)for(Y=0;Y<3;Y+=1)z.length?j[Y]+=($.sc.v[Y]-j[Y])*z[0]:j[Y]+=($.sc.v[Y]-j[Y])*z;if(t.fillColorAnim&&t.fc){if($.fc.propType)for(Y=0;Y<3;Y+=1)z.length?U[Y]+=($.fc.v[Y]-U[Y])*z[0]:U[Y]+=($.fc.v[Y]-U[Y])*z;$.fh.propType&&(U=z.length?addHueToRGB(U,$.fh.v*z[0]):addHueToRGB(U,$.fh.v*z)),$.fs.propType&&(U=z.length?addSaturationToRGB(U,$.fs.v*z[0]):addSaturationToRGB(U,$.fs.v*z)),$.fb.propType&&(U=z.length?addBrightnessToRGB(U,$.fb.v*z[0]):addBrightnessToRGB(U,$.fb.v*z))}}for(M=0;M<N;M+=1)($=_[M].a).p.propType&&(z=_[M].s.getMult(T[n].anIndexes[M],x.a[M].s.totalChars),this._hasMaskedPath?z.length?k.translate(0,$.p.v[1]*z[0],-$.p.v[2]*z[1]):k.translate(0,$.p.v[1]*z,-$.p.v[2]*z):z.length?k.translate($.p.v[0]*z[0],$.p.v[1]*z[1],-$.p.v[2]*z[2]):k.translate($.p.v[0]*z,$.p.v[1]*z,-$.p.v[2]*z));if(t.strokeWidthAnim&&(K=W<0?0:W),t.strokeColorAnim&&(Z="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),t.fillColorAnim&&t.fc&&(J="rgb("+Math.round(255*U[0])+","+Math.round(255*U[1])+","+Math.round(255*U[2])+")"),this._hasMaskedPath){if(k.translate(0,-t.ls),k.translate(0,w[1]*R*.01+s,0),this._pathData.p.v){E=(l.point[1]-m.point[1])/(l.point[0]-m.point[0]);var ut=180*Math.atan(E)/Math.PI;l.point[0]<m.point[0]&&(ut+=180),k.rotate(-ut*Math.PI/180)}k.translate(H,G,0),o-=w[0]*T[n].an*.005,T[n+1]&&Q!==T[n+1].ind&&(o+=T[n].an/2,o+=.001*t.tr*t.finalSize)}else{switch(k.translate(i,s,0),t.ps&&k.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:k.translate(T[n].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[n].line]),0,0);break;case 2:k.translate(T[n].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[n].line])/2,0,0)}k.translate(0,-t.ls),k.translate(V,0,0),k.translate(w[0]*T[n].an*.005,w[1]*R*.01,0),i+=T[n].l+.001*t.tr*t.finalSize}"html"===L?nt=k.toCSS():"svg"===L?nt=k.to2dCSS():at=[k.props[0],k.props[1],k.props[2],k.props[3],k.props[4],k.props[5],k.props[6],k.props[7],k.props[8],k.props[9],k.props[10],k.props[11],k.props[12],k.props[13],k.props[14],k.props[15]],X=q}P<=n?(F=new LetterProps(X,K,Z,J,nt,at),this.renderedLetters.push(F),P+=1,this.lettersChangedFlag=!0):(F=this.renderedLetters[n],this.lettersChangedFlag=F.update(X,K,Z,J,nt,at)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)},ITextElement.prototype.createPathShape=function(t,e){var i,s,n=e.length,a="";for(i=0;i<n;i+=1)"sh"===e[i].ty&&(s=e[i].ks.k,a+=buildShapeString(s,s.i.length,!0,t));return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,i,s,n){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(s,n,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(t,e,i){this.textSpans=[],this.renderType="svg",this.initElement(t,e,i)}function ISolidElement(t,e,i){this.initElement(t,e,i)}function NullElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initFrame(),this.initTransform(t,e,i),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(t,e,i){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var i="";if(e&&e.title){var s=createNS("title"),n=createElementID();s.setAttribute("id",n),s.textContent=e.title,this.svgElement.appendChild(s),i+=n}if(e&&e.description){var a=createNS("desc"),r=createElementID();a.setAttribute("id",r),a.textContent=e.description,this.svgElement.appendChild(a),i+=" "+r}i&&this.svgElement.setAttribute("aria-labelledby",i);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"},width:e&&e.width,height:e&&e.height,runExpressions:!e||void 0===e.runExpressions||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(t){for(var e=0,i=t.length,s=[],n="";e<i;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(s.push(n),n=""):n+=t[e],e+=1;return s.push(n),s},SVGTextLottieElement.prototype.buildShapeData=function(t,e){if(t.shapes&&t.shapes.length){var i=t.shapes[0];if(i.it){var s=i.it[i.it.length-1];s.s&&(s.s.k[0]=e,s.s.k[1]=e)}}return t},SVGTextLottieElement.prototype.buildNewText=function(){var t,e;this.addDynamicProperty(this);var i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var s=this.globalData.fontManager.getFontByName(i.f);if(s.fClass)this.layerElement.setAttribute("class",s.fClass);else{this.layerElement.setAttribute("font-family",s.fFamily);var n=i.fWeight,a=i.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",n)}this.layerElement.setAttribute("aria-label",i.t);var r,o=i.l||[],l=!!this.globalData.fontManager.chars;e=o.length;var h=this.mHelper,d=this.data.singleShape,u=0,p=0,m=!0,g=.001*i.tr*i.finalSize;if(!d||l||i.sz){var b,f=this.textSpans.length;for(t=0;t<e;t+=1){if(this.textSpans[t]||(this.textSpans[t]={span:null,childSpan:null,glyph:null}),!l||!d||0===t){if(r=f>t?this.textSpans[t].span:createNS(l?"g":"text"),f<=t){if(r.setAttribute("stroke-linecap","butt"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=r,l){var v=createNS("g");r.appendChild(v),this.textSpans[t].childSpan=v}this.textSpans[t].span=r,this.layerElement.appendChild(r)}r.style.display="inherit"}if(h.reset(),d&&(o[t].n&&(u=-g,p+=i.yOffset,p+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(i,h,o[t].line,u,p),u+=o[t].l||0,u+=g),l){var y;if(1===(b=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily)).t)y=new SVGCompElement(b.data,this.globalData,this);else{var E=emptyShapeData;b.data&&b.data.shapes&&(E=this.buildShapeData(b.data,i.finalSize)),y=new SVGShapeElement(E,this.globalData,this)}if(this.textSpans[t].glyph){var S=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(S.layerElement),S.destroy()}this.textSpans[t].glyph=y,y._debug=!0,y.prepareFrame(0),y.renderFrame(),this.textSpans[t].childSpan.appendChild(y.layerElement),1===b.t&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")")}else d&&r.setAttribute("transform","translate("+h.props[12]+","+h.props[13]+")"),r.textContent=o[t].val,r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}d&&r&&r.setAttribute("d","")}else{var w=this.textContainer,_="start";switch(i.j){case 1:_="end";break;case 2:_="middle";break;default:_="start"}w.setAttribute("text-anchor",_),w.setAttribute("letter-spacing",g);var x=this.buildTextContents(i.finalText);for(e=x.length,p=i.ps?i.ps[1]+i.ascent:0,t=0;t<e;t+=1)(r=this.textSpans[t].span||createNS("tspan")).textContent=x[t],r.setAttribute("x",0),r.setAttribute("y",p),r.style.display="inherit",w.appendChild(r),this.textSpans[t]||(this.textSpans[t]={span:null,glyph:null}),this.textSpans[t].span=r,p+=i.finalLineHeight;this.layerElement.appendChild(w)}for(;t<this.textSpans.length;)this.textSpans[t].span.style.display="none",t+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var t,e,i=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,t=0;t<i;t+=1)(e=this.textSpans[t].glyph)&&(e.prepareFrame(this.comp.renderedFrame-this.data.st),e._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var i,s,n,a=this.textAnimator.renderedLetters,r=this.textProperty.currentData.l;for(e=r.length,t=0;t<e;t+=1)r[t].n||(i=a[t],s=this.textSpans[t].span,(n=this.textSpans[t].glyph)&&n.renderFrame(),i._mdf.m&&s.setAttribute("transform",i.m),i._mdf.o&&s.setAttribute("opacity",i.o),i._mdf.sw&&s.setAttribute("stroke-width",i.sw),i._mdf.sc&&s.setAttribute("stroke",i.sc),i._mdf.fc&&s.setAttribute("fill",i.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRendererBase.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRendererBase.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},SVGRendererBase.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var i=createNS("clipPath"),s=createNS("rect");s.setAttribute("width",t.w),s.setAttribute("height",t.h),s.setAttribute("x",0),s.setAttribute("y",0);var n=createElementID();i.setAttribute("id",n),i.appendChild(s),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+n+")"),e.appendChild(i),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRendererBase.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(t){var e=0,i=this.layers.length;for(e=0;e<i;e+=1)if(this.layers[e].ind===t)return e;return-1},SVGRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var i=this.createItem(this.layers[t]);if(e[t]=i,getExpressionsPlugin()&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,t),this.layers[t].tt){var s="tp"in this.layers[t]?this.findIndexByInd(this.layers[t].tp):t-1;if(-1===s)return;if(this.elements[s]&&!0!==this.elements[s]){var n=e[s].getMatte(this.layers[t].tt);i.setMatte(n)}else this.buildItem(s),this.addPendingElement(i)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,i=this.elements.length;e<i;){if(this.elements[e]===t){var s="tp"in t.data?this.findIndexByInd(t.data.tp):e-1,n=this.elements[s].getMatte(this.layers[e].tt);t.setMatte(n);break}e+=1}}},SVGRendererBase.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=i-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<i;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){for(var s,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement()&&(s=this.elements[n].getBaseElement()),n+=1;s?this.layerElement.insertBefore(i,s):this.layerElement.appendChild(i)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i,s=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},ShapeTransformManager.prototype={addTransformSequence:function addTransformSequence(t){var e,i=t.length,s="_";for(e=0;e<i;e+=1)s+=t[e].transform.key+"_";var n=this.sequences[s];return n||(n={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[s]=n,this.sequenceList.push(n)),n},processSequence:function processSequence(t,e){for(var i=0,s=t.transforms.length,n=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){n=!0;break}i+=1}if(n)for(t.finalTransform.reset(),i=s-1;i>=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=n},processSequences:function processSequences(t){var e,i=this.sequenceList.length;for(e=0;e<i;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function getNewKey(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function lumaLoader(){var t="__lottie_element_luma_buffer",e=null,i=null,s=null;function loadLuma(){e||(s=function createLumaSvgFilter(){var e=createNS("svg"),i=createNS("filter"),s=createNS("feColorMatrix");return i.setAttribute("id",t),s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),i.appendChild(s),e.appendChild(i),e.setAttribute("id",t+"_svg"),featureSupport.svgLumaHidden&&(e.style.display="none"),e}(),document.body.appendChild(s),e=createTag("canvas"),(i=e.getContext("2d")).filter="url(#"+t+")",i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1))}return{load:loadLuma,get:function getLuma(s){return e||loadLuma(),e.width=s.width,e.height=s.height,i.filter="url(#"+t+")",e}}};function createCanvas(t,e){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(t,e);var i=createTag("canvas");return i.width=t,i.height=e,i}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas:createCanvas},registeredEffects={};function CVEffects(t){var e,i,s=t.data.ef?t.data.ef.length:0;for(this.filters=[],e=0;e<s;e+=1){i=null;var n=t.data.ef[e].ty;registeredEffects[n]&&(i=new(0,registeredEffects[n].effect)(t.effectsManager.effectElements[e],t)),i&&this.filters.push(i)}this.filters.length&&t.addRenderableComponent(this)}function registerEffect(t,e){registeredEffects[t]={effect:e}}function CVMaskElement(t,e){var i;this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var s=this.masksProperties.length,n=!1;for(i=0;i<s;i+=1)"n"!==this.masksProperties[i].mode&&(n=!0),this.viewData[i]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);this.hasMasks=n,n&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)},CVEffects.prototype.getEffects=function(t){var e,i=this.filters.length,s=[];for(e=0;e<i;e+=1)this.filters[e].type===t&&s.push(this.filters[e]);return s},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,i,s,n=this.element.finalTransform.mat,a=this.element.canvasContext,r=this.masksProperties.length;for(a.beginPath(),t=0;t<r;t+=1)if("n"!==this.masksProperties[t].mode){var o;this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),s=this.viewData[t].v,e=n.applyToPointArray(s.v[0][0],s.v[0][1],0),a.moveTo(e[0],e[1]);var l=s._length;for(o=1;o<l;o+=1)i=n.applyToTriplePoints(s.o[o-1],s.i[o],s.v[o]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);i=n.applyToTriplePoints(s.o[o-1],s.i[0],s.v[0]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(t,e,i,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var n,a=4;"rc"===e.ty?a=5:"el"===e.ty?a=6:"sr"===e.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,a,t);var r,o=i.length;for(n=0;n<o;n+=1)i[n].closed||(r={transforms:s.addTransformSequence(i[n].transforms),trNodes:[]},this.styledShapes.push(r),i[n].elements.push(r))}function CVShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,i)}function CVTextElement(t,e,i){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,i)}function CVImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getAsset(this.assetData),this.initElement(t,e,i)}function CVSolidElement(t,e,i){this.initElement(t,e,i)}function CanvasRendererBase(){}function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){var t;for(this.stack=[],this.cArrPos=0,this.cTr=new Matrix,t=0;t<15;t+=1){var e=new CanvasContext;this.stack[t]=e}this._length=15,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}function CVCompElement(t,e,i){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||void 0===e.runExpressions||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}function HBaseElement(){}function HSolidElement(t,e,i){this.initElement(t,e,i)}function HShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,i){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,i)}function HCameraElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initHierarchy();var s=PropertyFactory.getProp;if(this.pe=s(this,t.pe,0,0,this),t.ks.p.s?(this.px=s(this,t.ks.p.x,1,0,this),this.py=s(this,t.ks.p.y,1,0,this),this.pz=s(this,t.ks.p.z,1,0,this)):this.p=s(this,t.ks.p,1,0,this),t.ks.a&&(this.a=s(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var n,a=t.ks.or.k.length;for(n=0;n<a;n+=1)t.ks.or.k[n].to=null,t.ks.or.k[n].ti=null}this.or=s(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=s(this,t.ks.rx,0,degToRads,this),this.ry=s(this,t.ks.ry,0,degToRads,this),this.rz=s(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i)}function HybridRendererBase(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&!1===e.hideOnTransparent),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(t,e,i){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&!1===e.hideOnTransparent),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"},runExpressions:!e||void 0===e.runExpressions||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function createElements(){},initRendererElement:function initRendererElement(){},createContainerElements:function createContainerElements(){if(this.data.tt>=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function createContent(){},setBlendMode:function setBlendMode(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function createRenderableComponents(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function hideElement(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function showElement(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function clearCanvas(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function prepareLayer(){if(this.data.tt>=1){var t=this.buffers[0].getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function exitLayer(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");if(this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var i=assetLoader.getLumaCanvas(this.canvasContext.canvas);i.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(i,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function renderFrame(t){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function destroy(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var i={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},s={};if("fl"===t.ty||"st"===t.ty?(s.c=PropertyFactory.getProp(this,t.c,1,255,this),s.c.k||(i.co="rgb("+bmFloor(s.c.v[0])+","+bmFloor(s.c.v[1])+","+bmFloor(s.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(s.s=PropertyFactory.getProp(this,t.s,1,null,this),s.e=PropertyFactory.getProp(this,t.e,1,null,this),s.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),s.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),s.g=new GradientProperty(this,t.g,this)),s.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(i.lc=lineCapEnum[t.lc||2],i.lj=lineJoinEnum[t.lj||2],1==t.lj&&(i.ml=t.ml),s.w=PropertyFactory.getProp(this,t.w,0,null,this),s.w.k||(i.wi=s.w.v),t.d){var n=new DashProperty(this,t.d,"canvas",this);s.d=n,s.d.k||(i.da=s.d.dashArray,i.do=s.d.dashoffset[0])}}else i.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(i),s.style=i,s},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,i,s,n){var a,r,o,l,h,d,u=t.length-1,p=[],m=[],g=[].concat(n);for(a=u;a>=0;a-=1){if((l=this.searchProcessedElement(t[a]))?e[a]=i[l-1]:t[a]._shouldRender=s,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)l?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],g),p.push(e[a].style);else if("gr"===t[a].ty){if(l)for(o=e[a].it.length,r=0;r<o;r+=1)e[a].prevViewData[r]=e[a].it[r];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,s,g)}else"tr"===t[a].ty?(l||(d=this.createTransformElement(t[a]),e[a]=d),g.push(e[a]),this.addTransformToStyleList(e[a])):"sh"===t[a].ty||"rc"===t[a].ty||"el"===t[a].ty||"sr"===t[a].ty?l||(e[a]=this.createShapeElement(t[a])):"tm"===t[a].ty||"rd"===t[a].ty||"pb"===t[a].ty||"zz"===t[a].ty||"op"===t[a].ty?(l?(h=e[a]).closed=!1:((h=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=h,this.shapeModifiers.push(h)),m.push(h)):"rp"===t[a].ty&&(l?(h=e[a]).closed=!0:(h=ShapeModifiers.getModifier(t[a].ty),e[a]=h,h.init(this,t,a,e),this.shapeModifiers.push(h),s=!1),m.push(h));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(p),u=m.length,a=0;a<u;a+=1)m[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,i,s,n,a,r,o,l,h=this.stylesList.length,d=this.globalData.renderer,u=this.globalData.canvasContext;for(t=0;t<h;t+=1)if(("st"!==(o=(l=this.stylesList[t]).type)&&"gs"!==o||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(d.save(),a=l.elements,"st"===o||"gs"===o?(d.ctxStrokeStyle("st"===o?l.co:l.grd),d.ctxLineWidth(l.wi),d.ctxLineCap(l.lc),d.ctxLineJoin(l.lj),d.ctxMiterLimit(l.ml||0)):d.ctxFillStyle("fl"===o?l.co:l.grd),d.ctxOpacity(l.coOp),"st"!==o&&"gs"!==o&&u.beginPath(),d.ctxTransform(l.preTransforms.finalTransform.props),i=a.length,e=0;e<i;e+=1){for("st"!==o&&"gs"!==o||(u.beginPath(),l.da&&(u.setLineDash(l.da),u.lineDashOffset=l.do)),n=(r=a[e].trNodes).length,s=0;s<n;s+=1)"m"===r[s].t?u.moveTo(r[s].p[0],r[s].p[1]):"c"===r[s].t?u.bezierCurveTo(r[s].pts[0],r[s].pts[1],r[s].pts[2],r[s].pts[3],r[s].pts[4],r[s].pts[5]):u.closePath();"st"!==o&&"gs"!==o||(d.ctxStroke(),l.da&&u.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&this.globalData.renderer.ctxFill(l.r),d.restore()}},CVShapeElement.prototype.renderShape=function(t,e,i,s){var n,a;for(a=t,n=e.length-1;n>=0;n-=1)"tr"===e[n].ty?(a=i[n].transform,this.renderShapeTransform(t,a)):"sh"===e[n].ty||"el"===e[n].ty||"rc"===e[n].ty||"sr"===e[n].ty?this.renderPath(e[n],i[n]):"fl"===e[n].ty?this.renderFill(e[n],i[n],a):"st"===e[n].ty?this.renderStroke(e[n],i[n],a):"gf"===e[n].ty||"gs"===e[n].ty?this.renderGradientFill(e[n],i[n],a):"gr"===e[n].ty?this.renderShape(a,e[n].it,i[n].it):e[n].ty;s&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i,s,n,a=t.trNodes,r=e.paths,o=r._length;a.length=0;var l=t.transforms.finalTransform;for(n=0;n<o;n+=1){var h=r.shapes[n];if(h&&h.v){for(s=h._length,i=1;i<s;i+=1)1===i&&a.push({t:"m",p:l.applyToPointArray(h.v[0][0],h.v[0][1],0)}),a.push({t:"c",pts:l.applyToTriplePoints(h.o[i-1],h.i[i],h.v[i])});1===s&&a.push({t:"m",p:l.applyToPointArray(h.v[0][0],h.v[0][1],0)}),h.c&&s&&(a.push({t:"c",pts:l.applyToTriplePoints(h.o[i-1],h.i[0],h.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var i,s=e.styledShapes.length;for(i=0;i<s;i+=1)this.renderStyledShape(e.styledShapes[i],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,i){var s=e.style;(e.c._mdf||this._isFirstFrame)&&(s.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(s.coOp=e.o.v*i.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,i){var s,n=e.style;if(!n.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var a,r=this.globalData.canvasContext,o=e.s.v,l=e.e.v;if(1===t.t)s=r.createLinearGradient(o[0],o[1],l[0],l[1]);else{var h=Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2)),d=Math.atan2(l[1]-o[1],l[0]-o[0]),u=e.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var p=h*u,m=Math.cos(d+e.a.v)*p+o[0],g=Math.sin(d+e.a.v)*p+o[1];s=r.createRadialGradient(m,g,0,o[0],o[1],h)}var b=t.g.p,f=e.g.c,v=1;for(a=0;a<b;a+=1)e.g._hasOpacity&&e.g._collapsable&&(v=e.g.o[2*a+1]),s.addColorStop(f[4*a]/100,"rgba("+f[4*a+1]+","+f[4*a+2]+","+f[4*a+3]+","+v+")");n.grd=s}n.coOp=e.o.v*i.opacity},CVShapeElement.prototype.renderStroke=function(t,e,i){var s=e.style,n=e.d;n&&(n._mdf||this._isFirstFrame)&&(s.da=n.dashArray,s.do=n.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(s.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(s.coOp=e.o.v*i.opacity),(e.w._mdf||this._isFirstFrame)&&(s.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var i=!1;t.sc&&(i=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var s,n,a,r,o,l,h,d,u,p,m,g,b=this.globalData.fontManager.getFontByName(t.f),f=t.l,v=this.mHelper;this.stroke=i,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,n=t.finalText.length;var y=this.data.singleShape,E=.001*t.tr*t.finalSize,S=0,w=0,_=!0,x=0;for(s=0;s<n;s+=1){r=(a=this.globalData.fontManager.getCharData(t.finalText[s],b.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&a.data||{},v.reset(),y&&f[s].n&&(S=-E,w+=t.yOffset,w+=_?1:0,_=!1),u=(h=r.shapes?r.shapes[0].it:[]).length,v.scale(t.finalSize/100,t.finalSize/100),y&&this.applyTextPropertiesToMatrix(t,v,f[s].line,S,w),m=createSizedArray(u-1);var k=0;for(d=0;d<u;d+=1)if("sh"===h[d].ty){for(l=h[d].ks.k.i.length,p=h[d].ks.k,g=[],o=1;o<l;o+=1)1===o&&g.push(v.applyToX(p.v[0][0],p.v[0][1],0),v.applyToY(p.v[0][0],p.v[0][1],0)),g.push(v.applyToX(p.o[o-1][0],p.o[o-1][1],0),v.applyToY(p.o[o-1][0],p.o[o-1][1],0),v.applyToX(p.i[o][0],p.i[o][1],0),v.applyToY(p.i[o][0],p.i[o][1],0),v.applyToX(p.v[o][0],p.v[o][1],0),v.applyToY(p.v[o][0],p.v[o][1],0));g.push(v.applyToX(p.o[o-1][0],p.o[o-1][1],0),v.applyToY(p.o[o-1][0],p.o[o-1][1],0),v.applyToX(p.i[0][0],p.i[0][1],0),v.applyToY(p.i[0][0],p.i[0][1],0),v.applyToX(p.v[0][0],p.v[0][1],0),v.applyToY(p.v[0][0],p.v[0][1],0)),m[k]=g,k+=1}y&&(S+=f[s].l,S+=E),this.textSpans[x]?this.textSpans[x].elem=m:this.textSpans[x]={elem:m},x+=1}},CVTextElement.prototype.renderInnerContent=function(){var t,e,i,s,n,a;this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var r,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var h,d,u=null,p=null,m=null,g=this.globalData.renderer;for(t=0;t<e;t+=1)if(!l[t].n){if((r=o[t])&&(g.save(),g.ctxTransform(r.p),g.ctxOpacity(r.o)),this.fill){for(r&&r.fc?u!==r.fc&&(g.ctxFillStyle(r.fc),u=r.fc):u!==this.values.fill&&(u=this.values.fill,g.ctxFillStyle(this.values.fill)),s=(h=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),i=0;i<s;i+=1)for(a=(d=h[i]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),n=2;n<a;n+=6)this.globalData.canvasContext.bezierCurveTo(d[n],d[n+1],d[n+2],d[n+3],d[n+4],d[n+5]);this.globalData.canvasContext.closePath(),g.ctxFill()}if(this.stroke){for(r&&r.sw?m!==r.sw&&(m=r.sw,g.ctxLineWidth(r.sw)):m!==this.values.sWidth&&(m=this.values.sWidth,g.ctxLineWidth(this.values.sWidth)),r&&r.sc?p!==r.sc&&(p=r.sc,g.ctxStrokeStyle(r.sc)):p!==this.values.stroke&&(p=this.values.stroke,g.ctxStrokeStyle(this.values.stroke)),s=(h=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),i=0;i<s;i+=1)for(a=(d=h[i]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),n=2;n<a;n+=6)this.globalData.canvasContext.bezierCurveTo(d[n],d[n+1],d[n+2],d[n+3],d[n+4],d[n+5]);this.globalData.canvasContext.closePath(),g.ctxStroke()}r&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,i,s=t.getContext("2d"),n=this.img.width,a=this.img.height,r=n/a,o=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;r>o&&"xMidYMid slice"===l||r<o&&"xMidYMid slice"!==l?e=(i=a)*o:i=(e=n)/o,s.drawImage(this.img,(n-e)/2,(a-i)/2,e,i,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRendererBase.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(t){1===t[0]&&0===t[1]&&0===t[4]&&1===t[5]&&0===t[12]&&0===t[13]||this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRendererBase.prototype.ctxOpacity=function(t){this.canvasContext.globalAlpha*=t<0?0:t},CanvasRendererBase.prototype.ctxFillStyle=function(t){this.canvasContext.fillStyle=t},CanvasRendererBase.prototype.ctxStrokeStyle=function(t){this.canvasContext.strokeStyle=t},CanvasRendererBase.prototype.ctxLineWidth=function(t){this.canvasContext.lineWidth=t},CanvasRendererBase.prototype.ctxLineCap=function(t){this.canvasContext.lineCap=t},CanvasRendererBase.prototype.ctxLineJoin=function(t){this.canvasContext.lineJoin=t},CanvasRendererBase.prototype.ctxMiterLimit=function(t){this.canvasContext.miterLimit=t},CanvasRendererBase.prototype.ctxFill=function(t){this.canvasContext.fill(t)},CanvasRendererBase.prototype.ctxFillRect=function(t,e,i,s){this.canvasContext.fillRect(t,e,i,s)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(t){this.renderConfig.clearCanvas?(t&&(this.globalData.blendMode="source-over"),this.contextData.restore(t)):this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(t){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var i="0px 0px 0px";e.transformOrigin=i,e.mozTransformOrigin=i,e.webkitTransformOrigin=i,e["-webkit-transform"]=i,e.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(t,e){var i,s,n,a;if(this.reset(),t?(i=t,s=e,this.canvasContext.canvas.width=i,this.canvasContext.canvas.height=s):(this.animationItem.wrapper&&this.animationItem.container?(i=this.animationItem.wrapper.offsetWidth,s=this.animationItem.wrapper.offsetHeight):(i=this.canvasContext.canvas.width,s=this.canvasContext.canvas.height),this.canvasContext.canvas.width=i*this.renderConfig.dpr,this.canvasContext.canvas.height=s*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var r=this.renderConfig.preserveAspectRatio.split(" "),o=r[1]||"meet",l=r[0]||"xMidYMid",h=l.substr(0,4),d=l.substr(4);n=i/s,(a=this.transformCanvas.w/this.transformCanvas.h)>n&&"meet"===o||a<n&&"slice"===o?(this.transformCanvas.sx=i/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=i/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=s/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=s/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===h&&(a<n&&"meet"===o||a>n&&"slice"===o)?(i-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===h&&(a<n&&"meet"===o||a>n&&"slice"===o)?(i-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===d&&(a>n&&"meet"===o||a<n&&"slice"===o)?(s-this.transformCanvas.h*(i/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===d&&(a>n&&"meet"===o||a<n&&"slice"===o)?(s-this.transformCanvas.h*(i/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=i/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=s/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var i;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=0;for(e=this._length;e<t;e+=1)this.stack[e]=new CanvasContext;this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(t){this.cArrPos-=1;var e,i=this.stack[this.cArrPos],s=i.transform,n=this.cTr.props;for(e=0;e<16;e+=1)n[e]=s[e];if(t){this.nativeContext.restore();var a=this.stack[this.cArrPos+1];this.appliedFillStyle=a.fillStyle,this.appliedStrokeStyle=a.strokeStyle,this.appliedLineWidth=a.lineWidth,this.appliedLineCap=a.lineCap,this.appliedLineJoin=a.lineJoin,this.appliedMiterLimit=a.miterLimit}this.nativeContext.setTransform(s[0],s[1],s[4],s[5],s[12],s[13]),(t||-1!==i.opacity&&this.currentOpacity!==i.opacity)&&(this.nativeContext.globalAlpha=i.opacity,this.currentOpacity=i.opacity),this.currentFillStyle=i.fillStyle,this.currentStrokeStyle=i.strokeStyle,this.currentLineWidth=i.lineWidth,this.currentLineCap=i.lineCap,this.currentLineJoin=i.lineJoin,this.currentMiterLimit=i.miterLimit},CVContextData.prototype.save=function(t){t&&this.nativeContext.save();var e=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var i,s=this.stack[this.cArrPos];for(i=0;i<16;i+=1)s.transform[i]=e[i];this.cArrPos+=1;var n=this.stack[this.cArrPos];n.opacity=s.opacity,n.fillStyle=s.fillStyle,n.strokeStyle=s.strokeStyle,n.lineWidth=s.lineWidth,n.lineCap=s.lineCap,n.lineJoin=s.lineJoin,n.miterLimit=s.miterLimit},CVContextData.prototype.setOpacity=function(t){this.stack[this.cArrPos].opacity=t},CVContextData.prototype.setContext=function(t){this.nativeContext=t},CVContextData.prototype.fillStyle=function(t){this.stack[this.cArrPos].fillStyle!==t&&(this.currentFillStyle=t,this.stack[this.cArrPos].fillStyle=t)},CVContextData.prototype.strokeStyle=function(t){this.stack[this.cArrPos].strokeStyle!==t&&(this.currentStrokeStyle=t,this.stack[this.cArrPos].strokeStyle=t)},CVContextData.prototype.lineWidth=function(t){this.stack[this.cArrPos].lineWidth!==t&&(this.currentLineWidth=t,this.stack[this.cArrPos].lineWidth=t)},CVContextData.prototype.lineCap=function(t){this.stack[this.cArrPos].lineCap!==t&&(this.currentLineCap=t,this.stack[this.cArrPos].lineCap=t)},CVContextData.prototype.lineJoin=function(t){this.stack[this.cArrPos].lineJoin!==t&&(this.currentLineJoin=t,this.stack[this.cArrPos].lineJoin=t)},CVContextData.prototype.miterLimit=function(t){this.stack[this.cArrPos].miterLimit!==t&&(this.currentMiterLimit=t,this.stack[this.cArrPos].miterLimit=t)},CVContextData.prototype.transform=function(t){this.transformMat.cloneFromProps(t);var e=this.cTr;this.transformMat.multiply(e),e.cloneFromProps(this.transformMat.props);var i=e.props;this.nativeContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13])},CVContextData.prototype.opacity=function(t){var e=this.stack[this.cArrPos].opacity;e*=t<0?0:t,this.stack[this.cArrPos].opacity!==e&&(this.currentOpacity!==t&&(this.nativeContext.globalAlpha=t,this.currentOpacity=t),this.stack[this.cArrPos].opacity=e)},CVContextData.prototype.fill=function(t){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(t)},CVContextData.prototype.fillRect=function(t,e,i,s){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(t,e,i,s)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function checkBlendMode(){},initRendererElement:function initRendererElement(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function createContainerElements(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function renderElement(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function renderFrame(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function destroy(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function createRenderableComponents(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function addEffects(){},setMatte:function setMatte(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)e=t[i].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var i,s,n,a,r,o=t.sh.v,l=t.transformers,h=o._length;if(!(h<=1)){for(i=0;i<h-1;i+=1)s=this.getTransformedPoint(l,o.v[i]),n=this.getTransformedPoint(l,o.o[i]),a=this.getTransformedPoint(l,o.i[i+1]),r=this.getTransformedPoint(l,o.v[i+1]),this.checkBounds(s,n,a,r,e);o.c&&(s=this.getTransformedPoint(l,o.v[i]),n=this.getTransformedPoint(l,o.o[i]),a=this.getTransformedPoint(l,o.i[0]),r=this.getTransformedPoint(l,o.v[0]),this.checkBounds(s,n,a,r,e))}},HShapeElement.prototype.checkBounds=function(t,e,i,s,n){this.getBoundsOfCurve(t,e,i,s);var a=this.shapeBoundingBox;n.x=bmMin(a.left,n.x),n.xMax=bmMax(a.right,n.xMax),n.y=bmMin(a.top,n.y),n.yMax=bmMax(a.bottom,n.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,i,s){for(var n,a,r,o,l,h,d,u=[[t[0],s[0]],[t[1],s[1]]],p=0;p<2;++p)a=6*t[p]-12*e[p]+6*i[p],n=-3*t[p]+9*e[p]-9*i[p]+3*s[p],r=3*e[p]-3*t[p],a|=0,r|=0,0==(n|=0)&&0===a||(0===n?(o=-r/a)>0&&o<1&&u[p].push(this.calculateF(o,t,e,i,s,p)):(l=a*a-4*r*n)>=0&&((h=(-a+bmSqrt(l))/(2*n))>0&&h<1&&u[p].push(this.calculateF(h,t,e,i,s,p)),(d=(-a-bmSqrt(l))/(2*n))>0&&d<1&&u[p].push(this.calculateF(d,t,e,i,s,p))));this.shapeBoundingBox.left=bmMin.apply(null,u[0]),this.shapeBoundingBox.top=bmMin.apply(null,u[1]),this.shapeBoundingBox.right=bmMax.apply(null,u[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,u[1])},HShapeElement.prototype.calculateF=function(t,e,i,s,n,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*s[a]+bmPow(t,3)*n[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)t[i]&&t[i].sh?this.calculateShapeBoundingBox(t[i],e):t[i]&&t[i].it?this.calculateBoundingBox(t[i].it,e):t[i]&&t[i].style&&t[i].w&&this.expandStrokeBoundingBox(t[i].w,e)},HShapeElement.prototype.expandStrokeBoundingBox=function(t,e){var i=0;if(t.keyframes){for(var s=0;s<t.keyframes.length;s+=1){var n=t.keyframes[s].s;n>i&&(i=n)}i*=t.mult}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var i=!1;if(this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),i=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),i=!0),i||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y){this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var s=this.shapeCont.style,n="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";s.transform=n,s.webkitTransform=n}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style,i=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)";e.fill=i,e.color=i,t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var s,n,a=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{e.fontFamily=a.fFamily;var r=t.fWeight,o=t.fStyle;e.fontStyle=o,e.fontWeight=r}var l,h,d,u=t.l;n=u.length;var p,m=this.mHelper,g="",b=0;for(s=0;s<n;s+=1){if(this.globalData.fontManager.chars?(this.textPaths[b]?l=this.textPaths[b]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[b]?d=(h=this.textSpans[b]).children[0]:((h=createTag("div")).style.lineHeight=0,(d=createNS("svg")).appendChild(l),styleDiv(h)))):this.isMasked?l=this.textPaths[b]?this.textPaths[b]:createNS("text"):this.textSpans[b]?(h=this.textSpans[b],l=this.textPaths[b]):(styleDiv(h=createTag("span")),styleDiv(l=createTag("span")),h.appendChild(l)),this.globalData.fontManager.chars){var f,v=this.globalData.fontManager.getCharData(t.finalText[s],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(f=v?v.data:null,m.reset(),f&&f.shapes&&f.shapes.length&&(p=f.shapes[0].it,m.scale(t.finalSize/100,t.finalSize/100),g=this.createPathShape(m,p),l.setAttribute("d",g)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(h),f&&f.shapes){document.body.appendChild(d);var y=d.getBBox();d.setAttribute("width",y.width+2),d.setAttribute("height",y.height+2),d.setAttribute("viewBox",y.x-1+" "+(y.y-1)+" "+(y.width+2)+" "+(y.height+2));var E=d.style,S="translate("+(y.x-1)+"px,"+(y.y-1)+"px)";E.transform=S,E.webkitTransform=S,u[s].yOffset=y.y-1}else d.setAttribute("width",1),d.setAttribute("height",1);h.appendChild(d)}}else if(l.textContent=u[s].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(h);var w=l.style,_="translate3d(0,"+-t.finalSize/1.2+"px,0)";w.transform=_,w.webkitTransform=_}this.isMasked?this.textSpans[b]=l:this.textSpans[b]=h,this.textSpans[b].style.display="block",this.textPaths[b]=l,b+=1}for(;b<this.textSpans.length;)this.textSpans[b].style.display="none",b+=1},HTextElement.prototype.renderInnerContent=function(){var t;if(this.validateText(),this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),t=this.svgElement.style;var e="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";t.transform=e,t.webkitTransform=e}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var i,s,n,a,r,o=0,l=this.textAnimator.renderedLetters,h=this.textProperty.currentData.l;for(s=h.length,i=0;i<s;i+=1)h[i].n?o+=1:(a=this.textSpans[i],r=this.textPaths[i],n=l[o],o+=1,n._mdf.m&&(this.isMasked?a.setAttribute("transform",n.m):(a.style.webkitTransform=n.m,a.style.transform=n.m)),a.style.opacity=n.o,n.sw&&n._mdf.sw&&r.setAttribute("stroke-width",n.sw),n.sc&&n._mdf.sc&&r.setAttribute("stroke",n.sc),n.fc&&n._mdf.fc&&(r.setAttribute("fill",n.fc),r.style.color=n.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var d=this.innerElem.getBBox();if(this.currentBBox.w!==d.width&&(this.currentBBox.w=d.width,this.svgElement.setAttribute("width",d.width)),this.currentBBox.h!==d.height&&(this.currentBBox.h=d.height,this.svgElement.setAttribute("height",d.height)),this.currentBBox.w!==d.width+2||this.currentBBox.h!==d.height+2||this.currentBBox.x!==d.x-1||this.currentBBox.y!==d.y-1){this.currentBBox.w=d.width+2,this.currentBBox.h=d.height+2,this.currentBBox.x=d.x-1,this.currentBBox.y=d.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),t=this.svgElement.style;var u="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";t.transform=u,t.webkitTransform=u}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,i,s,n=this.comp.threeDElements.length;for(t=0;t<n;t+=1)if("3d"===(e=this.comp.threeDElements[t]).type){i=e.perspectiveElem.style,s=e.container.style;var a=this.pe.v+"px",r="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";i.perspective=a,i.webkitPerspective=a,s.transformOrigin=r,s.mozTransformOrigin=r,s.webkitTransformOrigin=r,i.transform=o,i.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,i=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)i=this.hierarchy[t].finalTransform.mProp._mdf||i;if(i||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;t>=0;t-=1){var s=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var n;n=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2)+Math.pow(n[2],2)),r=[n[0]/a,n[1]/a,n[2]/a],o=Math.sqrt(r[2]*r[2]+r[0]*r[0]),l=Math.atan2(r[1],o),h=Math.atan2(r[0],-r[2]);this.mat.rotateY(h).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var d=!this._prevMat.equals(this.mat);if((d||this.pe._mdf)&&this.comp.threeDElements){var u,p,m;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)if("3d"===(u=this.comp.threeDElements[t]).type){if(d){var g=this.mat.toCSS();(m=u.container.style).transform=g,m.webkitTransform=g}this.pe._mdf&&((p=u.perspectiveElem.style).perspective=this.pe.v+"px",p.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){var s=this.layers[e];if(s.ddd&&this.supports3d)this.addTo3dContainer(i,e);else if(this.threeDElements)this.addTo3dContainer(i,e);else{for(var n,a,r=0;r<e;)this.elements[r]&&!0!==this.elements[r]&&this.elements[r].getBaseElement&&(a=this.elements[r],n=(this.layers[r].ddd?this.getThreeDContainerByPos(r):a.getBaseElement())||n),r+=1;n?s.ddd&&this.supports3d||this.layerElement.insertBefore(i,n):s.ddd&&this.supports3d||this.layerElement.appendChild(i)}}},HybridRendererBase.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRendererBase.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextLottieElement(t,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(t){for(var e=0,i=this.threeDElements.length;e<i;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i,s,n=createTag("div");styleDiv(n);var a=createTag("div");if(styleDiv(a),"3d"===e){(i=n.style).width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var r="50% 50%";i.webkitTransformOrigin=r,i.mozTransformOrigin=r,i.transformOrigin=r;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(s=a.style).transform=o,s.webkitTransform=o}n.appendChild(a);var l={container:a,perspectiveElem:n,startPos:t,endPos:t,type:e};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var t,e,i=this.layers.length,s="";for(t=0;t<i;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?("3d"!==s&&(s="3d",e=this.createThreeDContainer(t,"3d")),e.endPos=Math.max(e.endPos,t)):("2d"!==s&&(s="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t));for(t=(i=this.threeDElements.length)-1;t>=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;i<s;){if(e<=this.threeDElements[i].endPos){for(var n,a=this.threeDElements[i].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(n=this.elements[a].getBaseElement()),a+=1;n?this.threeDElements[i].container.insertBefore(t,n):this.threeDElements[i].container.appendChild(t);break}i+=1}},HybridRendererBase.prototype.configAnimation=function(t){var e=createTag("div"),i=this.animationItem.wrapper,s=e.style;s.width=t.w+"px",s.height=t.h+"px",this.resizerElem=e,styleDiv(e),s.transformStyle="flat",s.mozTransformStyle="flat",s.webkitTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),i.appendChild(e),s.overflow="hidden";var n=createNS("svg");n.setAttribute("width","1"),n.setAttribute("height","1"),styleDiv(n),this.resizerElem.appendChild(n);var a=createNS("defs");n.appendChild(a),this.data=t,this.setupGlobalData(t,n),this.globalData.defs=a,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var t,e,i,s,n=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight,r=n/a;this.globalData.compSize.w/this.globalData.compSize.h>r?(t=n/this.globalData.compSize.w,e=n/this.globalData.compSize.w,i=0,s=(a-this.globalData.compSize.h*(n/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,i=(n-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,s=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+s+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,s=this.threeDElements.length;for(t=0;t<s;t+=1){var n=this.threeDElements[t].perspectiveElem.style;n.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(i,2))+"px",n.perspective=n.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(t){var e,i=t.length,s=createTag("div");for(e=0;e<i;e+=1)if(t[e].xt){var n=this.createComp(t[e],s,this.globalData.comp,null);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var i,s=0;s<e;)this.elements[s]&&this.elements[s].getBaseElement&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(t,i):this.layerElement.appendChild(t)},HCompElement.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)};var CompExpressionInterface=function(t){function _thisLayerFunction(e){for(var i=0,s=t.layers.length;i<s;){if(t.layers[i].nm===e||t.layers[i].ind===e)return t.elements[i].layerInterface;i+=1}return null}return Object.defineProperty(_thisLayerFunction,"_name",{value:t.data.nm}),_thisLayerFunction.layer=_thisLayerFunction,_thisLayerFunction.pixelAspect=1,_thisLayerFunction.height=t.data.h||t.globalData.compSize.h,_thisLayerFunction.width=t.data.w||t.globalData.compSize.w,_thisLayerFunction.pixelAspect=1,_thisLayerFunction.frameDuration=1/t.globalData.frameRate,_thisLayerFunction.displayStartTime=0,_thisLayerFunction.numLayers=t.layers.length,_thisLayerFunction};function _typeof$2(t){return _typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$2(t)}function seedRandom(t,e){var i=this,s=256,n="random",a=e.pow(s,6),r=e.pow(2,52),o=2*r,l=255;function ARC4(t){var e,i=t.length,n=this,a=0,r=n.i=n.j=0,o=n.S=[];for(i||(t=[i++]);a<s;)o[a]=a++;for(a=0;a<s;a++)o[a]=o[r=l&r+t[a%i]+(e=o[a])],o[r]=e;n.g=function(t){for(var e,i=0,a=n.i,r=n.j,o=n.S;t--;)e=o[a=l&a+1],i=i*s+o[l&(o[a]=o[r=l&r+e])+(o[r]=e)];return n.i=a,n.j=r,i}}function copy(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function flatten(t,e){var i,s=[],n=_typeof$2(t);if(e&&"object"==n)for(i in t)try{s.push(flatten(t[i],e-1))}catch(t){}return s.length?s:"string"==n?t:t+"\0"}function mixkey(t,e){for(var i,s=t+"",n=0;n<s.length;)e[l&n]=l&(i^=19*e[l&n])+s.charCodeAt(n++);return tostring(e)}function tostring(t){return String.fromCharCode.apply(0,t)}e["seed"+n]=function seedrandom(l,h,d){var u=[],p=mixkey(flatten((h=!0===h?{entropy:!0}:h||{}).entropy?[l,tostring(t)]:null===l?function autoseed(){try{var e=new Uint8Array(s);return(i.crypto||i.msCrypto).getRandomValues(e),tostring(e)}catch(e){var n=i.navigator,a=n&&n.plugins;return[+new Date,i,a,i.screen,tostring(t)]}}():l,3),u),m=new ARC4(u),g=function prng(){for(var t=m.g(6),e=a,i=0;t<r;)t=(t+i)*s,e*=s,i=m.g(1);for(;t>=o;)t/=2,e/=2,i>>>=1;return(t+i)/e};return g.int32=function(){return 0|m.g(4)},g.quick=function(){return m.g(4)/4294967296},g.double=g,mixkey(tostring(m.S),t),(h.pass||d||function(t,i,s,a){return a&&(a.S&©(a,m),t.state=function(){return copy(m,{})}),s?(e[n]=t,i):t})(g,p,"global"in h?h.global:this==e,h.state)},mixkey(e.random(),t)}function initialize$2(t){seedRandom([],t)}var propTypes={SHAPE:"shape"};function _typeof$1(t){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$1(t)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||e instanceof Number||"boolean"===t||"string"===t}function $bm_neg(t){var e=_typeof$1(t);if("number"===e||t instanceof Number||"boolean"===e)return-t;if($bm_isInstanceOfArray(t)){var i,s=t.length,n=[];for(i=0;i<s;i+=1)n[i]=-t[i];return n}return t.propType?t.v:-t}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var i=_typeof$1(t),s=_typeof$1(e);if(isNumerable(i,t)&&isNumerable(s,e)||"string"===i||"string"===s)return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(s,e))return(t=t.slice(0))[0]+=e,t;if(isNumerable(i,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var n=0,a=t.length,r=e.length,o=[];n<a||n<r;)("number"==typeof t[n]||t[n]instanceof Number)&&("number"==typeof e[n]||e[n]instanceof Number)?o[n]=t[n]+e[n]:o[n]=void 0===e[n]?t[n]:t[n]||e[n],n+=1;return o}return 0}var add=sum;function sub(t,e){var i=_typeof$1(t),s=_typeof$1(e);if(isNumerable(i,t)&&isNumerable(s,e))return"string"===i&&(t=parseInt(t,10)),"string"===s&&(e=parseInt(e,10)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(s,e))return(t=t.slice(0))[0]-=e,t;if(isNumerable(i,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var n=0,a=t.length,r=e.length,o=[];n<a||n<r;)("number"==typeof t[n]||t[n]instanceof Number)&&("number"==typeof e[n]||e[n]instanceof Number)?o[n]=t[n]-e[n]:o[n]=void 0===e[n]?t[n]:t[n]||e[n],n+=1;return o}return 0}function mul(t,e){var i,s,n,a=_typeof$1(t),r=_typeof$1(e);if(isNumerable(a,t)&&isNumerable(r,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(r,e)){for(n=t.length,i=createTypedArray("float32",n),s=0;s<n;s+=1)i[s]=t[s]*e;return i}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(n=e.length,i=createTypedArray("float32",n),s=0;s<n;s+=1)i[s]=t*e[s];return i}return 0}function div(t,e){var i,s,n,a=_typeof$1(t),r=_typeof$1(e);if(isNumerable(a,t)&&isNumerable(r,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(r,e)){for(n=t.length,i=createTypedArray("float32",n),s=0;s<n;s+=1)i[s]=t[s]/e;return i}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(n=e.length,i=createTypedArray("float32",n),s=0;s<n;s+=1)i[s]=t/e[s];return i}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t,10)),"string"==typeof e&&(e=parseInt(e,10)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,i){if(e>i){var s=i;i=e,e=s}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var i;e||(e=helperLengthArray);var s=Math.min(t.length,e.length),n=0;for(i=0;i<s;i+=1)n+=Math.pow(e[i]-t[i],2);return Math.sqrt(n)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,i,s=t[0],n=t[1],a=t[2],r=Math.max(s,n,a),o=Math.min(s,n,a),l=(r+o)/2;if(r===o)e=0,i=0;else{var h=r-o;switch(i=l>.5?h/(2-r-o):h/(r+o),r){case s:e=(n-a)/h+(n<a?6:0);break;case n:e=(a-s)/h+2;break;case a:e=(s-n)/h+4}e/=6}return[e,i,l,t[3]]}function hue2rgb(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,s,n=t[0],a=t[1],r=t[2];if(0===a)e=r,s=r,i=r;else{var o=r<.5?r*(1+a):r+a-r*a,l=2*r-o;e=hue2rgb(l,o,n+1/3),i=hue2rgb(l,o,n),s=hue2rgb(l,o,n-1/3)}return[e,i,s,t[3]]}function linear(t,e,i,s,n){if(void 0!==s&&void 0!==n||(s=e,n=i,e=0,i=1),i<e){var a=i;i=e,e=a}if(t<=e)return s;if(t>=i)return n;var r,o=i===e?0:(t-e)/(i-e);if(!s.length)return s+(n-s)*o;var l=s.length,h=createTypedArray("float32",l);for(r=0;r<l;r+=1)h[r]=s[r]+(n[r]-s[r])*o;return h}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var i,s=e.length;t||(t=createTypedArray("float32",s));var n=createTypedArray("float32",s),a=BMMath.random();for(i=0;i<s;i+=1)n[i]=t[i]+a*(e[i]-t[i]);return n}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,i,s){var n,a=t.length,r=shapePool.newElement();r.setPathData(!!s,a);var o,l,h=[0,0];for(n=0;n<a;n+=1)o=e&&e[n]?e[n]:h,l=i&&i[n]?i[n]:h,r.setTripleAt(t[n][0],t[n][1],l[0]+t[n][0],l[1]+t[n][1],o[0]+t[n][0],o[1]+t[n][1],n,!0);return r}function initiateExpression(elem,data,property){function noOp(t){return t}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty._name=elem.data.nm,thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function get(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function wiggle(t,e){var i,s,n=this.pv.length?this.pv.length:1,a=createTypedArray("float32",n),r=Math.floor(5*time);for(i=0,s=0;i<r;){for(s=0;s<n;s+=1)a[s]+=-e+2*e*BMMath.random();i+=1}var o=5*time,l=o-Math.floor(o),h=createTypedArray("float32",n);if(n>1){for(s=0;s<n;s+=1)h[s]=this.pv[s]+a[s]+(-e+2*e*BMMath.random())*l;return h}return this.pv+a[0]+(-e+2*e*BMMath.random())*l}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],s=Math.atan2(i[0],Math.sqrt(i[1]*i[1]+i[2]*i[2]))/degToRads;return[-Math.atan2(i[1],i[2])/degToRads,s,0]}function easeOut(t,e,i,s,n){return applyEase(easeOutBez,t,e,i,s,n)}function easeIn(t,e,i,s,n){return applyEase(easeInBez,t,e,i,s,n)}function ease(t,e,i,s,n){return applyEase(easeInOutBez,t,e,i,s,n)}function applyEase(t,e,i,s,n,a){void 0===n?(n=i,a=s):e=(e-i)/(s-i),e>1?e=1:e<0&&(e=0);var r=t(e);if($bm_isInstanceOfArray(n)){var o,l=n.length,h=createTypedArray("float32",l);for(o=0;o<l;o+=1)h[o]=(a[o]-n[o])*r+n[o];return h}return(a-n)*r+n}function nearestKey(t){var e,i,s,n=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(i=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)i=1,s=data.k[0].t;else{for(e=0;e<n-1;e+=1){if(t===data.k[e].t){i=e+1,s=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){t-data.k[e].t>data.k[e+1].t-t?(i=e+2,s=data.k[e+1].t):(i=e+1,s=data.k[e].t);break}}-1===i&&(i=e+1,s=data.k[e].t)}else i=0,s=0;var a={};return a.index=i,a.time=s/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var n=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=n.length,i=0;i<s;i+=1)e[i]=n[i],e.value[i]=n[i];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var t={initExpressions:function initExpressions(t){var e=0,i=[];t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function pushExpression(){e+=1},t.renderer.globalData.popExpression=function popExpression(){0==(e-=1)&&function releaseInstances(){var t,e=i.length;for(t=0;t<e;t+=1)i[t].release();i.length=0}()},t.renderer.globalData.registerExpressionProperty=function registerExpressionProperty(t){-1===i.indexOf(t)&&i.push(t)}}};return t.resetFrame=ExpressionManager.resetFrame,t}(),MaskManagerInterface=function(){function MaskInterface(t,e){this._mask=t,this._data=e}return Object.defineProperty(MaskInterface.prototype,"maskPath",{get:function get(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(MaskInterface.prototype,"maskOpacity",{get:function get(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function MaskManager(t){var e,i=createSizedArray(t.viewData.length),s=t.viewData.length;for(e=0;e<s;e+=1)i[e]=new MaskInterface(t.viewData[e],t.masksProperties[e]);return function maskFunction(n){for(e=0;e<s;){if(t.masksProperties[e].nm===n)return i[e];e+=1}return null}}}(),ExpressionPropertyInterface=function(){var t={pv:0,v:0,mult:1},e={pv:[0,0,0],v:[0,0,0],mult:1};function completeProperty(t,e,i){Object.defineProperty(t,"velocity",{get:function get(){return e.getVelocityAtTime(e.comp.currentFrame)}}),t.numKeys=e.keyframes?e.keyframes.length:0,t.key=function(s){if(!t.numKeys)return 0;var n="";n="s"in e.keyframes[s-1]?e.keyframes[s-1].s:"e"in e.keyframes[s-2]?e.keyframes[s-2].e:e.keyframes[s-2].s;var a="unidimensional"===i?new Number(n):Object.assign({},n);return a.time=e.keyframes[s-1].t/e.elem.comp.globalData.frameRate,a.value="unidimensional"===i?n[0]:n,a},t.valueAtTime=e.getValueAtTime,t.speedAtTime=e.getSpeedAtTime,t.velocityAtTime=e.getVelocityAtTime,t.propertyGroup=e.propertyGroup}function defaultGetter(){return t}return function(i){return i?"unidimensional"===i.propType?function UnidimensionalPropertyInterface(e){e&&"pv"in e||(e=t);var i=1/e.mult,s=e.pv*i,n=new Number(s);return n.value=s,completeProperty(n,e,"unidimensional"),function(){return e.k&&e.getValue(),s=e.v*i,n.value!==s&&((n=new Number(s)).value=s,n[0]=s,completeProperty(n,e,"unidimensional")),n}}(i):function MultidimensionalPropertyInterface(t){t&&"pv"in t||(t=e);var i=1/t.mult,s=t.data&&t.data.l||t.pv.length,n=createTypedArray("float32",s),a=createTypedArray("float32",s);return n.value=a,completeProperty(n,t,"multidimensional"),function(){t.k&&t.getValue();for(var e=0;e<s;e+=1)a[e]=t.v[e]*i,n[e]=a[e];return n}}(i):defaultGetter}}(),TransformExpressionInterface=function(t){function _thisFunction(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return _thisFunction.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return _thisFunction.rotation;case"ADBE Rotate X":return _thisFunction.xRotation;case"ADBE Rotate Y":return _thisFunction.yRotation;case"position":case"Position":case"ADBE Position":case 2:return _thisFunction.position;case"ADBE Position_0":return _thisFunction.xPosition;case"ADBE Position_1":return _thisFunction.yPosition;case"ADBE Position_2":return _thisFunction.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return _thisFunction.anchorPoint;case"opacity":case"Opacity":case 11:return _thisFunction.opacity;default:return null}}var e,i,s,n;return Object.defineProperty(_thisFunction,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(_thisFunction,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(_thisFunction,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(_thisFunction,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(_thisFunction,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p?n=ExpressionPropertyInterface(t.p):(e=ExpressionPropertyInterface(t.px),i=ExpressionPropertyInterface(t.py),t.pz&&(s=ExpressionPropertyInterface(t.pz))),Object.defineProperty(_thisFunction,"position",{get:function get(){return t.p?n():[e(),i(),s?s():0]}}),Object.defineProperty(_thisFunction,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(_thisFunction,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(_thisFunction,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(_thisFunction,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(_thisFunction,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(_thisFunction,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(_thisFunction,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(_thisFunction,"orientation",{get:ExpressionPropertyInterface(t.or)}),_thisFunction},LayerExpressionInterface=function(){function getMatrix(t){var e=new Matrix;return void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e),e}function toWorldVec(t,e){var i=this.getMatrix(e);return i.props[12]=0,i.props[13]=0,i.props[14]=0,this.applyPoint(i,t)}function toWorld(t,e){var i=this.getMatrix(e);return this.applyPoint(i,t)}function fromWorldVec(t,e){var i=this.getMatrix(e);return i.props[12]=0,i.props[13]=0,i.props[14]=0,this.invertPoint(i,t)}function fromWorld(t,e){var i=this.getMatrix(e);return this.invertPoint(i,t)}function applyPoint(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,s=this._elem.hierarchy.length;for(i=0;i<s;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function invertPoint(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,s=this._elem.hierarchy.length;for(i=0;i<s;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function fromComp(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var i,s=this._elem.hierarchy.length;for(i=0;i<s;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function sampleImage(){return[1,1,1,1]}return function(t){var e;function _thisLayerFunction(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return _thisLayerFunction.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return e;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return _thisLayerFunction.effect;case"ADBE Text Properties":return _thisLayerFunction.textInterface;default:return null}}_thisLayerFunction.getMatrix=getMatrix,_thisLayerFunction.invertPoint=invertPoint,_thisLayerFunction.applyPoint=applyPoint,_thisLayerFunction.toWorld=toWorld,_thisLayerFunction.toWorldVec=toWorldVec,_thisLayerFunction.fromWorld=fromWorld,_thisLayerFunction.fromWorldVec=fromWorldVec,_thisLayerFunction.toComp=toWorld,_thisLayerFunction.fromComp=fromComp,_thisLayerFunction.sampleImage=sampleImage,_thisLayerFunction.sourceRectAtTime=t.sourceRectAtTime.bind(t),_thisLayerFunction._elem=t;var i=getDescriptor(e=TransformExpressionInterface(t.finalTransform.mProp),"anchorPoint");return Object.defineProperties(_thisLayerFunction,{hasParent:{get:function get(){return t.hierarchy.length}},parent:{get:function get(){return t.hierarchy[0].layerInterface}},rotation:getDescriptor(e,"rotation"),scale:getDescriptor(e,"scale"),position:getDescriptor(e,"position"),opacity:getDescriptor(e,"opacity"),anchorPoint:i,anchor_point:i,transform:{get:function get(){return e}},active:{get:function get(){return t.isInRange}}}),_thisLayerFunction.startTime=t.data.st,_thisLayerFunction.index=t.data.ind,_thisLayerFunction.source=t.data.refId,_thisLayerFunction.height=0===t.data.ty?t.data.h:100,_thisLayerFunction.width=0===t.data.ty?t.data.w:100,_thisLayerFunction.inPoint=t.data.ip/t.comp.globalData.frameRate,_thisLayerFunction.outPoint=t.data.op/t.comp.globalData.frameRate,_thisLayerFunction._name=t.data.nm,_thisLayerFunction.registerMaskInterface=function _registerMaskInterface(e){_thisLayerFunction.mask=new MaskManagerInterface(e,t)},_thisLayerFunction.registerEffectsInterface=function _registerEffectsInterface(t){_thisLayerFunction.effect=t},_thisLayerFunction}}(),propertyGroupFactory=function(t,e){return function(i){return(i=void 0===i?1:i)<=0?t:e(i-1)}},PropertyInterface=function(t,e){var i={_name:t};return function _propertyGroup(t){return(t=void 0===t?1:t)<=0?i:e(t-1)}},EffectsExpressionInterface=function(){function createGroupInterface(t,e,i,s){function groupInterface(e){for(var i=t.ef,s=0,n=i.length;s<n;){if(e===i[s].nm||e===i[s].mn||e===i[s].ix)return 5===i[s].ty?r[s]:r[s]();s+=1}throw new Error}var n,a=propertyGroupFactory(groupInterface,i),r=[],o=t.ef.length;for(n=0;n<o;n+=1)5===t.ef[n].ty?r.push(createGroupInterface(t.ef[n],e.effectElements[n],e.effectElements[n].propertyGroup,s)):r.push(createValueInterface(e.effectElements[n],t.ef[n].ty,s,a));return"ADBE Color Control"===t.mn&&Object.defineProperty(groupInterface,"color",{get:function get(){return r[0]()}}),Object.defineProperties(groupInterface,{numProperties:{get:function get(){return t.np}},_name:{value:t.nm},propertyGroup:{value:a}}),groupInterface.enabled=0!==t.en,groupInterface.active=groupInterface.enabled,groupInterface}function createValueInterface(t,e,i,s){var n=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",s)),function interfaceFunction(){return 10===e?i.comp.compInterface(t.p.v):n()}}return{createEffectsInterface:function createEffectsInterface(t,e){if(t.effectsManager){var i,s=[],n=t.data.ef,a=t.effectsManager.effectElements.length;for(i=0;i<a;i+=1)s.push(createGroupInterface(n[i],t.effectsManager.effectElements[i],e,t));var r=t.data.ef||[],o=function groupInterface(t){for(i=0,a=r.length;i<a;){if(t===r[i].nm||t===r[i].mn||t===r[i].ix)return s[i];i+=1}return null};return Object.defineProperty(o,"numProperties",{get:function get(){return r.length}}),o}return null}}}(),ShapePathInterface=function pathInterfaceFactory(t,e,i){var s=e.sh;function interfaceFunction(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t?interfaceFunction.path:null}var n=propertyGroupFactory(interfaceFunction,i);return s.setGroupProperty(PropertyInterface("Path",n)),Object.defineProperties(interfaceFunction,{path:{get:function get(){return s.k&&s.getValue(),s}},shape:{get:function get(){return s.k&&s.getValue(),s}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:i}}),interfaceFunction},ShapeExpressionInterface=function(){function iterateElements(t,e,i){var s,n=[],a=t?t.length:0;for(s=0;s<a;s+=1)"gr"===t[s].ty?n.push(groupInterfaceFactory(t[s],e[s],i)):"fl"===t[s].ty?n.push(fillInterfaceFactory(t[s],e[s],i)):"st"===t[s].ty?n.push(strokeInterfaceFactory(t[s],e[s],i)):"tm"===t[s].ty?n.push(trimInterfaceFactory(t[s],e[s],i)):"tr"===t[s].ty||("el"===t[s].ty?n.push(ellipseInterfaceFactory(t[s],e[s],i)):"sr"===t[s].ty?n.push(starInterfaceFactory(t[s],e[s],i)):"sh"===t[s].ty?n.push(ShapePathInterface(t[s],e[s],i)):"rc"===t[s].ty?n.push(rectInterfaceFactory(t[s],e[s],i)):"rd"===t[s].ty?n.push(roundedInterfaceFactory(t[s],e[s],i)):"rp"===t[s].ty?n.push(repeaterInterfaceFactory(t[s],e[s],i)):"gf"===t[s].ty?n.push(gradientFillInterfaceFactory(t[s],e[s],i)):n.push(defaultInterfaceFactory(t[s],e[s])));return n}function groupInterfaceFactory(t,e,i){var s=function _interfaceFunction(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return s.content;default:return s.transform}};s.propertyGroup=propertyGroupFactory(s,i);var n=function contentsInterfaceFactory(t,e,i){var s,n=function _interfaceFunction(t){for(var e=0,i=s.length;e<i;){if(s[e]._name===t||s[e].mn===t||s[e].propertyIndex===t||s[e].ix===t||s[e].ind===t)return s[e];e+=1}return"number"==typeof t?s[t-1]:null};n.propertyGroup=propertyGroupFactory(n,i),s=iterateElements(t.it,e.it,n.propertyGroup),n.numProperties=s.length;var a=transformInterfaceFactory(t.it[t.it.length-1],e.it[e.it.length-1],n.propertyGroup);return n.transform=a,n.propertyIndex=t.cix,n._name=t.nm,n}(t,e,s.propertyGroup),a=transformInterfaceFactory(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.content=n,s.transform=a,Object.defineProperty(s,"_name",{get:function get(){return t.nm}}),s.numProperties=t.np,s.propertyIndex=t.ix,s.nm=t.nm,s.mn=t.mn,s}function fillInterfaceFactory(t,e,i){function interfaceFunction(t){return"Color"===t||"color"===t?interfaceFunction.color:"Opacity"===t||"opacity"===t?interfaceFunction.opacity:null}return Object.defineProperties(interfaceFunction,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),interfaceFunction}function gradientFillInterfaceFactory(t,e,i){function interfaceFunction(t){return"Start Point"===t||"start point"===t?interfaceFunction.startPoint:"End Point"===t||"end point"===t?interfaceFunction.endPoint:"Opacity"===t||"opacity"===t?interfaceFunction.opacity:null}return Object.defineProperties(interfaceFunction,{startPoint:{get:ExpressionPropertyInterface(e.s)},endPoint:{get:ExpressionPropertyInterface(e.e)},opacity:{get:ExpressionPropertyInterface(e.o)},type:{get:function get(){return"a"}},_name:{value:t.nm},mn:{value:t.mn}}),e.s.setGroupProperty(PropertyInterface("Start Point",i)),e.e.setGroupProperty(PropertyInterface("End Point",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),interfaceFunction}function defaultInterfaceFactory(){return function interfaceFunction(){return null}}function strokeInterfaceFactory(t,e,i){var s,n=propertyGroupFactory(interfaceFunction,i),a=propertyGroupFactory(o,n);function addPropertyToDashOb(i){Object.defineProperty(o,t.d[i].nm,{get:ExpressionPropertyInterface(e.d.dataProps[i].p)})}var r=t.d?t.d.length:0,o={};for(s=0;s<r;s+=1)addPropertyToDashOb(s),e.d.dataProps[s].p.setGroupProperty(a);function interfaceFunction(t){return"Color"===t||"color"===t?interfaceFunction.color:"Opacity"===t||"opacity"===t?interfaceFunction.opacity:"Stroke Width"===t||"stroke width"===t?interfaceFunction.strokeWidth:null}return Object.defineProperties(interfaceFunction,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function get(){return o}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",n)),e.o.setGroupProperty(PropertyInterface("Opacity",n)),e.w.setGroupProperty(PropertyInterface("Stroke Width",n)),interfaceFunction}function trimInterfaceFactory(t,e,i){function interfaceFunction(e){return e===t.e.ix||"End"===e||"end"===e?interfaceFunction.end:e===t.s.ix?interfaceFunction.start:e===t.o.ix?interfaceFunction.offset:null}var s=propertyGroupFactory(interfaceFunction,i);return interfaceFunction.propertyIndex=t.ix,e.s.setGroupProperty(PropertyInterface("Start",s)),e.e.setGroupProperty(PropertyInterface("End",s)),e.o.setGroupProperty(PropertyInterface("Offset",s)),interfaceFunction.propertyIndex=t.ix,interfaceFunction.propertyGroup=i,Object.defineProperties(interfaceFunction,{start:{get:ExpressionPropertyInterface(e.s)},end:{get:ExpressionPropertyInterface(e.e)},offset:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm}}),interfaceFunction.mn=t.mn,interfaceFunction}function transformInterfaceFactory(t,e,i){function interfaceFunction(e){return t.a.ix===e||"Anchor Point"===e?interfaceFunction.anchorPoint:t.o.ix===e||"Opacity"===e?interfaceFunction.opacity:t.p.ix===e||"Position"===e?interfaceFunction.position:t.r.ix===e||"Rotation"===e||"ADBE Vector Rotation"===e?interfaceFunction.rotation:t.s.ix===e||"Scale"===e?interfaceFunction.scale:t.sk&&t.sk.ix===e||"Skew"===e?interfaceFunction.skew:t.sa&&t.sa.ix===e||"Skew Axis"===e?interfaceFunction.skewAxis:null}var s=propertyGroupFactory(interfaceFunction,i);return e.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),e.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),e.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),e.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),e.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),e.transform.mProps.sk&&(e.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),e.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),e.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(interfaceFunction,{opacity:{get:ExpressionPropertyInterface(e.transform.mProps.o)},position:{get:ExpressionPropertyInterface(e.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(e.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(e.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(e.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(e.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(e.transform.mProps.sa)},_name:{value:t.nm}}),interfaceFunction.ty="tr",interfaceFunction.mn=t.mn,interfaceFunction.propertyGroup=i,interfaceFunction}function ellipseInterfaceFactory(t,e,i){function interfaceFunction(e){return t.p.ix===e?interfaceFunction.position:t.s.ix===e?interfaceFunction.size:null}var s=propertyGroupFactory(interfaceFunction,i);interfaceFunction.propertyIndex=t.ix;var n="tm"===e.sh.ty?e.sh.prop:e.sh;return n.s.setGroupProperty(PropertyInterface("Size",s)),n.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(interfaceFunction,{size:{get:ExpressionPropertyInterface(n.s)},position:{get:ExpressionPropertyInterface(n.p)},_name:{value:t.nm}}),interfaceFunction.mn=t.mn,interfaceFunction}function starInterfaceFactory(t,e,i){function interfaceFunction(e){return t.p.ix===e?interfaceFunction.position:t.r.ix===e?interfaceFunction.rotation:t.pt.ix===e?interfaceFunction.points:t.or.ix===e||"ADBE Vector Star Outer Radius"===e?interfaceFunction.outerRadius:t.os.ix===e?interfaceFunction.outerRoundness:!t.ir||t.ir.ix!==e&&"ADBE Vector Star Inner Radius"!==e?t.is&&t.is.ix===e?interfaceFunction.innerRoundness:null:interfaceFunction.innerRadius}var s=propertyGroupFactory(interfaceFunction,i),n="tm"===e.sh.ty?e.sh.prop:e.sh;return interfaceFunction.propertyIndex=t.ix,n.or.setGroupProperty(PropertyInterface("Outer Radius",s)),n.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),n.pt.setGroupProperty(PropertyInterface("Points",s)),n.p.setGroupProperty(PropertyInterface("Position",s)),n.r.setGroupProperty(PropertyInterface("Rotation",s)),t.ir&&(n.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),n.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(interfaceFunction,{position:{get:ExpressionPropertyInterface(n.p)},rotation:{get:ExpressionPropertyInterface(n.r)},points:{get:ExpressionPropertyInterface(n.pt)},outerRadius:{get:ExpressionPropertyInterface(n.or)},outerRoundness:{get:ExpressionPropertyInterface(n.os)},innerRadius:{get:ExpressionPropertyInterface(n.ir)},innerRoundness:{get:ExpressionPropertyInterface(n.is)},_name:{value:t.nm}}),interfaceFunction.mn=t.mn,interfaceFunction}function rectInterfaceFactory(t,e,i){function interfaceFunction(e){return t.p.ix===e?interfaceFunction.position:t.r.ix===e?interfaceFunction.roundness:t.s.ix===e||"Size"===e||"ADBE Vector Rect Size"===e?interfaceFunction.size:null}var s=propertyGroupFactory(interfaceFunction,i),n="tm"===e.sh.ty?e.sh.prop:e.sh;return interfaceFunction.propertyIndex=t.ix,n.p.setGroupProperty(PropertyInterface("Position",s)),n.s.setGroupProperty(PropertyInterface("Size",s)),n.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(interfaceFunction,{position:{get:ExpressionPropertyInterface(n.p)},roundness:{get:ExpressionPropertyInterface(n.r)},size:{get:ExpressionPropertyInterface(n.s)},_name:{value:t.nm}}),interfaceFunction.mn=t.mn,interfaceFunction}function roundedInterfaceFactory(t,e,i){function interfaceFunction(e){return t.r.ix===e||"Round Corners 1"===e?interfaceFunction.radius:null}var s=propertyGroupFactory(interfaceFunction,i),n=e;return interfaceFunction.propertyIndex=t.ix,n.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(interfaceFunction,{radius:{get:ExpressionPropertyInterface(n.rd)},_name:{value:t.nm}}),interfaceFunction.mn=t.mn,interfaceFunction}function repeaterInterfaceFactory(t,e,i){function interfaceFunction(e){return t.c.ix===e||"Copies"===e?interfaceFunction.copies:t.o.ix===e||"Offset"===e?interfaceFunction.offset:null}var s=propertyGroupFactory(interfaceFunction,i),n=e;return interfaceFunction.propertyIndex=t.ix,n.c.setGroupProperty(PropertyInterface("Copies",s)),n.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(interfaceFunction,{copies:{get:ExpressionPropertyInterface(n.c)},offset:{get:ExpressionPropertyInterface(n.o)},_name:{value:t.nm}}),interfaceFunction.mn=t.mn,interfaceFunction}return function(t,e,i){var s;function _interfaceFunction(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,n=s.length;e<n;){if(s[e]._name===t)return s[e];e+=1}return null}return _interfaceFunction.propertyGroup=propertyGroupFactory(_interfaceFunction,function parentGroupWrapper(){return i}),s=iterateElements(t,e,_interfaceFunction.propertyGroup),_interfaceFunction.numProperties=s.length,_interfaceFunction._name="Contents",_interfaceFunction}}(),TextExpressionInterface=function(t){var e;function _thisLayerFunction(t){return"ADBE Text Document"===t?_thisLayerFunction.sourceText:null}return Object.defineProperty(_thisLayerFunction,"sourceText",{get:function get(){t.textProperty.getValue();var i=t.textProperty.currentData.t;return e&&i===e.value||((e=new String(i)).value=i||new String(i),Object.defineProperty(e,"style",{get:function get(){return{fillColor:t.textProperty.currentData.fc}}})),e}}),_thisLayerFunction};function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var FootageInterface=(dataInterfaceFactory=function dataInterfaceFactory(t){function interfaceFunction(t){return"Outline"===t?interfaceFunction.outlineInterface():null}return interfaceFunction._name="Outline",interfaceFunction.outlineInterface=function outlineInterfaceFactory(t){var e="",i=t.getFootageData();function searchProperty(t){if(i[t])return e=t,"object"===_typeof(i=i[t])?searchProperty:i;var s=t.indexOf(e);if(-1!==s){var n=parseInt(t.substr(s+e.length),10);return"object"===_typeof(i=i[n])?searchProperty:i}return""}return function init(){return e="",i=t.getFootageData(),searchProperty}}(t),interfaceFunction},function(t){function _interfaceFunction(t){return"Data"===t?_interfaceFunction.dataInterface:null}return _interfaceFunction._name="Data",_interfaceFunction.dataInterface=dataInterfaceFactory(t),_interfaceFunction}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(t){return interfaces[t]||null}var expressionHelpers={searchExpressions:function searchExpressions(t,e,i){e.x&&(i.k=!0,i.x=!0,i.initiateExpression=ExpressionManager.initiateExpression,i.effectsSequence.push(i.initiateExpression(t,e,i).bind(i)))},getSpeedAtTime:function getSpeedAtTime(t){var e=this.getValueAtTime(t),i=this.getValueAtTime(t+-.01),s=0;if(e.length){var n;for(n=0;n<e.length;n+=1)s+=Math.pow(i[n]-e[n],2);s=100*Math.sqrt(s)}else s=0;return s},getVelocityAtTime:function getVelocityAtTime(t){if(void 0!==this.vel)return this.vel;var e,i,s=-.001,n=this.getValueAtTime(t),a=this.getValueAtTime(t+s);if(n.length)for(e=createTypedArray("float32",n.length),i=0;i<n.length;i+=1)e[i]=(a[i]-n[i])/s;else e=(a-n)/s;return e},getValueAtTime:function getValueAtTime(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function getStaticValueAtTime(){return this.pv},setGroupProperty:function setGroupProperty(t){this.propertyGroup=t}};function addPropertyDecorator(){function loopOut(t,e,i){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var s,n,a,r,o,l=this.comp.renderedFrame,h=this.keyframes,d=h[h.length-1].t;if(l<=d)return this.pv;if(i?n=d-(s=e?Math.abs(d-this.elem.comp.globalData.frameRate*e):Math.max(0,d-this.elem.data.ip)):((!e||e>h.length-1)&&(e=h.length-1),s=d-(n=h[h.length-1-e].t)),"pingpong"===t){if(Math.floor((l-n)/s)%2!=0)return this.getValueAtTime((s-(l-n)%s+n)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var u=this.getValueAtTime(n/this.comp.globalData.frameRate,0),p=this.getValueAtTime(d/this.comp.globalData.frameRate,0),m=this.getValueAtTime(((l-n)%s+n)/this.comp.globalData.frameRate,0),g=Math.floor((l-n)/s);if(this.pv.length){for(r=(o=new Array(u.length)).length,a=0;a<r;a+=1)o[a]=(p[a]-u[a])*g+m[a];return o}return(p-u)*g+m}if("continue"===t){var b=this.getValueAtTime(d/this.comp.globalData.frameRate,0),f=this.getValueAtTime((d-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(r=(o=new Array(b.length)).length,a=0;a<r;a+=1)o[a]=b[a]+(b[a]-f[a])*((l-d)/this.comp.globalData.frameRate)/5e-4;return o}return b+(l-d)/.001*(b-f)}}return this.getValueAtTime(((l-n)%s+n)/this.comp.globalData.frameRate,0)}function loopIn(t,e,i){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var s,n,a,r,o,l=this.comp.renderedFrame,h=this.keyframes,d=h[0].t;if(l>=d)return this.pv;if(i?n=d+(s=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-d)):((!e||e>h.length-1)&&(e=h.length-1),s=(n=h[e].t)-d),"pingpong"===t){if(Math.floor((d-l)/s)%2==0)return this.getValueAtTime(((d-l)%s+d)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var u=this.getValueAtTime(d/this.comp.globalData.frameRate,0),p=this.getValueAtTime(n/this.comp.globalData.frameRate,0),m=this.getValueAtTime((s-(d-l)%s+d)/this.comp.globalData.frameRate,0),g=Math.floor((d-l)/s)+1;if(this.pv.length){for(r=(o=new Array(u.length)).length,a=0;a<r;a+=1)o[a]=m[a]-(p[a]-u[a])*g;return o}return m-(p-u)*g}if("continue"===t){var b=this.getValueAtTime(d/this.comp.globalData.frameRate,0),f=this.getValueAtTime((d+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(r=(o=new Array(b.length)).length,a=0;a<r;a+=1)o[a]=b[a]+(b[a]-f[a])*(d-l)/.001;return o}return b+(b-f)*(d-l)/.001}}return this.getValueAtTime((s-((d-l)%s+d))/this.comp.globalData.frameRate,0)}function smooth(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var i,s,n=this.comp.renderedFrame/this.comp.globalData.frameRate,a=n-t,r=e>1?(n+t-a)/(e-1):1,o=0,l=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(s=this.getValueAtTime(a+o*r),this.pv.length)for(l=0;l<this.pv.length;l+=1)i[l]+=s[l];else i+=s;o+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)i[l]/=e;else i/=e;return i}function getTransformValueAtTime(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var i=this.a.getValueAtTime(t);e.translate(-i[0]*this.a.mult,-i[1]*this.a.mult,i[2]*this.a.mult)}if(this.appliedTransformations<2){var s=this.s.getValueAtTime(t);e.scale(s[0]*this.s.mult,s[1]*this.s.mult,s[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var n=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-n*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var r=this.r.getValueAtTime(t);e.rotate(-r*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),l=this.ry.getValueAtTime(t),h=this.rx.getValueAtTime(t),d=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(l*this.ry.mult).rotateX(h*this.rx.mult).rotateZ(-d[2]*this.or.mult).rotateY(d[1]*this.or.mult).rotateX(d[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var u=this.px.getValueAtTime(t),p=this.py.getValueAtTime(t);if(this.data.p.z){var m=this.pz.getValueAtTime(t);e.translate(u*this.px.mult,p*this.py.mult,-m*this.pz.mult)}else e.translate(u*this.px.mult,p*this.py.mult,0)}else{var g=this.p.getValueAtTime(t);e.translate(g[0]*this.p.mult,g[1]*this.p.mult,-g[2]*this.p.mult)}return e}function getTransformStaticValueAtTime(){return this.v.clone(new Matrix)}var t=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,i,s){var n=t(e,i,s);return n.dynamicProperties.length?n.getValueAtTime=getTransformValueAtTime.bind(n):n.getValueAtTime=getTransformStaticValueAtTime.bind(n),n.setGroupProperty=expressionHelpers.setGroupProperty,n};var e=PropertyFactory.getProp;PropertyFactory.getProp=function(t,i,s,n,a){var r=e(t,i,s,n,a);r.kf?r.getValueAtTime=expressionHelpers.getValueAtTime.bind(r):r.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(r),r.setGroupProperty=expressionHelpers.setGroupProperty,r.loopOut=loopOut,r.loopIn=loopIn,r.smooth=smooth,r.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(r),r.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(r),r.numKeys=1===i.a?i.k.length:0,r.propertyIndex=i.ix;var o=0;return 0!==s&&(o=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),r._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:o},expressionHelpers.searchExpressions(t,i,r),r.k&&a.addDynamicProperty(r),r};var i=ShapePropertyFactory.getConstructorFunction(),s=ShapePropertyFactory.getKeyframedConstructorFunction();function ShapeExpressions(){}ShapeExpressions.prototype={vertices:function vertices(t,e){this.k&&this.getValue();var i,s=this.v;void 0!==e&&(s=this.getValueAtTime(e,0));var n=s._length,vertices=s[t],a=s.v,r=createSizedArray(n);for(i=0;i<n;i+=1)r[i]="i"===t||"o"===t?[vertices[i][0]-a[i][0],vertices[i][1]-a[i][1]]:[vertices[i][0],vertices[i][1]];return r},points:function points(t){return this.vertices("v",t)},inTangents:function inTangents(t){return this.vertices("i",t)},outTangents:function outTangents(t){return this.vertices("o",t)},isClosed:function isClosed(){return this.v.c},pointOnPath:function pointOnPath(t,e){var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(i));for(var s,n=this._segmentsLength,a=n.lengths,r=n.totalLength*t,o=0,l=a.length,h=0;o<l;){if(h+a[o].addedLength>r){var d=o,u=i.c&&o===l-1?0:o+1,p=(r-h)/a[o].addedLength;s=bez.getPointInSegment(i.v[d],i.v[u],i.o[d],i.i[u],p,a[o]);break}h+=a[o].addedLength,o+=1}return s||(s=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),s},vectorOnPath:function vectorOnPath(t,e,i){1==t?t=this.v.c:0==t&&(t=.999);var s=this.pointOnPath(t,e),n=this.pointOnPath(t+.001,e),a=n[0]-s[0],r=n[1]-s[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(r,2));return 0===o?[0,0]:"tangent"===i?[a/o,r/o]:[-r/o,a/o]},tangentOnPath:function tangentOnPath(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function normalOnPath(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([ShapeExpressions],i),extendPrototype([ShapeExpressions],s),s.prototype.getValueAtTime=function getShapeValueAtTime(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},s.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,i,s,a){var r=n(t,e,i,s,a);return r.propertyIndex=e.ix,r.lock=!1,3===i?expressionHelpers.searchExpressions(t,e.pt,r):4===i&&expressionHelpers.searchExpressions(t,e.ks,r),r.k&&t.addDynamicProperty(r),r}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(t,e){var i=this.calculateExpression(e);if(t.t!==i){var s={};return this.copyData(s,t),s.t=i.toString(),s.__complete=!1,s}return t},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function searchExpressions(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function createMergeNode(t,e){var i,s,n=createNS("feMerge");for(n.setAttribute("result",t),s=0;s<e.length;s+=1)(i=createNS("feMergeNode")).setAttribute("in",e[s]),n.appendChild(i),n.appendChild(i);return n}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(t,e,i,s,n){this.filterManager=e;var a=createNS("feColorMatrix");a.setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","linearRGB"),a.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=a,a.setAttribute("result",s+"_tint_1"),t.appendChild(a),(a=createNS("feColorMatrix")).setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),a.setAttribute("result",s+"_tint_2"),t.appendChild(a),this.matrixFilter=a;var r=this.createMergeNode(s,[n,s+"_tint_1",s+"_tint_2"]);t.appendChild(r)}function SVGFillFilter(t,e,i,s){this.filterManager=e;var n=createNS("feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),n.setAttribute("result",s),t.appendChild(n),this.matrixFilter=n}function SVGStrokeEffect(t,e,i){this.initialized=!1,this.filterManager=e,this.elem=i,this.paths=[]}function SVGTritoneFilter(t,e,i,s){this.filterManager=e;var n=createNS("feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","linearRGB"),n.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),t.appendChild(n);var a=createNS("feComponentTransfer");a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",s),this.matrixFilter=a;var r=createNS("feFuncR");r.setAttribute("type","table"),a.appendChild(r),this.feFuncR=r;var o=createNS("feFuncG");o.setAttribute("type","table"),a.appendChild(o),this.feFuncG=o;var l=createNS("feFuncB");l.setAttribute("type","table"),a.appendChild(l),this.feFuncB=l,t.appendChild(a)}function SVGProLevelsFilter(t,e,i,s){this.filterManager=e;var n=this.filterManager.effectElements,a=createNS("feComponentTransfer");(n[10].p.k||0!==n[10].p.v||n[11].p.k||1!==n[11].p.v||n[12].p.k||1!==n[12].p.v||n[13].p.k||0!==n[13].p.v||n[14].p.k||1!==n[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",a)),(n[17].p.k||0!==n[17].p.v||n[18].p.k||1!==n[18].p.v||n[19].p.k||1!==n[19].p.v||n[20].p.k||0!==n[20].p.v||n[21].p.k||1!==n[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",a)),(n[24].p.k||0!==n[24].p.v||n[25].p.k||1!==n[25].p.v||n[26].p.k||1!==n[26].p.v||n[27].p.k||0!==n[27].p.v||n[28].p.k||1!==n[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",a)),(n[31].p.k||0!==n[31].p.v||n[32].p.k||1!==n[32].p.v||n[33].p.k||1!==n[33].p.v||n[34].p.k||0!==n[34].p.v||n[35].p.k||1!==n[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",a)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(a.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(a)),(n[3].p.k||0!==n[3].p.v||n[4].p.k||1!==n[4].p.v||n[5].p.k||1!==n[5].p.v||n[6].p.k||0!==n[6].p.v||n[7].p.k||1!==n[7].p.v)&&((a=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",s),t.appendChild(a),this.feFuncRComposed=this.createFeFunc("feFuncR",a),this.feFuncGComposed=this.createFeFunc("feFuncG",a),this.feFuncBComposed=this.createFeFunc("feFuncB",a))}function SVGDropShadowEffect(t,e,i,s,n){var a=e.container.globalData.renderConfig.filterSize,r=e.data.fs||a;t.setAttribute("x",r.x||a.x),t.setAttribute("y",r.y||a.y),t.setAttribute("width",r.width||a.width),t.setAttribute("height",r.height||a.height),this.filterManager=e;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",s+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,t.appendChild(o);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",s+"_drop_shadow_1"),l.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=l,t.appendChild(l);var h=createNS("feFlood");h.setAttribute("flood-color","#00ff00"),h.setAttribute("flood-opacity","1"),h.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=h,t.appendChild(h);var d=createNS("feComposite");d.setAttribute("in",s+"_drop_shadow_3"),d.setAttribute("in2",s+"_drop_shadow_2"),d.setAttribute("operator","in"),d.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(d);var u=this.createMergeNode(s,[s+"_drop_shadow_4",n]);t.appendChild(u)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,s=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+s+" 0"),this.matrixFilter.setAttribute("values",i[0]-e[0]+" 0 0 0 "+e[0]+" "+(i[1]-e[1])+" 0 0 0 "+e[1]+" "+(i[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,i=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var t,e,i,s,n=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(s=this.elem.maskManager.masksProperties.length,i=0):s=1+(i=this.filterManager.effectElements[0].p.v-1),(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);i<s;i+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:i});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),r=createElementID();a.setAttribute("id",r),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+r+")");n[0];)o.appendChild(n[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(n=this.elem.layerElement.children||this.elem.layerElement.childNodes;n.length;)this.elem.layerElement.removeChild(n[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){var e;this.initialized||this.initialize();var i,s,n=this.paths.length;for(e=0;e<n;e+=1)if(-1!==this.paths[e].m&&(i=this.elem.maskManager.viewData[this.paths[e].m],s=this.paths[e].p,(t||this.filterManager._mdf||i.prop._mdf)&&s.setAttribute("d",i.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||i.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var r=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=s.getTotalLength();a="0 0 0 "+l*r+" ";var h,d=l*(o-r),u=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,p=Math.floor(d/u);for(h=0;h<p;h+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*l+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;s.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var m=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*m[0])+","+bmFloor(255*m[1])+","+bmFloor(255*m[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,s=this.filterManager.effectElements[2].p.v,n=s[0]+" "+i[0]+" "+e[0],a=s[1]+" "+i[1]+" "+e[1],r=s[2]+" "+i[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",n),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",r)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var i=createNS(t);return i.setAttribute("type","table"),e.appendChild(i),i},SVGProLevelsFilter.prototype.getTableValue=function(t,e,i,s,n){for(var a,r,o=0,l=Math.min(t,e),h=Math.max(t,e),d=Array.call(null,{length:256}),u=0,p=n-s,m=e-t;o<=256;)r=(a=o/256)<=l?m<0?n:s:a>=h?m<0?s:n:s+p*Math.pow((a-t)/m,1/i),d[u]=r,u+=1,o+=256/255;return d.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,n=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",n),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGGaussianBlurEffect(t,e,i,s){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var n=createNS("feGaussianBlur");n.setAttribute("result",s),t.appendChild(n),this.feGaussianBlur=n}function TransformEffect(){}function SVGTransformEffect(t,e){this.init(e)}function CVTransformEffect(t){this.init(t)}return SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e<i;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var i=t.layerElement.parentNode;if(i){for(var s,n=i.children,a=0,r=n.length;a<r&&n[a]!==t.layerElement;)a+=1;a<=r-2&&(s=n[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),s?i.insertBefore(o,s):i.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var i=createElementID(),s=createNS("mask");s.setAttribute("id",e.layerId),s.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var n=t.globalData.defs;n.appendChild(s);var a=createNS("symbol");a.setAttribute("id",i),this.replaceInParent(e,i),a.appendChild(e.layerElement),n.appendChild(a);var r=createNS("use");r.setAttribute("href","#"+i),s.appendChild(r),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,i=0,s=e.length;i<s;)e[i]&&e[i].data.ind===t&&this.setElementAsMask(this.elem,e[i]),i+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,s=3==i?0:e,n=2==i?0:e;this.feGaussianBlur.setAttribute("stdDeviation",s+" "+n);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},TransformEffect.prototype.init=function(t){this.effectsManager=t,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(t){if(this._opMdf=!1,this._mdf=!1,t||this.effectsManager._mdf){var e=this.effectsManager.effectElements,i=e[0].p.v,s=e[1].p.v,n=1===e[2].p.v,a=e[3].p.v,r=n?a:e[4].p.v,o=e[5].p.v,l=e[6].p.v,h=e[7].p.v;this.matrix.reset(),this.matrix.translate(-i[0],-i[1],i[2]),this.matrix.scale(.01*r,.01*a,1),this.matrix.rotate(-h*degToRads),this.matrix.skewFromAxis(-o*degToRads,(l+90)*degToRads),this.matrix.translate(s[0],s[1],0),this._mdf=!0,this.opacity!==e[8].p.v&&(this.opacity=e[8].p.v,this._opMdf=!0)}},extendPrototype([TransformEffect],SVGTransformEffect),extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie},module.exports=factory())})(lottie$2,lottie$2.exports);var lottieExports=lottie$2.exports,lottie=getDefaultExportFromCjs(lottieExports),lottie$1=_mergeNamespaces({__proto__:null,default:lottie},[lottieExports]);exports.DbAccordion=DbAccordion,exports.DbAdBanner=DbAdBanner,exports.DbAlert=DbAlert,exports.DbAnimationBackground=DbAnimationBackground,exports.DbAnimationText=DbAnimationText,exports.DbAppBadge=DbAppBadge,exports.DbAudioPlayer=DbAudioPlayer,exports.DbAvatar=DbAvatar,exports.DbBackdrop=DbBackdrop,exports.DbBadge=DbBadge,exports.DbBanner=DbBanner,exports.DbBottomNavigation=DbBottomNavigation,exports.DbBottomSheet=DbBottomSheet,exports.DbBreadcrumbs=DbBreadcrumbs,exports.DbButton=DbButton,exports.DbCalendar=DbCalendar,exports.DbCard=DbCard,exports.DbCarousel=DbCarousel,exports.DbCheckbox=DbCheckbox,exports.DbChip=DbChip,exports.DbCodeBlock=DbCodeBlock,exports.DbColorPicker=DbColorPicker,exports.DbConfirm=DbConfirm,exports.DbContainer=DbContainer,exports.DbContextMenu=DbContextMenu,exports.DbCountdown=DbCountdown,exports.DbCursorFollower=DbCursorFollower,exports.DbDatePicker=DbDatePicker,exports.DbDivider=DbDivider,exports.DbDrawer=DbDrawer,exports.DbDropdown=DbDropdown,exports.DbDropzone=DbDropzone,exports.DbEmptyState=DbEmptyState,exports.DbFileUploader=DbFileUploader,exports.DbFloatingActionButton=DbFloatingActionButton,exports.DbForm=DbForm,exports.DbGradient=DbGradient,exports.DbGrid=DbGrid,exports.DbGridItem=DbGridItem,exports.DbImage=DbImage,exports.DbImageList=DbImageList,exports.DbImagePlaceholder=DbImagePlaceholder,exports.DbIndicator=DbIndicator,exports.DbInput=DbInput,exports.DbLabel=DbLabel,exports.DbLightbox=DbLightbox,exports.DbList=DbList,exports.DbLogo=DbLogo,exports.DbLottie=DbLottie,exports.DbMarkdownEditor=DbMarkdownEditor,exports.DbMarquee=DbMarquee,exports.DbMasonry=DbMasonry,exports.DbMenuItem=DbMenuItem,exports.DbModal=DbModal,exports.DbNavbar=DbNavbar,exports.DbOnboardingModal=DbOnboardingModal,exports.DbPageHeader=DbPageHeader,exports.DbPagination=DbPagination,exports.DbPopover=DbPopover,exports.DbProgress=DbProgress,exports.DbProgressStep=DbProgressStep,exports.DbProgressbar=DbProgressbar,exports.DbRadio=DbRadio,exports.DbRandomGradient=DbRandomGradient,exports.DbRangeSlider=DbRangeSlider,exports.DbRating=DbRating,exports.DbReorder=DbReorder,exports.DbResizablePanels=DbResizablePanels,exports.DbScrollArea=DbScrollArea,exports.DbSearchBar=DbSearchBar,exports.DbSection=DbSection,exports.DbSectionAppDownload=DbSectionAppDownload,exports.DbSectionContact=DbSectionContact,exports.DbSectionFeature=DbSectionFeature,exports.DbSectionHero=DbSectionHero,exports.DbSegmentControl=DbSegmentControl,exports.DbSelect=DbSelect,exports.DbShare=DbShare,exports.DbSidebar=DbSidebar,exports.DbSkeleton=DbSkeleton,exports.DbSpinner=DbSpinner,exports.DbSplitView=DbSplitView,exports.DbStack=DbStack,exports.DbStat=DbStat,exports.DbStepper=DbStepper,exports.DbTable=DbTable,exports.DbTabs=DbTabs,exports.DbTestimonial=DbTestimonial,exports.DbTextarea=DbTextarea,exports.DbTimePicker=DbTimePicker,exports.DbTimeline=DbTimeline,exports.DbToast=DbToast,exports.DbToggle=DbToggle,exports.DbToolbar=DbToolbar,exports.DbTooltip=DbTooltip,exports.DbTopBanner=DbTopBanner,exports.DbTutorial=DbTutorial,exports.DbVideoPlayer=DbVideoPlayer,exports.DbYouTubePlayer=DbYouTubePlayer;
|