@ckeditor/ckeditor5-ai 46.1.0-alpha.0 → 46.1.0-alpha.2

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.
Files changed (170) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +9 -9
  150. package/src/adapters/aiadapter.js +1 -1
  151. package/src/adapters/aitextadapter.js +1 -1
  152. package/src/adapters/awstextadapter.js +1 -1
  153. package/src/adapters/openaitextadapter.js +1 -1
  154. package/src/aiassistant.js +1 -1
  155. package/src/aiassistantediting.js +1 -1
  156. package/src/aiassistantui.js +1 -1
  157. package/src/index.js +1 -1
  158. package/src/legacyerrors.js +1 -1
  159. package/src/ui/aiassistantcontroller.js +2 -2
  160. package/src/ui/form/aiformcontentarea.js +1 -1
  161. package/src/ui/form/aiformerrorview.js +1 -1
  162. package/src/ui/form/aiformpromptview.js +1 -1
  163. package/src/ui/form/aiformtoolbarview.js +1 -1
  164. package/src/ui/form/aiformview.js +1 -1
  165. package/src/ui/form/aihistorylistitemview.js +1 -1
  166. package/src/ui/form/aihistorylistview.js +1 -1
  167. package/src/ui/form/prompthistory.js +1 -1
  168. package/src/ui/showaiassistantcommand.js +1 -1
  169. package/src/utils/common-translations.js +1 -1
  170. package/src/utils/normalizecommandsconfig.js +1 -1
package/build/ai.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={168:e=>{"use strict";e.exports=function(e){return e[1]}},181:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),i=n.n(r),s=n(433),o=n.n(s)()(i());o.push([e.id,":root{--ck-ai-dropdown-view-width:250px;--ck-ai-dropdown-view-list-max-height:250px}.ck.ck-ai-commands-search{width:var(--ck-ai-dropdown-view-width)}.ck.ck-ai-commands-search>.ck-labeled-field-view{padding:var(--ck-spacing-large)}.ck.ck-ai-commands-search>.ck-labeled-field-view .ck-input{min-width:unset}.ck.ck-ai-commands-search>.ck-search__results{border-top:1px solid var(--ck-color-base-border)}.ck.ck-ai-commands-search>.ck-search__results>.ck-list{max-height:var(--ck-ai-dropdown-view-list-max-height);overflow:auto}",""]);const a=o},237:e=>{"use strict";e.exports=CKEditor5.dll},262:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},331:(e,t,n)=>{e.exports=n(237)("./src/clipboard.js")},355:(e,t,n)=>{e.exports=n(237)("./src/icons.js")},357:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},369:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(n),o=Math.max(i,s),a=0,c=e.map([t,n],function(t){var n=o-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});for(r&&(a=o-Math.min(i,s)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(s));var a=function(){var e=s[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach(function(t){r[t]=e[t]})};for(t=0,n=s.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv",bot:"bot"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},s=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}();t.default=a,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),s=c(n(94)),o=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(s.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},s=0;if(Object.keys(e).forEach(function(t){var o=e[t];"string"==typeof o?(i[t]=o,s+=1):"object"==typeof o&&(n[t]=o,r+=1)}),r>0){var o=Object.keys(n),c=a.default.find(o,function(e){return t.isOS(e)});if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var d=a.default.find(o,function(e){return t.isPlatform(e)});if(d){var l=this.satisfies(n[d]);if(void 0!==l)return l}}if(s>0){var h=Object.keys(i),f=a.default.find(h,function(e){return t.isBrowser(e,!0)});if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:s.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:s.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:s.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=i.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:s.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},379:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),i=n.n(r),s=n(433),o=n.n(s)()(i());o.push([e.id,":root{--ck-ai-form-submit-button-text-color:var(--ck-color-text);--ck-ai-form-submit-button-border-color:transparent;--ck-ai-form-submit-button-disabled-border-color:transparent;--ck-ai-toolbar-button-hover-color:var(--ck-color-text);--ck-color-ai-selection:rgba(31,176,255,.3)}.ck-ai-assistant-ui_theme{--ck-color-button-default-hover-background:#f3ecff;--ck-color-button-default-active-background:#f3ecff;--ck-color-button-on-background:#f3ecff;--ck-color-button-on-hover-background:#f3ecff;--ck-color-button-on-active-background:#f3ecff;--ck-color-button-on-disabled-background:#f3ecff;--ck-color-button-on-color:#743ccd;--ck-color-button-action-background:#743ccd;--ck-color-button-action-hover-background:#6c34c9;--ck-color-button-action-active-background:#6c34c9;--ck-color-button-action-disabled-background:#ba9de6;--ck-color-list-button-hover-background:#f3ecff;--ck-ai-form-content-background:#f9f9f9;--ck-ai-form-submit-button-text-color:var(--ck-color-button-on-color);--ck-ai-form-submit-button-border-color:var(--ck-color-button-action-background);--ck-ai-form-submit-button-disabled-border-color:var(--ck-color-button-action-disabled-background);--ck-ai-toolbar-button-hover-color:var(--ck-color-button-on-color);--ck-color-ai-selection:#e2d6f5}.ck-ai-assistant-button:hover,.ck-ai-commands-dropdown>.ck-button:hover{color:var(--ck-ai-toolbar-button-hover-color)}.ck span.ck-fake-ai-selection{background:var(--ck-color-ai-selection)}.ck .ck-widget.ck-fake-ai-selection{outline-color:var(--ck-color-ai-selection)}.ck span.ck-fake-ai-selection-candidate{background:var(--ck-color-ai-selection)}.ck .ck-fake-ai-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}.ck.ck-content.ck-ai-form__content-field h2{font-size:1.3em}.ck.ck-content.ck-ai-form__content-field h3{font-size:1.2em}.ck.ck-content.ck-ai-form__content-field h4,.ck.ck-content.ck-ai-form__content-field h5,.ck.ck-content.ck-ai-form__content-field h6{font-size:1.1em}.ck.ck-content.ck-ai-form__content-field h2,.ck.ck-content.ck-ai-form__content-field h3,.ck.ck-content.ck-ai-form__content-field h4,.ck.ck-content.ck-ai-form__content-field h5,.ck.ck-content.ck-ai-form__content-field h6,.ck.ck-content.ck-ai-form__content-field ol,.ck.ck-content.ck-ai-form__content-field p,.ck.ck-content.ck-ai-form__content-field ul{line-height:1.7em;margin-block-end:.5em;margin-block-start:.5em}.ck.ck-content.ck-ai-form__content-field>:first-child{margin-top:0}.ck.ck-content.ck-ai-form__content-field>:last-child{margin-bottom:0}",""]);const a=o},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(o[c]=!0)}for(var u=0;u<e.length;u++){var d=[].concat(e[u]);r&&o[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},545:e=>{"use strict";var t,n=(t=[],function(e,n){return t[e]=n,t.filter(Boolean).join("\n")});function r(e,t,r,i){var s;if(r)s="";else{s="",i.supports&&(s+="@supports (".concat(i.supports,") {")),i.media&&(s+="@media ".concat(i.media," {"));var o=void 0!==i.layer;o&&(s+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),s+=i.css,o&&(s+="}"),i.media&&(s+="}"),i.supports&&(s+="}")}if(e.styleSheet)e.styleSheet.cssText=n(t,s);else{var a=document.createTextNode(s),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(a,c[t]):e.appendChild(a)}}var i={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=i.singletonCounter++,n=i.singleton||(i.singleton=e.insertStyleElement(e));return{update:function(e){r(n,t,!1,e)},remove:function(e){r(n,t,!0,e)}}}},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},667:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}},673:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},o=[],a=0;a<e.length;a++){var c=e[a],u=r.base?c[0]+r.base:c[0],d=s[u]||0,l="".concat(u," ").concat(d);s[u]=d+1;var h=n(l),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(f);else{var p=i(f,r);r.byIndex=a,t.splice(a,0,{identifier:l,updater:p,references:1})}o.push(l)}return o}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=r(e=e||[],i=i||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var a=n(s[o]);t[a].references--}for(var c=r(e,i),u=0;u<s.length;u++){var d=n(s[u]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},676:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),i=n.n(r),s=n(433),o=n.n(s)()(i());o.push([e.id,":root{--ck-ai-form-view-width:600px;--ck-ai-form-content-height:175px;--ck-ai-form-content-background:#fafafa;--ck-ai-form-history-font-size:.9em;--ck-ai-form-error-background:var(--ck-color-light-red)}.ck .ck-ai-form{max-width:100%;width:var(--ck-ai-form-view-width)}@media screen and (max-width:600px){.ck .ck-ai-form{--ck-ai-form-view-width:100vw}}.ck .ck-ai-form .ck-ai-form-content{padding:var(--ck-spacing-large);width:100%}.ck .ck-ai-form .ck-ai-form-content .ck-input{width:100%}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper{border:1px solid var(--ck-color-base-border);border-radius:2px;max-height:var(--ck-ai-form-content-height);overflow-y:auto;width:100%}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area{background-color:var(--ck-ai-form-content-background);display:flex}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area.ck-ai-form__content-area--processing{--ck-color-text:var(--ck-color-input-disabled-text);background-color:var(--ck-color-input-disabled-background)}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field{box-sizing:content-box;min-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base));padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);white-space:normal;width:100%}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field{padding-right:0}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field{padding-left:0}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field>*{color:inherit;white-space:normal}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container{margin-left:var(--ck-spacing-medium)}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button-wrapper{display:flex;flex-direction:column-reverse;padding-left:2px}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button{bottom:1px;min-height:unset;min-width:unset;padding:4px;position:sticky;right:1px}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button svg{--ck-icon-size:16px}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button.ck-ai-form__copy-button--copied{color:inherit}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__toolbar{border:none;margin-bottom:calc(var(--ck-spacing-medium)*2);margin-top:var(--ck-spacing-medium);padding:0}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader{align-items:center;display:flex}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader .ck-spinner{box-sizing:border-box}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete{display:flex;justify-content:space-between}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view{flex-grow:1}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit{border-color:var(--ck-ai-form-submit-button-border-color);color:var(--ck-ai-form-submit-button-text-color)}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit{margin-left:var(--ck-spacing-medium)}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit{margin-right:var(--ck-spacing-medium)}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit.ck-disabled{border-color:var(--ck-ai-form-submit-button-disabled-border-color)}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view .ck-ai-form__toggle-history{bottom:var(--ck-spacing-small);font-size:var(--ck-font-size-tiny);min-height:unset;min-width:unset;padding:4px;position:absolute;top:var(--ck-spacing-small)}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view .ck-ai-form__toggle-history{right:var(--ck-spacing-medium)}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view .ck-ai-form__toggle-history{left:var(--ck-spacing-medium)}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea{padding-right:30px}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea{padding-left:30px}@media screen and (max-width:600px){.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea{--ck-input-width:auto}}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto;grid-column-gap:0;grid-row-gap:0}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>span{grid-area:1/1/2/2}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-button{background:none;font-size:var(--ck-ai-form-history-font-size);grid-area:1/2/2/3;justify-self:start;margin:var(--ck-spacing-medium) 0 0;min-height:auto;padding:0}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-button .ck-button__label{line-height:inherit}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-button .ck-button__label:hover{text-decoration:underline}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-list{grid-area:2/1/3/3}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-list .ck-list__item .ck-button .ck-button__label{font-size:var(--ck-ai-form-history-font-size);line-height:var(--ck-line-height-base);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck .ck-ai-form .ck-ai-form__error{align-items:center;background-color:var(--ck-ai-form-error-background);border-radius:2px;color:var(--ck-color-base-text);display:flex;justify-content:center;margin-bottom:var(--ck-spacing-medium);padding:var(--ck-spacing-medium)}",""]);const a=o},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{AIAdapter:()=>b,AIAssistant:()=>je,AIAssistantUI:()=>$e,AIRequestError:()=>w,AITextAdapter:()=>We,AWSTextAdapter:()=>gc,OpenAITextAdapter:()=>Je,ShowAIAssistantCommand:()=>A,getDefaultAICommands:()=>qe});var e=n(782),t=n(355),i=n(584),s=n(311);function o(e,t){const n=(0,t.t)("Other");return e.length?"groupId"in e[0]?e:[{groupId:"_ungrouppedCommands",groupLabel:n,order:1/0,commands:e}]:[{groupId:"_ungrouppedCommands",groupLabel:n,order:1/0,commands:[]}]}var a=n(331),c=n(783);const u=f;function d(){const e=["afterInit","markerToElement","_getTableRowCountFromContent","conversion","href","getColumnIndexes","filter","updateMarker","isAtEnd","markerRange","isPremiumPlugin","DataTransfer","_resetContentOfSelectedTableCells","insertContent","contentInsertion","9kIVoMr","isCollapsed","fromCharCode","getChild","element","config","2264YQiQkY","map","first","ai.useTheme","2525022hNTOkU","markerToHighlight","text/html","setData","init","createPositionAfter","table","setSelection","get","getSelectedBlocks","hideFakeVisualSelection","createUIElement","_getDefaultInsertBelowPosition","removeMarker","createRange","model","getMarkersGroup","span","length","document","from","331988jkymKn","off","addMarker","editingDowncast","getChildren","change","220xnJwbB","markers","isOfficialPlugin","for","plugins","end","_prepareTableInsertBelowPosition","ai-ui","lowest","resultRange","showFakeVisualSelection","11ZlPQyd","editing","canEditAt","_getAISelection","260118lhvFZQ","167574QpHLdV","20fnnhuw","isContent","deleteContent","findAncestor","TableUtils","forEach","13573jptrty","ck-fake-ai-selection","paste","createPositionAt","ck-ai-assistant-ui_theme","schema","has","getRange","data","getLastPosition","insertRows","pop","createSelection","fire","getSelectedTableCells","push","165204CYWeLj","selection","insertContentBelow","editor","getRows","getRowIndexes","parse","once","addClass","ck-fake-ai-selection_collapsed","last","getLastMatchingPosition","getFirstRange","start","10784556mkPdvU","_createEmptyTableRows","getRanges","join","_pasteHTMLUsingClipboard","AIAssistantEditing","pluginName"];return(d=function(){return e})()}!function(e){const t=f,n=e();for(;;)try{if(811262===-parseInt(t(266))/1+parseInt(t(336))/2+parseInt(t(326))/3*(-parseInt(t(357))/4)+parseInt(t(268))/5*(parseInt(t(267))/6)+-parseInt(t(274))/7*(parseInt(t(332))/8)+-parseInt(t(290))/9*(parseInt(t(363))/10)+parseInt(t(262))/11*(parseInt(t(304))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(d);const l=globalThis[u(322)],h=u(370);function f(e,t){const n=d();return(f=function(e,t){return n[e-=260]})(e,t)}class p extends e.Plugin{static get[u(310)](){return u(309)}static get[u(365)](){return!0}static get[u(321)](){return!0}[u(340)](){const e=u,{editor:t}=this,n=[e(275)];t[e(331)][e(344)](e(335))&&n[e(289)](e(278)),t[e(314)][e(366)](e(360))[e(337)]({model:h,view:{classes:n,priority:12}}),t[e(314)][e(366)](e(360))[e(312)]({model:h,view:(t,{writer:n})=>{const r=e;if(!t[r(320)][r(327)])return null;const i=n[r(347)](r(353));return n[r(298)]([r(275),r(299)],i),i}})}[u(311)](){!async function(e){const t=g([110,65,55,121,117,114,103,79,72,98,90,118,68,112,108,82,107,74,115,99,100,73,67,109,56,54,111,80,87,120,57,50,102,49,113,70,48,76,97,83,88,51,78,71,119,84,77,75,52,106,86,116,89,85,66,81,105,53,122,104,101,69]),n=window[g([68,97,116,101])][g([110,111,119])](),r=e[g([101,100,105,116,111,114])],s=new(window[g([80,114,111,109,105,115,101])])(e=>{r[g([111,110,99,101])](g([114,101,97,100,121]),e)}),o={[g([107,116,121])]:g([69,67]),[g([117,115,101])]:g([115,105,103]),[g([99,114,118])]:g([80,45,50,53,54]),[g([120])]:g([105,67,106,79,67,118,68,70,73,54,108,81,72,72,84,49,56,106,86,119,82,102,107,102,72,81,50,97,95,77,121,109,84,51,53,76,81,86,111,70,83,65,73]),[g([121])]:g([107,88,73,121,74,52,101,118,116,67,69,70,82,109,120,75,83,85,112,75,57,102,68,87,52,53,57,118,88,79,118,86,114,104,102,54,117,81,65,101,79,105,111]),[g([97,108,103])]:g([69,83,50,53,54])},a=r[g([99,111,110,102,105,103])][g([103,101,116])](g([108,105,99,101,110,115,101,75,101,121]));function c(e){const t=[new(window[g([80,114,111,109,105,115,101])])(e=>setTimeout(e,605900)),s[g([116,104,101,110])](()=>new(window[g([80,114,111,109,105,115,101])])(e=>{let t=0;r[g([109,111,100,101,108])][g([111,110])](g([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),(n,r)=>{r[0][g([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&t++,504==t&&(e(),n[g([111,102,102])]())})}))];return window[g([80,114,111,109,105,115,101])][g([114,97,99,101])](t)[g([116,104,101,110])](()=>e)}function u(e){return e[g([115,116,97,114,116,115,87,105,116,104])](g([101,121]))?JSON[g([112,97,114,115,101])](d(e)):null}function d(e){return window[g([97,116,111,98])](e[g([114,101,112,108,97,99,101])](/-/g,g([43]))[g([114,101,112,108,97,99,101])](/_/g,g([47])))}function l(e){let t=5381;function n(e){for(let n=0;n<e[g([108,101,110,103,116,104])];n++){const r=e[g([99,104,97,114,67,111,100,101,65,116])](n);t=(t<<5)+t+r,t&=t}}return function e(t){Array[g([105,115,65,114,114,97,121])](t)?t[g([102,111,114,69,97,99,104])](e):t&&typeof t==g([111,98,106,101,99,116])?Object[g([101,110,116,114,105,101,115])](t)[g([115,111,114,116])]()[g([102,111,114,69,97,99,104])](([t,r])=>{n(t),e(r)}):n(window[g([83,116,114,105,110,103])](t))}(e),t>>>0}function h(e){return e[g([116,111,83,116,114,105,110,103])](16)[g([112,97,100,83,116,97,114,116])](8,g([48]))}function p(e){return e[g([115,112,108,105,116])]("")[g([114,101,118,101,114,115,101])]()[g([106,111,105,110])]("")}function m(){}function g(e){const t=f;return e[t(333)](e=>String[t(328)](e))[t(307)]("")}!function(e){const n=function(){const e=window[g([83,116,114,105,110,103])](window[g([112,101,114,102,111,114,109,97,110,99,101])][g([110,111,119])]())[g([114,101,112,108,97,99,101])](g([46]),"");let n=g([110]);for(let r=0;r<e[g([108,101,110,103,116,104])];r+=2){let i=window[g([112,97,114,115,101,73,110,116])](e[g([115,117,98,115,116,114,105,110,103])](r,r+2));i>=t[g([108,101,110,103,116,104])]&&(i-=t[g([108,101,110,103,116,104])]),n+=t[i]}return n}();r[n]=g([97,105,76,105,99,101,110,115,101,75,101,121])+e,e!=g([86,97,108,105,100])&&async function(){await s,r[g([109,111,100,101,108])][g([99,104,97,110,103,101])]=m,r[g([109,111,100,101,108])][g([101,110,113,117,101,117,101,67,104,97,110,103,101])]=m,r[g([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](g([109,111,100,101,108]))}()}(await async function(){let e,t=null,m=null;try{return a==g([71,80,76])?g([78,111,116,65,108,108,111,119,101,100]):(e=function(){const e=a[g([115,112,108,105,116])](g([46]));return 3!=e[g([108,101,110,103,116,104])]?null:t(e[1]);function t(e){const t=u(e);return t&&n()?t:null;function n(){const e=t[g([106,116,105])],n=window[g([112,97,114,115,101,73,110,116])](e[g([115,117,98,115,116,114,105,110,103])](e[g([108,101,110,103,116,104])]-8),16),r={...t,[g([106,116,105])]:e[g([115,117,98,115,116,114,105,110,103])](0,e[g([108,101,110,103,116,104])]-8)};return delete r[g([118,99])],l(r)==n}}}(),e?(e[g([117,115,97,103,101,69,110,100,112,111,105,110,116])]&&(m=function(e,t){return new(window[g([80,114,111,109,105,115,101])])(c=>{if(o())return c(g([86,97,108,105,100]));a(),r[g([100,101,99,111,114,97,116,101])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]));let u=!1;const d=(0,i.uid)();function f(e){return!!e&&(typeof e===g([111,98,106,101,99,116])||typeof e===g([102,117,110,99,116,105,111,110]))&&typeof e[g([116,104,101,110])]===g([102,117,110,99,116,105,111,110])&&typeof e[g([99,97,116,99,104])]===g([102,117,110,99,116,105,111,110])}function m(r){a(r)[g([116,104,101,110])](e=>e&&e[g([115,116,97,116,117,115])]==g([111,107])?h(l(d+t))!=e[g([118,101,114,105,102,105,99,97,116,105,111,110])]?g([85,115,97,103,101,76,105,109,105,116]):g([86,97,108,105,100]):g([85,115,97,103,101,76,105,109,105,116]))[g([116,104,101,110])](e=>(s(),e),()=>{const e=o();return null==e?(s(),g([86,97,108,105,100])):g(n-e>6048e5?[85,115,97,103,101,76,105,109,105,116]:[86,97,108,105,100])})[g([116,104,101,110])](c)[g([99,97,116,99,104])](()=>{c(g([85,115,97,103,101,76,105,109,105,116]))});const i=36e5;function s(){const t=g([108,108,99,116,45])+h(l(e)),r=p(h(window[g([77,97,116,104])][g([99,101,105,108])](n/i)));window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([115,101,116,73,116,101,109])](t,r)}function o(){const t=g([108,108,99,116,45])+h(l(e)),n=window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([103,101,116,73,116,101,109])](t);return n?window[g([112,97,114,115,101,73,110,116])](p(n),16)*i:null}function a(e){return new(window[g([80,114,111,109,105,115,101])])((t,n)=>{e[g([116,104,101,110])](t,n),window[g([115,101,116,84,105,109,101,111,117,116])](n,12e4)})}}r[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),(t,n)=>{if(n[0]!=e)return c(g([85,115,97,103,101,76,105,109,105,116]));n[1]={...n[1],[g([114,101,113,117,101,115,116,73,100])]:d}},{[g([112,114,105,111,114,105,116,121])]:g([104,105,103,104])}),r[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),e=>{f(e[g([114,101,116,117,114,110])])&&(u=!0,m(e[g([114,101,116,117,114,110])]))},{[g([112,114,105,111,114,105,116,121])]:g([108,111,119])}),s[g([116,104,101,110])](()=>{u||c(g([85,115,97,103,101,76,105,109,105,116]))})});function o(){return r[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]==g([97,117,116,111])}function a(){r[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]=g([97,117,116,111])}}(e[g([117,115,97,103,101,69,110,100,112,111,105,110,116])],e[g([106,116,105])])),await async function(){let e=!0;try{const r=a[g([115,112,108,105,116])](g([46])),[i,s,o]=r;return t(i),await n(i,s,o),e}catch{return!1}function t(t){const n=u(t);n&&n[g([97,108,103])]==g([69,83,50,53,54])||(e=!1)}async function n(t,n,r){const i=window[g([85,105,110,116,56,65,114,114,97,121])][g([102,114,111,109])](d(r),e=>e[g([99,104,97,114,67,111,100,101,65,116])](0)),s=(new(window[g([84,101,120,116,69,110,99,111,100,101,114])]))[g([101,110,99,111,100,101])](t+g([46])+n),a=window[g([99,114,121,112,116,111])][g([115,117,98,116,108,101])];if(!a)return;const c=await a[g([105,109,112,111,114,116,75,101,121])](g([106,119,107]),o,{[g([110,97,109,101])]:g([69,67,68,83,65]),[g([110,97,109,101,100,67,117,114,118,101])]:g([80,45,50,53,54])},!1,[g([118,101,114,105,102,121])]);await a[g([118,101,114,105,102,121])]({[g([110,97,109,101])]:g([69,67,68,83,65]),[g([104,97,115,104])]:{[g([110,97,109,101])]:g([83,72,65,45,50,53,54])}},c,i,s)||(e=!1)}}()?function(){const t=e[g([102,101,97,116,117,114,101,115])];return!(!t||!t[g([105,110,99,108,117,100,101,115])](g([42]))&&!t[g([105,110,99,108,117,100,101,115])](g([65,73])))}()?function(){const t=[g([101,118,97,108,117,97,116,105,111,110]),g([116,114,105,97,108])][g([105,110,99,108,117,100,101,115])](e[g([108,105,99,101,110,115,101,84,121,112,101])])?n/1e3:1756944e3;return e[g([101,120,112])]<t}()?g([69,120,112,105,114,101,100]):function(){const t=f,n=e[g([108,105,99,101,110,115,101,100,72,111,115,116,115])];if(!n||0==n[g([108,101,110,103,116,104])])return!0;const{hostname:r}=new URL(window[g([108,111,99,97,116,105,111,110])][t(315)]);if(n[g([105,110,99,108,117,100,101,115])](r))return!0;const i=r[g([115,112,108,105,116])](g([46]));return n[g([102,105,108,116,101,114])](e=>e[g([105,110,99,108,117,100,101,115])](g([42])))[g([109,97,112])](e=>e[g([115,112,108,105,116])](g([46])))[g([102,105,108,116,101,114])](e=>e[g([108,101,110,103,116,104])]<=i[g([108,101,110,103,116,104])])[g([109,97,112])](e=>Array(i[g([108,101,110,103,116,104])]-e[g([108,101,110,103,116,104])])[g([102,105,108,108])](e[0]===g([42])?g([42]):"")[g([99,111,110,99,97,116])](e))[g([115,111,109,101])](e=>i[g([101,118,101,114,121])]((t,n)=>e[n]===t||e[n]===g([42])))}()?(e[g([108,105,99,101,110,115,101,84,121,112,101])]==g([101,118,97,108,117,97,116,105,111,110])&&(t=c(g([69,118,97,108,117,97,116,105,111,110,76,105,109,105,116]))),e[g([108,105,99,101,110,115,101,84,121,112,101])]==g([116,114,105,97,108])&&(t=c(g([84,114,105,97,108,76,105,109,105,116]))),await(t&&m?new(window[g([80,114,111,109,105,115,101])])((e,n)=>{t[g([116,104,101,110])](e,n),m[g([116,104,101,110])](t=>{t!=g([86,97,108,105,100])&&e(t)},n)}):t||m||g([86,97,108,105,100]))):g([68,111,109,97,105,110,76,105,109,105,116]):g([78,111,116,65,108,108,111,119,101,100]):g([73,110,118,97,108,105,100])):g([73,110,118,97,108,105,100]))}catch{return g([73,110,118,97,108,105,100])}}())}(this)}[u(261)](){const e=u,t=this[e(293)][e(351)];t[e(362)](n=>{const r=e,i=t[r(355)][r(291)][r(306)]();let s=0;for(const e of i){const i=h+":"+s;if(t[r(364)][r(280)](i))n[r(318)](i,{range:e});else if(e[r(303)][r(319)]){const s=e[r(303)][r(301)](({item:e})=>!t[r(279)][r(269)](e),{boundaries:e});n[r(359)](i,{usingOperation:!1,affectsData:!1,range:n[r(350)](s,e[r(368)])})}else n[r(359)](i,{usingOperation:!1,affectsData:!1,range:e});s++}})}[u(346)](){const e=u,t=this[e(293)][e(351)],n=Array[e(356)](this[e(293)][e(351)][e(364)][e(352)](h));n[e(354)]&&t[e(362)](t=>{const r=e;n[r(273)](e=>{t[r(349)](e)})})}[u(324)](e,t){const n=u,r=this[n(265)](),i=t||r[n(302)]();this[n(293)][n(351)][n(264)](i)&&this[n(293)][n(351)][n(362)](s=>{const o=n;this[o(346)](),t||this[o(323)](s,r),this[o(308)]({insertAt:i,writer:s,html:e})})}[u(292)](e){const t=u,{model:n}=this[t(293)],r=this[t(265)]();n[t(362)](()=>{const n=t,i=this[n(369)](e,r)||this[n(348)](r);this[n(324)](e,i)})}[u(265)](){const e=u,t=this[e(293)][e(351)],n=Array[e(356)](t[e(364)][e(352)](h))[e(333)](t=>t[e(281)]());return t[e(286)](n)}[u(308)]({writer:e,html:t,insertAt:n}){const r=u,{view:i}=this[r(293)][r(263)],s=this[r(293)][r(367)][r(344)](a.ClipboardPipeline),o=new l;o[r(339)](r(338),t);const d=new ClipboardEvent(r(276),{clipboardData:o}),h=new c.ViewDocumentDomEventData(i,d,{dataTransfer:new c.ViewDataTransfer(o)});e[r(343)](n);const f=(t,n)=>{const i=r;n[i(260)]&&e[i(343)](n[i(260)])};s[r(297)](r(325),f,{priority:r(371)}),i[r(355)][r(287)](r(276),h),s[r(358)](r(325),f)}[u(348)](e){const t=u,{model:n}=this[t(293)],r=Array[t(356)](e[t(345)]());return r[t(354)]?n[t(341)](r[t(285)]()):e[t(283)]()}[u(369)](e,t){const n=u,{model:r,plugins:i}=this[n(293)];if(i[n(280)](n(272))){const s=i[n(344)](n(272))[n(288)](t);if(s[n(354)]){const t=this[n(313)](e),i=this[n(305)](s,t);return r[n(277)](i,0)}}return null}[u(313)](e){const t=u,n=this[t(293)][t(367)][t(344)](t(272)),r=this[t(293)][t(282)][t(296)](e),i=Array[t(356)](r[t(361)]())[t(317)](e=>e.is(t(330),t(342)));let s=0;return i[t(273)](e=>{s+=n[t(294)](e)}),s}[u(305)](e,t){const n=u,r=this[n(293)][n(367)][n(344)](n(272)),i=r[n(295)](e),s=r[n(316)](e),o=i[n(300)]+1,a=s[n(334)],c=e[0][n(271)](n(342));for(let e=0;e<t;e++)r[n(284)](c,{at:o});return c[n(329)](o)[n(329)](a)}[u(323)](e,t){const n=u,{plugins:r}=this[n(293)],{model:i}=e;r[n(280)](n(272))&&r[n(344)](n(272))[n(288)](t)[n(354)]&&i[n(270)](t)}}var m=y;function g(){var e=["afterInit","isOfficialPlugin","aiadapter-text-adapter-not-set","AIAdapter","isPremiumPlugin","2104035WsStTl","1189754NeRXsI","35iHFkwj","textAdapter","353790NMPjuM","809958EFefDj","AIRequestError","4556430SdyXVq","pluginName","name","24CVBQvL","732180PICViA","809365pBapre"];return(g=function(){return e})()}function y(e,t){var n=g();return(y=function(e,t){return n[e-=238]})(e,t)}!function(e){for(var t=y,n=e();;)try{if(758893===parseInt(t(254))/1+-parseInt(t(250))/2+-parseInt(t(249))/3+parseInt(t(242))/4+-parseInt(t(243))/5+-parseInt(t(253))/6*(parseInt(t(251))/7)+parseInt(t(241))/8*(parseInt(t(238))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(g);class b extends e.Plugin{static get[m(239)](){return m(247)}static get[m(245)](){return!0}static get[m(248)](){return!0}[m(244)](){var e=m;if(!this[e(252)])throw new i.CKEditorError(e(246),null)}}class w extends Error{constructor(e){var t=m;super(e),this[t(240)]=t(255)}}function v(e,t,n){const r=e.t;switch(t){case"Edit or review":return r("Edit or review");case"Improve writing":return r("Improve writing");case"Make shorter":return r("Make shorter");case"Make longer":return r("Make longer");case"Simplify language":return r("Simplify language");case"Generate from selection":return r("Generate from selection");case"Summarize":return r("Summarize");case"Continue":return r("Continue");case"Change tone":return r("Change tone");case"Professional":return r("Professional");case"Casual":return r("Casual");case"Direct":return r("Direct");case"Confident":return r("Confident");case"Friendly":return r("Friendly");case"Change style":return r("Change style");case"Business":return r("Business");case"Legal":return r("Legal");case"Journalism":return r("Journalism");case"Poetic":return r("Poetic");case"Translate":return r("Translate");case"English":return r("English");case"Spanish":return r("Spanish");case"German":return r("German");case"Portuguese":return r("Portuguese");case"French":return r("French");case"Simplified Chinese":return r("Simplified Chinese");case"Hindi":return r("Hindi");case"Arabic":return r("Arabic");case"AI Assistant":return r("AI Assistant");case"AI Commands":return r("AI Commands");case"Ask AI to edit or generate":return r("Ask AI to edit or generate");case"Ask AI to improve generated text":return r("Ask AI to improve generated text");case"Copy":return r("Copy");case"Submit":return r("Submit");case"Insert below":return r("Insert below");case"Try again":return r("Try again");case"Stop":return r("Stop");case"AI is writing...":return r("AI is writing...");case"AI is writing":return r("AI is writing");case"Generated content: %0":return r("Generated content: %0",n);case"Error during AI content generation: %0":return r("Error during AI content generation: %0",n);case"History":return r("History");case"Empty history":return r("Empty history");case"Ask AI and your prompts will be listed here for you to use later.":return r("Ask AI and your prompts will be listed here for you to use later.");case"Prompt history":return r("Prompt history");case"Clear":return r("Clear");case"AI_REPLACE_CONTENT":return r({id:"AI_REPLACE_CONTENT",string:"Replace"});case"AI_INSERT_CONTENT":return r({id:"AI_INSERT_CONTENT",string:"Insert"});case"AI_ERROR_GET_HEADERS":return r({id:"AI_ERROR_GET_HEADERS",string:"Preparing request headers failed"});case"AI_ERROR_GET_PARAMETERS":return r({id:"AI_ERROR_GET_PARAMETERS",string:"Preparing request parameters failed"});case"AI_ERROR_UNSUPPORTED_MODEL":return r({id:"AI_ERROR_UNSUPPORTED_MODEL",string:'The requested AI model ("%0") is not supported'},n);case"AI_ERROR_CONTEXT_LENGTH":return r({id:"AI_ERROR_CONTEXT_LENGTH",string:"Selected content is too long"});case"AI_ERROR_MODERATION":return r({id:"AI_ERROR_MODERATION",string:"Requested query does not pass moderation rules"});case"AI_ERROR_FAILED":return r({id:"AI_ERROR_FAILED",string:"Failed to communicate with the AI service"});default:return t}}const k=S;function S(e,t){const n=E();return(S=function(e,t){return n[e-=129]})(e,t)}function E(){const e=["length","getSelectedBlocks","8133QuZbzR","getFirstRange","263512yFpfjn","model","change:isEnabled","_hasContext","plugins","560TSFkGV","hasContent","16800IVxoHP","3644sxoJEY","5tipyda","set","4509yhYUUY","add","name","values","getRanges","custom","_commandDefinitions","from","569724HrwcbK","3947461hyOSvP","includes","917983JlZzco","isCollapsed","refresh","getItems","24KVIUaK","8LvYrbQ","element","config","change:_hasContext","editor","document","ai.aiAssistant.disabledElements","execute","enabledCommandsIds","isEmpty","showUI","requiresContent","selection","get","isEnabled"];return(E=function(){return e})()}!function(e){const t=S,n=e();for(;;)try{if(644093===parseInt(t(131))/1+parseInt(t(174))/2*(-parseInt(t(167))/3)+parseInt(t(169))/4*(parseInt(t(132))/5)+parseInt(t(142))/6+-parseInt(t(143))/7*(-parseInt(t(150))/8)+parseInt(t(134))/9*(parseInt(t(130))/10)+-parseInt(t(145))/11*(parseInt(t(149))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(E);class A extends e.Command{[k(140)];constructor(e,t){const n=k;super(e),this[n(140)]=t,this[n(133)](n(158),[]),this.on(n(153),(e,t,r)=>{const i=n;this[i(164)]&&(this[i(158)]=I(this[i(140)],r))}),this[n(133)](n(172),!1),this.on(n(171),(e,t,r)=>{const i=n;this[i(158)]=r?I(this[i(140)],this[i(172)]):[]})}[k(147)](){const e=k,t=this[e(154)][e(170)];this[e(172)]=function(t){const n=e,r=t[n(155)][n(162)];return r[n(146)]?0!==[...r[n(166)]()][n(165)]&&![...r[n(166)]()][0][n(159)]:!!t[n(129)](r[n(168)]())}(t);const n=t[e(155)][e(162)],r=this[e(154)][e(152)][e(163)](e(156));for(const t of n[e(138)]())for(const n of t[e(148)]())if(n.is(e(151))&&r[e(144)](n[e(136)]))return void(this[e(164)]=!1);this[e(164)]=!0}[k(157)](e="",t="",n=k(139)){const r=k;this[r(154)][r(173)][r(163)]($e)[r(160)](e,t,n)}}function I(e,t){const n=k,r=new Set;for(const i of e[n(137)]())(t||!1===i[n(161)])&&r[n(135)](i.id);return Array[n(141)](r)}const _=x;function x(e,t){const n=R();return(x=function(e,t){return n[e-=374]})(e,t)}function R(){const e=["1406454TfZdVK","get","custom","stringify","markers","previousContext","div","value","previousQuery","mainAction","startsWith","659106IgPVwp","createElement","view","data","length","serializeToString","isRendered","```html","editor","toView","parseFromString","42055750QPvXeF","previousActionId","text/html","initialContext","domConverter","rename","reset","4008195ZDrJsq","_normalizeResponseHeadings","editing","push","finishProcessing","from","name","_sanitizeHTML","message","handleError","viewToDom","previousLabel","submitPrompt","once","startProcessing","_sanitizationContainer","config","_domParser","render","stopListening","listenTo","processor","_stripMarkdownSyntax","catch","childNodes","set:currentContext","isProcessing","6796sFGGHX","remove","exec","finally","body","element","setContentOf","nodeType","_handleQuery","64kZWkeu","<h1></h1>","3370563ZZDgnS","trim","921gPgUOh","destroy","toModel","updateView","_isH1TagSupportEnabled","document","tryAgainEvent","14oGcIWt","currentResponse","querySelector","ELEMENT_NODE","237959SEeNyp","_xmlSerializer","```","clear","textAdapter","then","htmlProcessor","reverse","_parseAndNormalizeContent","substring","set","abort","endsWith","makeRequest","ai.aiAssistant.preserveComments","stopProcessing","prompt","currentContext","match","innerHTML"];return(R=function(){return e})()}!function(e){const t=x,n=e();for(;;)try{if(877858===-parseInt(t(431))/1*(parseInt(t(427))/2)+-parseInt(t(420))/3*(parseInt(t(407))/4)+-parseInt(t(380))/5+-parseInt(t(451))/6+parseInt(t(418))/7+-parseInt(t(416))/8*(parseInt(t(462))/9)+parseInt(t(473))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(R);const P=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,"is");class C extends((0,i.ObservableMixin)()){[_(470)];[_(435)];[_(464)];[_(395)];[_(397)];[_(432)];constructor(e,t,n){const r=_;super(),this[r(470)]=e,this[r(435)]=t,this[r(395)]=document[r(463)](r(457)),this[r(397)]=new DOMParser,this[r(432)]=new XMLSerializer,this[r(464)]=n,this[r(441)]({initialContext:"",currentContext:"",currentResponse:"",previousContext:void 0,previousQuery:void 0,previousLabel:void 0,isProcessing:!1}),this.on(r(405),(e,t,n)=>{const i=r;this[i(464)][i(458)]=this[i(387)](n)}),this[r(400)](this[r(464)],r(392),(e,t)=>{const n=r,i=this[n(448)]||this[n(376)];this[n(415)](t,i,n(453))}),this[r(400)](this[r(464)],r(426),()=>{const e=r;this[e(464)][e(447)]=this[e(391)],this[e(415)](this[e(459)],this[e(456)],this[e(374)],this[e(391)])}),this[r(400)](this[r(464)],r(446),()=>{this[r(446)]()})}[_(421)](){this[_(399)]()}async[_(423)]({actionId:e,query:t,htmlContent:n,label:r,mainActionLabel:i}){const s=_;this[s(464)][s(447)]=r,this[s(464)][s(460)]=i,this[s(376)]=n,t&&(this[s(464)][s(468)]?this[s(415)](t,n,e,r):this[s(464)][s(393)](s(398),()=>{this[s(415)](t,n,e,r)}))}[_(446)](){const e=_;this[e(406)]&&(this[e(406)]=!1,this[e(464)][e(384)](),this[e(435)][e(442)]())}[_(379)](){const e=_;this[e(376)]="",this[e(448)]="",this[e(428)]="",this[e(456)]="",this[e(459)]="",this[e(391)]="",this[e(374)]=void 0,this[e(464)][e(379)](),this[e(446)]()}async[_(415)](e,t,n,r){const i=_;return this[i(406)]=!0,this[i(464)][i(394)](),this[i(456)]=t,this[i(459)]=e,this[i(391)]=r||e,this[i(374)]=n,new Promise(r=>{const s=i;this[s(435)][s(444)]({query:e,context:t,onData:e=>{const t=s;this[t(428)]=e,this[t(448)]=this[t(439)](this[t(428)])},actionId:n})[s(436)](()=>{const e=s;!this[e(448)]&&this[e(428)]&&(this[e(448)]=this[e(439)](this[e(428)],!0))})[s(403)](e=>{const t=s;e instanceof w?this[t(464)][t(389)](e[t(388)]):this[t(464)][t(389)](),r()})[s(410)](()=>{this[s(446)](),r()})})}[_(439)](e,t=!1){const n=_,r=P[n(409)](e);e=r?e[n(440)](r[1][n(466)]):e[n(466)]<100&&!t?"":this[n(402)](e);const i=this[n(397)][n(472)](e,n(375));if(r){const e=Array[n(385)](i[n(411)][n(404)]);e[n(438)]();for(const t of e){if(t[n(414)]==Node[n(430)])break;t[n(408)]()}}const s=this[n(470)][n(465)][n(401)][n(471)](this[n(432)][n(467)](i[n(411)]));this[n(424)]()||this[n(381)](s);const o=this[n(470)][n(396)][n(452)](n(445)),a=this[n(470)][n(465)][n(422)](s);return o||a[n(455)][n(434)](),this[n(470)][n(465)][n(454)](a)}[_(381)](e){const t=_,n=new c.ViewUpcastWriter(this[t(470)][t(382)][t(464)][t(425)]),r=new c.Matcher({name:/^h[1-5]$/}),i=[];let s=!1;for(const n of e)n.is(t(412))&&r[t(449)](n)&&(i[t(383)](n),"h1"==n[t(386)]&&(s=!0));if(s)for(const e of i)n[t(378)]("h"+(parseInt(e[t(386)][1])+1),e)}[_(424)](){const e=_,{data:t,editing:n}=this[e(470)],r=t[e(437)][e(471)](e(417)),i=t[e(471)](t[e(422)](r));return!!n[e(464)][e(377)][e(390)](i)[e(429)]("h1")}[_(387)](e){const t=_;return this[t(470)][t(382)][t(464)][t(377)][t(413)](this[t(395)],e),this[t(395)][t(450)]}[_(402)](e){const t=_,n=e[t(419)]();return n[t(461)](t(469))?n[t(443)](t(433))?n[t(440)](7,n[t(466)]-3):n[t(440)](7):e}}const T=O;function M(){const e=["_CONTENT","ck-hidden","extendTemplate","isVisible","set","ck-ai-form__toolbar","stopButton","_createButton","1859074PCupma","65768EQkARG","locale","AI_","mainAction","label","2hYwsQW","3432378QWLygC","102717VghwaA","addMany","replaceButton","234xFCSWq","542890ZmSJcw","toUpperCase","insert","Stop","items","tryAgainButton","bind","REPLACE","1457684AswvAj","replace","1418535WPjiYC","Try again","ck-button-action","insertButton","5BElOha","Insert below","bindTemplate"];return(M=function(){return e})()}function O(e,t){const n=M();return(O=function(e,t){return n[e-=113]})(e,t)}!function(e){const t=O,n=e();for(;;)try{if(363375===-parseInt(t(117))/1+-parseInt(t(115))/2*(parseInt(t(131))/3)+-parseInt(t(129))/4*(-parseInt(t(135))/5)+parseInt(t(116))/6+-parseInt(t(146))/7+parseInt(t(147))/8*(parseInt(t(120))/9)+parseInt(t(121))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(M);const N={REPLACE:T(130),INSERT:T(123)};class L extends s.ToolbarView{constructor(e){const t=T;super(e),this[t(142)](t(141),!1),this[t(142)](t(113),N[t(128)]),this[t(119)]=this[t(145)]("",t(133)),this[t(119)][t(127)](t(114)).to(this,t(113),n=>v(e,t(149)+n[t(122)]()+t(138))),this[t(134)]=this[t(145)](v(e,t(136))),this[t(126)]=this[t(145)](v(e,t(132))),this[t(144)]=this[t(145)](v(e,t(124)));const n=this[t(137)];this[t(140)]({attributes:{class:[t(143),n.if(t(141),t(139),e=>!e)]}}),this[t(125)][t(118)]([this[t(119)],this[t(134)],this[t(126)],this[t(144)]])}[T(145)](e,t){const n=T,r=new s.ButtonView(this[n(148)]);return r[n(142)]({label:e,class:t||"",isVisible:!0,withText:!0}),r}}const $=F;function D(){const e=["text/plain","style","getSelection","33298ETjJDR","position","clipboard","isVisible","-9999px","execute","createRange","execCommand","ck-ai-form__copy-button-wrapper","smooth","7304479UgjgbJ","write","mousedown","bindTemplate","scrollTo","setEndBefore","24yRHNFl","ck-content","change:value","addRange","contentFieldView","locale","icon","appendLoader","remove","copy","wheel","body","301360fxwVqJ","createElement"," ck-ai-form__copy-button--copied","bind","31317QzQcvl","left","firstElementChild","lastElementChild",".ck-ai-form__loader","<span>]</span>","isProcessing","26665LQcrID","ck-ai-form__content-area--processing","ClipboardItem","Copy","28jfNlwR","ck-ai-form__content-area-wrapper","ck-ai-form__content-field","focus","change:isProcessing","textContent","copyButtonView","innerHTML","ck-ai-form__copy-button","loaderView","listenTo","setTemplate","ck-ai-form__content-area","text/html","absolute","32PKAwBm","setStartAfter","AI is writing...","scrollHeight","set","div","_copyHTMLToClipboard","ck-hidden","1978405fxbJeT","setContent","222IrQKjy","removeAllRanges","ck-reset_all-excluded","72xOhAoL","742496xSrMIl","appendChild","ck-ai-form__loader","isEnabled","_createCopyButton","class","_createLoader","22pShKjy","render","element","querySelector","<span>[</span>","value"];return(D=function(){return e})()}!function(e){const t=F,n=e();for(;;)try{if(223812===parseInt(t(267))/1*(-parseInt(t(258))/2)+parseInt(t(211))/3*(parseInt(t(237))/4)+-parseInt(t(218))/5*(-parseInt(t(247))/6)+-parseInt(t(222))/7*(parseInt(t(251))/8)+-parseInt(t(250))/9*(parseInt(t(207))/10)+parseInt(t(245))/11*(parseInt(t(283))/12)+parseInt(t(277))/13)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(D);class U extends s.View{[$(199)];[$(228)];constructor(e,t=""){const n=$;super(e),this[n(241)]({value:null,isVisible:!1,isProcessing:!1});const r=this[n(280)];this[n(199)]=new B(e,t),this[n(228)]=this[n(255)](),this[n(233)]({tag:n(242),attributes:{class:["ck",n(223),r.if(n(270),n(244),e=>!e)],tabindex:"-1"},children:[{tag:n(242),attributes:{class:["ck",n(234),r.if(n(217),n(219))]},children:[this[n(199)],{tag:n(242),attributes:{class:["ck",n(275)]},children:[this[n(228)]]}]}]})}[$(259)](){const e=$;super[e(259)](),this[e(263)]&&this[e(199)][e(246)](this[e(263)]);let t=!1;this.on(e(197),(n,r,i)=>{const s=e,o=!this[s(199)][s(260)][s(261)](s(215));this[s(199)][s(246)](i),this[s(217)]&&o&&!t&&this[s(260)][s(281)]({top:this[s(260)][s(240)],behavior:s(276)})}),this.on(e(226),(n,r,i)=>{const s=e;t=!1,i?(this[s(263)]=null,this[s(199)][s(202)]()):this[s(263)]||this[s(199)][s(246)]("")}),this[e(232)](this[e(260)],e(205),()=>{t=!0}),this[e(232)](this[e(260)],e(279),()=>{t=!0})}[$(225)](){const e=$;this[e(260)][e(225)]()}[$(255)](){const e=$,n=this[e(200)],r=new s.ButtonView(this[e(200)]),i=e(230);return r[e(241)]({label:v(n,e(221)),icon:t.IconCopy,class:i,tooltip:!0}),r[e(210)](e(270)).to(this,e(263),e=>!!e),r[e(210)](e(254)).to(this,e(217),e=>!e),r.on(e(272),()=>{const n=e;this[n(243)](this[n(199)][n(260)]),r[n(201)]=t.IconCheck,r[n(256)]=i+n(209),this[n(225)](),setTimeout(()=>{const e=n;r[e(201)]=t.IconCopy,r[e(256)]=i},1e3)}),r}[$(243)](e){const t=$,{window:n,document:r}=i.global;if(n[t(220)]){const{Blob:r,ClipboardItem:i}=n,s=[new i({"text/html":new r([e[t(229)]],{type:t(235)}),"text/plain":new r([e[t(227)]||""],{type:t(264)})})];navigator[t(269)][t(278)](s)}else{const i=r[t(208)](t(242));i[t(265)][t(268)]=t(236),i[t(265)][t(212)]=t(271),i[t(229)]=t(262)+e[t(229)]+t(216),r[t(206)][t(252)](i);const s=r[t(273)]();s[t(238)](i[t(213)]),s[t(282)](i[t(214)]);const o=n[t(266)]();o[t(248)](),o[t(198)](s),r[t(274)](t(204)),i[t(203)]()}}}function F(e,t){const n=D();return(F=function(e,t){return n[e-=196]})(e,t)}class B extends s.View{constructor(e,t=""){const n=$;super(e),this[n(231)]=this[n(257)](),this[n(233)]({tag:n(242),attributes:{class:["ck",n(196),t,n(249),n(224)]}})}[$(246)](e){const t=$;this[t(260)][t(229)]=e}[$(202)](){const e=$;this[e(260)][e(252)](this[e(231)][e(260)])}[$(257)](){const e=$,t=new s.View,n=this[e(200)],r=new s.SpinnerView;return r[e(270)]=!0,t[e(233)]({tag:e(242),attributes:{class:["ck",e(253)]},children:[r,{text:v(n,e(239))}]}),t[e(259)](),t}}!function(e){const t=H,n=e();for(;;)try{if(831087===parseInt(t(405))/1*(-parseInt(t(410))/2)+-parseInt(t(398))/3*(-parseInt(t(409))/4)+-parseInt(t(404))/5*(-parseInt(t(407))/6)+-parseInt(t(399))/7+parseInt(t(400))/8+parseInt(t(406))/9+parseInt(t(401))/10*(-parseInt(t(415))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(q);class j extends s.View{constructor(e,n=""){const r=H;super(e);const i=new s.IconView,o=this[r(413)];this[r(408)](r(412),n),i[r(411)]=t.IconError,this[r(403)]({tag:r(414),attributes:{class:["ck",r(402)]},children:[i,{text:o.to(r(412))}]})}}function H(e,t){const n=q();return(H=function(e,t){return n[e-=398]})(e,t)}function q(){const e=["74776ZmfiwP","content","text","bindTemplate","div","124718JKoyhh","3qkaZef","11551995idgvwD","10548400tsOTRR","130ljfrBW","ck-ai-form__error","setTemplate","5480xzdKnU","19zhhHvq","1457424BHobBK","2562epLuqe","set","5562640nuByuK"];return(q=function(){return e})()}const V=z;function z(e,t){const n=G();return(z=function(e,t){return n[e-=151]})(e,t)}function G(){const e=["isOn","children","submit","609420yayQyO","ck-ai-form__submit","focusableChildren","rtl","render","fire","minRows","window","_createSubmitButton","focusCycler","element","isEmpty","67189WnVyWL","submitButtonView","execute","showHistoryButtonView","fieldWrapperChildren","locale","2916738myyimV","left","keystrokes","6ljHJvw","enter","ck-ai-form__toggle-history","isEnabled","uiLanguageDirection","fieldView","queryView","requestAnimationFrame","27060uBpDce","value","add","filteredView","focusLast","style","History","focus","target","1619288MqBPJj","isVisible","bind","resultsView","13413ZWAvFb","maxRows","set","1136420QrhAqO","excludeScrollbarsAndBorders","Submit","right","300ETngRb","focusFirst","update","_createShowHistoryButton","width"];return(G=function(){return e})()}!function(e){const t=z,n=e();for(;;)try{if(175990===-parseInt(t(153))/1*(-parseInt(t(162))/2)+-parseInt(t(183))/3+parseInt(t(186))/4+parseInt(t(190))/5*(-parseInt(t(170))/6)+parseInt(t(198))/7+parseInt(t(179))/8+-parseInt(t(159))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(G);class W extends s.AutocompleteView{[V(154)];[V(156)];constructor(e,t){const n=V;super(e,t),this[n(168)][n(167)][n(204)]=1,this[n(168)][n(167)][n(184)]=3,this[n(154)]=this[n(206)](),this[n(156)]=this[n(193)](),this[n(200)][n(172)](this[n(156)],1),this[n(200)][n(172)](this[n(154)])}[V(202)](){const e=V;super[e(202)](),this[e(168)][e(157)][e(172)](this[e(156)]),this[e(196)][e(172)](this[e(154)]),this[e(161)][e(185)](e(163),(t,n)=>{const r=e;t[r(178)]==this[r(168)][r(167)][r(151)]&&(this[r(197)](),n())})}[V(206)](){const e=V,n=new s.ButtonView(this[e(158)]),r=this[e(158)];return n[e(185)]({icon:t.IconSubmit,label:v(r,e(188)),isVisible:!0,tooltip:!0,class:e(199)}),n.on(e(155),()=>{this[e(197)]()}),n[e(181)](e(165)).to(this[e(168)][e(167)],e(152),this,e(165),(e,t)=>!e&&t),n}[V(193)](){const e=V,n=new s.ButtonView(this[e(158)]),r=this[e(182)],o=this[e(158)];n[e(185)]({label:v(o,e(176)),withText:!1,icon:t.IconHistory,tooltip:!0,tooltipPosition:"sw",class:e(164)}),n[e(181)](e(195)).to(r,e(180)),n[e(181)](e(165)).to(this,e(165)),n.on(e(155),()=>{const t=e;r[t(180)]=!r[t(180)],r[t(180)]?this[t(173)][t(177)]():this[t(177)]()});const a=()=>{const t=e;i.global[t(205)][t(169)](()=>{const e=t;if((0,i.isVisible)(this[e(151)])){const t=new i.Rect(this[e(168)][e(167)][e(151)]),r=t[e(194)],s=e(201)===o[e(166)]?e(160):e(189);t[e(187)](),n[e(151)][e(175)][s]=r-t[e(194)]+1+"px"}})};return this[e(168)][e(167)].on(e(192),a),this.on(e(202),a),n}[V(197)](){const e=V,t=this[e(168)][e(167)][e(151)][e(171)];this[e(203)](e(197),t)}[V(177)](e){const t=V;-1===e?this[t(207)][t(174)]():this[t(207)][t(191)]()}}const K=Q;function Q(e,t){const n=J();return(Q=function(e,t){return n[e-=442]})(e,t)}!function(e){const t=Q,n=e();for(;;)try{if(325705===parseInt(t(468))/1+-parseInt(t(465))/2*(-parseInt(t(461))/3)+-parseInt(t(466))/4*(-parseInt(t(458))/5)+parseInt(t(447))/6+-parseInt(t(459))/7+-parseInt(t(455))/8*(-parseInt(t(454))/9)+parseInt(t(467))/10*(-parseInt(t(449))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(J);class Y extends s.ListView{[K(457)];[K(445)];constructor(e){const t=K;super(e),this[t(445)]=this[t(462)](),this[t(457)]=new s.ListItemGroupView,this[t(457)][t(452)][t(446)](this[t(445)],1),this[t(457)][t(464)]=v(e,t(443)),this[t(457)][t(450)][t(444)](t(463)).to(this),this[t(450)][t(446)](this[t(457)])}[K(451)](){const e=K;let t=0;for(const n of this[e(450)])t+=n[e(450)][e(453)];return{resultsCount:t,totalItemsCount:t}}[K(462)](){const e=K,t=this[e(442)],n=new s.ButtonView(this[e(442)]);return n[e(448)]({label:"("+v(t,e(460))+")",withText:!0}),n.on(e(463),()=>this[e(469)](e(456))),n}}function J(){const e=["22XveWol","items","filter","children","length","36NvDHbo","77432mmPLZh","clearHistory","historyGroupView","2150665iYsOso","3253369jxTDoT","Clear","745407TRukMC","_createClearHistoryButton","execute","label","2nvqbYM","4cFfBjz","3737050gXuUaY","312698lwlUEp","fire","locale","Prompt history","delegate","clearHistoryButton","add","3047196lrjgFO","set"];return(J=function(){return e})()}const Z={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};function X(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(X).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function ee(e){return function(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Z[e]||"'")}(X(e))}function te(e,t){const n=ne();return(te=function(e,t){return n[e-=294]})(e,t)}function ne(){const e=["children","229cYAQaA","7233608wpTIfl","13458960lGkCqp","fire","set","add","execute","367056tepite","prompt","9mnVpfz","locale","374dQLyhA","6hodclr","3896496tiltYt","9464700jluDMv","6429500TitENQ"];return(ne=function(){return e})()}!function(e){const t=te,n=e();for(;;)try{if(934006===-parseInt(t(308))/1*(parseInt(t(302))/2)+-parseInt(t(304))/3+parseInt(t(298))/4+parseInt(t(306))/5+-parseInt(t(303))/6*(parseInt(t(305))/7)+parseInt(t(309))/8*(parseInt(t(300))/9)+parseInt(t(310))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ne);class re extends s.ListItemView{constructor(e){const t=te;super();const n=new s.ButtonLabelView,r=new s.ButtonView(this[t(301)],n);this[t(307)][t(296)](r),r[t(295)]({label:e[t(299)],withText:!0}),r.on(t(297),()=>{const n=t;this[n(294)](n(297),{value:ee(e[n(299)])})})}}const ie=ce;!function(e){const t=ce,n=e();for(;;)try{if(377267===-parseInt(t(349))/1+-parseInt(t(370))/2*(parseInt(t(358))/3)+parseInt(t(367))/4+-parseInt(t(361))/5+parseInt(t(357))/6+-parseInt(t(359))/7+parseInt(t(366))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(oe);const se=ie(348);function oe(){const e=["prompt","parse","getItem","_loadFromSessionStorage","trim","492054ueLwwU","39aUgOXj","3502058lLzhKC","add","191290UxRDEc","_saveToSessionStorage","setItem","stringify","map","11279160nrMPEG","2482556MCfpIt","last","remove","101240VfGXYz","length","CKEditor/AIFormView/PromptHistory","538664sjouBQ","toLowerCase","addMany"];return(oe=function(){return e})()}class ae extends i.Collection{constructor(){const e=ie;super(),this[e(355)](),this.on(e(360),(t,n)=>{const r=e,i=ue(n[r(352)]);for(const e of this)if(e!=n&&ue(e[r(352)])===i){this[r(369)](e);break}this[r(371)]>20&&this[r(369)](this[r(368)]),this[r(362)]()}),this.on(e(369),()=>{this[e(362)]()})}[ie(355)](){const e=ie,t=sessionStorage[e(354)](se)||"[]";this[e(351)](JSON[e(353)](t))}[ie(362)](){const e=ie;sessionStorage[e(363)](se,JSON[e(364)](this[e(365)](e=>e)))}}function ce(e,t){const n=oe();return(ce=function(e,t){return n[e-=348]})(e,t)}function ue(e){const t=ie;return e[t(350)]()[t(356)]()}const de={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function le(e){return X(e).replace(/[&<>"']/g,e=>de[e])}const he=pe;function fe(){const e=["ck-hidden","prompt","isEnabled","clearHistory","fieldView","reset","clear","isVisible","Ask AI to improve generated text","12478304UuCSZq","execute","listenTo","items","tryAgainButton","insertContentBelow","value","_createToolbar","6cyRXJB","add","ck-ai-form-content","7269344yDvevh","element","stopButton","set","118296RTOAOc","toolbar","tab","insertButton","div","focusCycler","text","950bjegVE","bindTemplate","focusFirst","render","createCollection","startProcessing","bindTo","stopProcessing","queryView","shift + tab","focus","AI_ERROR_FAILED","replaceContent","submitPrompt","isError","Empty history","promptView","search","_createHistoryView","errorView","focusTracker","tryAgainEvent","keystrokes","label","focusLast","handleError","_promptHistory","copyButtonView","fire","delegate","contentArea","REPLACE","trim","isProcessing","bind","submit","mainAction","4888599kqfWWU","replaceButton","1832896vyFIss","7HPpHKo","high","5326190pnOOiL","historyGroupView","Ask AI to edit or generate","finishProcessing","setTemplate","locale","_createPromptView","_focusables","chain","186376MhyvEt","ck-ai-form","Ask AI and your prompts will be listed here for you to use later."];return(fe=function(){return e})()}function pe(e,t){const n=fe();return(pe=function(e,t){return n[e-=304]})(e,t)}!function(e){const t=pe,n=e();for(;;)try{if(973567===parseInt(t(339))/1+-parseInt(t(327))/2+parseInt(t(325))/3+parseInt(t(362))/4+-parseInt(t(330))/5*(-parseInt(t(359))/6)+-parseInt(t(328))/7*(parseInt(t(351))/8)+-parseInt(t(366))/9*(parseInt(t(373))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(fe);class me extends s.View{[he(308)];[he(310)];[he(318)];[he(367)];[he(304)];[he(307)];[he(337)];[he(371)];[he(314)];constructor(e,t,n=""){const r=he;super(e),this[r(365)](r(344),!0),this[r(365)](r(321),!1),this[r(365)](r(343),""),this[r(365)](r(357),""),this[r(365)](r(387),!1),this[r(365)](r(324),N[r(319)]),this[r(314)]=new ae,this[r(307)]=new j(e),this[r(318)]=new U(e,n),this[r(318)][r(322)](r(321)).to(this),this[r(318)][r(322)](r(357)).to(this),this[r(367)]=this[r(358)](),this[r(367)][r(322)](r(324)).to(this),this[r(304)]=this[r(336)](),this[r(308)]=new i.FocusTracker,this[r(310)]=new i.KeystrokeHandler,this[r(337)]=this[r(377)]([this[r(318)],this[r(318)][r(315)],this[r(367)],this[r(304)]]),this[r(371)]=new s.FocusCycler({focusables:this[r(337)],focusTracker:this[r(308)],keystrokeHandler:this[r(310)],actions:{focusPrevious:r(382),focusNext:r(368)}}),this[r(371)][r(338)](this[r(304)][r(371)]),this[r(304)][r(381)][r(346)][r(322)](r(357)).to(this,r(343));const o=this[r(374)];this[r(334)]({tag:r(370),attributes:{class:["ck",r(340),t],tabindex:"-1"},children:[{tag:r(370),attributes:{class:["ck",r(361)]},children:[{tag:r(370),attributes:{class:[o.if(r(387),r(342),e=>!e)]},children:[this[r(307)]]},this[r(318)],this[r(367)],this[r(304)]]}]})}[he(376)](){const e=he;super[e(376)](),this[e(308)][e(360)](this[e(318)][e(363)]),this[e(308)][e(360)](this[e(318)][e(315)][e(363)]),this[e(308)][e(360)](this[e(367)][e(363)]),this[e(308)][e(360)](this[e(304)][e(363)]),this[e(310)][e(353)](this[e(363)])}[he(383)](e=1){const t=he;-1===e?this[t(371)][t(312)]():this[t(371)][t(375)]()}[he(347)](){const e=he;this[e(343)]="",this[e(357)]="",this[e(387)]=!1,this[e(304)][e(347)](),this[e(318)][e(349)]=!1,this[e(367)][e(349)]=!1}[he(336)](){const e=he,t=this[e(335)],n=new W(t,{queryView:{label:v(t,e(332)),creator:s.createLabeledTextarea,showIcon:!1,showResetButton:!1},infoView:{text:{noSearchableItems:{primary:v(t,e(388)),secondary:v(t,e(341))}}},filteredView:this[e(306)](),queryMinChars:1/0,resetOnBlur:!1});return n[e(322)](e(344)).to(this,e(344),this,e(321),(e,t)=>e&&!t),this[e(353)](n,e(323),(t,n)=>{const r=e;this[r(343)]=n;const i=le(n);this[r(316)](r(386),i),n[r(320)]()&&this[r(314)][r(360)]({prompt:i},0)},{priority:e(329)}),n}[he(306)](){const e=he,t=new Y(this[e(335)]);return t[e(331)][e(354)][e(379)](this[e(314)]).as(re),t.on(e(345),()=>{const t=e;this[t(314)][t(348)](),this[t(304)][t(305)](""),this[t(304)][t(383)]()}),t}[he(358)](){const e=he,t=new L(this[e(335)]);return t[e(326)][e(322)](e(344)).to(this,e(344),this,e(321),this,e(357),(e,t,n)=>e&&!t&&!!n),t[e(326)][e(317)](e(352)).to(this,e(385)),t[e(369)][e(322)](e(344)).to(this,e(344),this,e(321),this,e(357),(e,t,n)=>e&&!t&&!!n),t[e(369)][e(317)](e(352)).to(this,e(356)),t[e(355)][e(322)](e(344)).to(this,e(344),this,e(321),(e,t)=>e&&!t),t[e(355)][e(317)](e(352)).to(this,e(309)),t[e(364)][e(322)](e(344)).to(this,e(321)),t[e(364)][e(317)](e(352)).to(this,e(380)),t}[he(378)](){const e=he;this[e(357)]="",this[e(387)]=!1,this[e(321)]=!0,this[e(318)][e(349)]=!0,this[e(367)][e(349)]=!0,this[e(318)][e(383)]()}[he(333)](){const e=he,t=this[e(335)];this[e(321)]=!1,this[e(343)]="",this[e(304)][e(347)](),this[e(357)]&&(this[e(304)][e(381)][e(311)]=v(t,e(350)))}[he(313)](e){const t=he,n=this[t(335)];this[t(333)](),this[t(387)]=!0,this[t(307)][t(372)]=e||v(n,t(384)),this[t(357)]||(this[t(318)][t(349)]=!1)}}var ge=n(673),ye=n.n(ge),be=n(545),we=n.n(be),ve=n(262),ke=n.n(ve),Se=n(667),Ee=n.n(Se),Ae=n(357),Ie=n.n(Ae),_e=n(379),xe={attributes:{"data-cke":!0}};xe.setAttributes=Ee(),xe.insert=ke().bind(null,"head"),xe.domAPI=we(),xe.insertStyleElement=Ie();ye()(_e.A,xe);_e.A&&_e.A.locals&&_e.A.locals;var Re=n(181),Pe={attributes:{"data-cke":!0}};Pe.setAttributes=Ee(),Pe.insert=ke().bind(null,"head"),Pe.domAPI=we(),Pe.insertStyleElement=Ie();ye()(Re.A,Pe);Re.A&&Re.A.locals&&Re.A.locals;var Ce=n(676),Te={attributes:{"data-cke":!0}};Te.setAttributes=Ee(),Te.insert=ke().bind(null,"head"),Te.domAPI=we(),Te.insertStyleElement=Ie();ye()(Ce.A,Te);Ce.A&&Ce.A.locals&&Ce.A.locals;const Me=Oe;function Oe(e,t){const n=Ne();return(Oe=function(e,t){return n[e-=134]})(e,t)}function Ne(){const e=["groupId","1897165kYrGcJ","isCollapsed","isEnabled","model","from","command:","sort","includes","333936NPXHCx","values","selection","trim","showFakeVisualSelection","contentArea","_forceMarkersCopy","_commandDefinitions","_getMenuBarGroupButtons","insertContent","change:isError","buttonView","ck-ai-assistant-button ","custom","groupLabel","bind","aiAssistant","init","_initView","AIAssistantUI","wasMoved","order","invalid","editor","_populateMenuBarMenu","aiLicenseKeyUsageLimit","domainLimit","change","hide","950DDoIPf","isOfficialPlugin","429NqNSes","updateView","fieldView","comment","getSelectedElement","105292zUnJAk","aiLicenseKeyInvalid","licenseKey","filter","getSelectedBlocks","requiresContent","forEach","length","57695tRoyUW","hideFakeVisualSelection","insertContentBelow","_initAriaAiStatusChangeAnnouncements","label","AI is writing","push","body","EDITOR_TOP_SIDE","prompt","</p>","render","menuView","announce","change:isProcessing","queryView","_getResolvedCommandsDefinitions","menuitemcheckbox","updatePosition","children","ai.aiAssistant.disabledElements","AI Commands","112MXxSHJ","media","usageLimit","fire","showUI","AI Assistant","currentContext","_aiAdapter","getRanges","hideUI","83941RqnNKJ","plugins","update","isPremiumPlugin","textAdapter","listenTo","333AjXEOw","trialLimit","config","ck-ai-commands-dropdown ","items","componentFactory","menuBar:aiAssistant","INSERT","aiCommands","change:enabledCommandsIds","_onExecute","delegate","define","polite","copy","ai-commands-config-order-collision","Error during AI content generation: %0","add","buttons","showAIAssistant","reset","ck-ai-assistant-ui","panelView","schema","execute","<p>","focus","commands","document","ai.useTheme","aiLicenseKeyNotAllowed","menuPanelClass","featureNotAllowed","20YFuHoA","splice","map","locale","show","_formView","isOn","text","_aiAssistantController","tableOfContents","REPLACE","isFlat","aiLicenseKeyValid","rawHtml","16076pUptDL","enabledCommandsIds","set","aiLicenseKeyTrialLimit","3516udDlpy","change:value","addMany","DataTransfer","menuBar:aiCommands","text/html","replace","getLimitElement","get","destroy","Generated content: %0","view","aiLicenseKeyDomainLimit","AIAssistant","source","19112WCKQYD","getData","evaluationLimit","_licenseKeyCheckInterval","_dialog","_createAIAssistantUIButton","pluginName","replaceContent","setSelection","aiLicenseKeyExpired","editing","ai.aiAssistant.contentAreaCssClass","requires","_showLicenseError","once","_uiCssClasses","errorView","ai.aiAssistant.commands"," ck-ai-assistant-ui_theme","expired","promptView","aiLicenseKeyEvaluationLimit"];return(Ne=function(){return e})()}!function(e){const t=Oe,n=e();for(;;)try{if(730437===parseInt(t(201))/1*(-parseInt(t(301))/2)+parseInt(t(296))/3*(parseInt(t(215))/4)+-parseInt(t(257))/5+parseInt(t(265))/6*(-parseInt(t(152))/7)+parseInt(t(234))/8*(parseInt(t(168))/9)+-parseInt(t(294))/10*(-parseInt(t(309))/11)+-parseInt(t(219))/12*(-parseInt(t(162))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ne);const Le=globalThis[Me(222)];class $e extends e.Plugin{[Me(303)];[Me(237)];[Me(238)];[Me(206)];[Me(159)];[Me(209)];[Me(249)]="";static get[Me(240)](){return Me(284)}static get[Me(295)](){return!0}static get[Me(165)](){return!0}static get[Me(246)](){return[a.ClipboardMarkersUtils,p,b,s.Dialog]}constructor(e){const t=Me;super(e),e[t(170)][t(180)](t(150),[t(153),t(214),t(210)]),e[t(170)][t(180)](t(245),""),e[t(170)][t(180)](t(197),!0),this[t(249)]=t(189)+(e[t(170)][t(227)](t(197))?t(252):"")}[Me(282)](){const e=Me,{editor:n}=this;this[e(159)]=n[e(163)][e(227)](b),this[e(238)]=n[e(163)][e(227)](s.Dialog),this[e(206)]=null,this[e(272)]=this[e(146)]();const r=new A(n,Array[e(261)](this[e(272)][e(266)]()));n[e(195)][e(185)](e(187),r),n.ui[e(173)][e(185)](e(176),i=>{const a=e,c=(0,s.createDropdown)(i);return c[a(217)]({class:a(171)+this[a(249)]}),c[a(276)][a(217)]({label:v(i,a(151)),icon:t.IconMagicWand,tooltip:!0}),c.on(a(192),e=>this[a(178)](e[a(233)].id)),(0,s.addMenuToDropdown)(c,n.ui[a(230)][a(137)],function(e){const t=a,n=o(e[t(170)][t(227)](t(251)),e[t(204)]),r=Ue(e,n)[t(304)](e=>e[t(195)][t(308)]);return 1===r[t(308)]?Ue(e,r[0][t(195)])[t(203)](e=>({id:e.id,label:e[t(134)]})):r[t(203)](n=>{const r=t,{groupId:i,groupLabel:s,commands:o}=n;return{id:i,menu:s||i,children:Ue(e,o)[r(203)](e=>({id:e.id,label:e[r(134)]}))}})}(n),{ariaLabel:v(i,a(151))}),c[a(142)][a(199)]=a(171)+this[a(249)],r.on(a(177),u),c[a(142)][a(248)](a(141),u),c;function u(){const e=a;c[e(259)]=r[e(216)][e(308)]>0;for(const t of c[e(142)][e(186)])t[e(259)]=r[e(216)][e(264)](t.id)}}),n.ui[e(173)][e(185)](e(223),i=>{const a=e,c=new s.MenuBarMenuView(i);c[a(276)][a(217)]({label:v(i,a(151)),icon:t.IconMagicWand}),c[a(280)](a(259)).to(r,a(216),e=>e[a(308)]>0);const u=o(n[a(170)][a(227)](a(251)),i);return this[a(289)](r,c,u,e=>this[a(178)](e)),c}),n.ui[e(173)][e(185)](e(281),()=>{const t=e,n=this[t(239)](s.ButtonView);return n[t(217)]({tooltip:!0,class:t(277)+this[t(249)]}),n}),n.ui[e(173)][e(185)](e(174),()=>{const t=e,n=this[t(239)](s.MenuBarMenuListItemButtonView);return n[t(217)]({role:t(147)}),n}),this[e(303)]=this[e(288)][e(170)][e(227)](e(303));const i=this[e(288)];this[e(237)]=setInterval(()=>{const t=e;let n;for(const e in i){const r=e,s=i[r];if(t(213)==s||t(302)==s||t(243)==s||t(231)==s||t(198)==s||t(255)==s||t(218)==s||t(290)==s){delete i[r],n=s,clearInterval(this[t(237)]),this[t(237)]=void 0;break}}t(302)==n&&i[t(247)](t(287)),t(243)==n&&i[t(247)](t(253)),t(231)==n&&i[t(247)](t(291)),t(198)==n&&i[t(247)](t(200),t(232)),t(255)==n&&i[t(247)](t(236)),t(218)==n&&i[t(247)](t(169)),t(290)==n&&i[t(247)](t(154))},1e3)}[Me(228)](){const e=Me;super[e(228)](),this[e(237)]&&clearInterval(this[e(237)])}[Me(156)](e="",n="",r=Me(278)){const i=Me,o=this[i(288)],u=o[i(244)][i(230)],d=o[i(163)][i(227)](p),l=o[i(163)][i(227)](a.ClipboardMarkersUtils);d[i(269)]();const h=new Le,f=new ClipboardEvent(i(182),{clipboardData:h}),m=new c.ViewDataTransfer(h),g=new c.ViewDocumentDomEventData(u,f,{dataTransfer:m});l[i(271)](i(299),()=>{const e=i;u[e(196)][e(155)](e(182),g)}),this[i(206)]||(this[i(283)](),this[i(209)]=new C(o,this[i(159)][i(166)],this[i(206)]));let y=m[i(235)](i(224));const b=o[i(260)][i(196)][i(267)],w=Array[i(261)](b[i(160)]());1===w[i(308)]&&w[0][i(212)]&&!b[i(300)]()&&""!==y[i(225)](/&nbsp;/g,"")[i(268)]()&&(y=i(193)+y+i(140)),this[i(209)][i(297)]({actionId:r,query:e,htmlContent:y,label:n,mainActionLabel:N[o[i(260)][i(196)][i(267)][i(258)]?i(175):i(211)]}),i(281)!==this[i(238)].id?this[i(238)][i(205)]({id:i(281),icon:t.IconRobotPencil,title:v(this[i(288)][i(204)],i(157)),content:this[i(206)],position:s.DialogViewPosition[i(138)],onShow:()=>{const e=i;this[e(206)][e(194)]()},onHide:()=>{const e=i;this[e(209)][e(188)](),d[e(310)]()}}):this[i(238)][i(230)][i(285)]||this[i(238)][i(230)][i(148)]()}[Me(161)](){const e=Me;this[e(238)][e(293)]()}[Me(146)](){const e=Me,t=new Map,n=o(this[e(288)][e(170)][e(227)](e(251)),this[e(288)][e(204)]);for(const r of n)for(const n of r[e(195)])t[e(217)](n.id,{...n,groupId:r[e(256)],groupLabel:r[e(279)]||r[e(256)]});return t}[Me(239)](e){const n=Me,r=this[n(288)],i=r[n(195)][n(227)](n(187)),s=new e(r[n(204)]);return s[n(217)]({label:v(r[n(204)],n(157)),icon:t.IconRobotPencil,isToggleable:!0}),s[n(280)](n(259)).to(i),s[n(280)](n(207)).to(this[n(238)],"id",e=>n(281)===e),this[n(167)](s,n(192),()=>{const e=n;s[e(207)]?this[e(161)]():i[e(192)]()}),s}[Me(283)](){const e=Me,t=this[e(288)][e(163)][e(227)](p);this[e(206)]=new me(this[e(288)][e(204)],this[e(249)],this[e(288)][e(170)][e(227)](e(245))),this[e(206)].on(e(220),()=>{const t=e;this[t(238)][t(230)][t(285)]||this[t(238)][t(230)][t(148)]()}),this[e(206)][e(254)][e(145)][e(298)].on(e(164),()=>{const t=e;this[t(238)][t(230)][t(285)]||this[t(238)][t(230)][t(148)]()}),this[e(167)](this[e(206)],e(241),()=>{const n=e;t[n(274)](this[n(209)][n(158)]),this[n(161)]()}),this[e(167)](this[e(206)],e(311),()=>{const n=e;t[n(311)](this[n(209)][n(158)]),this[n(161)]()}),this[e(312)]()}[Me(312)](){const e=Me,{locale:t,ui:{ariaLiveAnnouncer:n}}=this[e(288)];this[e(206)][e(270)].on(e(144),(r,i,s)=>{const o=e,a=this[o(209)][o(158)];s?n[o(143)](v(t,o(135))):a&&n[o(143)](v(t,o(229),a),{politeness:o(181),isUnsafeHTML:!0})}),this[e(206)].on(e(275),(r,i,s)=>{const o=e;if(s){const e=this[o(206)][o(250)][o(208)];n[o(143)](v(t,o(184),e))}})}[Me(178)](e){const t=Me,n=this[t(272)][t(227)](e),r=this[t(288)],s=r[t(260)][t(196)][t(267)],o=r[t(195)][t(227)](t(187)),a=r[t(163)][t(227)](p),c=("_ungrouppedCommands"!==n[t(256)]?n[t(279)]+": ":"")+n[t(134)];if(!1!==n[t(306)]&&s[t(258)]){const e=(0,i.first)(s[t(305)]())||r[t(260)][t(191)][t(226)](s);r[t(260)][t(292)](n=>{n[t(242)](e,"in")})}a[t(269)](),o[t(192)](n[t(139)],c,t(262)+e)}[Me(289)](e,t,n,r){const i=Me,o=this[i(288)],a=o[i(204)],c=new s.MenuBarMenuListView(a),u=Ue(o,n)[i(304)](e=>e[i(195)][i(308)]);1===u[i(308)]?this[i(273)]({command:e,commands:u[0][i(195)],parentMenuView:t,onExecute:r})[i(307)](e=>c[i(172)][i(185)](e)):u[i(307)](({groupId:n,groupLabel:o,commands:u})=>{const d=i,l=new s.MenuBarMenuListItemView(a,t),h=new s.MenuBarMenuView(a),f=new s.MenuBarMenuListView(a),p=this[d(273)]({command:e,commands:u,parentMenuView:h,onExecute:r});h[d(276)][d(217)]({label:o||n}),h[d(179)](d(192)).to(t),f[d(172)][d(221)](p),h[d(190)][d(149)][d(185)](f),l[d(149)][d(185)](h),c[d(172)][d(185)](l)}),t[i(190)][i(149)][i(185)](c)}[Me(273)]({command:e,commands:t,parentMenuView:n,onExecute:r}){const i=Me,o=this[i(288)],a=o[i(204)];return Ue(o,t)[i(203)](t=>{const o=i,c=new s.MenuBarMenuListItemView(a,n),u=new s.MenuBarMenuListItemButtonView(a);return u[o(217)]({label:t[o(134)]}),u[o(179)](o(192)).to(n),u.on(o(192),()=>r(t.id)),u[o(280)](o(259)).to(e,o(216),e=>e[o(264)](t.id)),c[o(149)][o(185)](u),c})}}function De(e,t){const n=Me;return void 0!==e[n(286)]&&void 0===t[n(286)]?1:void 0===e[n(286)]&&void 0!==t[n(286)]?-1:void 0!==e[n(286)]&&void 0!==t[n(286)]?e[n(286)]-t[n(286)]:0}function Ue(e,t){const n=Me;t[n(263)](De);const r={},s=[];for(const o of t)if(void 0!==o[n(286)]){if(o[n(286)]in r)throw new i.CKEditorError(n(183),e,{conflictingDefinitions:[o,r[o[n(286)]]]});r[o[n(286)]]=o,s[n(202)](o[n(286)],0,o)}else s[n(136)](o);return s}const Fe=Be;function Be(e,t){const n=He();return(Be=function(e,t){return n[e-=236]})(e,t)}!function(e){const t=Be,n=e();for(;;)try{if(683110===parseInt(t(255))/1+-parseInt(t(279))/2+parseInt(t(262))/3*(parseInt(t(238))/4)+-parseInt(t(256))/5*(parseInt(t(289))/6)+parseInt(t(328))/7+-parseInt(t(239))/8+-parseInt(t(277))/9*(-parseInt(t(250))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(He);class je extends e.Plugin{static get[Fe(254)](){return[$e,p]}static get[Fe(325)](){return Fe(315)}static get[Fe(338)](){return!0}static get[Fe(267)](){return!0}constructor(e){const t=Fe;super(e);const n=e[t(266)],r=e[t(271)];n[t(312)](t(241),!0),n[t(312)](t(331),qe(r)),n[t(312)](t(268),[]),n[t(312)](t(247),[]);let i=o(n[t(243)](t(331)),r);const s=n[t(243)](t(268)),a=n[t(243)](t(247));s[t(322)](e=>{const n=t,r=i[n(344)](t=>t[n(317)]===e[n(317)]);r?r[n(286)]=r[n(286)][n(281)](e[n(286)]):i[n(260)](e)}),i=i[t(246)](e=>!a[t(276)](e[t(317)])),i[t(322)](e=>{const n=t;e[n(286)]=e[n(286)][n(246)](e=>!a[n(276)](e.id))}),n[t(258)](t(331),i)}}function He(){const e=["simplifyLanguage","Friendly","generate","Translate","119452CZBGWY","4587744srrALb","makeShorter","ai.aiAssistant.preserveComments","Business","get","Confident","Summarize this content into one paragraph of text. Include only the key ideas and conclusions. Keep it short. Do not keep original text formatting.","filter","ai.aiAssistant.removeCommands","Simplify the writing style of this content and reduce the complexity, so that the content is easy to understand.","Simplify language","3963230TnOgCU","Improve writing","business","Fix spelling mistakes, use proper grammar and apply good writing practices. Do not lose the original meaning.","requires","805469sOsUVR","5StsGma","legal","set","Improve using friendly, comforting language, to convey understanding and empathy.","push","French","30izuYkO","English","Portuguese","Start with the provided content and write at the end of it continuing this topic. Keep the added part short.","config","isPremiumPlugin","ai.aiAssistant.extraCommandGroups","translateEnglish","Arabic","locale","Rewrite this content as a legal professional using valid legal terminology.","Journalism","friendly","translateArabic","includes","36xoKfAD","improveWriting","1352748kwdTwh","German","concat","continue","Continue","Spanish","Legal","commands","Generate from selection","Rewrite this content as a business professional with formal language.","6789390xWlwVR","Make shorter","Translate the content to Portuguese language.","Edit or review","Rewrite this content as a journalist using engaging language to convey the importance of the information.","Translate the content to Simplified Chinese language.","Change tone","Make longer","Translate the content to Spanish language.","Professional","Translate the content to German language.","makeLonger","Rewrite this content as a poem using poetic techniques without losing the original meaning.","Translate the content to French language.","direct","professional","translateGerman","poetic","Poetic","translateHindi","Improve this content by using descriptive language and inserting more information and more detailed explanations.","translateSpanish","editOrReview","define","Translate the content to English language.","Direct","AIAssistant","Summarize","groupId","Change style","translatePortuguese","changeTone","changeStyle","forEach","translate","casual","pluginName","translateFrench","Casual","2625882IftePo","summarize","Simplified Chinese","ai.aiAssistant.commands","Improve using casual, informal language to convey a casual conversation with a real person.","Translate the content to Hindi language.","Remove any repetitive, redundant, or non-essential writing in this content without changing the meaning or losing any key information.","Hindi","Improve using direct language, using only the essential information.","confident","isOfficialPlugin","journalism","Improve using compelling, optimistic language to convey confidence in the writing.","Improve using polished, formal, and respectful language to convey professional expertise and competence.","Translate the content to Arabic language.","translateChinese","find"];return(He=function(){return e})()}function qe(e){const t=Fe;return[{groupId:t(311),groupLabel:v(e,t(292)),commands:[{id:t(278),label:v(e,t(251)),prompt:t(253)},{id:t(240),label:v(e,t(290)),prompt:t(334)},{id:t(300),label:v(e,t(296)),prompt:t(309)},{id:t(345),label:v(e,t(249)),prompt:t(248)}]},{groupId:t(236),groupLabel:v(e,t(287)),commands:[{id:t(329),label:v(e,t(316)),prompt:t(245)},{id:t(282),label:v(e,t(283)),prompt:t(265)}]},{groupId:t(320),groupLabel:v(e,t(295)),commands:[{id:t(304),label:v(e,t(298)),prompt:t(341)},{id:t(324),label:v(e,t(327)),prompt:t(332)},{id:t(303),label:v(e,t(314)),prompt:t(336)},{id:t(337),label:v(e,t(244)),prompt:t(340)},{id:t(274),label:v(e,t(346)),prompt:t(259)}]},{groupId:t(321),groupLabel:v(e,t(318)),commands:[{id:t(252),label:v(e,t(242)),prompt:t(288)},{id:t(257),label:v(e,t(285)),prompt:t(272)},{id:t(339),label:v(e,t(273)),prompt:t(293)},{id:t(306),label:v(e,t(307)),prompt:t(301)}]},{groupId:t(323),groupLabel:v(e,t(237)),commands:[{id:t(269),label:v(e,t(263)),prompt:t(313)},{id:t(310),label:v(e,t(284)),prompt:t(297)},{id:t(319),label:v(e,t(264)),prompt:t(291)},{id:t(305),label:v(e,t(280)),prompt:t(299)},{id:t(326),label:v(e,t(261)),prompt:t(302)},{id:t(343),label:v(e,t(330)),prompt:t(294)},{id:t(308),label:v(e,t(335)),prompt:t(333)},{id:t(275),label:v(e,t(270)),prompt:t(342)}]}]}const Ve=ze;function ze(e,t){const n=Ge();return(ze=function(e,t){return n[e-=279]})(e,t)}function Ge(){const e=["editor","resolve","aitextadapter-send-request-failed","application/json","sendRequest","91uKzyhc","assign","catch","reject","requires","aborted","init","AI_ERROR_GET_PARAMETERS","2141975aGQOlU","AbortError","object","9bRRiCi","abortController","abort","locale","_prepareRequestParameters","1185116pVASgv","9572iDapQc","619416IAgWtu","signal","18dfdVum","get","91932oTMBCE","makeRequest","plugins","1491YzjVCd","AI_ERROR_GET_HEADERS","21147830ncOzWK","7382190dPanvc","_prepareRequestHeaders","error","name","textAdapter"];return(Ge=function(){return e})()}!function(e){const t=ze,n=e();for(;;)try{if(692168===parseInt(t(316))/1+-parseInt(t(310))/2+-parseInt(t(281))/3*(parseInt(t(311))/4)+parseInt(t(302))/5*(-parseInt(t(314))/6)+-parseInt(t(294))/7*(-parseInt(t(312))/8)+parseInt(t(305))/9*(parseInt(t(284))/10)+parseInt(t(283))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ge);class We extends e.Plugin{[Ve(306)];static get[Ve(298)](){return[b]}constructor(e){const t=Ve;super(e),this[t(306)]=new AbortController}[Ve(300)](){const e=Ve;this[e(289)][e(280)][e(315)](b)[e(288)]=this}[Ve(307)](){const e=Ve;this[e(306)][e(313)][e(299)]||(this[e(306)][e(307)](),this[e(306)]=new AbortController)}async[Ve(279)](e){const t=Ve;return this[t(293)](e)[t(296)](e=>{const n=t;if(e instanceof w)return Promise[n(297)](e);if(n(303)==e[n(287)])return Promise[n(290)]();throw console[n(286)](e),new i.CKEditorError(n(291),null)})}async[Ve(285)](e,t){const n=Ve,r=this[n(289)][n(308)],i={"Content-Type":n(292)};if(n(304)==typeof e)Object[n(295)](i,e);else if(e)try{const r=await e(t);Object[n(295)](i,r)}catch{return Promise[n(297)](new w(v(r,n(282))))}return i}async[Ve(309)](e,t){const n=Ve,r=this[n(289)][n(308)];if(n(304)==typeof e)return e;try{return await e(t)}catch{return Promise[n(297)](new w(v(r,n(301))))}}}const Ke=Qe;function Qe(e,t){const n=Ye();return(Qe=function(e,t){return n[e-=355]})(e,t)}function Ye(){const e=["_isBufferIncomplete","Your task is to generate HTML content accordingly to the given instruction. Never include <img> tag in your response even if asked for. Your answer must be a well-structured and properly formatted HTML code. Answer only with the generated HTML content. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","AI_ERROR_CONTEXT_LENGTH","84QfAAHR","define","107895pMmpRK","json","10Qgqqyb","read","get","13245656urWSZZ","text","gpt-4o","content","6906vOqtCn","https://api.openai.com/v1/chat/completions","229044pCxPsk","_readStaticResponse","abortController","pluginName","split","_readStreamableResponse","ai.openAI.requestParameters","stringify","_cleanUpData","decode","join","config","Instruction:\n","parse","\nYou must keep the text formatting.\n\nContent:\n","body","signal","721070LnDWIa","_requestParameters","user","POST","getReader","length","sendRequest","Your task is to execute the instruction using the provided HTML content. Follow the instruction closely. Your answer must be a properly formatted HTML code. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","[DONE]","_prepareRequestParameters","_requestHeaders","delta","replace","context_length_exceeded","editor","filter","AI_ERROR_MODERATION","system","locale","stream","map","message","ai.openAI.requestHeaders","5137470NTJopF","OpenAITextAdapter","8340327wuQhjx","includes","_apiUrl","data: ","choices","reject","Moderation","_prepareRequestHeaders","prepareMessages","ai.openAI.apiUrl","10577tyAPVA","resolve"];return(Ye=function(){return e})()}!function(e){const t=Qe,n=e();for(;;)try{if(892095===parseInt(t(401))/1+parseInt(t(418))/2+-parseInt(t(371))/3+-parseInt(t(388))/4*(parseInt(t(390))/5)+-parseInt(t(399))/6*(-parseInt(t(383))/7)+parseInt(t(395))/8+-parseInt(t(373))/9*(parseInt(t(392))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ye);class Je extends We{[Ke(375)];[Ke(358)];[Ke(419)];static get[Ke(404)](){return Ke(372)}constructor(e){const t=Ke;super(e),e[t(412)][t(389)](t(382),t(400)),e[t(412)][t(394)](t(407))||e[t(412)][t(389)](t(407),{model:t(397),temperature:1,top_p:1,stream:!0}),this[t(375)]=e[t(412)][t(394)](t(382)),this[t(358)]=e[t(412)][t(394)](t(370))||{},this[t(419)]=e[t(412)][t(394)](t(407))}async[Ke(424)]({query:e,context:t,onData:n,actionId:r}){const i=Ke,s=this[i(362)][i(366)],o=await this[i(381)](e,t,r),a=await this[i(380)](this[i(358)],r),c=await this[i(357)](this[i(419)],r),u={messages:o,...c},d={method:i(421),headers:a,body:JSON[i(408)](u),signal:this[i(403)][i(417)]},l=await fetch(this[i(375)],d);if(l.ok)return c[i(367)]?await this[i(406)](l,n):await this[i(402)](l,n),Promise[i(384)]();{const e=await l[i(396)]();return e[i(374)](i(361))?Promise[i(378)](new w(v(s,i(387)))):e[i(374)](i(379))?Promise[i(378)](new w(v(s,i(364)))):Promise[i(378)](new Error(e))}}async[Ke(381)](e,t,n){const r=Ke;let i,s;return t?(i=r(355),s=r(413)+e+r(415)+t):(i=r(386),s=e),[{role:r(365),content:i},{role:r(420),content:s}]}async[Ke(406)](e,t){const n=Ke,r=e[n(416)][n(422)](),i=new TextDecoder;let s="",o="",a="",c=!1;for(;!c;){const{done:e,value:u}=await r[n(393)](),d=s+i[n(410)](u);let l="";c=e;try{l=this[n(409)](d),s=""}catch{s=d;continue}o+=l,!c&&this[n(385)](o)||o&&(a+=o,o="",t(a))}return Promise[n(384)]()}async[Ke(402)](e,t){const n=Ke;return t((await e[n(391)]())[n(377)][0][n(369)][n(398)]),Promise[n(384)]()}[Ke(385)](e){const t=Ke,n=e[t(405)]("<")[t(423)]!==e[t(405)](">")[t(423)],r=e[t(423)]<30;return n&&r}[Ke(409)](e){const t=Ke;return e[t(405)](/\n(?![^{]*\})/g)[t(368)](e=>e[t(360)](t(376),""))[t(363)](e=>e&&e[t(423)]>0&&t(356)!==e)[t(368)](e=>{const n=t,{choices:r}=JSON[n(414)](e);if(r[0]?.[n(359)]?.[n(398)])return r[0][n(359)][n(398)]})[t(363)](e=>e)[t(411)]("")}}var Ze,Xe,et,tt;!function(e){e.HEADER="header",e.QUERY="query"}(Ze||(Ze={})),function(e){e.HEADER="header",e.QUERY="query"}(Xe||(Xe={})),function(e){e.HTTP="http",e.HTTPS="https"}(et||(et={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(tt||(tt={}));var nt;!function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(nt||(nt={}));const rt="__smithy_context";var it,st;!function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"}(it||(it={})),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(st||(st={}));class ot{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new ot({...e,headers:{...e.headers}});var n;return t.query&&(t.query=(n=t.query,Object.keys(n).reduce((e,t)=>{const r=n[t];return{...e,[t]:Array.isArray(r)?[...r]:r}},{}))),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return ot.clone(this)}}class at{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const ct={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},ut=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!ot.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),ct)}}),dt={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},lt="X-Amzn-Trace-Id",ht={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},ft=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{const{request:r}=n;if(!ot.isInstance(r)||"node"!==e.runtime)return t(n);const i=Object.keys(r.headers??{}).find(e=>e.toLowerCase()===lt.toLowerCase())??lt;if(r.headers.hasOwnProperty(i))return t(n);const s=process.env.AWS_LAMBDA_FUNCTION_NAME,o=process.env._X_AMZN_TRACE_ID,a=e=>"string"==typeof e&&e.length>0;return a(s)&&a(o)&&(r.headers[lt]=o),t({...n,request:r})})(e),ht)}}),pt=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t};const mt=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),gt=e=>mt.test(e)||e.startsWith("[")&&e.endsWith("]"),yt=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),bt=(e,t=!1)=>{if(!t)return yt.test(e);const n=e.split(".");for(const e of n)if(!bt(e))return!1;return!0},wt={},vt="endpoints";function kt(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${kt(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(kt).join(", ")})`:JSON.stringify(e,null,2)}class St extends Error{constructor(e){super(e),this.name="EndpointError"}}const Et=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new St(`Path: '${e}' does not end with ']'`);const i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new St(`Invalid array index: '${i}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n})(t).reduce((n,r)=>{if("object"!=typeof n)throw new St(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]},e),At={[et.HTTP]:80,[et.HTTPS]:443},It={booleanEquals:(e,t)=>e===t,getAttr:Et,isSet:e=>null!=e,isValidHostLabel:bt,not:e=>!e,parseURL:e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:i="",query:s={}}=e,o=new URL(`${r}//${t}${n?`:${n}`:""}${i}`);return o.search=Object.entries(s).map(([e,t])=>`${e}=${t}`).join("&"),o}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:i,pathname:s,protocol:o,search:a}=t;if(a)return null;const c=o.slice(0,-1);if(!Object.values(et).includes(c))return null;const u=gt(i);return{scheme:c,authority:`${r}${n.includes(`${r}:${At[c]}`)||"string"==typeof e&&e.includes(`${r}:${At[c]}`)?`:${At[c]}`:""}`,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:u}},stringEquals:(e,t)=>e===t,substring:(e,t,n,r)=>t>=n||e.length<n?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),uriEncode:e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},_t=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let i=0;for(;i<e.length;){const t=e.indexOf("{",i);if(-1===t){n.push(e.slice(i));break}n.push(e.slice(i,t));const s=e.indexOf("}",t);if(-1===s){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[s+1]&&(n.push(e.slice(t+1,s)),i=s+2);const o=e.substring(t+1,s);if(o.includes("#")){const[e,t]=o.split("#");n.push(Et(r[e],t))}else n.push(r[o]);i=s+1}return n.join("")},xt=(e,t,n)=>{if("string"==typeof e)return _t(e,n);if(e.fn)return Rt(e,n);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,n);throw new St(`'${t}': ${String(e)} is not a string, function or reference.`)},Rt=({fn:e,argv:t},n)=>{const r=t.map(e=>["boolean","number"].includes(typeof e)?e:xt(e,"arg",n)),i=e.split(".");return i[0]in wt&&null!=i[1]?wt[i[0]][i[1]](...r):It[e](...r)},Pt=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new St(`'${e}' is already defined in Reference Record.`);const r=Rt(t,n);return n.logger?.debug?.(`${vt} evaluateCondition: ${kt(t)} = ${kt(r)}`),{result:""===r||!!r,...null!=e&&{toAssign:{name:e,value:r}}}},Ct=(e=[],t)=>{const n={};for(const r of e){const{result:e,toAssign:i}=Pt(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};i&&(n[i.name]=i.value,t.logger?.debug?.(`${vt} assign: ${i.name} := ${kt(i.value)}`))}return{result:!0,referenceRecord:n}},Tt=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r.map(e=>{const r=xt(e,"Header value entry",t);if("string"!=typeof r)throw new St(`Header '${n}' value '${r}' is not a string`);return r})}),{}),Mt=(e,t)=>{if(Array.isArray(e))return e.map(e=>Mt(e,t));switch(typeof e){case"string":return _t(e,t);case"object":if(null===e)throw new St(`Unexpected endpoint property: ${e}`);return Ot(e,t);case"boolean":return e;default:throw new St("Unexpected endpoint property type: "+typeof e)}},Ot=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:Mt(r,t)}),{}),Nt=(e,t)=>{const n=xt(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new St("Endpoint URL must be a string, got "+typeof n)},Lt=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:i,referenceRecord:s}=Ct(n,t);if(!i)return;const o={...t,referenceRecord:{...t.referenceRecord,...s}},{url:a,properties:c,headers:u}=r;return t.logger?.debug?.(`${vt} Resolving endpoint from template: ${kt(r)}`),{...null!=u&&{headers:Tt(u,o)},...null!=c&&{properties:Ot(c,o)},url:Nt(a,o)}},$t=(e,t)=>{const{conditions:n,error:r}=e,{result:i,referenceRecord:s}=Ct(n,t);if(i)throw new St(xt(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...s}}))},Dt=(e,t)=>{const{conditions:n,rules:r}=e,{result:i,referenceRecord:s}=Ct(n,t);if(i)return Ut(r,{...t,referenceRecord:{...t.referenceRecord,...s}})},Ut=(e,t)=>{for(const n of e)if("endpoint"===n.type){const e=Lt(n,t);if(e)return e}else if("error"===n.type)$t(n,t);else{if("tree"!==n.type)throw new St(`Unknown endpoint rule: ${n}`);{const e=Dt(n,t);if(e)return e}}throw new St("Rules evaluation failed")},Ft=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!Ft(t))return!1;return!0}return!!bt(e)&&(!(e.length<3||e.length>63)&&(e===e.toLowerCase()&&!gt(e)))};let Bt=JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","implicitGlobalRegion":"us-east-1","name":"aws","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"ap-northeast-1":{"description":"Asia Pacific (Tokyo)"},"ap-northeast-2":{"description":"Asia Pacific (Seoul)"},"ap-northeast-3":{"description":"Asia Pacific (Osaka)"},"ap-south-1":{"description":"Asia Pacific (Mumbai)"},"ap-south-2":{"description":"Asia Pacific (Hyderabad)"},"ap-southeast-1":{"description":"Asia Pacific (Singapore)"},"ap-southeast-2":{"description":"Asia Pacific (Sydney)"},"ap-southeast-3":{"description":"Asia Pacific (Jakarta)"},"ap-southeast-4":{"description":"Asia Pacific (Melbourne)"},"ap-southeast-5":{"description":"Asia Pacific (Malaysia)"},"ap-southeast-7":{"description":"Asia Pacific (Thailand)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"ca-west-1":{"description":"Canada West (Calgary)"},"eu-central-1":{"description":"Europe (Frankfurt)"},"eu-central-2":{"description":"Europe (Zurich)"},"eu-north-1":{"description":"Europe (Stockholm)"},"eu-south-1":{"description":"Europe (Milan)"},"eu-south-2":{"description":"Europe (Spain)"},"eu-west-1":{"description":"Europe (Ireland)"},"eu-west-2":{"description":"Europe (London)"},"eu-west-3":{"description":"Europe (Paris)"},"il-central-1":{"description":"Israel (Tel Aviv)"},"me-central-1":{"description":"Middle East (UAE)"},"me-south-1":{"description":"Middle East (Bahrain)"},"mx-central-1":{"description":"Mexico (Central)"},"sa-east-1":{"description":"South America (Sao Paulo)"},"us-east-1":{"description":"US East (N. Virginia)"},"us-east-2":{"description":"US East (Ohio)"},"us-west-1":{"description":"US West (N. California)"},"us-west-2":{"description":"US West (Oregon)"}}},{"id":"aws-cn","outputs":{"dnsSuffix":"amazonaws.com.cn","dualStackDnsSuffix":"api.amazonwebservices.com.cn","implicitGlobalRegion":"cn-northwest-1","name":"aws-cn","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^cn\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-cn-global":{"description":"AWS China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"id":"aws-us-gov","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","implicitGlobalRegion":"us-gov-west-1","name":"aws-us-gov","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-us-gov-global":{"description":"AWS GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","implicitGlobalRegion":"us-iso-east-1","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) global region"},"us-iso-east-1":{"description":"US ISO East"},"us-iso-west-1":{"description":"US ISO WEST"}}},{"id":"aws-iso-b","outputs":{"dnsSuffix":"sc2s.sgov.gov","dualStackDnsSuffix":"sc2s.sgov.gov","implicitGlobalRegion":"us-isob-east-1","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","implicitGlobalRegion":"eu-isoe-west-1","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-e-global":{"description":"AWS ISOE (Europe) global region"},"eu-isoe-west-1":{"description":"EU ISOE West"}}},{"id":"aws-iso-f","outputs":{"dnsSuffix":"csp.hci.ic.gov","dualStackDnsSuffix":"csp.hci.ic.gov","implicitGlobalRegion":"us-isof-south-1","name":"aws-iso-f","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-f-global":{"description":"AWS ISOF global region"},"us-isof-east-1":{"description":"US ISOF EAST"},"us-isof-south-1":{"description":"US ISOF SOUTH"}}},{"id":"aws-eusc","outputs":{"dnsSuffix":"amazonaws.eu","dualStackDnsSuffix":"amazonaws.eu","implicitGlobalRegion":"eusc-de-east-1","name":"aws-eusc","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eusc\\\\-(de)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"eusc-de-east-1":{"description":"EU (Germany)"}}}],"version":"1.1"}'),jt="";const Ht={isVirtualHostableS3Bucket:Ft,parseArn:e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,i,s,o,...a]=t;if("arn"!==n||""===r||""===i||""===a.join(":"))return null;return{partition:r,service:i,region:s,accountId:o,resourceId:a.map(e=>e.split("/")).flat()}},partition:e=>{const{partitions:t}=Bt;for(const n of t){const{regions:t,outputs:r}=n;for(const[n,i]of Object.entries(t))if(n===e)return{...r,...i}}for(const n of t){const{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}const n=t.find(e=>"aws"===e.id);if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}}};function qt(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}wt.aws=Ht;const Vt=/\d{12}\.ddb/;const zt="user-agent",Gt="x-amz-user-agent",Wt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,Kt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;const Qt=e=>(t,n)=>async r=>{const{request:i}=r;if(!ot.isInstance(i))return t(r);const{headers:s}=i,o=n?.userAgent?.map(Yt)||[],a=(await e.defaultUserAgentProvider()).map(Yt);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&qt(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();"function"==typeof n.acquireInitialRetryToken?n.constructor?.name?.includes("Adaptive")?qt(e,"RETRY_MODE_ADAPTIVE","F"):qt(e,"RETRY_MODE_STANDARD","E"):qt(e,"RETRY_MODE_LEGACY","D")}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(Vt)&&qt(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":qt(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":qt(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":qt(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const t=i;t.accountId&&qt(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))qt(e,n,r)}}(n,e,r);const c=n;a.push(`m/${function(e){let t="";for(const n in e){const r=e[n];if(!(t.length+r.length+1<=1024))break;t.length?t+=","+r:t+=r}return t}(Object.assign({},n.__smithy_context?.features,c.__aws_sdk_context?.features))}`);const u=e?.customUserAgent?.map(Yt)||[],d=await e.userAgentAppId();d&&a.push(Yt([`app/${d}`]));const l=(jt?[jt]:[]).concat([...a,...o,...u]).join(" "),h=[...a.filter(e=>e.startsWith("aws-sdk-")),...u].join(" ");return"browser"!==e.runtime?(h&&(s[Gt]=s[Gt]?`${s[zt]} ${h}`:h),s[zt]=l):s[Gt]=l,t({...r,request:i})},Yt=e=>{const t=e[0].split("/").map(e=>e.replace(Wt,"-")).join("/"),n=e[1]?.replace(Kt,"-"),r=t.indexOf("/"),i=t.substring(0,r);let s=t.substring(r+1);return"api"===i&&(s=s.toLowerCase()),[i,s,n].filter(e=>e&&e.length>0).reduce((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}},"")},Jt={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0};var Zt;!function(e){e.ENV="env",e.CONFIG="shared config entry"}(Zt||(Zt={}));const Xt=e=>e[rt]||(e[rt]={}),en=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},tn=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),nn=e=>tn(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e;const rn=(e,t)=>(n,r)=>async i=>{const s=((e,t)=>{if(!t||0===t.length)return e;const n=[];for(const r of t)for(const t of e)t.schemeId.split("#")[1]===r&&n.push(t);for(const t of e)n.find(({schemeId:e})=>e===t.schemeId)||n.push(t);return n})(e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),e.authSchemePreference?await e.authSchemePreference():[]),o=function(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}(e.httpAuthSchemes),a=Xt(r),c=[];for(const n of s){const i=o.get(n.schemeId);if(!i){c.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}const s=i.identityProvider(await t.identityProviderConfigProvider(e));if(!s){c.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:u={},signingProperties:d={}}=n.propertiesExtractor?.(e,r)||{};n.identityProperties=Object.assign(n.identityProperties||{},u),n.signingProperties=Object.assign(n.signingProperties||{},d),a.selectedHttpAuthScheme={httpAuthOption:n,identity:await s(n.identityProperties),signer:i.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(c.join("\n"));return n(i)},sn={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};class on{constructor(e){this.authSchemes=new Map;for(const[t,n]of Object.entries(e))void 0!==n&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}const an=e=>e=>{throw e},cn=(e,t)=>{},un={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},dn=e=>({applyToStack:e=>{e.addRelativeTo((e,t)=>async n=>{if(!ot.isInstance(n.request))return e(n);const r=Xt(t).selectedHttpAuthScheme;if(!r)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:s,signer:o}=r,a=await e({...n,request:await o.sign(n.request,s,i)}).catch((o.errorHandler||an)(i));return(o.successHandler||cn)(a.response,i),a},un)}}),ln="content-length";const hn={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},fn=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(ot.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(ln))try{const t=n(e);r.headers={...r.headers,[ln]:String(t)}}catch(e){}}return e({...t,request:r})}),hn)}});const pn=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,mn=/(\d+\.){3}\d+/,gn=/\.\./,yn=e=>pn.test(e)&&!mn.test(e)&&!gn.test(e),bn=e=>{const[t,n,r,,,i]=e.split(":"),s="arn"===t&&e.split(":").length>=6,o=Boolean(s&&n&&r&&i);if(s&&!o)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return o},wn=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"credentialScope"===e||"CredentialScope"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:"accountId"===e||"AccountId"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:"endpoint"===e||"endpoint"===t?async()=>{if(!1===n.isCustomEndpoint)return;const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?":"+r:""}${i}`}}return e}:r},vn=async e=>{};const kn=e=>{if("string"==typeof e)return kn(new URL(e));const{hostname:t,pathname:n,port:r,protocol:i,search:s}=e;let o;return s&&(o=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(s)),{hostname:t,port:r?parseInt(r):void 0,protocol:i,path:n,query:o}},Sn=e=>"object"==typeof e?"url"in e?kn(e.url):e:kn(e),En=async(e,t,n)=>{const r={},i=t?.getEndpointParameterInstructions?.()||{};for(const[t,s]of Object.entries(i))switch(s.type){case"staticContextParams":r[t]=s.value;break;case"contextParams":r[t]=e[s.name];break;case"clientContextParams":case"builtInParams":r[t]=await wn(s.name,t,n)();break;case"operationContextParams":r[t]=s.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return 0===Object.keys(i).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),bn(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!yn(t)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},An=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&function(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}(r,"ENDPOINT_OVERRIDE","N");const s=await(async(e,t,n,r)=>{if(!n.isCustomEndpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await vn(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(Sn(e)),n.isCustomEndpoint=!0)}const i=await En(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(i,r)})(i.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=s,r.authSchemes=s.properties?.authSchemes;const o=r.authSchemes?.[0];if(o){r.signing_region=o.signingRegion,r.signing_service=o.signingName;const e=Xt(r),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:o.signingRegion,signingRegion:o.signingRegion,signing_service:o.signingName,signingName:o.signingName,signingRegionSet:o.signingRegionSet},o.properties))}return n({...i})},In=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1],_n={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},xn={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Rn(e,t,n){return{applyToStack:r=>{r.add(((e,t)=>(n,r)=>async i=>{const{response:s}=await n(i);try{return{response:s,output:await t(s,e)}}catch(e){if(Object.defineProperty(e,"$response",{value:s}),!("$metadata"in e)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{e.message+="\n "+t}catch(e){r.logger&&"NoOpLogger"!==r.logger?.constructor?.name?r.logger?.warn?.(t):console.warn(t)}void 0!==e.$responseBodyText&&e.$response&&(e.$response.body=e.$responseBodyText);try{if(at.isInstance(s)){const{headers:t={}}=s,n=Object.entries(t);e.$metadata={httpStatusCode:s.statusCode,requestId:In(/^x-[\w-]+-request-?id$/,n),extendedRequestId:In(/^x-[\w-]+-id-2$/,n),cfId:In(/^x-[\w-]+-cf-id$/,n)}}}catch(e){}}throw e}})(e,n),_n),r.add(((e,t)=>(n,r)=>async i=>{const s=e,o=r.endpointV2?.url&&s.urlParser?async()=>s.urlParser(r.endpointV2.url):s.endpoint;if(!o)throw new Error("No valid endpoint provider available.");const a=await t(i.input,{...e,endpoint:o});return n({...i,request:a})})(e,t),xn)}}}const Pn={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:xn.name},Cn=(e,t)=>({applyToStack:n=>{n.addRelativeTo(An({config:e,instructions:t}),Pn)}});var Tn;!function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(Tn||(Tn={}));const Mn=Tn.STANDARD,On=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Nn=["TimeoutError","RequestTimeout","RequestTimeoutException"],Ln=[500,502,503,504],$n=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Dn=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],Un=e=>429===e.$metadata?.httpStatusCode||On.includes(e.name)||1==e.$retryable?.throttling,Fn=(e,t=0)=>(e=>e.$metadata?.clockSkewCorrected)(e)||Nn.includes(e.name)||$n.includes(e?.code||"")||Dn.includes(e?.code||"")||Ln.includes(e.$metadata?.httpStatusCode||0)||(e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return!!(e&&e instanceof TypeError)&&t.has(e.message)})(e)||void 0!==e.cause&&t<=10&&Fn(e.cause,t+1);class Bn{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(e=>Bn.setTimeoutFn(e,t))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),Un(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}Bn.setTimeoutFn=setTimeout;const jn=100,Hn=2e4,qn="amz-sdk-invocation-id",Vn="amz-sdk-request",zn=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(Hn,e),getRetryCost:()=>n});class Gn{constructor(e){this.maxAttempts=e,this.mode=Tn.STANDARD,this.capacity=500,this.retryBackoffStrategy=(()=>{let e=jn;return{computeNextBackoffDelay:t=>Math.floor(Math.min(Hn,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})(),this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return zn({retryDelay:jn,retryCount:0})}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n)){const n=t.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===n?500:jn);const r=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),i=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,r):r,s=this.getCapacityCost(n);return this.capacity-=s,zn({retryDelay:i,retryCount:e.getRetryCount()+1,retryCost:s})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return"TRANSIENT"===e?10:5}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}class Wn{constructor(e,t){this.maxAttemptsProvider=e,this.mode=Tn.ADAPTIVE;const{rateLimiter:n}=t??{};this.rateLimiter=n??new Bn,this.standardRetryStrategy=new Gn(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const Kn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Qn;const Yn=new Uint8Array(16);function Jn(){if(!Qn&&(Qn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qn(Yn)}const Zn=[];for(let e=0;e<256;++e)Zn.push((e+256).toString(16).slice(1));function Xn(e,t=0){return Zn[e[t+0]]+Zn[e[t+1]]+Zn[e[t+2]]+Zn[e[t+3]]+"-"+Zn[e[t+4]]+Zn[e[t+5]]+"-"+Zn[e[t+6]]+Zn[e[t+7]]+"-"+Zn[e[t+8]]+Zn[e[t+9]]+"-"+Zn[e[t+10]]+Zn[e[t+11]]+Zn[e[t+12]]+Zn[e[t+13]]+Zn[e[t+14]]+Zn[e[t+15]]}const er=function(e,t,n){if(Kn.randomUUID&&!t&&!e)return Kn.randomUUID();const r=(e=e||{}).random||(e.rng||Jn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Xn(r)},tr=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error(`AWS SDK error wrapper for ${e}`);const nr=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const e of t)n.push(e);return n},rr=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,ir=()=>{let e=[],t=[],n=!1;const r=new Set,i=n=>(e.forEach(e=>{n.add(e.middleware,{...e})}),t.forEach(e=>{n.addRelativeTo(e.middleware,{...e})}),n.identifyOnResolve?.(a.identifyOnResolve()),n),s=e=>{const t=[];return e.before.forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...s(e))}),t.push(e),e.after.reverse().forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...s(e))}),t},o=(n=!1)=>{const r=[],i=[],o={};e.forEach(e=>{const t={...e,before:[],after:[]};for(const e of nr(t.name,t.aliases))o[e]=t;r.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const e of nr(t.name,t.aliases))o[e]=t;i.push(t)}),i.forEach(e=>{if(e.toMiddleware){const t=o[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${rr(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}});const a=(c=r,c.sort((e,t)=>sr[t.step]-sr[e.step]||or[t.priority||"normal"]-or[e.priority||"normal"])).map(s).reduce((e,t)=>(e.push(...t),e),[]);var c;return a},a={add:(t,n={})=>{const{name:i,override:s,aliases:o}=n,a={step:"initialize",priority:"normal",middleware:t,...n},c=nr(i,o);if(c.length>0){if(c.some(e=>r.has(e))){if(!s)throw new Error(`Duplicate middleware name '${rr(i,o)}'`);for(const t of c){const n=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(-1===n)continue;const r=e[n];if(r.step!==a.step||a.priority!==r.priority)throw new Error(`"${rr(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${rr(i,o)}" middleware with ${a.priority} priority in ${a.step} step.`);e.splice(n,1)}}for(const e of c)r.add(e)}e.push(a)},addRelativeTo:(e,n)=>{const{name:i,override:s,aliases:o}=n,a={middleware:e,...n},c=nr(i,o);if(c.length>0){if(c.some(e=>r.has(e))){if(!s)throw new Error(`Duplicate middleware name '${rr(i,o)}'`);for(const e of c){const n=t.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(-1===n)continue;const r=t[n];if(r.toMiddleware!==a.toMiddleware||r.relation!==a.relation)throw new Error(`"${rr(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${rr(i,o)}" middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(n,1)}}for(const e of c)r.add(e)}t.push(a)},clone:()=>i(ir()),use:e=>{e.applyToStack(a)},remove:n=>"string"==typeof n?(n=>{let i=!1;const s=e=>{const t=nr(e.name,e.aliases);if(t.includes(n)){i=!0;for(const e of t)r.delete(e);return!1}return!0};return e=e.filter(s),t=t.filter(s),i})(n):(n=>{let i=!1;const s=e=>{if(e.middleware===n){i=!0;for(const t of nr(e.name,e.aliases))r.delete(t);return!1}return!0};return e=e.filter(s),t=t.filter(s),i})(n),removeByTag:n=>{let i=!1;const s=e=>{const{tags:t,name:s,aliases:o}=e;if(t&&t.includes(n)){const e=nr(s,o);for(const t of e)r.delete(t);return i=!0,!1}return!0};return e=e.filter(s),t=t.filter(s),i},concat:e=>{const t=i(ir());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:i,identify:()=>o(!0).map(e=>{const t=e.step??e.relation+" "+e.toMiddleware;return rr(e.name,e.aliases)+" - "+t}),identifyOnResolve:e=>("boolean"==typeof e&&(n=e),n),resolve:(e,t)=>{for(const n of o().map(e=>e.middleware).reverse())e=n(e,t);return n&&console.log(a.identify()),e}};return a},sr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},or={high:3,normal:2,low:1};class ar{constructor(e){this.config=e,this.middlewareStack=ir()}send(e,t,n){const r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n;let s;if(void 0===r&&!0===this.config.cacheMiddleware){this.handlers||(this.handlers=new WeakMap);const t=this.handlers;t.has(e.constructor)?s=t.get(e.constructor):(s=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,s))}else delete this.handlers,s=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return s(e).then(e=>e.output);s(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{})}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const cr={},ur=new Array(64);for(let e=0,t="A".charCodeAt(0),n="Z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t);cr[n]=e,ur[e]=n}for(let e=0,t="a".charCodeAt(0),n="z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t),r=e+26;cr[n]=r,ur[r]=n}for(let e=0;e<10;e++){cr[e.toString(10)]=e+52;const t=e.toString(10),n=e+52;cr[t]=n,ur[n]=t}cr["+"]=62,ur[62]="+",cr["/"]=63,ur[63]="/";const dr=e=>{let t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let t=0;t<e.length;t+=4){let n=0,i=0;for(let r=t,s=t+3;r<=s;r++)if("="!==e[r]){if(!(e[r]in cr))throw new TypeError(`Invalid character ${e[r]} in base64 string.`);n|=cr[e[r]]<<6*(s-r),i+=6}else n>>=6;const s=t/4*3;n>>=i%8;const o=Math.floor(i/8);for(let e=0;e<o;e++){const t=8*(o-e-1);r.setUint8(s+e,(n&255<<t)>>t)}}return new Uint8Array(n)},lr=e=>(new TextEncoder).encode(e);function hr(e){let t;t="string"==typeof e?lr(e):e;const n="object"==typeof t&&"number"==typeof t.length,r="object"==typeof t&&"number"==typeof t.byteOffset&&"number"==typeof t.byteLength;if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let e=0;e<t.length;e+=3){let n=0,r=0;for(let i=e,s=Math.min(e+3,t.length);i<s;i++)n|=t[i]<<8*(s-i-1),r+=8;const s=Math.ceil(r/6);n<<=6*s-r;for(let e=1;e<=s;e++){const t=6*(s-e);i+=ur[(n&63<<t)>>t]}i+="==".slice(0,4-s)}return i}const fr=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};class pr extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return function(e,t){return"base64"===t?pr.mutate(dr(e)):pr.mutate(lr(e))}(e,t);throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,pr.prototype),e}transformToString(e="utf-8"){return function(e,t="utf-8"){return"base64"===t?hr(e):fr(e)}(this,e)}}"function"==typeof ReadableStream&&ReadableStream;const mr=e=>encodeURIComponent(e).replace(/[!'()*]/g,gr),gr=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function yr(e,t){return new Request(e,t)}function br(e=0){return new Promise((t,n)=>{e&&setTimeout(()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name="TimeoutError",n(t)},e)})}const wr={supported:void 0};class vr{static create(e){return"function"==typeof e?.handle?e:new vr(e)}constructor(e){"function"==typeof e?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===wr.supported&&(wr.supported=Boolean("undefined"!=typeof Request&&"keepalive"in yr("https://[::1]")))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const r=n??this.config.requestTimeout,i=!0===this.config.keepAlive,s=this.config.credentials;if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",Promise.reject(e)}let o=e.path;const a=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=mr(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${mr(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${mr(r)}`),t.push(e)}}return t.join("&")}(e.query||{});a&&(o+=`?${a}`),e.fragment&&(o+=`#${e.fragment}`);let c="";if(null!=e.username||null!=e.password){c=`${e.username??""}:${e.password??""}@`}const{port:u,method:d}=e,l=`${e.protocol}//${c}${e.hostname}${u?`:${u}`:""}${o}`,h="GET"===d||"HEAD"===d?void 0:e.body,f={body:h,headers:new Headers(e.headers),method:d,credentials:s};this.config?.cache&&(f.cache=this.config.cache),h&&(f.duplex="half"),"undefined"!=typeof AbortController&&(f.signal=t),wr.supported&&(f.keepalive=i),"function"==typeof this.config.requestInit&&Object.assign(f,this.config.requestInit(e));let p=()=>{};const m=yr(l,f),g=[fetch(m).then(e=>{const t=e.headers,n={};for(const e of t.entries())n[e[0]]=e[1];return null!=e.body?{response:new at({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then(t=>({response:new at({headers:n,reason:e.statusText,statusCode:e.status,body:t})}))}),br(r)];return t&&g.push(new Promise((e,n)=>{const r=()=>{const e=new Error("Request aborted");e.name="AbortError",n(e)};if("function"==typeof t.addEventListener){const e=t;e.addEventListener("abort",r,{once:!0}),p=()=>e.removeEventListener("abort",r)}else t.onabort=r})),Promise.race(g).finally(p)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}const kr=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(2!==r.readyState)return n(new Error("Reader aborted too early"));const e=r.result??"",i=e.indexOf(","),s=i>-1?i+1:e.length;t(e.substring(s))},r.onabort=()=>n(new Error("Read aborted")),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}(e),n=dr(t);return new Uint8Array(n)}(e):async function(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:e,value:s}=await n.read();s&&(t.push(s),i+=s.length),r=e}const s=new Uint8Array(i);let o=0;for(const e of t)s.set(e,o),o+=e.length;return s}(e);const Sr={},Er={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),Sr[e]=t,Er[t]=e}function Ar(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(!(r in Er))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=Er[r]}return t}function Ir(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Sr[e[n]];return t}const _r=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return pr.mutate(e);if(!e)return pr.mutate(new Uint8Array);const n=t.streamCollector(e);return pr.mutate(await n)},xr=e=>"function"==typeof e?e():e;class Rr{constructor(e,t){this.name=e,this.traits=t}}class Pr extends Rr{constructor(e,t,n){super(e,t),this.name=e,this.traits=t,this.valueSchema=n,this.symbol=Pr.symbol}static[Symbol.hasInstance](e){const t=Pr.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===Pr.symbol}return t}}Pr.symbol=Symbol.for("@smithy/core/schema::ListSchema");class Cr extends Rr{constructor(e,t,n,r){super(e,t),this.name=e,this.traits=t,this.keySchema=n,this.valueSchema=r,this.symbol=Cr.symbol}static[Symbol.hasInstance](e){const t=Cr.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===Cr.symbol}return t}}Cr.symbol=Symbol.for("@smithy/core/schema::MapSchema");const Tr={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class Mr extends Rr{constructor(e,t,n){super(e,n),this.name=e,this.schemaRef=t,this.traits=n,this.symbol=Mr.symbol}static[Symbol.hasInstance](e){const t=Mr.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===Mr.symbol}return t}}Mr.symbol=Symbol.for("@smithy/core/schema::SimpleSchema");class Or extends Rr{constructor(e,t,n,r){super(e,t),this.name=e,this.traits=t,this.memberNames=n,this.memberList=r,this.symbol=Or.symbol,this.members={};for(let e=0;e<n.length;++e)this.members[n[e]]=Array.isArray(r[e])?r[e]:[r[e],0]}static[Symbol.hasInstance](e){const t=Or.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===Or.symbol}return t}}Or.symbol=Symbol.for("@smithy/core/schema::StructureSchema");class Nr{constructor(e,t){this.ref=e,this.memberName=t,this.symbol=Nr.symbol;const n=[];let r=e,i=e;for(this._isMemberSchema=!1;Array.isArray(r);)n.push(r[1]),r=r[0],i=xr(r),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let e=n.length-1;e>=0;--e){const t=n[e];Object.assign(this.memberTraits,Nr.translateTraits(t))}}else this.memberTraits=0;if(i instanceof Nr)return this.name=i.name,this.traits=i.traits,this._isMemberSchema=i._isMemberSchema,this.schema=i.schema,this.memberTraits=Object.assign({},i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.ref=i.ref,void(this.memberName=t??i.memberName);if(this.schema=xr(i),this.schema&&"object"==typeof this.schema?this.traits=this.schema?.traits??{}:this.traits=0,this.name=("object"==typeof this.schema?this.schema?.name:void 0)??this.memberName??this.getSchemaName(),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member schema ${this.getName(!0)} must initialize with memberName argument.`)}static[Symbol.hasInstance](e){const t=Nr.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===Nr.symbol}return t}static of(e,t){return e instanceof Nr?e:new Nr(e,t)}static translateTraits(e){if("object"==typeof e)return e;const t={};return 1&~(e|=0)||(t.httpLabel=1),1==(e>>1&1)&&(t.idempotent=1),1==(e>>2&1)&&(t.idempotencyToken=1),1==(e>>3&1)&&(t.sensitive=1),1==(e>>4&1)&&(t.httpPayload=1),1==(e>>5&1)&&(t.httpResponseCode=1),1==(e>>6&1)&&(t.httpQueryParams=1),t}static memberFrom(e,t){return e instanceof Nr?(e.memberName=t,e._isMemberSchema=!0,e):new Nr(e,t)}getSchema(){return this.schema instanceof Nr?this.schema=this.schema.getSchema():this.schema instanceof Mr?xr(this.schema.schemaRef):xr(this.schema)}getName(e=!1){return!e&&this.name&&this.name.includes("#")?this.name.split("#")[1]:this.name||void 0}getMemberName(){if(!this.isMemberSchema())throw new Error(`@smithy/core/schema - cannot get member name on non-member schema: ${this.getName(!0)}`);return this.memberName}isMemberSchema(){return this._isMemberSchema}isUnitSchema(){return"unit"===this.getSchema()}isListSchema(){const e=this.getSchema();return"number"==typeof e?e>=Tr.LIST_MODIFIER&&e<Tr.MAP_MODIFIER:e instanceof Pr}isMapSchema(){const e=this.getSchema();return"number"==typeof e?e>=Tr.MAP_MODIFIER&&e<=255:e instanceof Cr}isDocumentSchema(){return this.getSchema()===Tr.DOCUMENT}isStructSchema(){const e=this.getSchema();return null!==e&&"object"==typeof e&&"members"in e||e instanceof Or}isBlobSchema(){return this.getSchema()===Tr.BLOB||this.getSchema()===Tr.STREAMING_BLOB}isTimestampSchema(){const e=this.getSchema();return"number"==typeof e&&e>=Tr.TIMESTAMP_DEFAULT&&e<=Tr.TIMESTAMP_EPOCH_SECONDS}isStringSchema(){return this.getSchema()===Tr.STRING}isBooleanSchema(){return this.getSchema()===Tr.BOOLEAN}isNumericSchema(){return this.getSchema()===Tr.NUMERIC}isBigIntegerSchema(){return this.getSchema()===Tr.BIG_INTEGER}isBigDecimalSchema(){return this.getSchema()===Tr.BIG_DECIMAL}isStreaming(){return!!this.getMergedTraits().streaming||this.getSchema()===Tr.STREAMING_BLOB}isIdempotencyToken(){return"number"==typeof this.traits?!(4&~this.traits):"object"==typeof this.traits&&!!this.traits.idempotencyToken}getMergedTraits(){return this.normalizedTraits||(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()}),this.normalizedTraits}getMemberTraits(){return Nr.translateTraits(this.memberTraits)}getOwnTraits(){return Nr.translateTraits(this.traits)}getKeySchema(){if(this.isDocumentSchema())return Nr.memberFrom([Tr.DOCUMENT,0],"key");if(!this.isMapSchema())throw new Error(`@smithy/core/schema - cannot get key schema for non-map schema: ${this.getName(!0)}`);const e=this.getSchema();return"number"==typeof e?Nr.memberFrom([63&e,0],"key"):Nr.memberFrom([e.keySchema,0],"key")}getValueSchema(){const e=this.getSchema();if("number"==typeof e){if(this.isMapSchema())return Nr.memberFrom([63&e,0],"value");if(this.isListSchema())return Nr.memberFrom([63&e,0],"member")}if(e&&"object"==typeof e){if(this.isStructSchema())throw new Error(`cannot call getValueSchema() with StructureSchema ${this.getName(!0)}`);const t=e;if("valueSchema"in t){if(this.isMapSchema())return Nr.memberFrom([t.valueSchema,0],"value");if(this.isListSchema())return Nr.memberFrom([t.valueSchema,0],"member")}}if(this.isDocumentSchema())return Nr.memberFrom([Tr.DOCUMENT,0],"value");throw new Error(`@smithy/core/schema - the schema ${this.getName(!0)} does not have a value member.`)}hasMemberSchema(e){if(this.isStructSchema()){return e in this.getSchema().members}return!1}getMemberSchema(e){if(this.isStructSchema()){const t=this.getSchema();if(!(e in t.members))throw new Error(`@smithy/core/schema - the schema ${this.getName(!0)} does not have a member with name=${e}.`);return Nr.memberFrom(t.members[e],e)}if(this.isDocumentSchema())return Nr.memberFrom([Tr.DOCUMENT,0],e);throw new Error(`@smithy/core/schema - the schema ${this.getName(!0)} does not have members.`)}getMemberSchemas(){const{schema:e}=this,t=e;if(!t||"object"!=typeof t)return{};if("members"in t){const e={};for(const n of t.memberNames)e[n]=this.getMemberSchema(n);return e}return{}}getEventStreamMember(){if(this.isStructSchema())for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e;return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot acquire structIterator on non-struct schema.");const e=this.getSchema();for(let t=0;t<e.memberNames.length;++t)yield[e.memberNames[t],Nr.memberFrom([e.memberList[t],0],e.memberNames[t])]}getSchemaName(){const e=this.getSchema();if("number"==typeof e){const t=63&e,n=192&e,r=Object.entries(Tr).find(([,e])=>e===t)?.[0]??"Unknown";switch(n){case Tr.MAP_MODIFIER:return`${r}Map`;case Tr.LIST_MODIFIER:return`${r}List`;case 0:return r}}return"Unknown"}}Nr.symbol=Symbol.for("@smithy/core/schema::NormalizedSchema");const Lr="***SensitiveInformation***";function $r(e,t){if(null==t)return t;const n=Nr.of(e);if(n.getMergedTraits().sensitive)return Lr;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return Lr}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return Lr}else if(n.isStructSchema()&&"object"==typeof t){const e=t,r={};for(const[t,i]of n.structIterator())null!=e[t]&&(r[t]=$r(i,e[t]));return r}return t}class Dr{constructor(){this.middlewareStack=ir()}static classBuilder(){return new Ur}resolveMiddlewareWithContext(e,t,n,{middlewareFn:r,clientName:i,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,smithyContext:c,additionalContext:u,CommandCtor:d}){for(const i of r.bind(this)(d,e,t,n))this.middlewareStack.use(i);const l=e.concat(this.middlewareStack),{logger:h}=t,f={logger:h,clientName:i,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,[rt]:{commandInstance:this,...c},...u},{requestHandler:p}=t;return l.resolve(e=>p.handle(e.request,n||{}),f)}}class Ur{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=void 0,this._outputFilterSensitiveLog=void 0,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends Dr{static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(e._operationSchema?$r.bind(null,e._operationSchema.input):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(e._operationSchema?$r.bind(null,e._operationSchema.output):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const Fr="***SensitiveInformation***";class Br extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return Br.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&("client"===t.$fault||"server"===t.$fault)}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===Br?Br.isInstance(e):!!Br.isInstance(e)&&(t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e))}}const jr=(e,t={})=>{Object.entries(t).filter(([,e])=>void 0!==e).forEach(([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)});const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},Hr=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),qr=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},Vr=e=>Object.assign((e=>{const t=[];for(const n in tt){const r=tt[n];void 0!==e[r]&&t.push({algorithmId:()=>r,checksumConstructor:()=>e[r]})}return{addChecksumAlgorithm(e){t.push(e)},checksumAlgorithms:()=>t}})(e),(e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy:()=>e.retryStrategy}))(e)),zr=e=>null!=e;class Gr{trace(){}debug(){}info(){}warn(){}error(){}}function Wr(e,t,n){let r,i,s;if(void 0===t&&void 0===n)r={},s=e;else{if(r=e,"function"==typeof t)return i=t,s=n,Qr(r,i,s);s=t}for(const e of Object.keys(s))Array.isArray(s[e])?Yr(r,null,s,e):r[e]=s[e];return r}const Kr=(e,t)=>{const n={};for(const r in t)Yr(n,e,t,r);return n},Qr=(e,t,n)=>Wr(e,Object.entries(n).reduce((e,[n,r])=>(Array.isArray(r)?e[n]=r:e[n]="function"==typeof r?[t,r()]:[t,r],e),{})),Yr=(e,t,n,r)=>{if(null!==t){let i=n[r];"function"==typeof i&&(i=[,i]);const[s=Jr,o=Zr,a=r]=i;return void(("function"==typeof s&&s(t[a])||"function"!=typeof s&&s)&&(e[r]=o(t[a])))}let[i,s]=n[r];if("function"==typeof s){let t;const n=void 0===i&&null!=(t=s()),o="function"==typeof i&&!!i(void 0)||"function"!=typeof i&&!!i;n?e[r]=t:o&&(e[r]=s())}else{const t=void 0===i&&null!=s,n="function"==typeof i&&!!i(s)||"function"!=typeof i&&!!i;(t||n)&&(e[r]=s)}},Jr=e=>null!=e,Zr=e=>e,Xr=(Math.ceil(2**127*(2-2**-23)),e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}}),ei=e=>ti(e,32),ti=(e,t)=>{const n=Xr(e);if(void 0!==n&&ni(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},ni=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},ri=e=>{if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return si.warn(ii(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},ii=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),si={warn:console.warn},oi=e=>e?.body instanceof ReadableStream,ai=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,ci=e=>{const t={error:e,errorType:ui(e)},n=hi(e.$response);return n&&(t.retryAfterHint=n),t},ui=e=>Un(e)?"THROTTLING":Fn(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!Fn(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",di={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},li=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let i=await e.retryStrategy();const s=await e.maxAttempts();if(!ai(i))return i?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,r);{let e=await i.acquireInitialRetryToken(n.partition_id),o=new Error,a=0,c=0;const{request:u}=r,d=ot.isInstance(u);for(d&&(u.headers[qn]=er());;)try{d&&(u.headers[Vn]=`attempt=${a+1}; max=${s}`);const{response:n,output:o}=await t(r);return i.recordSuccess(e),o.$metadata.attempts=a+1,o.$metadata.totalRetryDelay=c,{response:n,output:o}}catch(t){const r=ci(t);if(o=tr(t),d&&oi(u))throw(n.logger instanceof Gr?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),o;try{e=await i.refreshRetryTokenForRetry(e,r)}catch(e){throw o.$metadata||(o.$metadata={}),o.$metadata.attempts=a+1,o.$metadata.totalRetryDelay=c,o}a=e.getRetryCount();const s=e.getRetryDelay();c+=s,await new Promise(e=>setTimeout(e,s))}}})(e),di)}}),hi=e=>{if(!at.isInstance(e))return;const t=Object.keys(e.headers).find(e=>"retry-after"===e.toLowerCase());if(!t)return;const n=e.headers[t],r=Number(n);if(!Number.isNaN(r))return new Date(1e3*r);return new Date(n)};const fi=(pi=3e5,e=>mi(e)&&e.expiration.getTime()-Date.now()<pi);var pi;const mi=e=>void 0!==e.expiration,gi=e=>"string"==typeof e?lr(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),yi="X-Amz-Date",bi="X-Amz-Signature",wi="X-Amz-Security-Token",vi="authorization",ki=yi.toLowerCase(),Si=[vi,ki,"date"],Ei=bi.toLowerCase(),Ai="x-amz-content-sha256",Ii=wi.toLowerCase(),_i={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},xi=/^proxy-/,Ri=/^sec-/,Pi="AWS4-HMAC-SHA256",Ci="AWS4-HMAC-SHA256-PAYLOAD",Ti="aws4_request",Mi={},Oi=[],Ni=(e,t,n)=>`${e}/${t}/${n}/${Ti}`,Li=(e,t,n)=>{const r=new e(t);return r.update(gi(n)),r.digest()},$i=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(null==e[i])continue;const s=i.toLowerCase();(s in _i||t?.has(s)||xi.test(s)||Ri.test(s))&&(!n||n&&!n.has(s))||(r[s]=e[i].trim().replace(/\s+/g," "))}return r},Di=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===Ai)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(r=t,"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(r))){const e=new n;return e.update(gi(t)),Ir(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class Ui{format(e){const t=[];for(const n of Object.keys(e)){const r=lr(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(i.buffer);return s.set(e.value,3),s;case"string":const o=lr(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const u=new Uint8Array(9);return u[0]=8,u.set(ji.fromNumber(e.value.valueOf()).bytes,1),u;case"uuid":if(!Bi.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(Ar(e.value.replace(/\-/g,"")),1),d}}}var Fi;!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(Fi||(Fi={}));const Bi=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ji{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&Hi(t),new ji(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&Hi(e),parseInt(Ir(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function Hi(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const qi=e=>{e=ot.clone(e);for(const t of Object.keys(e.headers))Si.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},Vi=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class zi{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:s=!0}){this.service=r,this.sha256=i,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=en(n),this.credentialProvider=en(t)}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===Ei)continue;const i=mr(r);t.push(i);const s=e[r];"string"==typeof s?n[i]=`${i}=${mr(s)}`:Array.isArray(s)&&(n[i]=s.slice(0).reduce((e,t)=>e.concat([`${i}=${mr(t)}`]),[]).sort().join("&"))}return t.sort().map(e=>n[e]).filter(e=>e).join("&")})(e)}\n${r.map(e=>`${e}:${t[e]}`).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n,r){const i=new this.sha256;i.update(gi(n));return`${r}\n${e}\n${t}\n${Ir(await i.digest())}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return mr(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}formatDate(e){const t=(n=e,Vi(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class Gi extends zi{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:s=!0}){super({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:s}),this.headerFormatter=new Ui}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:s,signableHeaders:o,hoistableHeaders:a,signingRegion:c,signingService:u}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=c??await this.regionProvider(),{longDate:h,shortDate:f}=this.formatDate(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const p=Ni(f,l,u??this.service),m=((e,t={})=>{const{headers:n,query:r={}}=ot.clone(e);for(const e of Object.keys(n)){const i=e.toLowerCase();("x-amz-"===i.slice(0,6)&&!t.unhoistableHeaders?.has(i)||t.hoistableHeaders?.has(i))&&(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})(qi(e),{unhoistableHeaders:s,hoistableHeaders:a});d.sessionToken&&(m.query[wi]=d.sessionToken),m.query["X-Amz-Algorithm"]=Pi,m.query["X-Amz-Credential"]=`${d.accessKeyId}/${p}`,m.query[yi]=h,m.query["X-Amz-Expires"]=r.toString(10);const g=$i(m,i,o);return m.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(g),m.query[bi]=await this.getSignature(h,p,this.getSigningKey(d,l,f,u),this.createCanonicalRequest(m,g,await Di(e,this.sha256))),m}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:i,signingService:s}){const o=i??await this.regionProvider(),{shortDate:a,longDate:c}=this.formatDate(n),u=Ni(a,o,s??this.service),d=await Di({headers:{},body:t},this.sha256),l=new this.sha256;l.update(e);const h=Ir(await l.digest()),f=[Ci,c,u,r,h,d].join("\n");return this.signString(f,{signingDate:n,signingRegion:o,signingService:s})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const s=n??await this.regionProvider(),{shortDate:o}=this.formatDate(t),a=new this.sha256(await this.getSigningKey(i,s,o,r));return a.update(gi(e)),Ir(await a.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const a=i??await this.regionProvider(),c=qi(e),{longDate:u,shortDate:d}=this.formatDate(t),l=Ni(d,a,s??this.service);c.headers[ki]=u,o.sessionToken&&(c.headers[Ii]=o.sessionToken);const h=await Di(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(Ai,c.headers)&&this.applyChecksum&&(c.headers[Ai]=h);const f=$i(c,r,n),p=await this.getSignature(u,l,this.getSigningKey(o,a,d,s),this.createCanonicalRequest(c,f,h));return c.headers[vi]=`${Pi} Credential=${o.accessKeyId}/${l}, SignedHeaders=${this.getCanonicalHeaderList(f)}, Signature=${p}`,c}async getSignature(e,t,n,r){const i=await this.createStringToSign(e,t,r,Pi),s=new this.sha256(await n);return s.update(gi(i)),Ir(await s.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const s=`${n}:${r}:${i}:${Ir(await Li(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(s in Mi)return Mi[s];for(Oi.push(s);Oi.length>50;)delete Mi[Oi.shift()];let o=`AWS4${t.secretAccessKey}`;for(const t of[n,r,i,Ti])o=await Li(e,o,t);return Mi[s]=o})(this.sha256,e,n,t,r||this.service)}}const Wi=e=>{let t,n=e.credentials,r=!!e.credentials;Object.defineProperty(e,"credentials",{set(i){i&&i!==n&&i!==t&&(r=!0),n=i;const s=function(e,{credentials:t,credentialDefaultProvider:n}){let r;r=t?t?.memoized?t:((e,t,n)=>{if(void 0===e)return;const r="function"!=typeof e?async()=>Promise.resolve(e):e;let i,s,o,a=!1;const c=async e=>{s||(s=r(e));try{i=await s,o=!0,a=!1}finally{s=void 0}return i};return void 0===t?async e=>(o&&!e?.forceRefresh||(i=await c(e)),i):async e=>(o&&!e?.forceRefresh||(i=await c(e)),a?i:n(i)?t(i)?(await c(e),i):i:(a=!0,i))})(t,fi,mi):n?pt(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return r.memoized=!0,r}(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),o=function(e,t){if(t.configBound)return t;const n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}(e,s);r&&!o.attributed?(t=async e=>o(e).then(e=>function(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}(e,"CREDENTIALS_CODE","e")),t.memoized=o.memoized,t.configBound=o.configBound,t.attributed=!0):t=o},get:()=>t,enumerable:!0,configurable:!0}),e.credentials=n;const{signingEscapePath:i=!0,systemClockOffset:s=e.systemClockOffset||0,sha256:o}=e;let a;a=e.signer?pt(e.signer):e.regionInfoProvider?()=>pt(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{const{signingRegion:r,signingService:s}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||s||e.serviceId;const a={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||Gi)(a)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await pt(e.region)(),properties:{}},t)).signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;const s={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||Gi)(s)};return Object.assign(e,{systemClockOffset:s,signingEscapePath:i,signer:a})};const Ki=async(e,t,n)=>({operation:Xt(t).operation,region:await en(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const Qi=e=>{const t=[];return e.operation,t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},Yi={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Ji="3.823.0";var Zi="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function Xi(e){return e instanceof Uint8Array?e:"string"==typeof e?Zi(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function es(e){return"string"==typeof e?0===e.length:0===e.byteLength}var ts={name:"SHA-256"},ns={name:"HMAC",hash:ts},rs=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const is={};function ss(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:is}var os=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!es(e)){var t=Xi(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return ss().crypto.subtle.sign(ns,t,e.toHash).then(function(e){return new Uint8Array(e)})}):es(this.toHash)?Promise.resolve(rs):Promise.resolve().then(function(){return ss().crypto.subtle.digest(ts,e.toHash)}).then(function(e){return Promise.resolve(new Uint8Array(e))})},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise(function(t,n){ss().crypto.subtle.importKey("raw",Xi(e.secret),ns,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},e}();function as(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})}function cs(e,t){var n,r,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;function us(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;"function"==typeof SuppressedError&&SuppressedError;var ds=64,ls=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hs=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],fs=Math.pow(2,53)-1,ps=function(){function e(){this.state=Int32Array.from(hs),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>fs)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===ds&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%ds>=56){for(var r=this.bufferLength;r<ds;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<56;r++)t.setUint8(r,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(32);for(r=0;r<8;r++)i[4*r]=this.state[r]>>>24&255,i[4*r+1]=this.state[r]>>>16&255,i[4*r+2]=this.state[r]>>>8&255,i[4*r+3]=this.state[r]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],u=t[7],d=0;d<ds;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var l=this.temp[d-2],h=(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10,f=((l=this.temp[d-15])>>>7|l<<25)^(l>>>18|l<<14)^l>>>3;this.temp[d]=(h+this.temp[d-7]|0)+(f+this.temp[d-16]|0)}var p=(((o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7))+(o&a^~o&c)|0)+(u+(ls[d]+this.temp[d]|0)|0)|0,m=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;u=c,c=a,a=o,o=s+p|0,s=i,i=r,r=n,n=p+m|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=s,t[4]+=o,t[5]+=a,t[6]+=c,t[7]+=u},e}(),ms=function(){function e(e){this.secret=e,this.hash=new ps,this.reset()}return e.prototype.update=function(e){if(!es(e)&&!this.error)try{this.hash.update(Xi(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return as(this,void 0,void 0,function(){return cs(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new ps,this.secret){this.outer=new ps;var e=function(e){var t=Xi(e);if(t.byteLength>ds){var n=new ps;n.update(t),t=n.digest()}var r=new Uint8Array(ds);return r.set(t),r}(this.secret),t=new Uint8Array(ds);t.set(e);for(var n=0;n<ds;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n<e.byteLength;n++)e[n]=0}},e}();var gs=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function ys(e){return e&&gs.every(function(t){return"function"==typeof e[t]})}var bs=function(){function e(e){!function(e){return!(!function(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}(e)||"object"!=typeof e.crypto.subtle)&&ys(e.crypto.subtle)}(ss())?this.hash=new ms(e):this.hash=new os(e)}return e.prototype.update=function(e,t){this.hash.update(Xi(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}(),ws=n(369),vs=n.n(ws);const ks=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window&&window?.navigator?.userAgent?vs().parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",t],["ua","2.1"],[`os/${r?.os?.name||"other"}`,r?.os?.version],["lang/js"],["md/browser",`${r?.browser?.name??"unknown"}_${r?.browser?.version??"unknown"}`]];e&&i.push([`api/${e}`,t]);const s=await(n?.userAgentAppId?.());return s&&i.push([`app/${s}`]),i};!function(){function e(){this.crc32=new Es}e.prototype.update=function(e){es(e)||this.crc32.update(Xi(e))},e.prototype.digest=function(){return as(this,void 0,void 0,function(){return cs(this,function(e){return[2,(t=this.crc32.digest(),new Uint8Array([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))];var t})})},e.prototype.reset=function(){this.crc32=new Es}}();var Ss,Es=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var r=us(e),i=r.next();!i.done;i=r.next()){var s=i.value;this.checksum=this.checksum>>>8^As[255&(this.checksum^s)]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}(),As=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);class Is{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&_s(t),new Is(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&_s(e),parseInt(Ir(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function _s(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}class xs{constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){const t=[];for(const n of Object.keys(e)){const r=this.fromUtf8(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(i.buffer);return s.set(e.value,3),s;case"string":const o=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const u=new Uint8Array(9);return u[0]=8,u.set(Is.fromNumber(e.value.valueOf()).bytes,1),u;case"uuid":if(!Ds.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(Ar(e.value.replace(/\-/g,"")),1),d}}parse(e){const t={};let n=0;for(;n<e.byteLength;){const r=e.getUint8(n++),i=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,r));switch(n+=r,e.getUint8(n++)){case 0:t[i]={type:Rs,value:!0};break;case 1:t[i]={type:Rs,value:!1};break;case 2:t[i]={type:Ps,value:e.getInt8(n++)};break;case 3:t[i]={type:Cs,value:e.getInt16(n,!1)},n+=2;break;case 4:t[i]={type:Ts,value:e.getInt32(n,!1)},n+=4;break;case 5:t[i]={type:Ms,value:new Is(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:const r=e.getUint16(n,!1);n+=2,t[i]={type:Os,value:new Uint8Array(e.buffer,e.byteOffset+n,r)},n+=r;break;case 7:const s=e.getUint16(n,!1);n+=2,t[i]={type:Ns,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s))},n+=s;break;case 8:t[i]={type:Ls,value:new Date(new Is(new Uint8Array(e.buffer,e.byteOffset+n,8)).valueOf())},n+=8;break;case 9:const o=new Uint8Array(e.buffer,e.byteOffset+n,16);n+=16,t[i]={type:$s,value:`${Ir(o.subarray(0,4))}-${Ir(o.subarray(4,6))}-${Ir(o.subarray(6,8))}-${Ir(o.subarray(8,10))}-${Ir(o.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return t}}!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(Ss||(Ss={}));const Rs="boolean",Ps="byte",Cs="short",Ts="integer",Ms="long",Os="binary",Ns="string",Ls="timestamp",$s="uuid",Ds=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class Us{constructor(e,t){this.headerMarshaller=new xs(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage:()=>e,isEndOfStream:()=>t}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const t=this.isEndOfStream;return{getMessages:()=>e,isEndOfStream:()=>t}}encode({headers:e,body:t}){const n=this.headerMarshaller.format(e),r=n.byteLength+t.byteLength+16,i=new Uint8Array(r),s=new DataView(i.buffer,i.byteOffset,i.byteLength),o=new Es;return s.setUint32(0,r,!1),s.setUint32(4,n.byteLength,!1),s.setUint32(8,o.update(i.subarray(0,8)).digest(),!1),i.set(n,12),i.set(t,n.byteLength+12),s.setUint32(r-4,o.update(i.subarray(8,r-4)).digest(),!1),i}decode(e){const{headers:t,body:n}=function({byteLength:e,byteOffset:t,buffer:n}){if(e<16)throw new Error("Provided message too short to accommodate event stream message overhead");const r=new DataView(n,t,e),i=r.getUint32(0,!1);if(e!==i)throw new Error("Reported message length does not match received message length");const s=r.getUint32(4,!1),o=r.getUint32(8,!1),a=r.getUint32(e-4,!1),c=(new Es).update(new Uint8Array(n,t,8));if(o!==c.digest())throw new Error(`The prelude checksum specified in the message (${o}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(n,t+8,e-12)),a!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(n,t+8+4,s),body:new Uint8Array(n,t+8+4+s,i-s-16)}}(e);return{headers:this.headerMarshaller.parse(t),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}}class Fs{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream){const t=this.options.decoder.decode(e);yield t}}}class Bs{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=this.options.encoder.encode(e);yield t}this.options.includeEndFrame&&(yield new Uint8Array(0))}}class js{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=await this.options.deserializer(e);void 0!==t&&(yield t)}}}class Hs{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream){const t=this.options.serializer(e);yield t}}}function qs(e,t){return async function(n){const{value:r}=n.headers[":message-type"];if("error"===r){const e=new Error(n.headers[":error-message"].value||"UnknownError");throw e.name=n.headers[":error-code"].value,e}if("exception"===r){const r=n.headers[":exception-type"].value,i={[r]:n},s=await e(i);if(s.$unknown){const e=new Error(t(n.body));throw e.name=r,e}throw s[r]}if("event"===r){const t={[n.headers[":event-type"].value]:n},r=await e(t);if(r.$unknown)return;return r}throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}class Vs{constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new Us(e,t),this.utfEncoder=e}deserialize(e,t){const n=function(e){let t=0,n=0,r=null,i=null;const s=e=>{if("number"!=typeof e)throw new Error("Attempted to allocate an event message where size was not a number: "+e);t=e,n=4,r=new Uint8Array(e),new DataView(r.buffer).setUint32(0,e,!1)};return{[Symbol.asyncIterator]:async function*(){const o=e[Symbol.asyncIterator]();for(;;){const{value:e,done:a}=await o.next();if(a){if(!t)return;if(t!==n)throw new Error("Truncated event message received.");return void(yield r)}const c=e.length;let u=0;for(;u<c;){if(!r){const t=c-u;i||(i=new Uint8Array(4));const r=Math.min(4-n,t);if(i.set(e.slice(u,u+r),n),n+=r,u+=r,n<4)break;s(new DataView(i.buffer).getUint32(0,!1)),i=null}const o=Math.min(t-n,c-u);r.set(e.slice(u,u+o),n),n+=o,u+=o,t&&t===n&&(yield r,r=null,t=0,n=0)}}}}}(e);return new js({messageStream:new Fs({inputStream:n,decoder:this.eventStreamCodec}),deserializer:qs(t,this.utfEncoder)})}serialize(e,t){return new Bs({messageStream:new Hs({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}class zs{constructor({utf8Encoder:e,utf8Decoder:t}){this.universalMarshaller=new Vs({utf8Decoder:t,utf8Encoder:e})}deserialize(e,t){const n=Gs(e)?(r=e,{[Symbol.asyncIterator]:async function*(){const e=r.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}}}):e;var r;return this.universalMarshaller.deserialize(n,t)}serialize(e,t){const n=this.universalMarshaller.serialize(e,t);return"function"==typeof ReadableStream?(e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(e){const{done:n,value:r}=await t.next();if(n)return e.close();e.enqueue(r)}})})(n):n}}const Gs=e=>"function"==typeof ReadableStream&&e instanceof ReadableStream,Ws=e=>new zs(e),Ks="function"==typeof TextEncoder?new TextEncoder:null,Qs=e=>{if("string"==typeof e){if(Ks)return Ks.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error(`Body Length computation failed for ${e}`)},Ys=e=>new Date(Date.now()+e),Js=e=>at.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,Zs=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(Ys(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},Xs=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t};class eo{async sign(e,t,n){if(!ot.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await(async e=>{const t=Xs("context",e.context),n=Xs("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=Xs("signer",n.signer),s=await i(r),o=e?.signingRegion,a=e?.signingRegionSet,c=e?.signingName;return{config:n,signer:s,signingRegion:o,signingRegionSet:a,signingName:c}})(n),{config:i,signer:s}=r;let{signingRegion:o,signingName:a}=r;const c=n.context;if(c?.authSchemes?.length){const[e,t]=c.authSchemes;"sigv4a"===e?.name&&"sigv4"===t?.name&&(o=t?.signingRegion??o,a=t?.signingName??a)}return await s.sign(e,{signingDate:Ys(i.systemClockOffset),signingRegion:o,signingService:a})}errorHandler(e){return t=>{const n=t.ServerTime??Js(t.$response);if(n){const r=Xs("config",e.config),i=r.systemClockOffset;r.systemClockOffset=Zs(n,r.systemClockOffset);r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=Js(e);if(n){const e=Xs("config",t.config);e.systemClockOffset=Zs(n,e.systemClockOffset)}}}const to="required",no="fn",ro="argv",io="ref",so=!0,oo="isSet",ao="booleanEquals",co="error",uo="endpoint",lo="tree",ho="PartitionResult",fo={[to]:!1,type:"String"},po={[to]:!0,default:!1,type:"Boolean"},mo={[io]:"Endpoint"},go={[no]:ao,[ro]:[{[io]:"UseFIPS"},!0]},yo={[no]:ao,[ro]:[{[io]:"UseDualStack"},!0]},bo={},wo={[no]:"getAttr",[ro]:[{[io]:ho},"supportsFIPS"]},vo={[no]:ao,[ro]:[!0,{[no]:"getAttr",[ro]:[{[io]:ho},"supportsDualStack"]}]},ko=[go],So=[yo],Eo=[{[io]:"Region"}],Ao={version:"1.0",parameters:{Region:fo,UseDualStack:po,UseFIPS:po,Endpoint:fo},rules:[{conditions:[{[no]:oo,[ro]:[mo]}],rules:[{conditions:ko,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:co},{rules:[{conditions:So,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:co},{endpoint:{url:mo,properties:bo,headers:bo},type:uo}],type:lo}],type:lo},{rules:[{conditions:[{[no]:oo,[ro]:Eo}],rules:[{conditions:[{[no]:"aws.partition",[ro]:Eo,assign:ho}],rules:[{conditions:[go,yo],rules:[{conditions:[{[no]:ao,[ro]:[so,wo]},vo],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:bo,headers:bo},type:uo}],type:lo}],type:lo},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:co}],type:lo},{conditions:ko,rules:[{conditions:[{[no]:ao,[ro]:[wo,so]}],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:bo,headers:bo},type:uo}],type:lo}],type:lo},{error:"FIPS is enabled but this partition does not support FIPS",type:co}],type:lo},{conditions:So,rules:[{conditions:[vo],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:bo,headers:bo},type:uo}],type:lo}],type:lo},{error:"DualStack is enabled but this partition does not support DualStack",type:co}],type:lo},{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:bo,headers:bo},type:uo}],type:lo}],type:lo}],type:lo},{error:"Invalid Configuration: Missing Region",type:co}],type:lo}]},Io=new class{constructor({size:e,params:t}){this.data=new Map,this.parameters=[],this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(!1===n)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const e=this.data.keys();let t=0;for(;;){const{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(0===n.length)return!1;for(const r of n){const n=String(e[r]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),_o=(e,t={})=>Io.get(e,()=>((e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:i,rules:s}=e;t.logger?.debug?.(`${vt} Initial EndpointParams: ${kt(n)}`);const o=Object.entries(i).filter(([,e])=>null!=e.default).map(([e,t])=>[e,t.default]);if(o.length>0)for(const[e,t]of o)n[e]=n[e]??t;const a=Object.entries(i).filter(([,e])=>e.required).map(([e])=>e);for(const e of a)if(null==n[e])throw new St(`Missing required parameter: '${e}'`);const c=Ut(s,{endpointParams:n,logger:r,referenceRecord:{}});return t.logger?.debug?.(`${vt} Resolved endpoint: ${kt(c)}`),c})(Ao,{endpointParams:e,logger:t.logger}));wt.aws=Ht;Error;const xo=["in-region","cross-region","mobile","standard","legacy"],Ro=()=>{const e="undefined"!=typeof window&&window?.navigator?.userAgent?vs().parse(window.navigator.userAgent):void 0,t=e?.platform?.type;return"tablet"===t||"mobile"===t},Po=e=>{const t=(({defaultsMode:e}={})=>((e,t,n)=>{let r,i,s,o=!1;const a=async()=>{i||(i=e());try{r=await i,s=!0,o=!1}finally{i=void 0}return r};return void 0===t?async e=>(s&&!e?.forceRefresh||(r=await a()),r):async e=>(s&&!e?.forceRefresh||(r=await a()),o?r:n&&!n(r)?(o=!0,r):t(r)?(await a(),r):r)})(async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(Ro()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${xo.join(", ")}, got ${t}`)}}))(e),n=()=>t().then(qr),r=(e=>({apiVersion:"2023-09-30",base64Decoder:e?.base64Decoder??dr,base64Encoder:e?.base64Encoder??hr,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??_o,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Qi,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new eo}],logger:e?.logger??new Gr,serviceId:e?.serviceId??"Bedrock Runtime",urlParser:e?.urlParser??kn,utf8Decoder:e?.utf8Decoder??lr,utf8Encoder:e?.utf8Encoder??fr}))(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Qs,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??ks({serviceId:r.serviceId,clientVersion:Ji}),eventStreamPayloadHandlerProvider:e?.eventStreamPayloadHandlerProvider??(()=>{return{handle:(e="event stream request is not supported in browser.",()=>{throw new Error(e)})};var e}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??Ws,maxAttempts:e?.maxAttempts??3,region:e?.region??(i="Region is missing",()=>Promise.reject(i)),requestHandler:vr.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||Mn),sha256:e?.sha256??bs,streamCollector:e?.streamCollector??kr,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(false)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(false))};var i},Co=(e,t)=>{const n=Object.assign((e=>({setRegion(t){e.region=t},region:()=>e.region}))(e),Vr(e),(e=>({setHttpHandler(t){e.httpHandler=t},httpHandler:()=>e.httpHandler,updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs:()=>e.httpHandler.httpHandlerConfigs()}))(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,{region:n.region()},(r=n,Object.assign((e=>{const t={};return e.checksumAlgorithms().forEach(e=>{t[e.algorithmId()]=e.checksumConstructor()}),t})(r),(e=>{const t={};return t.retryStrategy=e.retryStrategy(),t})(r))),{httpHandler:n.httpHandler()},(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}))(n));var r};class To extends ar{config;constructor(...[e]){const t=Po(e||{});super(t),this.initConfig=t;const n=(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"bedrock"}))(t),r=function(e){const t=pt(e.userAgentAppId??void 0),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:"string"==typeof n?[[n]]:n,userAgentAppId:async()=>{const n=await t();if(!function(e){return void 0===e||"string"==typeof e&&e.length<=50}(n)){const t="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger:console;"string"!=typeof n?t?.warn("userAgentAppId must be a string or undefined."):n.length>50&&t?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}(n),i=(e=>{const{retryStrategy:t,retryMode:n,maxAttempts:r}=e,i=en(r??3);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await en(n)()===Tn.ADAPTIVE?new Wn(i):new Gn(i))})})(r),s=(e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{if("string"==typeof t)return nn(t);const e=await t();return nn(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!tn(e)||("function"!=typeof n?Promise.resolve(!!n):n())}})})(i),o=(e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,s=null!=n?async()=>Sn(await en(n)()):void 0,o=!!n,a=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:o,useDualstackEndpoint:en(r??!1),useFipsEndpoint:en(i??!1)});let c;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=vn(e.serviceId)),c),a})(s);var a;const c=(e=>{const t=Wi(e);return Object.assign(t,{authSchemePreference:en(e.authSchemePreference??[])})})((a=o,Object.assign(a,{eventStreamMarshaller:a.eventStreamSerdeProvider(a)}))),u=function(e){const t=e.signer,n=e.signer,r=Object.assign(e,{eventSigner:t,messageSigner:n}),i=r.eventStreamPayloadHandlerProvider(r);return Object.assign(r,{eventStreamPayloadHandler:i})}(c),d=Co(u,e?.extensions||[]);var l;this.config=d,this.middlewareStack.use((l=this.config,{applyToStack:e=>{e.add(Qt(l),Jt)}})),this.middlewareStack.use(li(this.config)),this.middlewareStack.use(fn(this.config)),this.middlewareStack.use(ut(this.config)),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add((e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:s,logger:o,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:u}=a,d=c??t.inputFilterSensitiveLog,l=u??t.outputFilterSensitiveLog,{$metadata:h,...f}=r.output;return o?.info?.({clientName:i,commandName:s,input:d(n.input),output:l(f),metadata:h}),r}catch(e){const{clientName:r,commandName:i,logger:s,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:a}=o,c=a??t.inputFilterSensitiveLog;throw s?.error?.({clientName:r,commandName:i,input:c(n.input),error:e,metadata:e.$metadata}),e}},dt)}})),this.middlewareStack.use(ft(this.config)),this.middlewareStack.use(((e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(rn(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),sn)}}))(this.config,{httpAuthSchemeParametersProvider:Ki,identityProviderConfigProvider:async e=>new on({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(dn(this.config))}destroy(){super.destroy()}}class Mo extends Br{constructor(e){super(e),Object.setPrototypeOf(this,Mo.prototype)}}class Oo extends Mo{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Oo.prototype)}}var No;!function(e){e.visit=(e,t)=>void 0!==e.s3OutputDataConfig?t.s3OutputDataConfig(e.s3OutputDataConfig):t._(e.$unknown[0],e.$unknown[1])}(No||(No={}));class Lo extends Mo{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,Lo.prototype)}}class $o extends Mo{name="ThrottlingException";$fault="client";constructor(e){super({name:"ThrottlingException",$fault:"client",...e}),Object.setPrototypeOf(this,$o.prototype)}}class Do extends Mo{name="ValidationException";$fault="client";constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,Do.prototype)}}class Uo extends Mo{name="ConflictException";$fault="client";constructor(e){super({name:"ConflictException",$fault:"client",...e}),Object.setPrototypeOf(this,Uo.prototype)}}class Fo extends Mo{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Fo.prototype)}}class Bo extends Mo{name="ServiceQuotaExceededException";$fault="client";constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,Bo.prototype)}}class jo extends Mo{name="ServiceUnavailableException";$fault="server";constructor(e){super({name:"ServiceUnavailableException",$fault:"server",...e}),Object.setPrototypeOf(this,jo.prototype)}}var Ho;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):t._(e.$unknown[0],e.$unknown[1])}(Ho||(Ho={}));var qo;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):t._(e.$unknown[0],e.$unknown[1])}(qo||(qo={}));var Vo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):void 0!==e.s3Location?t.s3Location(e.s3Location):t._(e.$unknown[0],e.$unknown[1])}(Vo||(Vo={}));var zo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):t._(e.$unknown[0],e.$unknown[1])}(zo||(zo={}));var Go;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):t._(e.$unknown[0],e.$unknown[1])}(Go||(Go={}));var Wo,Ko;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):void 0!==e.s3Location?t.s3Location(e.s3Location):t._(e.$unknown[0],e.$unknown[1])}(Wo||(Wo={})),function(e){e.visit=(e,t)=>void 0!==e.reasoningText?t.reasoningText(e.reasoningText):void 0!==e.redactedContent?t.redactedContent(e.redactedContent):t._(e.$unknown[0],e.$unknown[1])}(Ko||(Ko={}));var Qo,Yo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):void 0!==e.s3Location?t.s3Location(e.s3Location):t._(e.$unknown[0],e.$unknown[1])}(Qo||(Qo={})),function(e){e.visit=(e,t)=>void 0!==e.json?t.json(e.json):void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):void 0!==e.document?t.document(e.document):void 0!==e.video?t.video(e.video):t._(e.$unknown[0],e.$unknown[1])}(Yo||(Yo={}));var Jo;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):void 0!==e.document?t.document(e.document):void 0!==e.video?t.video(e.video):void 0!==e.toolUse?t.toolUse(e.toolUse):void 0!==e.toolResult?t.toolResult(e.toolResult):void 0!==e.guardContent?t.guardContent(e.guardContent):void 0!==e.cachePoint?t.cachePoint(e.cachePoint):void 0!==e.reasoningContent?t.reasoningContent(e.reasoningContent):t._(e.$unknown[0],e.$unknown[1])}(Jo||(Jo={}));var Zo,Xo,ea,ta,na,ra;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):t._(e.$unknown[0],e.$unknown[1])}(Zo||(Zo={})),function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.guardContent?t.guardContent(e.guardContent):void 0!==e.cachePoint?t.cachePoint(e.cachePoint):t._(e.$unknown[0],e.$unknown[1])}(Xo||(Xo={})),function(e){e.visit=(e,t)=>void 0!==e.auto?t.auto(e.auto):void 0!==e.any?t.any(e.any):void 0!==e.tool?t.tool(e.tool):t._(e.$unknown[0],e.$unknown[1])}(ea||(ea={})),function(e){e.visit=(e,t)=>void 0!==e.json?t.json(e.json):t._(e.$unknown[0],e.$unknown[1])}(ta||(ta={})),function(e){e.visit=(e,t)=>void 0!==e.toolSpec?t.toolSpec(e.toolSpec):void 0!==e.cachePoint?t.cachePoint(e.cachePoint):t._(e.$unknown[0],e.$unknown[1])}(na||(na={})),function(e){e.visit=(e,t)=>void 0!==e.message?t.message(e.message):t._(e.$unknown[0],e.$unknown[1])}(ra||(ra={}));class ia extends Mo{name="ModelErrorException";$fault="client";originalStatusCode;resourceName;constructor(e){super({name:"ModelErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,ia.prototype),this.originalStatusCode=e.originalStatusCode,this.resourceName=e.resourceName}}class sa extends Mo{name="ModelNotReadyException";$fault="client";$retryable={};constructor(e){super({name:"ModelNotReadyException",$fault:"client",...e}),Object.setPrototypeOf(this,sa.prototype)}}class oa extends Mo{name="ModelTimeoutException";$fault="client";constructor(e){super({name:"ModelTimeoutException",$fault:"client",...e}),Object.setPrototypeOf(this,oa.prototype)}}var aa,ca,ua,da;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.redactedContent?t.redactedContent(e.redactedContent):void 0!==e.signature?t.signature(e.signature):t._(e.$unknown[0],e.$unknown[1])}(aa||(aa={})),function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.toolUse?t.toolUse(e.toolUse):void 0!==e.reasoningContent?t.reasoningContent(e.reasoningContent):t._(e.$unknown[0],e.$unknown[1])}(ca||(ca={})),function(e){e.visit=(e,t)=>void 0!==e.toolUse?t.toolUse(e.toolUse):t._(e.$unknown[0],e.$unknown[1])}(ua||(ua={}));class la extends Mo{name="ModelStreamErrorException";$fault="client";originalStatusCode;originalMessage;constructor(e){super({name:"ModelStreamErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,la.prototype),this.originalStatusCode=e.originalStatusCode,this.originalMessage=e.originalMessage}}!function(e){e.visit=(e,t)=>void 0!==e.messageStart?t.messageStart(e.messageStart):void 0!==e.contentBlockStart?t.contentBlockStart(e.contentBlockStart):void 0!==e.contentBlockDelta?t.contentBlockDelta(e.contentBlockDelta):void 0!==e.contentBlockStop?t.contentBlockStop(e.contentBlockStop):void 0!==e.messageStop?t.messageStop(e.messageStop):void 0!==e.metadata?t.metadata(e.metadata):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(da||(da={}));var ha,fa,pa;!function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):t._(e.$unknown[0],e.$unknown[1])}(ha||(ha={})),function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.modelTimeoutException?t.modelTimeoutException(e.modelTimeoutException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(fa||(fa={})),function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.modelTimeoutException?t.modelTimeoutException(e.modelTimeoutException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(pa||(pa={}));const ma=e=>({...e,...e.body&&{body:Fr}}),ga=e=>({...e,...e.body&&{body:Fr}}),ya=e=>({...e,...e.body&&{body:Fr}}),ba=e=>({...e,...e.body&&{body:"STREAMING_CONTENT"}}),wa=(e,t)=>((e,t)=>_r(e,t).then(e=>t.utf8Encoder(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}}),va=async(e,t)=>{const n=await wa(e,t);return n.message=n.message??n.Message,n};function ka(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function Sa(e,t){return new Ea(e,t)}class Ea{constructor(e,t){this.input=e,this.context=t,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:e,protocol:t="https",port:n,path:r}=await this.context.endpoint();this.path=r;for(const e of this.resolvePathStack)e(this.path);return new ot({protocol:t,hostname:this.hostname||e,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,n,r){return this.resolvePathStack.push(i=>{this.path=((e,t,n,r,i,s)=>{if(null==t||void 0===t[n])throw new Error("No value provided for input HTTP label: "+n+".");{const t=r();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");e=e.replace(i,s?t.split("/").map(e=>ka(e)).join("/"):ka(t))}return e})(i,this.input,e,t,n,r)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}const Aa=async(e,t)=>{const n=Sa(e,t),r=Wr({},zr,{[tc]:e[ec]||"application/octet-stream",[Xa]:e[Xa],[lc]:e[sc],[cc]:e[nc],[uc]:e[rc],[dc]:e[ic]});let i;return n.bp("/model/{modelId}/invoke"),n.p("modelId",()=>e.modelId,"{modelId}",!1),void 0!==e.body&&(i=e.body),n.m("POST").h(r).b(i),n.build()},Ia=async(e,t)=>{const n=Sa(e,t),r=Wr({},zr,{[tc]:e[ec]||"application/octet-stream",[oc]:e[Xa],[lc]:e[sc],[cc]:e[nc],[uc]:e[rc],[dc]:e[ic]});let i;return n.bp("/model/{modelId}/invoke-with-response-stream"),n.p("modelId",()=>e.modelId,"{modelId}",!1),void 0!==e.body&&(i=e.body),n.m("POST").h(r).b(i),n.build()},_a=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return Ra(e,t);const n=Wr({$metadata:Za(e),[ec]:[,e.headers[tc]],[ic]:[,e.headers[dc]]}),r=await _r(e.body,t);return n.body=r,n},xa=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return Ra(e,t);const n=Wr({$metadata:Za(e),[ec]:[,e.headers[ac]],[ic]:[,e.headers[dc]]}),r=e.body;return n.body=qa(r,t),n},Ra=async(e,t)=>{const n={...e,body:await va(e.body,t)},r=((e,t)=>{const n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=n(e.headers,"x-amzn-errortype");if(void 0!==i)return r(e.headers[i]);if(t&&"object"==typeof t){const e=n(t,"code");if(e&&void 0!==t[e])return r(t[e]);if(void 0!==t.__type)return r(t.__type)}})(e,n.body);switch(r){case"AccessDeniedException":case"com.amazonaws.bedrockruntime#AccessDeniedException":throw await Ta(n,t);case"InternalServerException":case"com.amazonaws.bedrockruntime#InternalServerException":throw await Oa(n,t);case"ResourceNotFoundException":case"com.amazonaws.bedrockruntime#ResourceNotFoundException":throw await Ua(n,t);case"ServiceQuotaExceededException":case"com.amazonaws.bedrockruntime#ServiceQuotaExceededException":throw await Fa(n,t);case"ThrottlingException":case"com.amazonaws.bedrockruntime#ThrottlingException":throw await ja(n,t);case"ValidationException":case"com.amazonaws.bedrockruntime#ValidationException":throw await Ha(n,t);case"ModelErrorException":case"com.amazonaws.bedrockruntime#ModelErrorException":throw await Na(n,t);case"ModelNotReadyException":case"com.amazonaws.bedrockruntime#ModelNotReadyException":throw await La(n,t);case"ModelTimeoutException":case"com.amazonaws.bedrockruntime#ModelTimeoutException":throw await Da(n,t);case"ServiceUnavailableException":case"com.amazonaws.bedrockruntime#ServiceUnavailableException":throw await Ba(n,t);case"ModelStreamErrorException":case"com.amazonaws.bedrockruntime#ModelStreamErrorException":throw await $a(n,t);case"ConflictException":case"com.amazonaws.bedrockruntime#ConflictException":throw await Ma(n,t);default:const i=n.body;return Pa({output:e,parsedBody:i,errorCode:r})}},Pa=(Ca=Mo,({output:e,parsedBody:t,errorCode:n})=>{(({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{const i=Hr(e),s=i.httpStatusCode?i.httpStatusCode+"":void 0,o=new n({name:t?.code||t?.Code||r||s||"UnknownError",$fault:"client",$metadata:i});throw jr(o,t)})({output:e,parsedBody:t,exceptionCtor:Ca,errorCode:n})});var Ca;const Ta=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new Oo({$metadata:Za(e),...n});return jr(s,e.body)},Ma=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new Uo({$metadata:Za(e),...n});return jr(s,e.body)},Oa=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new Lo({$metadata:Za(e),...n});return jr(s,e.body)},Na=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri,originalStatusCode:ei,resourceName:ri});Object.assign(n,i);const s=new ia({$metadata:Za(e),...n});return jr(s,e.body)},La=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new sa({$metadata:Za(e),...n});return jr(s,e.body)},$a=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri,originalMessage:ri,originalStatusCode:ei});Object.assign(n,i);const s=new la({$metadata:Za(e),...n});return jr(s,e.body)},Da=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new oa({$metadata:Za(e),...n});return jr(s,e.body)},Ua=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new Fo({$metadata:Za(e),...n});return jr(s,e.body)},Fa=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new Bo({$metadata:Za(e),...n});return jr(s,e.body)},Ba=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new jo({$metadata:Za(e),...n});return jr(s,e.body)},ja=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new $o({$metadata:Za(e),...n});return jr(s,e.body)},Ha=async(e,t)=>{const n=Wr({}),r=e.body,i=Kr(r,{message:ri});Object.assign(n,i);const s=new Do({$metadata:Za(e),...n});return jr(s,e.body)},qa=(e,t)=>t.eventStreamMarshaller.deserialize(e,async n=>null!=n.chunk?{chunk:await Wa(n.chunk,t)}:null!=n.internalServerException?{internalServerException:await Va(n.internalServerException,t)}:null!=n.modelStreamErrorException?{modelStreamErrorException:await za(n.modelStreamErrorException,t)}:null!=n.validationException?{validationException:await Ya(n.validationException,t)}:null!=n.throttlingException?{throttlingException:await Qa(n.throttlingException,t)}:null!=n.modelTimeoutException?{modelTimeoutException:await Ga(n.modelTimeoutException,t)}:null!=n.serviceUnavailableException?{serviceUnavailableException:await Ka(n.serviceUnavailableException,t)}:{$unknown:e}),Va=async(e,t)=>{const n={...e,body:await wa(e.body,t)};return Oa(n,t)},za=async(e,t)=>{const n={...e,body:await wa(e.body,t)};return $a(n,t)},Ga=async(e,t)=>{const n={...e,body:await wa(e.body,t)};return Da(n,t)},Wa=async(e,t)=>{const n={},r=await wa(e.body,t);return Object.assign(n,Ja(r,t)),n},Ka=async(e,t)=>{const n={...e,body:await wa(e.body,t)};return Ba(n,t)},Qa=async(e,t)=>{const n={...e,body:await wa(e.body,t)};return ja(n,t)},Ya=async(e,t)=>{const n={...e,body:await wa(e.body,t)};return Ha(n,t)},Ja=(e,t)=>Kr(e,{bytes:t.base64Decoder}),Za=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Xa="accept",ec="contentType",tc="content-type",nc="guardrailIdentifier",rc="guardrailVersion",ic="performanceConfigLatency",sc="trace",oc="x-amzn-bedrock-accept",ac="x-amzn-bedrock-content-type",cc="x-amzn-bedrock-guardrailidentifier",uc="x-amzn-bedrock-guardrailversion",dc="x-amzn-bedrock-performanceconfig-latency",lc="x-amzn-bedrock-trace";class hc extends(Dr.classBuilder().ep(Yi).m(function(e,t,n,r){return[Rn(n,this.serialize,this.deserialize),Cn(n,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").f(ya,ba).ser(Ia).de(xa).build()){}class fc extends(Dr.classBuilder().ep(Yi).m(function(e,t,n,r){return[Rn(n,this.serialize,this.deserialize),Cn(n,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").f(ma,ga).ser(Aa).de(_a).build()){}const pc=mc;function mc(e,t){const n=yc();return(mc=function(e,t){return n[e-=454]})(e,t)}!function(e){const t=mc,n=e();for(;;)try{if(282652===-parseInt(t(471))/1+parseInt(t(511))/2*(parseInt(t(494))/3)+parseInt(t(520))/4*(-parseInt(t(507))/5)+parseInt(t(476))/6*(-parseInt(t(510))/7)+-parseInt(t(503))/8*(-parseInt(t(491))/9)+parseInt(t(506))/10*(parseInt(t(475))/11)+parseInt(t(505))/12*(parseInt(t(484))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(yc);class gc extends We{[pc(486)];[pc(466)];[pc(536)];[pc(529)];static get[pc(488)](){return pc(473)}constructor(e){const t=pc;super(e),e[t(485)][t(487)](t(461))||e[t(485)][t(480)](t(461),{model:t(458),max_tokens_to_sample:2e3,temperature:1,top_p:1,top_k:250,anthropic_version:t(504),stream:!0}),this[t(486)]=e[t(485)][t(487)](t(502)),this[t(536)]=e[t(485)][t(487)](t(459)),this[t(466)]=e[t(485)][t(487)](t(514)),this[t(529)]=e[t(485)][t(487)](t(461))}async[pc(535)]({query:e,context:t,onData:n,actionId:r}){const i=pc,{model:s,stream:o,...a}=await this[i(454)](this[i(529)],r),c={prompt:await this[i(522)](e,t,s,r),...a};this[i(486)]?await this[i(493)](c,s,o,n,r):await this[i(527)](c,s,o,n)}async[pc(522)](e,t,n,r){const i=pc;let s,o;return t?(s=i(462),o=i(468)+e+i(519)+t):(s=i(517),o=e),i(501)==this[i(469)](n)?i(534)+s+i(457)+o+i(499):i(467)+s+"\n"+o+i(516)}[pc(469)](e){const t=pc;if(/^anthropic\.claude/[t(525)](e))return t(530);if(/^ai21\.j2/[t(525)](e))return t(523);if(/^cohere\.command/[t(525)](e))return t(495);if(/^meta\.llama/[t(525)](e))return t(501);throw new w(v(this[t(521)][t(532)],t(497),e))}async[pc(493)](e,t,n,r,i){const s=pc,o={method:s(526),headers:await this[s(472)](this[s(466)],i),body:JSON[s(455)]({...e,model:t,stream:n}),signal:this[s(463)][s(474)]},a=await fetch(this[s(486)],o);n?await this[s(500)](a,t,r):await this[s(465)](a,t,r)}async[pc(527)](e,t,n,r){const i=pc,s=new To(this[i(536)]),o={body:JSON[i(455)](e),contentType:i(492),accept:i(492),modelId:t};let a;if(n){const e=new hc(o);a=await s[i(518)](e,{abortSignal:this[i(463)][i(474)]}),await this[i(508)](a,t,r)}else{const e=new fc(o);a=await s[i(518)](e,{abortSignal:this[i(463)][i(474)]}),await this[i(465)](a,t,r)}}async[pc(508)](e,t,n){const r=pc,i=e[r(483)],s=new TextDecoder(r(515));let o="";for await(const e of i)if(e[r(460)]){const i=s[r(477)](e[r(460)][r(489)]),a=JSON[r(533)](i);o+=this[r(498)](a,t),n(o)}return Promise[r(456)]()}async[pc(500)](e,t,n){const r=pc,i=e[r(483)],s=new TextDecoder(r(515)),o=i[r(479)]();let a="",c="",u=!1;for(;!u;){const{done:e,value:i}=await o[r(528)]();if(u=e,u)break;const d=(a+s[r(477)](i))[r(470)]("\n")[r(496)](e=>{const t=r;try{return a="",JSON[t(533)](e)}catch{return a=e,null}})[r(524)](e=>null!==e);d[r(509)]&&(c+=d[r(496)](e=>this[r(498)](e,t))[r(531)](""),n(c))}return Promise[r(456)]()}async[pc(465)](e,t,n){const r=pc;let i;return i=e instanceof Response?await e[r(490)]():JSON[r(533)](new TextDecoder(r(515))[r(477)](e[r(483)])),n(this[r(498)](i,t)),Promise[r(456)]()}[pc(498)](e,t){const n=pc;switch(this[n(469)](t)){case n(530):return e[n(482)];case n(523):return e[n(464)][0][n(512)][n(513)];case n(495):return e[n(478)][0][n(513)];case n(501):return e[n(481)]}}}function yc(){const e=["_prepareRequestHeaders","AWSTextAdapter","signal","11PimIAv","6804NrWTHI","decode","generations","getReader","define","generation","completion","body","3302QBsVpw","config","_apiUrl","get","pluginName","bytes","json","218853TgeRwl","application/json","_processProxyRequest","9837FcJZvb","cohere.command","map","AI_ERROR_UNSUPPORTED_MODEL","_getGeneratedText","\n[/INST]","_readStreamableResponse","meta.llama","ai.aws.apiUrl","96gfqIQT","bedrock-2023-05-31","10716FxGueD","2124690PDGPQc","115pASWGV","_readAsyncIterableResponse","length","1092lYrskJ","130UIkTGN","data","text","ai.aws.requestHeaders","utf-8","\n\nAssistant:","Your task is to generate HTML content accordingly to the given instruction. Never include <img> tag in your response even if asked for. Your answer must be a well-structured and properly formatted HTML code. Answer only with the generated HTML content. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","send","\nYou must keep the text formatting.\n\nContent:\n","9304WDRcoF","editor","preparePrompt","ai21.j2","filter","test","POST","_processAWSRequest","read","_requestParameters","anthropic.claude","join","locale","parse","<<SYS>>\n","sendRequest","_bedrockClientConfig","_prepareRequestParameters","stringify","resolve","\n<</SYS>>\n[INST]\n","anthropic.claude-v2","ai.aws.bedrockClientConfig","chunk","ai.aws.requestParameters","Your task is to execute the instruction using the provided HTML content. Follow the instruction closely. Your answer must be a properly formatted HTML code. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","abortController","completions","_readStaticResponse","_requestHeaders","Human:\n","Instruction:\n","getModelFamily","split","431176cTXwGO"];return(yc=function(){return e})()}function bc(e,t){var n=wc();return(bc=function(e,t){return n[e-=295]})(e,t)}function wc(){var e=["910asjRaQ","1106KSiPtz","72GBQUPq","43448GHTCtd","9254883bZFCNH","2953782MYkDTP","5154364lHvrVs","48fOniSw","1393487qJcqce","63378wgtCST","3caAoTY","587650kATIsP"];return(wc=function(){return e})()}!function(e){for(var t=bc,n=e();;)try{if(749055===parseInt(t(304))/1+-parseInt(t(301))/2+-parseInt(t(306))/3*(-parseInt(t(302))/4)+-parseInt(t(295))/5*(-parseInt(t(298))/6)+-parseInt(t(297))/7*(-parseInt(t(299))/8)+-parseInt(t(305))/9*(-parseInt(t(296))/10)+parseInt(t(300))/11*(-parseInt(t(303))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(wc)})(),(window.CKEditor5=window.CKEditor5||{}).ai=r})();
5
+ */(()=>{var e={168:e=>{"use strict";e.exports=function(e){return e[1]}},181:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),i=n.n(r),s=n(433),o=n.n(s)()(i());o.push([e.id,":root{--ck-ai-dropdown-view-width:250px;--ck-ai-dropdown-view-list-max-height:250px}.ck.ck-ai-commands-search{width:var(--ck-ai-dropdown-view-width)}.ck.ck-ai-commands-search>.ck-labeled-field-view{padding:var(--ck-spacing-large)}.ck.ck-ai-commands-search>.ck-labeled-field-view .ck-input{min-width:unset}.ck.ck-ai-commands-search>.ck-search__results{border-top:1px solid var(--ck-color-base-border)}.ck.ck-ai-commands-search>.ck-search__results>.ck-list{max-height:var(--ck-ai-dropdown-view-list-max-height);overflow:auto}",""]);const a=o},237:e=>{"use strict";e.exports=CKEditor5.dll},262:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},331:(e,t,n)=>{e.exports=n(237)("./src/clipboard.js")},355:(e,t,n)=>{e.exports=n(237)("./src/icons.js")},357:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},369:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(n),o=Math.max(i,s),a=0,c=e.map([t,n],function(t){var n=o-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});for(r&&(a=o-Math.min(i,s)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(s));var a=function(){var e=s[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach(function(t){r[t]=e[t]})};for(t=0,n=s.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv",bot:"bot"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},s=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}();t.default=a,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),s=c(n(94)),o=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(s.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},s=0;if(Object.keys(e).forEach(function(t){var o=e[t];"string"==typeof o?(i[t]=o,s+=1):"object"==typeof o&&(n[t]=o,r+=1)}),r>0){var o=Object.keys(n),c=a.default.find(o,function(e){return t.isOS(e)});if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var d=a.default.find(o,function(e){return t.isPlatform(e)});if(d){var l=this.satisfies(n[d]);if(void 0!==l)return l}}if(s>0){var h=Object.keys(i),f=a.default.find(h,function(e){return t.isBrowser(e,!0)});if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(s,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:s.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:s.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:s.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:s.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=i.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:s.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},379:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),i=n.n(r),s=n(433),o=n.n(s)()(i());o.push([e.id,":root{--ck-ai-form-submit-button-text-color:var(--ck-color-text);--ck-ai-form-submit-button-border-color:transparent;--ck-ai-form-submit-button-disabled-border-color:transparent;--ck-ai-toolbar-button-hover-color:var(--ck-color-text);--ck-color-ai-selection:rgba(31,176,255,.3)}.ck-ai-assistant-ui_theme{--ck-color-button-default-hover-background:#f3ecff;--ck-color-button-default-active-background:#f3ecff;--ck-color-button-on-background:#f3ecff;--ck-color-button-on-hover-background:#f3ecff;--ck-color-button-on-active-background:#f3ecff;--ck-color-button-on-disabled-background:#f3ecff;--ck-color-button-on-color:#743ccd;--ck-color-button-action-background:#743ccd;--ck-color-button-action-hover-background:#6c34c9;--ck-color-button-action-active-background:#6c34c9;--ck-color-button-action-disabled-background:#ba9de6;--ck-color-list-button-hover-background:#f3ecff;--ck-ai-form-content-background:#f9f9f9;--ck-ai-form-submit-button-text-color:var(--ck-color-button-on-color);--ck-ai-form-submit-button-border-color:var(--ck-color-button-action-background);--ck-ai-form-submit-button-disabled-border-color:var(--ck-color-button-action-disabled-background);--ck-ai-toolbar-button-hover-color:var(--ck-color-button-on-color);--ck-color-ai-selection:#e2d6f5}.ck-ai-assistant-button:hover,.ck-ai-commands-dropdown>.ck-button:hover{color:var(--ck-ai-toolbar-button-hover-color)}.ck span.ck-fake-ai-selection{background:var(--ck-color-ai-selection)}.ck .ck-widget.ck-fake-ai-selection{outline-color:var(--ck-color-ai-selection)}.ck span.ck-fake-ai-selection-candidate{background:var(--ck-color-ai-selection)}.ck .ck-fake-ai-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}.ck.ck-content.ck-ai-form__content-field h2{font-size:1.3em}.ck.ck-content.ck-ai-form__content-field h3{font-size:1.2em}.ck.ck-content.ck-ai-form__content-field h4,.ck.ck-content.ck-ai-form__content-field h5,.ck.ck-content.ck-ai-form__content-field h6{font-size:1.1em}.ck.ck-content.ck-ai-form__content-field h2,.ck.ck-content.ck-ai-form__content-field h3,.ck.ck-content.ck-ai-form__content-field h4,.ck.ck-content.ck-ai-form__content-field h5,.ck.ck-content.ck-ai-form__content-field h6,.ck.ck-content.ck-ai-form__content-field ol,.ck.ck-content.ck-ai-form__content-field p,.ck.ck-content.ck-ai-form__content-field ul{line-height:1.7em;margin-block-end:.5em;margin-block-start:.5em}.ck.ck-content.ck-ai-form__content-field>:first-child{margin-top:0}.ck.ck-content.ck-ai-form__content-field>:last-child{margin-bottom:0}",""]);const a=o},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(o[c]=!0)}for(var u=0;u<e.length;u++){var d=[].concat(e[u]);r&&o[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},545:e=>{"use strict";var t,n=(t=[],function(e,n){return t[e]=n,t.filter(Boolean).join("\n")});function r(e,t,r,i){var s;if(r)s="";else{s="",i.supports&&(s+="@supports (".concat(i.supports,") {")),i.media&&(s+="@media ".concat(i.media," {"));var o=void 0!==i.layer;o&&(s+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),s+=i.css,o&&(s+="}"),i.media&&(s+="}"),i.supports&&(s+="}")}if(e.styleSheet)e.styleSheet.cssText=n(t,s);else{var a=document.createTextNode(s),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(a,c[t]):e.appendChild(a)}}var i={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=i.singletonCounter++,n=i.singleton||(i.singleton=e.insertStyleElement(e));return{update:function(e){r(n,t,!1,e)},remove:function(e){r(n,t,!0,e)}}}},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},667:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}},673:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},o=[],a=0;a<e.length;a++){var c=e[a],u=r.base?c[0]+r.base:c[0],d=s[u]||0,l="".concat(u," ").concat(d);s[u]=d+1;var h=n(l),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(f);else{var p=i(f,r);r.byIndex=a,t.splice(a,0,{identifier:l,updater:p,references:1})}o.push(l)}return o}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=r(e=e||[],i=i||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var a=n(s[o]);t[a].references--}for(var c=r(e,i),u=0;u<s.length;u++){var d=n(s[u]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},676:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),i=n.n(r),s=n(433),o=n.n(s)()(i());o.push([e.id,":root{--ck-ai-form-view-width:600px;--ck-ai-form-content-height:175px;--ck-ai-form-content-background:#fafafa;--ck-ai-form-history-font-size:.9em;--ck-ai-form-error-background:var(--ck-color-light-red)}.ck .ck-ai-form{max-width:100%;width:var(--ck-ai-form-view-width)}@media screen and (max-width:600px){.ck .ck-ai-form{--ck-ai-form-view-width:100vw}}.ck .ck-ai-form .ck-ai-form-content{padding:var(--ck-spacing-large);width:100%}.ck .ck-ai-form .ck-ai-form-content .ck-input{width:100%}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper{border:1px solid var(--ck-color-base-border);border-radius:2px;max-height:var(--ck-ai-form-content-height);overflow-y:auto;width:100%}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area{background-color:var(--ck-ai-form-content-background);display:flex}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area.ck-ai-form__content-area--processing{--ck-color-text:var(--ck-color-input-disabled-text);background-color:var(--ck-color-input-disabled-background)}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field{box-sizing:content-box;min-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base));padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);white-space:normal;width:100%}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field{padding-right:0}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field{padding-left:0}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field>*{color:inherit;white-space:normal}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container{margin-left:var(--ck-spacing-medium)}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button-wrapper{display:flex;flex-direction:column-reverse;padding-left:2px}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button{bottom:1px;min-height:unset;min-width:unset;padding:4px;position:sticky;right:1px}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button svg{--ck-icon-size:16px}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button.ck-ai-form__copy-button--copied{color:inherit}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__toolbar{border:none;margin-bottom:calc(var(--ck-spacing-medium)*2);margin-top:var(--ck-spacing-medium);padding:0}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader{align-items:center;display:flex}.ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader .ck-spinner{box-sizing:border-box}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete{display:flex;justify-content:space-between}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view{flex-grow:1}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit{border-color:var(--ck-ai-form-submit-button-border-color);color:var(--ck-ai-form-submit-button-text-color)}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit{margin-left:var(--ck-spacing-medium)}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit{margin-right:var(--ck-spacing-medium)}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck.ck-ai-form__submit.ck-disabled{border-color:var(--ck-ai-form-submit-button-disabled-border-color)}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view .ck-ai-form__toggle-history{bottom:var(--ck-spacing-small);font-size:var(--ck-font-size-tiny);min-height:unset;min-width:unset;padding:4px;position:absolute;top:var(--ck-spacing-small)}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view .ck-ai-form__toggle-history{right:var(--ck-spacing-medium)}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete>.ck-labeled-field-view .ck-ai-form__toggle-history{left:var(--ck-spacing-medium)}[dir=ltr] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea{padding-right:30px}[dir=rtl] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea{padding-left:30px}@media screen and (max-width:600px){.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea{--ck-input-width:auto}}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto;grid-column-gap:0;grid-row-gap:0}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>span{grid-area:1/1/2/2}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-button{background:none;font-size:var(--ck-ai-form-history-font-size);grid-area:1/2/2/3;justify-self:start;margin:var(--ck-spacing-medium) 0 0;min-height:auto;padding:0}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-button .ck-button__label{line-height:inherit}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-button .ck-button__label:hover{text-decoration:underline}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-list{grid-area:2/1/3/3}.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group>.ck-list .ck-list__item .ck-button .ck-button__label{font-size:var(--ck-ai-form-history-font-size);line-height:var(--ck-line-height-base);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck .ck-ai-form .ck-ai-form__error{align-items:center;background-color:var(--ck-ai-form-error-background);border-radius:2px;color:var(--ck-color-base-text);display:flex;justify-content:center;margin-bottom:var(--ck-spacing-medium);padding:var(--ck-spacing-medium)}",""]);const a=o},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{AIAdapter:()=>w,AIAssistant:()=>He,AIAssistantUI:()=>$e,AIRequestError:()=>b,AITextAdapter:()=>We,AWSTextAdapter:()=>uc,OpenAITextAdapter:()=>Je,ShowAIAssistantCommand:()=>A,getDefaultAICommands:()=>qe});var e=n(782),t=n(355),i=n(584),s=n(311);function o(e,t){const n=(0,t.t)("Other");return e.length?"groupId"in e[0]?e:[{groupId:"_ungrouppedCommands",groupLabel:n,order:1/0,commands:e}]:[{groupId:"_ungrouppedCommands",groupLabel:n,order:1/0,commands:[]}]}var a=n(331),c=n(783);function u(e,t){const n=p();return(u=function(e,t){return n[e-=292]})(e,t)}const d=u;!function(e){const t=u,n=e();for(;;)try{if(345122===parseInt(t(301))/1+-parseInt(t(323))/2+parseInt(t(366))/3+-parseInt(t(324))/4*(-parseInt(t(304))/5)+parseInt(t(305))/6*(parseInt(t(400))/7)+parseInt(t(331))/8+-parseInt(t(344))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(p);const l=globalThis[d(389)],h=d(293);class f extends e.Plugin{static get[d(369)](){return d(380)}static get[d(345)](){return!0}static get[d(343)](){return!0}[d(385)](){const e=d,{editor:t}=this,n=[e(346)];t[e(364)][e(330)](e(297))&&n[e(373)](e(299)),t[e(333)][e(382)](e(358))[e(315)]({model:h,view:{classes:n,priority:12}}),t[e(333)][e(382)](e(358))[e(360)]({model:h,view:(t,{writer:n})=>{const r=e;if(!t[r(353)][r(396)])return null;const i=n[r(300)](r(294));return n[r(309)]([r(346),r(340)],i),i}})}[d(314)](){!async function(e){const t=g([110,65,55,121,117,114,103,79,72,98,90,118,68,112,108,82,107,74,115,99,100,73,67,109,56,54,111,80,87,120,57,50,102,49,113,70,48,76,97,83,88,51,78,71,119,84,77,75,52,106,86,116,89,85,66,81,105,53,122,104,101,69]),n=window[g([68,97,116,101])][g([110,111,119])](),r=e[g([101,100,105,116,111,114])],s=new(window[g([80,114,111,109,105,115,101])])(e=>{r[g([111,110,99,101])](g([114,101,97,100,121]),e)}),o={[g([107,116,121])]:g([69,67]),[g([117,115,101])]:g([115,105,103]),[g([99,114,118])]:g([80,45,50,53,54]),[g([120])]:g([105,67,106,79,67,118,68,70,73,54,108,81,72,72,84,49,56,106,86,119,82,102,107,102,72,81,50,97,95,77,121,109,84,51,53,76,81,86,111,70,83,65,73]),[g([121])]:g([107,88,73,121,74,52,101,118,116,67,69,70,82,109,120,75,83,85,112,75,57,102,68,87,52,53,57,118,88,79,118,86,114,104,102,54,117,81,65,101,79,105,111]),[g([97,108,103])]:g([69,83,50,53,54])},a=r[g([99,111,110,102,105,103])][g([103,101,116])](g([108,105,99,101,110,115,101,75,101,121]));function c(e){const t=[new(window[g([80,114,111,109,105,115,101])])(e=>setTimeout(e,605900)),s[g([116,104,101,110])](()=>new(window[g([80,114,111,109,105,115,101])])(e=>{let t=0;r[g([109,111,100,101,108])][g([111,110])](g([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),(n,r)=>{r[0][g([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&t++,504==t&&(e(),n[g([111,102,102])]())})}))];return window[g([80,114,111,109,105,115,101])][g([114,97,99,101])](t)[g([116,104,101,110])](()=>e)}function d(e){return e[g([115,116,97,114,116,115,87,105,116,104])](g([101,121]))?JSON[g([112,97,114,115,101])](l(e)):null}function l(e){return window[g([97,116,111,98])](e[g([114,101,112,108,97,99,101])](/-/g,g([43]))[g([114,101,112,108,97,99,101])](/_/g,g([47])))}function h(e){let t=5381;function n(e){for(let n=0;n<e[g([108,101,110,103,116,104])];n++){const r=e[g([99,104,97,114,67,111,100,101,65,116])](n);t=(t<<5)+t+r,t&=t}}return function e(t){Array[g([105,115,65,114,114,97,121])](t)?t[g([102,111,114,69,97,99,104])](e):t&&typeof t==g([111,98,106,101,99,116])?Object[g([101,110,116,114,105,101,115])](t)[g([115,111,114,116])]()[g([102,111,114,69,97,99,104])](([t,r])=>{n(t),e(r)}):n(window[g([83,116,114,105,110,103])](t))}(e),t>>>0}function f(e){return e[g([116,111,83,116,114,105,110,103])](16)[g([112,97,100,83,116,97,114,116])](8,g([48]))}function p(e){return e[g([115,112,108,105,116])]("")[g([114,101,118,101,114,115,101])]()[g([106,111,105,110])]("")}function m(){}function g(e){const t=u;return e[t(395)](e=>String[t(359)](e))[t(354)]("")}!function(e){const n=function(){const e=window[g([83,116,114,105,110,103])](window[g([112,101,114,102,111,114,109,97,110,99,101])][g([110,111,119])]())[g([114,101,112,108,97,99,101])](g([46]),"");let n=g([110]);for(let r=0;r<e[g([108,101,110,103,116,104])];r+=2){let i=window[g([112,97,114,115,101,73,110,116])](e[g([115,117,98,115,116,114,105,110,103])](r,r+2));i>=t[g([108,101,110,103,116,104])]&&(i-=t[g([108,101,110,103,116,104])]),n+=t[i]}return n}();r[n]=g([97,105,76,105,99,101,110,115,101,75,101,121])+e,e!=g([86,97,108,105,100])&&async function(){await s,r[g([109,111,100,101,108])][g([99,104,97,110,103,101])]=m,r[g([109,111,100,101,108])][g([101,110,113,117,101,117,101,67,104,97,110,103,101])]=m,r[g([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](g([109,111,100,101,108]))}()}(await async function(){let e,t=null,m=null;try{return a==g([71,80,76])?g([78,111,116,65,108,108,111,119,101,100]):(e=function(){const e=a[g([115,112,108,105,116])](g([46]));return 3!=e[g([108,101,110,103,116,104])]?null:t(e[1]);function t(e){const t=d(e);return t&&n()?t:null;function n(){const e=t[g([106,116,105])],n=window[g([112,97,114,115,101,73,110,116])](e[g([115,117,98,115,116,114,105,110,103])](e[g([108,101,110,103,116,104])]-8),16),r={...t,[g([106,116,105])]:e[g([115,117,98,115,116,114,105,110,103])](0,e[g([108,101,110,103,116,104])]-8)};return delete r[g([118,99])],h(r)==n}}}(),e?(e[g([117,115,97,103,101,69,110,100,112,111,105,110,116])]&&(m=function(e,t){return new(window[g([80,114,111,109,105,115,101])])(c=>{if(o())return c(g([86,97,108,105,100]));a(),r[g([100,101,99,111,114,97,116,101])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]));let u=!1;const d=(0,i.uid)();function l(e){return!!e&&(typeof e===g([111,98,106,101,99,116])||typeof e===g([102,117,110,99,116,105,111,110]))&&typeof e[g([116,104,101,110])]===g([102,117,110,99,116,105,111,110])&&typeof e[g([99,97,116,99,104])]===g([102,117,110,99,116,105,111,110])}function m(r){a(r)[g([116,104,101,110])](e=>e&&e[g([115,116,97,116,117,115])]==g([111,107])?f(h(d+t))!=e[g([118,101,114,105,102,105,99,97,116,105,111,110])]?g([85,115,97,103,101,76,105,109,105,116]):g([86,97,108,105,100]):g([85,115,97,103,101,76,105,109,105,116]))[g([116,104,101,110])](e=>(s(),e),()=>{const e=o();return null==e?(s(),g([86,97,108,105,100])):g(n-e>6048e5?[85,115,97,103,101,76,105,109,105,116]:[86,97,108,105,100])})[g([116,104,101,110])](c)[g([99,97,116,99,104])](()=>{c(g([85,115,97,103,101,76,105,109,105,116]))});const i=36e5;function s(){const t=g([108,108,99,116,45])+f(h(e)),r=p(f(window[g([77,97,116,104])][g([99,101,105,108])](n/i)));window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([115,101,116,73,116,101,109])](t,r)}function o(){const t=g([108,108,99,116,45])+f(h(e)),n=window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([103,101,116,73,116,101,109])](t);return n?window[g([112,97,114,115,101,73,110,116])](p(n),16)*i:null}function a(e){return new(window[g([80,114,111,109,105,115,101])])((t,n)=>{e[g([116,104,101,110])](t,n),window[g([115,101,116,84,105,109,101,111,117,116])](n,12e4)})}}r[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),(t,n)=>{if(n[0]!=e)return c(g([85,115,97,103,101,76,105,109,105,116]));n[1]={...n[1],[g([114,101,113,117,101,115,116,73,100])]:d}},{[g([112,114,105,111,114,105,116,121])]:g([104,105,103,104])}),r[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),e=>{l(e[g([114,101,116,117,114,110])])&&(u=!0,m(e[g([114,101,116,117,114,110])]))},{[g([112,114,105,111,114,105,116,121])]:g([108,111,119])}),s[g([116,104,101,110])](()=>{u||c(g([85,115,97,103,101,76,105,109,105,116]))})});function o(){return r[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]==g([97,117,116,111])}function a(){r[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]=g([97,117,116,111])}}(e[g([117,115,97,103,101,69,110,100,112,111,105,110,116])],e[g([106,116,105])])),await async function(){let e=!0;try{const r=a[g([115,112,108,105,116])](g([46])),[i,s,o]=r;return t(i),await n(i,s,o),e}catch{return!1}function t(t){const n=d(t);n&&n[g([97,108,103])]==g([69,83,50,53,54])||(e=!1)}async function n(t,n,r){const i=window[g([85,105,110,116,56,65,114,114,97,121])][g([102,114,111,109])](l(r),e=>e[g([99,104,97,114,67,111,100,101,65,116])](0)),s=(new(window[g([84,101,120,116,69,110,99,111,100,101,114])]))[g([101,110,99,111,100,101])](t+g([46])+n),a=window[g([99,114,121,112,116,111])][g([115,117,98,116,108,101])];if(!a)return;const c=await a[g([105,109,112,111,114,116,75,101,121])](g([106,119,107]),o,{[g([110,97,109,101])]:g([69,67,68,83,65]),[g([110,97,109,101,100,67,117,114,118,101])]:g([80,45,50,53,54])},!1,[g([118,101,114,105,102,121])]);await a[g([118,101,114,105,102,121])]({[g([110,97,109,101])]:g([69,67,68,83,65]),[g([104,97,115,104])]:{[g([110,97,109,101])]:g([83,72,65,45,50,53,54])}},c,i,s)||(e=!1)}}()?function(){const t=e[g([102,101,97,116,117,114,101,115])];return!(!t||!t[g([105,110,99,108,117,100,101,115])](g([42]))&&!t[g([105,110,99,108,117,100,101,115])](g([65,73])))}()?function(){const t=[g([101,118,97,108,117,97,116,105,111,110]),g([116,114,105,97,108])][g([105,110,99,108,117,100,101,115])](e[g([108,105,99,101,110,115,101,84,121,112,101])])?n/1e3:1757462400;return e[g([101,120,112])]<t}()?g([69,120,112,105,114,101,100]):function(){const t=u,n=e[g([108,105,99,101,110,115,101,100,72,111,115,116,115])];if(!n||0==n[g([108,101,110,103,116,104])])return!0;const{hostname:r}=new URL(window[g([108,111,99,97,116,105,111,110])][t(357)]);if(n[g([105,110,99,108,117,100,101,115])](r))return!0;const i=r[g([115,112,108,105,116])](g([46]));return n[g([102,105,108,116,101,114])](e=>e[g([105,110,99,108,117,100,101,115])](g([42])))[g([109,97,112])](e=>e[g([115,112,108,105,116])](g([46])))[g([102,105,108,116,101,114])](e=>e[g([108,101,110,103,116,104])]<=i[g([108,101,110,103,116,104])])[g([109,97,112])](e=>Array(i[g([108,101,110,103,116,104])]-e[g([108,101,110,103,116,104])])[g([102,105,108,108])](e[0]===g([42])?g([42]):"")[g([99,111,110,99,97,116])](e))[g([115,111,109,101])](e=>i[g([101,118,101,114,121])]((t,n)=>e[n]===t||e[n]===g([42])))}()?(e[g([108,105,99,101,110,115,101,84,121,112,101])]==g([101,118,97,108,117,97,116,105,111,110])&&(t=c(g([69,118,97,108,117,97,116,105,111,110,76,105,109,105,116]))),e[g([108,105,99,101,110,115,101,84,121,112,101])]==g([116,114,105,97,108])&&(t=c(g([84,114,105,97,108,76,105,109,105,116]))),await(t&&m?new(window[g([80,114,111,109,105,115,101])])((e,n)=>{t[g([116,104,101,110])](e,n),m[g([116,104,101,110])](t=>{t!=g([86,97,108,105,100])&&e(t)},n)}):t||m||g([86,97,108,105,100]))):g([68,111,109,97,105,110,76,105,109,105,116]):g([78,111,116,65,108,108,111,119,101,100]):g([73,110,118,97,108,105,100])):g([73,110,118,97,108,105,100]))}catch{return g([73,110,118,97,108,105,100])}}())}(this)}[d(374)](){const e=d,t=this[e(306)][e(320)];t[e(386)](n=>{const r=e,i=t[r(377)][r(351)][r(317)]();let s=0;for(const e of i){const i=h+":"+s;if(t[r(370)][r(365)](i))n[r(313)](i,{range:e});else if(e[r(379)][r(326)]){const s=e[r(379)][r(321)](({item:e})=>!t[r(399)][r(337)](e),{boundaries:e});n[r(335)](i,{usingOperation:!1,affectsData:!1,range:n[r(342)](s,e[r(327)])})}else n[r(335)](i,{usingOperation:!1,affectsData:!1,range:e});s++}})}[d(383)](){const e=d,t=this[e(306)][e(320)],n=Array[e(392)](this[e(306)][e(320)][e(370)][e(381)](h));n[e(318)]&&t[e(386)](t=>{const r=e;n[r(388)](e=>{t[r(375)](e)})})}[d(348)](e,t){const n=d,r=this[n(310)](),i=t||r[n(325)]();this[n(306)][n(320)][n(312)](i)&&this[n(306)][n(320)][n(386)](s=>{const o=n;this[o(383)](),t||this[o(350)](s,r),this[o(362)]({insertAt:i,writer:s,html:e})})}[d(329)](e){const t=d,{model:n}=this[t(306)],r=this[t(310)]();n[t(386)](()=>{const n=t,i=this[n(397)](e,r)||this[n(363)](r);this[n(348)](e,i)})}[d(310)](){const e=d,t=this[e(306)][e(320)],n=Array[e(392)](t[e(370)][e(381)](h))[e(395)](t=>t[e(368)]());return t[e(298)](n)}[d(362)]({writer:e,html:t,insertAt:n}){const r=d,{view:i}=this[r(306)][r(393)],s=this[r(306)][r(376)][r(330)](a.ClipboardPipeline),o=new l;o[r(316)](r(334),t);const u=new ClipboardEvent(r(338),{clipboardData:o}),h=new c.ViewDocumentDomEventData(i,u,{dataTransfer:new c.ViewDataTransfer(o)});e[r(328)](n);const f=(t,n)=>{const i=r;n[i(339)]&&e[i(328)](n[i(339)])};s[r(356)](r(349),f,{priority:r(308)}),i[r(377)][r(394)](r(338),h),s[r(307)](r(349),f)}[d(363)](e){const t=d,{model:n}=this[t(306)],r=Array[t(392)](e[t(322)]());return r[t(318)]?n[t(319)](r[t(372)]()):e[t(311)]()}[d(397)](e,t){const n=d,{model:r,plugins:i}=this[n(306)];if(i[n(365)](n(336))){const s=i[n(330)](n(336))[n(387)](t);if(s[n(318)]){const t=this[n(367)](e),i=this[n(292)](s,t);return r[n(332)](i,0)}}return null}[d(367)](e){const t=d,n=this[t(306)][t(376)][t(330)](t(336)),r=this[t(306)][t(355)][t(384)](e),i=Array[t(392)](r[t(347)]())[t(303)](e=>e.is(t(295),t(296)));let s=0;return i[t(388)](e=>{s+=n[t(390)](e)}),s}[d(292)](e,t){const n=d,r=this[n(306)][n(376)][n(330)](n(336)),i=r[n(398)](e),s=r[n(341)](e),o=i[n(378)]+1,a=s[n(352)],c=e[0][n(391)](n(296));for(let e=0;e<t;e++)r[n(371)](c,{at:o});return c[n(361)](o)[n(361)](a)}[d(350)](e,t){const n=d,{plugins:r}=this[n(306)],{model:i}=e;r[n(365)](n(336))&&r[n(330)](n(336))[n(387)](t)[n(318)]&&i[n(302)](t)}}function p(){const e=["span","element","table","ai.useTheme","createSelection","ck-ai-assistant-ui_theme","createUIElement","186864iRVGmy","deleteContent","filter","5uJvTeN","1248CNrrOR","editor","off","lowest","addClass","_getAISelection","getLastPosition","canEditAt","updateMarker","afterInit","markerToHighlight","setData","getRanges","length","createPositionAfter","model","getLastMatchingPosition","getSelectedBlocks","439272VctAVi","1260452vDvizY","getFirstRange","isAtEnd","end","setSelection","insertContentBelow","get","4968872zgmkPP","createPositionAt","conversion","text/html","addMarker","TableUtils","isContent","paste","resultRange","ck-fake-ai-selection_collapsed","getColumnIndexes","createRange","isPremiumPlugin","7341291SAsEUw","isOfficialPlugin","ck-fake-ai-selection","getChildren","insertContent","contentInsertion","_resetContentOfSelectedTableCells","selection","first","markerRange","join","data","once","href","editingDowncast","fromCharCode","markerToElement","getChild","_pasteHTMLUsingClipboard","_getDefaultInsertBelowPosition","config","has","29553lyaTYh","_getTableRowCountFromContent","getRange","pluginName","markers","insertRows","pop","push","showFakeVisualSelection","removeMarker","plugins","document","last","start","AIAssistantEditing","getMarkersGroup","for","hideFakeVisualSelection","parse","init","change","getSelectedTableCells","forEach","DataTransfer","getRows","findAncestor","from","editing","fire","map","isCollapsed","_prepareTableInsertBelowPosition","getRowIndexes","schema","8330MUxvCm","_createEmptyTableRows","ai-ui"];return(p=function(){return e})()}var m=g;function g(e,t){var n=y();return(g=function(e,t){return n[e-=285]})(e,t)}function y(){var e=["7680970MkpsNh","1072JjFglF","isPremiumPlugin","pluginName","name","8ASJCbZ","5847rincyr","21maoUpz","afterInit","1843830REVYEP","textAdapter","4068330jQxFuU","aiadapter-text-adapter-not-set","AIAdapter","11HdApag","AIRequestError","1ysjIJw","2979372NLHgGA","8486253qlpuWX","56394744tcvkRo","isOfficialPlugin"];return(y=function(){return e})()}!function(e){for(var t=g,n=e();;)try{if(777143===parseInt(t(302))/1*(-parseInt(t(295))/2)+parseInt(t(292))/3*(-parseInt(t(287))/4)+-parseInt(t(297))/5+parseInt(t(303))/6*(-parseInt(t(293))/7)+parseInt(t(291))/8*(-parseInt(t(304))/9)+parseInt(t(286))/10+parseInt(t(300))/11*(parseInt(t(305))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(y);class w extends e.Plugin{static get[m(289)](){return m(299)}static get[m(285)](){return!0}static get[m(288)](){return!0}[m(294)](){var e=m;if(!this[e(296)])throw new i.CKEditorError(e(298),null)}}class b extends Error{constructor(e){var t=m;super(e),this[t(290)]=t(301)}}function v(e,t,n){const r=e.t;switch(t){case"Edit or review":return r("Edit or review");case"Improve writing":return r("Improve writing");case"Make shorter":return r("Make shorter");case"Make longer":return r("Make longer");case"Simplify language":return r("Simplify language");case"Generate from selection":return r("Generate from selection");case"Summarize":return r("Summarize");case"Continue":return r("Continue");case"Change tone":return r("Change tone");case"Professional":return r("Professional");case"Casual":return r("Casual");case"Direct":return r("Direct");case"Confident":return r("Confident");case"Friendly":return r("Friendly");case"Change style":return r("Change style");case"Business":return r("Business");case"Legal":return r("Legal");case"Journalism":return r("Journalism");case"Poetic":return r("Poetic");case"Translate":return r("Translate");case"English":return r("English");case"Spanish":return r("Spanish");case"German":return r("German");case"Portuguese":return r("Portuguese");case"French":return r("French");case"Simplified Chinese":return r("Simplified Chinese");case"Hindi":return r("Hindi");case"Arabic":return r("Arabic");case"AI Assistant":return r("AI Assistant");case"AI Commands":return r("AI Commands");case"Ask AI to edit or generate":return r("Ask AI to edit or generate");case"Ask AI to improve generated text":return r("Ask AI to improve generated text");case"Copy":return r("Copy");case"Submit":return r("Submit");case"Insert below":return r("Insert below");case"Try again":return r("Try again");case"Stop":return r("Stop");case"AI is writing...":return r("AI is writing...");case"AI is writing":return r("AI is writing");case"Generated content: %0":return r("Generated content: %0",n);case"Error during AI content generation: %0":return r("Error during AI content generation: %0",n);case"History":return r("History");case"Empty history":return r("Empty history");case"Ask AI and your prompts will be listed here for you to use later.":return r("Ask AI and your prompts will be listed here for you to use later.");case"Prompt history":return r("Prompt history");case"Clear":return r("Clear");case"AI_REPLACE_CONTENT":return r({id:"AI_REPLACE_CONTENT",string:"Replace"});case"AI_INSERT_CONTENT":return r({id:"AI_INSERT_CONTENT",string:"Insert"});case"AI_ERROR_GET_HEADERS":return r({id:"AI_ERROR_GET_HEADERS",string:"Preparing request headers failed"});case"AI_ERROR_GET_PARAMETERS":return r({id:"AI_ERROR_GET_PARAMETERS",string:"Preparing request parameters failed"});case"AI_ERROR_UNSUPPORTED_MODEL":return r({id:"AI_ERROR_UNSUPPORTED_MODEL",string:'The requested AI model ("%0") is not supported'},n);case"AI_ERROR_CONTEXT_LENGTH":return r({id:"AI_ERROR_CONTEXT_LENGTH",string:"Selected content is too long"});case"AI_ERROR_MODERATION":return r({id:"AI_ERROR_MODERATION",string:"Requested query does not pass moderation rules"});case"AI_ERROR_FAILED":return r({id:"AI_ERROR_FAILED",string:"Failed to communicate with the AI service"});default:return t}}function k(e,t){const n=S();return(k=function(e,t){return n[e-=492]})(e,t)}function S(){const e=["2167hygove","7796592cmxetB","element","execute","selection","hasContent","16OLLbSv","_commandDefinitions","plugins","getFirstRange","values","editor","334cAXMII","5512XwJluh","getSelectedBlocks","model","config","refresh","205806OSrwCi","name","4142184aFhMwa","get","custom","enabledCommandsIds","includes","add","document","getItems","isEmpty","ai.aiAssistant.disabledElements","set","isEnabled","showUI","166360leOtFT","_hasContext","change:isEnabled","isCollapsed","length","4838820zfzoDJ","change:_hasContext","3058643oKaBFJ","20IqRsKo","getRanges","requiresContent","from"];return(S=function(){return e})()}const E=k;!function(e){const t=k,n=e();for(;;)try{if(550992===-parseInt(t(503))/1*(parseInt(t(504))/2)+parseInt(t(509))/3*(-parseInt(t(532))/4)+parseInt(t(529))/5+-parseInt(t(511))/6+parseInt(t(531))/7*(-parseInt(t(497))/8)+-parseInt(t(492))/9+-parseInt(t(524))/10*(-parseInt(t(536))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(S);class A extends e.Command{[E(498)];constructor(e,t){const n=E;super(e),this[n(498)]=t,this[n(521)](n(514),[]),this.on(n(530),(e,t,r)=>{const i=n;this[i(522)]&&(this[i(514)]=I(this[i(498)],r))}),this[n(521)](n(525),!1),this.on(n(526),(e,t,r)=>{const i=n;this[i(514)]=r?I(this[i(498)],this[i(525)]):[]})}[E(508)](){const e=E,t=this[e(502)][e(506)];this[e(525)]=function(t){const n=e,r=t[n(517)][n(495)];return r[n(527)]?0!==[...r[n(505)]()][n(528)]&&![...r[n(505)]()][0][n(519)]:!!t[n(496)](r[n(500)]())}(t);const n=t[e(517)][e(495)],r=this[e(502)][e(507)][e(512)](e(520));for(const t of n[e(533)]())for(const n of t[e(518)]())if(n.is(e(493))&&r[e(515)](n[e(510)]))return void(this[e(522)]=!1);this[e(522)]=!0}[E(494)](e="",t="",n=E(513)){const r=E;this[r(502)][r(499)][r(512)]($e)[r(523)](e,t,n)}}function I(e,t){const n=E,r=new Set;for(const i of e[n(501)]())(t||!1===i[n(534)])&&r[n(516)](i.id);return Array[n(535)](r)}const _=x;function x(e,t){const n=R();return(x=function(e,t){return n[e-=428]})(e,t)}function R(){const e=["length","message","```","data","stopProcessing","```html","set:currentContext","config","name","handleError","div","893246cNloJV","trim","serializeToString","_handleQuery","parseFromString","stopListening","tryAgainEvent","startProcessing","match","set","toView","body","previousLabel","previousQuery","clear","destroy","textAdapter","ELEMENT_NODE","finally","get","_domParser","text/html","editor","catch","editing","initialContext","_isH1TagSupportEnabled","document","ai.aiAssistant.preserveComments","388WHcgTQ","view","nodeType","substring","previousContext","_normalizeResponseHeadings","currentContext","from","_parseAndNormalizeContent","prompt","toModel","element","stringify","15381Zpmvro","25633690SvLTXU","markers","<h1></h1>","isProcessing","reverse","rename","11AWuFle","value","once","updateView","abort","startsWith","_sanitizationContainer","remove","54yWsLBD","custom","processor","viewToDom","reset","414FBpHLC","htmlProcessor","finishProcessing","currentResponse","175064KiZgsN","listenTo","3445505WYiTfV","_stripMarkdownSyntax","domConverter","push","mainAction","innerHTML","1279453mrFQvr","submitPrompt","_sanitizeHTML","isRendered","previousActionId","childNodes","then","_xmlSerializer","2142234iXBZbk","setContentOf","createElement","endsWith","querySelector","makeRequest","render","exec"];return(R=function(){return e})()}!function(e){const t=x,n=e();for(;;)try{if(866203===parseInt(t(467))/1+parseInt(t(448))/2+-parseInt(t(509))/3*(parseInt(t(496))/4)+-parseInt(t(434))/5+parseInt(t(524))/6*(parseInt(t(440))/7)+-parseInt(t(432))/8*(-parseInt(t(428))/9)+parseInt(t(510))/10*(-parseInt(t(516))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(R);const C=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,"is");class M extends((0,i.ObservableMixin)()){[_(489)];[_(483)];[_(497)];[_(522)];[_(487)];[_(447)];constructor(e,t,n){const r=_;super(),this[r(489)]=e,this[r(483)]=t,this[r(522)]=document[r(450)](r(466)),this[r(487)]=new DOMParser,this[r(447)]=new XMLSerializer,this[r(497)]=n,this[r(476)]({initialContext:"",currentContext:"",currentResponse:"",previousContext:void 0,previousQuery:void 0,previousLabel:void 0,isProcessing:!1}),this.on(r(462),(e,t,n)=>{const i=r;this[i(497)][i(517)]=this[i(442)](n)}),this[r(433)](this[r(497)],r(441),(e,t)=>{const n=r,i=this[n(502)]||this[n(492)];this[n(470)](t,i,n(525))}),this[r(433)](this[r(497)],r(473),()=>{const e=r;this[e(497)][e(505)]=this[e(479)],this[e(470)](this[e(480)],this[e(500)],this[e(444)],this[e(479)])}),this[r(433)](this[r(497)],r(460),()=>{this[r(460)]()})}[_(482)](){this[_(472)]()}async[_(519)]({actionId:e,query:t,htmlContent:n,label:r,mainActionLabel:i}){const s=_;this[s(497)][s(505)]=r,this[s(497)][s(438)]=i,this[s(492)]=n,t&&(this[s(497)][s(443)]?this[s(470)](t,n,e,r):this[s(497)][s(518)](s(454),()=>{this[s(470)](t,n,e,r)}))}[_(460)](){const e=_;this[e(513)]&&(this[e(513)]=!1,this[e(497)][e(430)](),this[e(483)][e(520)]())}[_(528)](){const e=_;this[e(492)]="",this[e(502)]="",this[e(431)]="",this[e(500)]="",this[e(480)]="",this[e(479)]="",this[e(444)]=void 0,this[e(497)][e(528)](),this[e(460)]()}async[_(470)](e,t,n,r){const i=_;return this[i(513)]=!0,this[i(497)][i(474)](),this[i(500)]=t,this[i(480)]=e,this[i(479)]=r||e,this[i(444)]=n,new Promise(r=>{const s=i;this[s(483)][s(453)]({query:e,context:t,onData:e=>{const t=s;this[t(431)]=e,this[t(502)]=this[t(504)](this[t(431)])},actionId:n})[s(446)](()=>{const e=s;!this[e(502)]&&this[e(431)]&&(this[e(502)]=this[e(504)](this[e(431)],!0))})[s(490)](e=>{const t=s;e instanceof b?this[t(497)][t(465)](e[t(457)]):this[t(497)][t(465)](),r()})[s(485)](()=>{this[s(460)](),r()})})}[_(504)](e,t=!1){const n=_,r=C[n(455)](e);e=r?e[n(499)](r[1][n(456)]):e[n(456)]<100&&!t?"":this[n(435)](e);const i=this[n(487)][n(471)](e,n(488));if(r){const e=Array[n(503)](i[n(478)][n(445)]);e[n(514)]();for(const t of e){if(t[n(498)]==Node[n(484)])break;t[n(523)]()}}const s=this[n(489)][n(459)][n(526)][n(477)](this[n(447)][n(469)](i[n(478)]));this[n(493)]()||this[n(501)](s);const o=this[n(489)][n(463)][n(486)](n(495)),a=this[n(489)][n(459)][n(506)](s);return o||a[n(511)][n(481)](),this[n(489)][n(459)][n(508)](a)}[_(501)](e){const t=_,n=new c.ViewUpcastWriter(this[t(489)][t(491)][t(497)][t(494)]),r=new c.Matcher({name:/^h[1-5]$/}),i=[];let s=!1;for(const n of e)n.is(t(507))&&r[t(475)](n)&&(i[t(437)](n),"h1"==n[t(464)]&&(s=!0));if(s)for(const e of i)n[t(515)]("h"+(parseInt(e[t(464)][1])+1),e)}[_(493)](){const e=_,{data:t,editing:n}=this[e(489)],r=t[e(429)][e(477)](e(512)),i=t[e(477)](t[e(506)](r));return!!n[e(497)][e(436)][e(527)](i)[e(452)]("h1")}[_(442)](e){const t=_;return this[t(489)][t(491)][t(497)][t(436)][t(449)](this[t(522)],e),this[t(522)][t(439)]}[_(435)](e){const t=_,n=e[t(468)]();return n[t(521)](t(461))?n[t(451)](t(458))?n[t(499)](7,n[t(456)]-3):n[t(499)](7):e}}const P=T;function T(e,t){const n=O();return(T=function(e,t){return n[e-=220]})(e,t)}function O(){const e=["AI_","_createButton","tryAgainButton","8zXywwx","replace","8670WSqBrO","stopButton","ck-button-action","REPLACE","insert","1562671hqCQjQ","mainAction","129aiFIQQ","bindTemplate","insertButton","ck-ai-form__toolbar","1236qXFwhL","bind","locale","111924YaBhIP","addMany","1423056MRrtTA","items","470526ilyUcN","Try again","replaceButton","Stop","ck-hidden","toUpperCase","_CONTENT","Insert below","isVisible","label","set","470xKCGft","4405IcSLxh","1856911EzXmxn","extendTemplate"];return(O=function(){return e})()}!function(e){const t=T,n=e();for(;;)try{if(296839===parseInt(t(242))/1+parseInt(t(224))/2*(parseInt(t(231))/3)+-parseInt(t(240))/4+parseInt(t(254))/5*(-parseInt(t(235))/6)+-parseInt(t(255))/7*(parseInt(t(222))/8)+-parseInt(t(238))/9*(-parseInt(t(253))/10)+-parseInt(t(229))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(O);const N={REPLACE:P(223),INSERT:P(228)};class L extends s.ToolbarView{constructor(e){const t=P;super(e),this[t(252)](t(250),!1),this[t(252)](t(230),N[t(227)]),this[t(244)]=this[t(220)]("",t(226)),this[t(244)][t(236)](t(251)).to(this,t(230),n=>v(e,t(257)+n[t(247)]()+t(248))),this[t(233)]=this[t(220)](v(e,t(249))),this[t(221)]=this[t(220)](v(e,t(243))),this[t(225)]=this[t(220)](v(e,t(245)));const n=this[t(232)];this[t(256)]({attributes:{class:[t(234),n.if(t(250),t(246),e=>!e)]}}),this[t(241)][t(239)]([this[t(244)],this[t(233)],this[t(221)],this[t(225)]])}[P(220)](e,t){const n=P,r=new s.ButtonView(this[n(237)]);return r[n(252)]({label:e,class:t||"",isVisible:!0,withText:!0}),r}}const $=D;function D(e,t){const n=B();return(D=function(e,t){return n[e-=150]})(e,t)}!function(e){const t=D,n=e();for(;;)try{if(702187===parseInt(t(173))/1*(parseInt(t(229))/2)+parseInt(t(228))/3+parseInt(t(150))/4*(parseInt(t(183))/5)+-parseInt(t(194))/6*(parseInt(t(167))/7)+-parseInt(t(225))/8+parseInt(t(156))/9*(parseInt(t(191))/10)+parseInt(t(190))/11*(parseInt(t(181))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(B);class F extends s.View{[$(154)];[$(209)];constructor(e,t=""){const n=$;super(e),this[n(178)]({value:null,isVisible:!1,isProcessing:!1});const r=this[n(235)];this[n(154)]=new U(e,t),this[n(209)]=this[n(155)](),this[n(175)]({tag:n(200),attributes:{class:["ck",n(160),r.if(n(151),n(217),e=>!e)],tabindex:"-1"},children:[{tag:n(200),attributes:{class:["ck",n(174),r.if(n(192),n(187))]},children:[this[n(154)],{tag:n(200),attributes:{class:["ck",n(161)]},children:[this[n(209)]]}]}]})}[$(157)](){const e=$;super[e(157)](),this[e(158)]&&this[e(154)][e(170)](this[e(158)]);let t=!1;this.on(e(164),(n,r,i)=>{const s=e,o=!this[s(154)][s(207)][s(234)](s(232));this[s(154)][s(170)](i),this[s(192)]&&o&&!t&&this[s(207)][s(195)]({top:this[s(207)][s(166)],behavior:s(177)})}),this.on(e(184),(n,r,i)=>{const s=e;t=!1,i?(this[s(158)]=null,this[s(154)][s(152)]()):this[s(158)]||this[s(154)][s(170)]("")}),this[e(185)](this[e(207)],e(208),()=>{t=!0}),this[e(185)](this[e(207)],e(180),()=>{t=!0})}[$(159)](){const e=$;this[e(207)][e(159)]()}[$(155)](){const e=$,n=this[e(219)],r=new s.ButtonView(this[e(219)]),i=e(201);return r[e(178)]({label:v(n,e(179)),icon:t.IconCopy,class:i,tooltip:!0}),r[e(230)](e(151)).to(this,e(158),e=>!!e),r[e(230)](e(153)).to(this,e(192),e=>!e),r.on(e(188),()=>{const n=e;this[n(224)](this[n(154)][n(207)]),r[n(236)]=t.IconCheck,r[n(165)]=i+n(227),this[n(159)](),setTimeout(()=>{const e=n;r[e(236)]=t.IconCopy,r[e(165)]=i},1e3)}),r}[$(224)](e){const t=$,{window:n,document:r}=i.global;if(n[t(163)]){const{Blob:r,ClipboardItem:i}=n,s=[new i({"text/html":new r([e[t(233)]],{type:t(205)}),"text/plain":new r([e[t(186)]||""],{type:t(203)})})];navigator[t(211)][t(221)](s)}else{const i=r[t(193)](t(200));i[t(212)][t(169)]=t(218),i[t(212)][t(172)]=t(215),i[t(233)]=t(220)+e[t(233)]+t(182),r[t(213)][t(214)](i);const s=r[t(223)]();s[t(198)](i[t(162)]),s[t(226)](i[t(202)]);const o=n[t(204)]();o[t(171)](),o[t(196)](s),r[t(168)](t(231)),i[t(197)]()}}}class U extends s.View{constructor(e,t=""){const n=$;super(e),this[n(216)]=this[n(189)](),this[n(175)]({tag:n(200),attributes:{class:["ck",n(206),t,n(210),n(222)]}})}[$(170)](e){const t=$;this[t(207)][t(233)]=e}[$(152)](){const e=$;this[e(207)][e(214)](this[e(216)][e(207)])}[$(189)](){const e=$,t=new s.View,n=this[e(219)],r=new s.SpinnerView;return r[e(151)]=!0,t[e(175)]({tag:e(200),attributes:{class:["ck",e(176)]},children:[r,{text:v(n,e(199))}]}),t[e(157)](),t}}function B(){const e=["loaderView","ck-hidden","absolute","locale","<span>[</span>","write","ck-ai-form__content-field","createRange","_copyHTMLToClipboard","9844224LzNNeG","setEndBefore"," ck-ai-form__copy-button--copied","116106QoynaU","1252DLOrPu","bind","copy",".ck-ai-form__loader","innerHTML","querySelector","bindTemplate","icon","28wLDnPW","isVisible","appendLoader","isEnabled","contentFieldView","_createCopyButton","554787wrjKOL","render","value","focus","ck-ai-form__content-area-wrapper","ck-ai-form__copy-button-wrapper","firstElementChild","ClipboardItem","change:value","class","scrollHeight","70QyuxuD","execCommand","position","setContent","removeAllRanges","left","394ExPPCv","ck-ai-form__content-area","setTemplate","ck-ai-form__loader","smooth","set","Copy","mousedown","744hmPrcI","<span>]</span>","23875LhgCCH","change:isProcessing","listenTo","textContent","ck-ai-form__content-area--processing","execute","_createLoader","367741DahQYH","40dwlvPT","isProcessing","createElement","423210IxzFia","scrollTo","addRange","remove","setStartAfter","AI is writing...","div","ck-ai-form__copy-button","lastElementChild","text/plain","getSelection","text/html","ck-content","element","wheel","copyButtonView","ck-reset_all-excluded","clipboard","style","body","appendChild","-9999px"];return(B=function(){return e})()}!function(e){const t=H,n=e();for(;;)try{if(708762===-parseInt(t(132))/1*(-parseInt(t(125))/2)+-parseInt(t(120))/3+parseInt(t(133))/4*(parseInt(t(115))/5)+parseInt(t(128))/6*(-parseInt(t(131))/7)+-parseInt(t(117))/8*(parseInt(t(126))/9)+parseInt(t(121))/10*(parseInt(t(129))/11)+-parseInt(t(130))/12*(-parseInt(t(127))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(q);class j extends s.View{constructor(e,n=""){const r=H;super(e);const i=new s.IconView,o=this[r(118)];this[r(119)](r(123),n),i[r(116)]=t.IconError,this[r(114)]({tag:r(122),attributes:{class:["ck",r(124)]},children:[i,{text:o.to(r(123))}]})}}function H(e,t){const n=q();return(H=function(e,t){return n[e-=114]})(e,t)}function q(){const e=["12EeeDim","44ekYbCI","12IATxWk","4434927nSNSTU","1OrpJqO","856104dvLkti","setTemplate","10hyRbwj","content","1238152oHjIpo","bindTemplate","set","2731422lEobnn","2974880vRBvFY","div","text","ck-ai-form__error","320326HCiQVC","36hZJEEL","22454471xnvQEg"];return(q=function(){return e})()}const z=G;function V(){const e=["render","History","update","excludeScrollbarsAndBorders","focusLast","fieldWrapperChildren","focus","filteredView","showHistoryButtonView","target","312487ppVCJk","set","2656696QsGIdw","isOn","isEnabled","focusFirst","isVisible","4904535SEIxsv","rtl","locale","258vlldas","right","children","enter","resultsView","bind","queryView","style","window","fieldView","focusCycler","execute","submit","element","9091104KzCCuf","left","focusableChildren","minRows","56763akloyz","requestAnimationFrame","fire","submitButtonView","add","_createSubmitButton","210630rtodGD","Submit","maxRows","23844xaiSAU","ck-ai-form__submit","96NOPblx","ck-ai-form__toggle-history","_createShowHistoryButton","1030jnaKBe","value","uiLanguageDirection","isEmpty","width","keystrokes"];return(V=function(){return e})()}function G(e,t){const n=V();return(G=function(e,t){return n[e-=342]})(e,t)}!function(e){const t=G,n=e();for(;;)try{if(903326===parseInt(t(353))/1+-parseInt(t(356))/2*(parseInt(t(387))/3)+-parseInt(t(379))/4+parseInt(t(384))/5+parseInt(t(343))/6+-parseInt(t(377))/7*(-parseInt(t(358))/8)+parseInt(t(347))/9*(-parseInt(t(361))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(V);class W extends s.AutocompleteView{[z(350)];[z(375)];constructor(e,t){const n=z;super(e,t),this[n(393)][n(396)][n(346)]=1,this[n(393)][n(396)][n(355)]=3,this[n(350)]=this[n(352)](),this[n(375)]=this[n(360)](),this[n(345)][n(351)](this[n(375)],1),this[n(345)][n(351)](this[n(350)])}[z(367)](){const e=z;super[e(367)](),this[e(393)][e(372)][e(351)](this[e(375)]),this[e(389)][e(351)](this[e(350)]),this[e(366)][e(378)](e(390),(t,n)=>{const r=e;t[r(376)]==this[r(393)][r(396)][r(342)]&&(this[r(399)](),n())})}[z(352)](){const e=z,n=new s.ButtonView(this[e(386)]),r=this[e(386)];return n[e(378)]({icon:t.IconSubmit,label:v(r,e(354)),isVisible:!0,tooltip:!0,class:e(357)}),n.on(e(398),()=>{this[e(399)]()}),n[e(392)](e(381)).to(this[e(393)][e(396)],e(364),this,e(381),(e,t)=>!e&&t),n}[z(360)](){const e=z,n=new s.ButtonView(this[e(386)]),r=this[e(391)],o=this[e(386)];n[e(378)]({label:v(o,e(368)),withText:!1,icon:t.IconHistory,tooltip:!0,tooltipPosition:"sw",class:e(359)}),n[e(392)](e(380)).to(r,e(383)),n[e(392)](e(381)).to(this,e(381)),n.on(e(398),()=>{const t=e;r[t(383)]=!r[t(383)],r[t(383)]?this[t(374)][t(373)]():this[t(373)]()});const a=()=>{const t=e;i.global[t(395)][t(348)](()=>{const e=t;if((0,i.isVisible)(this[e(342)])){const t=new i.Rect(this[e(393)][e(396)][e(342)]),r=t[e(365)],s=e(385)===o[e(363)]?e(344):e(388);t[e(370)](),n[e(342)][e(394)][s]=r-t[e(365)]+1+"px"}})};return this[e(393)][e(396)].on(e(369),a),this.on(e(367),a),n}[z(399)](){const e=z,t=this[e(393)][e(396)][e(342)][e(362)];this[e(349)](e(399),t)}[z(373)](e){const t=z;-1===e?this[t(397)][t(371)]():this[t(397)][t(382)]()}}const K=J;function J(e,t){const n=Y();return(J=function(e,t){return n[e-=322]})(e,t)}function Y(){const e=["children","clearHistoryButton","add","4509700magzzA","2496416BGkakk","14433831rwgWFx","708MrbcGj","clearHistory","historyGroupView","Prompt history","locale","_createClearHistoryButton","Clear","fire","delegate","length","items","filter","277672RekatE","5619PyLTyG","label","5015442YksqXt","605201BxFMwo","14kHuDei","set","execute"];return(Y=function(){return e})()}!function(e){const t=J,n=e();for(;;)try{if(769769===parseInt(t(324))/1+-parseInt(t(334))/2*(parseInt(t(347))/3)+parseInt(t(332))/4+parseInt(t(331))/5+parseInt(t(323))/6+-parseInt(t(325))/7*(-parseInt(t(346))/8)+-parseInt(t(333))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Y);class Q extends s.ListView{[K(336)];[K(329)];constructor(e){const t=K;super(e),this[t(329)]=this[t(339)](),this[t(336)]=new s.ListItemGroupView,this[t(336)][t(328)][t(330)](this[t(329)],1),this[t(336)][t(322)]=v(e,t(337)),this[t(336)][t(344)][t(342)](t(327)).to(this),this[t(344)][t(330)](this[t(336)])}[K(345)](){const e=K;let t=0;for(const n of this[e(344)])t+=n[e(344)][e(343)];return{resultsCount:t,totalItemsCount:t}}[K(339)](){const e=K,t=this[e(338)],n=new s.ButtonView(this[e(338)]);return n[e(326)]({label:"("+v(t,e(340))+")",withText:!0}),n.on(e(327),()=>this[e(341)](e(335))),n}}const X={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};function Z(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(Z).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function ee(e){return function(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>X[e]||"'")}(Z(e))}function te(e,t){const n=re();return(te=function(e,t){return n[e-=246]})(e,t)}!function(e){const t=te,n=e();for(;;)try{if(345987===-parseInt(t(258))/1*(parseInt(t(251))/2)+-parseInt(t(254))/3+-parseInt(t(253))/4+-parseInt(t(255))/5+-parseInt(t(261))/6*(parseInt(t(256))/7)+parseInt(t(249))/8*(parseInt(t(262))/9)+parseInt(t(250))/10*(parseInt(t(247))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(re);class ne extends s.ListItemView{constructor(e){const t=te;super();const n=new s.ButtonLabelView,r=new s.ButtonView(this[t(259)],n);this[t(246)][t(257)](r),r[t(263)]({label:e[t(248)],withText:!0}),r.on(t(252),()=>{const n=t;this[n(260)](n(252),{value:ee(e[n(248)])})})}}function re(){const e=["1547316VIIDKY","1710462CdDejV","3193245SElzAX","7faZJnM","add","2UvrNtW","locale","fire","2038098hWiuqU","20673cqhyUv","set","children","11qTbVTG","prompt","1664ihZdrj","20437580bByLVs","240232QqMRuv","execute"];return(re=function(){return e})()}function ie(){const e=["addMany","1730118xIbRlX","remove","setItem","parse","trim","_saveToSessionStorage","prompt","length","199jkZANP","487998DwQKmA","last","toLowerCase","484sDVgZL","map","1802508vmeOLl","CKEditor/AIFormView/PromptHistory","473732odyAXS","add","1366296TajDQr","_loadFromSessionStorage","getItem","250240gLrITh","stringify"];return(ie=function(){return e})()}function se(e,t){const n=ie();return(se=function(e,t){return n[e-=373]})(e,t)}const oe=se;!function(e){const t=se,n=e();for(;;)try{if(497684===parseInt(t(384))/1*(-parseInt(t(388))/2)+parseInt(t(376))/3+parseInt(t(392))/4+parseInt(t(373))/5+-parseInt(t(390))/6+-parseInt(t(385))/7+parseInt(t(394))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ie);const ae=oe(391);class ce extends i.Collection{constructor(){const e=oe;super(),this[e(395)](),this.on(e(393),(t,n)=>{const r=e,i=ue(n[r(382)]);for(const e of this)if(e!=n&&ue(e[r(382)])===i){this[r(377)](e);break}this[r(383)]>20&&this[r(377)](this[r(386)]),this[r(381)]()}),this.on(e(377),()=>{this[e(381)]()})}[oe(395)](){const e=oe,t=sessionStorage[e(396)](ae)||"[]";this[e(375)](JSON[e(379)](t))}[oe(381)](){const e=oe;sessionStorage[e(378)](ae,JSON[e(374)](this[e(389)](e=>e)))}}function ue(e){const t=oe;return e[t(387)]()[t(380)]()}const de={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function le(e){return Z(e).replace(/[&<>"']/g,e=>de[e])}const he=pe;function fe(){const e=["submitPrompt","prompt","_focusables","769164znZCYA","locale","REPLACE","search","promptView","53919HdJmTD","4911951BbtIGV","Empty history","historyGroupView","errorView","element","insertButton","isError","keystrokes","text","setTemplate","stopProcessing","contentArea","2619071VcufcJ","items","listenTo","Ask AI to improve generated text","execute","1482864WpSPXk","delegate","isVisible","toolbar","AI_ERROR_FAILED","12pCTAkU","add","fire","focusCycler","bindTo","startProcessing","copyButtonView","reset","shift + tab","focus","insertContentBelow","264tKAhco","stopButton","_createToolbar","set","high","clearHistory","10FhCaMN","1380735JReDtF","ck-ai-form","chain","replaceButton","bind","div","focusFirst","finishProcessing","isEnabled","_createHistoryView","mainAction","Ask AI to edit or generate","createCollection","tryAgainEvent","_createPromptView","queryView","submit","ck-hidden","_promptHistory","label","render","tab","bindTemplate","isProcessing","handleError","focusTracker","clear","value","fieldView","ck-ai-form-content","focusLast","trim","20HXDxfR","tryAgainButton","63689zVnPek","replaceContent","Ask AI and your prompts will be listed here for you to use later."];return(fe=function(){return e})()}function pe(e,t){const n=fe();return(pe=function(e,t){return n[e-=301]})(e,t)}!function(e){const t=pe,n=e();for(;;)try{if(554864===parseInt(t(385))/1*(-parseInt(t(350))/2)+parseInt(t(328))/3+-parseInt(t(333))/4*(-parseInt(t(351))/5)+-parseInt(t(305))/6+parseInt(t(323))/7+parseInt(t(344))/8*(parseInt(t(310))/9)+parseInt(t(383))/10*(-parseInt(t(311))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(fe);class me extends s.View{[he(376)];[he(318)];[he(322)];[he(331)];[he(309)];[he(314)];[he(304)];[he(336)];[he(369)];constructor(e,t,n=""){const r=he;super(e),this[r(347)](r(359),!0),this[r(347)](r(374),!1),this[r(347)](r(303),""),this[r(347)](r(378),""),this[r(347)](r(317),!1),this[r(347)](r(361),N[r(307)]),this[r(369)]=new ce,this[r(314)]=new j(e),this[r(322)]=new F(e,n),this[r(322)][r(355)](r(374)).to(this),this[r(322)][r(355)](r(378)).to(this),this[r(331)]=this[r(346)](),this[r(331)][r(355)](r(361)).to(this),this[r(309)]=this[r(365)](),this[r(376)]=new i.FocusTracker,this[r(318)]=new i.KeystrokeHandler,this[r(304)]=this[r(363)]([this[r(322)],this[r(322)][r(339)],this[r(331)],this[r(309)]]),this[r(336)]=new s.FocusCycler({focusables:this[r(304)],focusTracker:this[r(376)],keystrokeHandler:this[r(318)],actions:{focusPrevious:r(341),focusNext:r(372)}}),this[r(336)][r(353)](this[r(309)][r(336)]),this[r(309)][r(366)][r(379)][r(355)](r(378)).to(this,r(303));const o=this[r(373)];this[r(320)]({tag:r(356),attributes:{class:["ck",r(352),t],tabindex:"-1"},children:[{tag:r(356),attributes:{class:["ck",r(380)]},children:[{tag:r(356),attributes:{class:[o.if(r(317),r(368),e=>!e)]},children:[this[r(314)]]},this[r(322)],this[r(331)],this[r(309)]]}]})}[he(371)](){const e=he;super[e(371)](),this[e(376)][e(334)](this[e(322)][e(315)]),this[e(376)][e(334)](this[e(322)][e(339)][e(315)]),this[e(376)][e(334)](this[e(331)][e(315)]),this[e(376)][e(334)](this[e(309)][e(315)]),this[e(318)][e(325)](this[e(315)])}[he(342)](e=1){const t=he;-1===e?this[t(336)][t(381)]():this[t(336)][t(357)]()}[he(340)](){const e=he;this[e(303)]="",this[e(378)]="",this[e(317)]=!1,this[e(309)][e(340)](),this[e(322)][e(330)]=!1,this[e(331)][e(330)]=!1}[he(365)](){const e=he,t=this[e(306)],n=new W(t,{queryView:{label:v(t,e(362)),creator:s.createLabeledTextarea,showIcon:!1,showResetButton:!1},infoView:{text:{noSearchableItems:{primary:v(t,e(312)),secondary:v(t,e(301))}}},filteredView:this[e(360)](),queryMinChars:1/0,resetOnBlur:!1});return n[e(355)](e(359)).to(this,e(359),this,e(374),(e,t)=>e&&!t),this[e(325)](n,e(367),(t,n)=>{const r=e;this[r(303)]=n;const i=le(n);this[r(335)](r(302),i),n[r(382)]()&&this[r(369)][r(334)]({prompt:i},0)},{priority:e(348)}),n}[he(360)](){const e=he,t=new Q(this[e(306)]);return t[e(313)][e(324)][e(337)](this[e(369)]).as(ne),t.on(e(349),()=>{const t=e;this[t(369)][t(377)](),this[t(309)][t(308)](""),this[t(309)][t(342)]()}),t}[he(346)](){const e=he,t=new L(this[e(306)]);return t[e(354)][e(355)](e(359)).to(this,e(359),this,e(374),this,e(378),(e,t,n)=>e&&!t&&!!n),t[e(354)][e(329)](e(327)).to(this,e(386)),t[e(316)][e(355)](e(359)).to(this,e(359),this,e(374),this,e(378),(e,t,n)=>e&&!t&&!!n),t[e(316)][e(329)](e(327)).to(this,e(343)),t[e(384)][e(355)](e(359)).to(this,e(359),this,e(374),(e,t)=>e&&!t),t[e(384)][e(329)](e(327)).to(this,e(364)),t[e(345)][e(355)](e(359)).to(this,e(374)),t[e(345)][e(329)](e(327)).to(this,e(321)),t}[he(338)](){const e=he;this[e(378)]="",this[e(317)]=!1,this[e(374)]=!0,this[e(322)][e(330)]=!0,this[e(331)][e(330)]=!0,this[e(322)][e(342)]()}[he(358)](){const e=he,t=this[e(306)];this[e(374)]=!1,this[e(303)]="",this[e(309)][e(340)](),this[e(378)]&&(this[e(309)][e(366)][e(370)]=v(t,e(326)))}[he(375)](e){const t=he,n=this[t(306)];this[t(358)](),this[t(317)]=!0,this[t(314)][t(319)]=e||v(n,t(332)),this[t(378)]||(this[t(322)][t(330)]=!1)}}var ge=n(673),ye=n.n(ge),we=n(545),be=n.n(we),ve=n(262),ke=n.n(ve),Se=n(667),Ee=n.n(Se),Ae=n(357),Ie=n.n(Ae),_e=n(379),xe={attributes:{"data-cke":!0}};xe.setAttributes=Ee(),xe.insert=ke().bind(null,"head"),xe.domAPI=be(),xe.insertStyleElement=Ie();ye()(_e.A,xe);_e.A&&_e.A.locals&&_e.A.locals;var Re=n(181),Ce={attributes:{"data-cke":!0}};Ce.setAttributes=Ee(),Ce.insert=ke().bind(null,"head"),Ce.domAPI=be(),Ce.insertStyleElement=Ie();ye()(Re.A,Ce);Re.A&&Re.A.locals&&Re.A.locals;var Me=n(676),Pe={attributes:{"data-cke":!0}};Pe.setAttributes=Ee(),Pe.insert=ke().bind(null,"head"),Pe.domAPI=be(),Pe.insertStyleElement=Ie();ye()(Me.A,Pe);Me.A&&Me.A.locals&&Me.A.locals;const Te=Oe;function Oe(e,t){const n=Le();return(Oe=function(e,t){return n[e-=239]})(e,t)}!function(e){const t=Oe,n=e();for(;;)try{if(599922===parseInt(t(411))/1*(parseInt(t(242))/2)+-parseInt(t(330))/3*(-parseInt(t(355))/4)+-parseInt(t(308))/5+parseInt(t(253))/6+-parseInt(t(404))/7+parseInt(t(240))/8+-parseInt(t(349))/9*(-parseInt(t(351))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Le);const Ne=globalThis[Te(348)];function Le(){const e=["forEach","hide","bind","_getResolvedCommandsDefinitions","ai.useTheme","menuPanelClass","</p>","groupId","_populateMenuBarMenu","enabledCommandsIds","plugins","usageLimit","custom","buttonView","commands","items","isCollapsed","currentContext","aiLicenseKeyValid","_getMenuBarGroupButtons","menuView","wasMoved","values","panelView","fire","featureNotAllowed","map","showAIAssistant","init","_dialog","domainLimit","sort","polite","getSelectedBlocks","isFlat","_initView","define","aiLicenseKeyTrialLimit","document","_createAIAssistantUIButton","textAdapter","_uiCssClasses","updatePosition","AI Commands","rawHtml","replace","AIAssistant","set","config","pluginName","Error during AI content generation: %0","show","trialLimit","3469815OHIWhZ","media","model","_forceMarkersCopy","comment"," ck-ai-assistant-ui_theme","getLimitElement","editing","schema","componentFactory","trim","AI Assistant","add","reset","change:isProcessing","updateView","_licenseKeyCheckInterval","listenTo","tableOfContents","requiresContent","showUI","change:value","12THCinv","push","execute","insertContentBelow","aiLicenseKeyUsageLimit","licenseKey","body","text/html","children","<p>","ai.aiAssistant.commands","Generated content: %0","isOn","aiLicenseKeyDomainLimit","addMany","_onExecute","replaceContent","splice","DataTransfer","12222zSBNDP","render","10XyzPbX","menuitemcheckbox","INSERT","copy","248116sYKwtr","change:enabledCommandsIds","errorView","aiLicenseKeyNotAllowed","REPLACE","ai-commands-config-order-collision","aiLicenseKeyInvalid","requires","selection","isEnabled","aiLicenseKeyEvaluationLimit","from","getSelectedElement","order","_commandDefinitions","contentArea","_initAriaAiStatusChangeAnnouncements","ck-ai-commands-dropdown ","change","delegate","invalid","fieldView","ck-ai-assistant-button ","text","_aiAssistantController","_aiAdapter","length","aiCommands","AIAssistantUI","showFakeVisualSelection","filter","menuBar:aiCommands","includes","isPremiumPlugin","destroy","label","queryView","hideFakeVisualSelection","EDITOR_TOP_SIDE","once","setSelection","ck-ai-assistant-ui","AI is writing","expired","aiLicenseKeyExpired","_showLicenseError","menuBar:aiAssistant","getRanges","prompt","7966168HvKOOl","source","locale","groupLabel","evaluationLimit","get","promptView","1102642LDnZov","ai.aiAssistant.contentAreaCssClass","change:isError","_formView","hideUI","784280EpcwIc","announce","2NeEPFJ","command:","insertContent","view","ai.aiAssistant.disabledElements","update","buttons","focus","aiAssistant","getData","editor","5890548MpBKSt","isOfficialPlugin"];return(Le=function(){return e})()}class $e extends e.Plugin{[Te(335)];[Te(324)];[Te(284)];[Te(414)];[Te(380)];[Te(379)];[Te(296)]="";static get[Te(304)](){return Te(383)}static get[Te(254)](){return!0}static get[Te(388)](){return!0}static get[Te(362)](){return[a.ClipboardMarkersUtils,f,w,s.Dialog]}constructor(e){const t=Te;super(e),e[t(303)][t(291)](t(246),[t(309),t(299),t(326)]),e[t(303)][t(291)](t(412),""),e[t(303)][t(291)](t(259),!0),this[t(296)]=t(396)+(e[t(303)][t(409)](t(259))?t(313):"")}[Te(283)](){const e=Te,{editor:n}=this;this[e(380)]=n[e(265)][e(409)](w),this[e(284)]=n[e(265)][e(409)](s.Dialog),this[e(414)]=null,this[e(369)]=this[e(258)]();const r=new A(n,Array[e(366)](this[e(369)][e(277)]()));n[e(269)][e(320)](e(282),r),n.ui[e(317)][e(320)](e(382),i=>{const a=e,c=(0,s.createDropdown)(i);return c[a(302)]({class:a(372)+this[a(296)]}),c[a(268)][a(302)]({label:v(i,a(298)),icon:t.IconMagicWand,tooltip:!0}),c.on(a(332),e=>this[a(345)](e[a(405)].id)),(0,s.addMenuToDropdown)(c,n.ui[a(245)][a(336)],function(e){const t=a,n=o(e[t(303)][t(409)](t(340)),e[t(406)]),r=Fe(e,n)[t(385)](e=>e[t(269)][t(381)]);return 1===r[t(381)]?Fe(e,r[0][t(269)])[t(281)](e=>({id:e.id,label:e[t(390)]})):r[t(281)](n=>{const r=t,{groupId:i,groupLabel:s,commands:o}=n;return{id:i,menu:s||i,children:Fe(e,o)[r(281)](e=>({id:e.id,label:e[r(390)]}))}})}(n),{ariaLabel:v(i,a(298))}),c[a(275)][a(260)]=a(372)+this[a(296)],r.on(a(356),u),c[a(275)][a(394)](a(350),u),c;function u(){const e=a;c[e(364)]=r[e(264)][e(381)]>0;for(const t of c[e(275)][e(248)])t[e(364)]=r[e(264)][e(387)](t.id)}}),n.ui[e(317)][e(320)](e(386),i=>{const a=e,c=new s.MenuBarMenuView(i);c[a(268)][a(302)]({label:v(i,a(298)),icon:t.IconMagicWand}),c[a(257)](a(364)).to(r,a(264),e=>e[a(381)]>0);const u=o(n[a(303)][a(409)](a(340)),i);return this[a(263)](r,c,u,e=>this[a(345)](e)),c}),n.ui[e(317)][e(320)](e(250),()=>{const t=e,n=this[t(294)](s.ButtonView);return n[t(302)]({tooltip:!0,class:t(377)+this[t(296)]}),n}),n.ui[e(317)][e(320)](e(401),()=>{const t=e,n=this[t(294)](s.MenuBarMenuListItemButtonView);return n[t(302)]({role:t(352)}),n}),this[e(335)]=this[e(252)][e(303)][e(409)](e(335));const i=this[e(252)];this[e(324)]=setInterval(()=>{const t=e;let n;for(const e in i){const r=e,s=i[r];if(t(273)==s||t(361)==s||t(399)==s||t(343)==s||t(358)==s||t(365)==s||t(292)==s||t(334)==s){delete i[r],n=s,clearInterval(this[t(324)]),this[t(324)]=void 0;break}}t(361)==n&&i[t(400)](t(375)),t(399)==n&&i[t(400)](t(398)),t(343)==n&&i[t(400)](t(285)),t(358)==n&&i[t(400)](t(280),t(301)),t(365)==n&&i[t(400)](t(408)),t(292)==n&&i[t(400)](t(307)),t(334)==n&&i[t(400)](t(266))},1e3)}[Te(389)](){const e=Te;super[e(389)](),this[e(324)]&&clearInterval(this[e(324)])}[Te(328)](e="",n="",r=Te(267)){const i=Te,o=this[i(252)],u=o[i(315)][i(245)],d=o[i(265)][i(409)](f),l=o[i(265)][i(409)](a.ClipboardMarkersUtils);d[i(384)]();const h=new Ne,p=new ClipboardEvent(i(354),{clipboardData:h}),m=new c.ViewDataTransfer(h),g=new c.ViewDocumentDomEventData(u,p,{dataTransfer:m});l[i(311)](i(312),()=>{const e=i;u[e(293)][e(279)](e(354),g)}),this[i(414)]||(this[i(290)](),this[i(379)]=new M(o,this[i(380)][i(295)],this[i(414)]));let y=m[i(251)](i(337));const w=o[i(310)][i(293)][i(363)],b=Array[i(366)](w[i(402)]());1===b[i(381)]&&b[0][i(289)]&&!w[i(367)]()&&""!==y[i(300)](/&nbsp;/g,"")[i(318)]()&&(y=i(339)+y+i(261)),this[i(379)][i(323)]({actionId:r,query:e,htmlContent:y,label:n,mainActionLabel:N[o[i(310)][i(293)][i(363)][i(271)]?i(353):i(359)]}),i(250)!==this[i(284)].id?this[i(284)][i(306)]({id:i(250),icon:t.IconRobotPencil,title:v(this[i(252)][i(406)],i(319)),content:this[i(414)],position:s.DialogViewPosition[i(393)],onShow:()=>{const e=i;this[e(414)][e(249)]()},onHide:()=>{const e=i;this[e(379)][e(321)](),d[e(392)]()}}):this[i(284)][i(245)][i(276)]||this[i(284)][i(245)][i(297)]()}[Te(239)](){const e=Te;this[e(284)][e(256)]()}[Te(258)](){const e=Te,t=new Map,n=o(this[e(252)][e(303)][e(409)](e(340)),this[e(252)][e(406)]);for(const r of n)for(const n of r[e(269)])t[e(302)](n.id,{...n,groupId:r[e(262)],groupLabel:r[e(407)]||r[e(262)]});return t}[Te(294)](e){const n=Te,r=this[n(252)],i=r[n(269)][n(409)](n(282)),s=new e(r[n(406)]);return s[n(302)]({label:v(r[n(406)],n(319)),icon:t.IconRobotPencil,isToggleable:!0}),s[n(257)](n(364)).to(i),s[n(257)](n(342)).to(this[n(284)],"id",e=>n(250)===e),this[n(325)](s,n(332),()=>{const e=n;s[e(342)]?this[e(239)]():i[e(332)]()}),s}[Te(290)](){const e=Te,t=this[e(252)][e(265)][e(409)](f);this[e(414)]=new me(this[e(252)][e(406)],this[e(296)],this[e(252)][e(303)][e(409)](e(412))),this[e(414)].on(e(329),()=>{const t=e;this[t(284)][t(245)][t(276)]||this[t(284)][t(245)][t(297)]()}),this[e(414)][e(410)][e(391)][e(376)].on(e(247),()=>{const t=e;this[t(284)][t(245)][t(276)]||this[t(284)][t(245)][t(297)]()}),this[e(325)](this[e(414)],e(346),()=>{const n=e;t[n(244)](this[n(379)][n(272)]),this[n(239)]()}),this[e(325)](this[e(414)],e(333),()=>{const n=e;t[n(333)](this[n(379)][n(272)]),this[n(239)]()}),this[e(371)]()}[Te(371)](){const e=Te,{locale:t,ui:{ariaLiveAnnouncer:n}}=this[e(252)];this[e(414)][e(370)].on(e(322),(r,i,s)=>{const o=e,a=this[o(379)][o(272)];s?n[o(241)](v(t,o(397))):a&&n[o(241)](v(t,o(341),a),{politeness:o(287),isUnsafeHTML:!0})}),this[e(414)].on(e(413),(r,i,s)=>{const o=e;if(s){const e=this[o(414)][o(357)][o(378)];n[o(241)](v(t,o(305),e))}})}[Te(345)](e){const t=Te,n=this[t(369)][t(409)](e),r=this[t(252)],s=r[t(310)][t(293)][t(363)],o=r[t(269)][t(409)](t(282)),a=r[t(265)][t(409)](f),c=("_ungrouppedCommands"!==n[t(262)]?n[t(407)]+": ":"")+n[t(390)];if(!1!==n[t(327)]&&s[t(271)]){const e=(0,i.first)(s[t(288)]())||r[t(310)][t(316)][t(314)](s);r[t(310)][t(373)](n=>{n[t(395)](e,"in")})}a[t(384)](),o[t(332)](n[t(403)],c,t(243)+e)}[Te(263)](e,t,n,r){const i=Te,o=this[i(252)],a=o[i(406)],c=new s.MenuBarMenuListView(a),u=Fe(o,n)[i(385)](e=>e[i(269)][i(381)]);1===u[i(381)]?this[i(274)]({command:e,commands:u[0][i(269)],parentMenuView:t,onExecute:r})[i(255)](e=>c[i(270)][i(320)](e)):u[i(255)](({groupId:n,groupLabel:o,commands:u})=>{const d=i,l=new s.MenuBarMenuListItemView(a,t),h=new s.MenuBarMenuView(a),f=new s.MenuBarMenuListView(a),p=this[d(274)]({command:e,commands:u,parentMenuView:h,onExecute:r});h[d(268)][d(302)]({label:o||n}),h[d(374)](d(332)).to(t),f[d(270)][d(344)](p),h[d(278)][d(338)][d(320)](f),l[d(338)][d(320)](h),c[d(270)][d(320)](l)}),t[i(278)][i(338)][i(320)](c)}[Te(274)]({command:e,commands:t,parentMenuView:n,onExecute:r}){const i=Te,o=this[i(252)],a=o[i(406)];return Fe(o,t)[i(281)](t=>{const o=i,c=new s.MenuBarMenuListItemView(a,n),u=new s.MenuBarMenuListItemButtonView(a);return u[o(302)]({label:t[o(390)]}),u[o(374)](o(332)).to(n),u.on(o(332),()=>r(t.id)),u[o(257)](o(364)).to(e,o(264),e=>e[o(387)](t.id)),c[o(338)][o(320)](u),c})}}function De(e,t){const n=Te;return void 0!==e[n(368)]&&void 0===t[n(368)]?1:void 0===e[n(368)]&&void 0!==t[n(368)]?-1:void 0!==e[n(368)]&&void 0!==t[n(368)]?e[n(368)]-t[n(368)]:0}function Fe(e,t){const n=Te;t[n(286)](De);const r={},s=[];for(const o of t)if(void 0!==o[n(368)]){if(o[n(368)]in r)throw new i.CKEditorError(n(360),e,{conflictingDefinitions:[o,r[o[n(368)]]]});r[o[n(368)]]=o,s[n(347)](o[n(368)],0,o)}else s[n(331)](o);return s}function Ue(){const e=["Remove any repetitive, redundant, or non-essential writing in this content without changing the meaning or losing any key information.","set","Casual","Improve using direct language, using only the essential information.","Translate the content to German language.","2MXbgZx","groupId","commands","2774110MmaDxQ","726976gbvqZx","journalism","Professional","Poetic","get","isPremiumPlugin","German","makeShorter","Journalism","pluginName","10554040yuHjLO","French","confident","ai.aiAssistant.removeCommands","Start with the provided content and write at the end of it continuing this topic. Keep the added part short.","Summarize this content into one paragraph of text. Include only the key ideas and conclusions. Keep it short. Do not keep original text formatting.","business","Rewrite this content as a journalist using engaging language to convey the importance of the information.","Translate the content to Arabic language.","Translate the content to French language.","Make longer","450495zwhaHu","translateChinese","locale","Translate the content to Hindi language.","Rewrite this content as a legal professional using valid legal terminology.","Portuguese","editOrReview","Improve this content by using descriptive language and inserting more information and more detailed explanations.","ai.aiAssistant.extraCommandGroups","AIAssistant","Business","define","professional","5149911FfZRPX","generate","Friendly","Rewrite this content as a poem using poetic techniques without losing the original meaning.","Arabic","Legal","Summarize","Improve using friendly, comforting language, to convey understanding and empathy.","includes","push","ai.aiAssistant.commands","translateEnglish","5pJioiy","Improve using compelling, optimistic language to convey confidence in the writing.","makeLonger","improveWriting","ai.aiAssistant.preserveComments","Translate the content to Spanish language.","Make shorter","concat","requires","translateFrench","Continue","poetic","translateSpanish","Translate","Direct","changeTone","Fix spelling mistakes, use proper grammar and apply good writing practices. Do not lose the original meaning.","filter","isOfficialPlugin","config","translateHindi","2957672SeYeWD","simplifyLanguage","77aKsbeI","Edit or review","Hindi","English","friendly","continue","Improve using polished, formal, and respectful language to convey professional expertise and competence.","summarize","casual","Confident","find","Simplified Chinese","translateArabic","changeStyle","direct","forEach","translatePortuguese","Rewrite this content as a business professional with formal language.","Change style","Translate the content to English language.","legal","4768638sBXtyy","Translate the content to Simplified Chinese language.","Improve writing","Translate the content to Portuguese language.","Generate from selection","Improve using casual, informal language to convey a casual conversation with a real person.","Simplify language","Simplify the writing style of this content and reduce the complexity, so that the content is easy to understand.","Spanish","Change tone","6RARvXH","translateGerman","translate"];return(Ue=function(){return e})()}const Be=je;function je(e,t){const n=Ue();return(je=function(e,t){return n[e-=478]})(e,t)}!function(e){const t=je,n=e();for(;;)try{if(925758===-parseInt(t(563))/1+-parseInt(t(559))/2*(parseInt(t(485))/3)+parseInt(t(518))/4*(parseInt(t(497))/5)+parseInt(t(551))/6*(-parseInt(t(541))/7)+parseInt(t(573))/8+parseInt(t(584))/9+-parseInt(t(562))/10*(-parseInt(t(520))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ue);class He extends e.Plugin{static get[Be(505)](){return[$e,f]}static get[Be(572)](){return Be(481)}static get[Be(515)](){return!0}static get[Be(568)](){return!0}constructor(e){const t=Be;super(e);const n=e[t(516)],r=e[t(586)];n[t(483)](t(501),!0),n[t(483)](t(495),qe(r)),n[t(483)](t(480),[]),n[t(483)](t(576),[]);let i=o(n[t(567)](t(495)),r);const s=n[t(567)](t(480)),a=n[t(567)](t(576));s[t(535)](e=>{const n=t,r=i[n(530)](t=>t[n(560)]===e[n(560)]);r?r[n(561)]=r[n(561)][n(504)](e[n(561)]):i[n(494)](e)}),i=i[t(514)](e=>!a[t(493)](e[t(560)])),i[t(535)](e=>{const n=t;e[n(561)]=e[n(561)][n(514)](e=>!a[n(493)](e.id))}),n[t(555)](t(495),i)}}function qe(e){const t=Be;return[{groupId:t(478),groupLabel:v(e,t(521)),commands:[{id:t(500),label:v(e,t(543)),prompt:t(513)},{id:t(570),label:v(e,t(503)),prompt:t(554)},{id:t(499),label:v(e,t(583)),prompt:t(479)},{id:t(519),label:v(e,t(547)),prompt:t(548)}]},{groupId:t(486),groupLabel:v(e,t(545)),commands:[{id:t(527),label:v(e,t(491)),prompt:t(578)},{id:t(525),label:v(e,t(507)),prompt:t(577)}]},{groupId:t(512),groupLabel:v(e,t(550)),commands:[{id:t(484),label:v(e,t(565)),prompt:t(526)},{id:t(528),label:v(e,t(556)),prompt:t(546)},{id:t(534),label:v(e,t(511)),prompt:t(557)},{id:t(575),label:v(e,t(529)),prompt:t(498)},{id:t(524),label:v(e,t(487)),prompt:t(492)}]},{groupId:t(533),groupLabel:v(e,t(538)),commands:[{id:t(579),label:v(e,t(482)),prompt:t(537)},{id:t(540),label:v(e,t(490)),prompt:t(588)},{id:t(564),label:v(e,t(571)),prompt:t(580)},{id:t(508),label:v(e,t(566)),prompt:t(488)}]},{groupId:t(553),groupLabel:v(e,t(510)),commands:[{id:t(496),label:v(e,t(523)),prompt:t(539)},{id:t(509),label:v(e,t(549)),prompt:t(502)},{id:t(536),label:v(e,t(589)),prompt:t(544)},{id:t(552),label:v(e,t(569)),prompt:t(558)},{id:t(506),label:v(e,t(574)),prompt:t(582)},{id:t(585),label:v(e,t(531)),prompt:t(542)},{id:t(517),label:v(e,t(522)),prompt:t(587)},{id:t(532),label:v(e,t(489)),prompt:t(581)}]}]}function ze(e,t){const n=Ge();return(ze=function(e,t){return n[e-=126]})(e,t)}const Ve=ze;function Ge(){const e=["makeRequest","textAdapter","602JLIdxB","abort","6421908hBKAsj","aborted","_prepareRequestHeaders","28038HcSppI","editor","signal","AbortError","_prepareRequestParameters","assign","init","name","aitextadapter-send-request-failed","2889210QWYuwK","sendRequest","35990GRMube","1900785afCsWS","object","6064440uDFeHc","catch","locale","11xOykjp","4TxJtVR","1908fSJEkE","application/json","error","382717EIYCDc","plugins","get","reject","abortController","AI_ERROR_GET_PARAMETERS","AI_ERROR_GET_HEADERS","resolve","requires","2gByPKZ"];return(Ge=function(){return e})()}!function(e){const t=ze,n=e();for(;;)try{if(465178===-parseInt(t(131))/1*(-parseInt(t(140))/2)+-parseInt(t(160))/3*(parseInt(t(127))/4)+parseInt(t(157))/5+-parseInt(t(148))/6*(parseInt(t(143))/7)+-parseInt(t(162))/8+parseInt(t(128))/9*(parseInt(t(159))/10)+-parseInt(t(126))/11*(-parseInt(t(145))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ge);class We extends e.Plugin{[Ve(135)];static get[Ve(139)](){return[w]}constructor(e){const t=Ve;super(e),this[t(135)]=new AbortController}[Ve(154)](){const e=Ve;this[e(149)][e(132)][e(133)](w)[e(142)]=this}[Ve(144)](){const e=Ve;this[e(135)][e(150)][e(146)]||(this[e(135)][e(144)](),this[e(135)]=new AbortController)}async[Ve(141)](e){const t=Ve;return this[t(158)](e)[t(163)](e=>{const n=t;if(e instanceof b)return Promise[n(134)](e);if(n(151)==e[n(155)])return Promise[n(138)]();throw console[n(130)](e),new i.CKEditorError(n(156),null)})}async[Ve(147)](e,t){const n=Ve,r=this[n(149)][n(164)],i={"Content-Type":n(129)};if(n(161)==typeof e)Object[n(153)](i,e);else if(e)try{const r=await e(t);Object[n(153)](i,r)}catch{return Promise[n(134)](new b(v(r,n(137))))}return i}async[Ve(152)](e,t){const n=Ve,r=this[n(149)][n(164)];if(n(161)==typeof e)return e;try{return await e(t)}catch{return Promise[n(134)](new b(v(r,n(136))))}}}const Ke=Ye;!function(e){const t=Ye,n=e();for(;;)try{if(170189===parseInt(t(531))/1*(-parseInt(t(516))/2)+parseInt(t(499))/3*(-parseInt(t(497))/4)+parseInt(t(491))/5+parseInt(t(501))/6+parseInt(t(490))/7+parseInt(t(522))/8+parseInt(t(532))/9*(-parseInt(t(506))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Qe);class Je extends We{[Ke(541)];[Ke(543)];[Ke(494)];static get[Ke(533)](){return Ke(510)}constructor(e){const t=Ke;super(e),e[t(548)][t(514)](t(498),t(544)),e[t(548)][t(512)](t(554))||e[t(548)][t(514)](t(554),{model:t(527),temperature:1,top_p:1,stream:!0}),this[t(541)]=e[t(548)][t(512)](t(498)),this[t(543)]=e[t(548)][t(512)](t(518))||{},this[t(494)]=e[t(548)][t(512)](t(554))}async[Ke(529)]({query:e,context:t,onData:n,actionId:r}){const i=Ke,s=this[i(552)][i(549)],o=await this[i(507)](e,t,r),a=await this[i(524)](this[i(543)],r),c=await this[i(550)](this[i(494)],r),u={messages:o,...c},d={method:i(508),headers:a,body:JSON[i(503)](u),signal:this[i(511)][i(523)]},l=await fetch(this[i(541)],d);if(l.ok)return c[i(513)]?await this[i(488)](l,n):await this[i(547)](l,n),Promise[i(536)]();{const e=await l[i(540)]();return e[i(519)](i(551))?Promise[i(517)](new b(v(s,i(496)))):e[i(519)](i(526))?Promise[i(517)](new b(v(s,i(528)))):Promise[i(517)](new Error(e))}}async[Ke(507)](e,t,n){const r=Ke;let i,s;return t?(i=r(515),s=r(492)+e+r(537)+t):(i=r(535),s=e),[{role:r(493),content:i},{role:r(502),content:s}]}async[Ke(488)](e,t){const n=Ke,r=e[n(553)][n(538)](),i=new TextDecoder;let s="",o="",a="",c=!1;for(;!c;){const{done:e,value:u}=await r[n(546)](),d=s+i[n(495)](u);let l="";c=e;try{l=this[n(500)](d),s=""}catch{s=d;continue}o+=l,!c&&this[n(525)](o)||o&&(a+=o,o="",t(a))}return Promise[n(536)]()}async[Ke(547)](e,t){const n=Ke;return t((await e[n(504)]())[n(556)][0][n(520)][n(509)]),Promise[n(536)]()}[Ke(525)](e){const t=Ke,n=e[t(557)]("<")[t(545)]!==e[t(557)](">")[t(545)],r=e[t(545)]<30;return n&&r}[Ke(500)](e){const t=Ke;return e[t(557)](/\n(?![^{]*\})/g)[t(505)](e=>e[t(539)](t(534),""))[t(542)](e=>e&&e[t(545)]>0&&t(489)!==e)[t(505)](e=>{const n=t,{choices:r}=JSON[n(530)](e);if(r[0]?.[n(521)]?.[n(509)])return r[0][n(521)][n(509)]})[t(542)](e=>e)[t(555)]("")}}function Ye(e,t){const n=Qe();return(Ye=function(e,t){return n[e-=488]})(e,t)}function Qe(){const e=["_readStreamableResponse","[DONE]","2156581fGsUcY","203645fcpxrY","Instruction:\n","system","_requestParameters","decode","AI_ERROR_CONTEXT_LENGTH","4sWylRw","ai.openAI.apiUrl","554961AtNPEL","_cleanUpData","352236SnnpeY","user","stringify","json","map","10mqrRpT","prepareMessages","POST","content","OpenAITextAdapter","abortController","get","stream","define","Your task is to execute the instruction using the provided HTML content. Follow the instruction closely. Your answer must be a properly formatted HTML code. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","570938LbcDPH","reject","ai.openAI.requestHeaders","includes","message","delta","2186120WBlvzc","signal","_prepareRequestHeaders","_isBufferIncomplete","Moderation","gpt-4o","AI_ERROR_MODERATION","sendRequest","parse","1AqVIAW","361242EABQZN","pluginName","data: ","Your task is to generate HTML content accordingly to the given instruction. Never include <img> tag in your response even if asked for. Your answer must be a well-structured and properly formatted HTML code. Answer only with the generated HTML content. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","resolve","\nYou must keep the text formatting.\n\nContent:\n","getReader","replace","text","_apiUrl","filter","_requestHeaders","https://api.openai.com/v1/chat/completions","length","read","_readStaticResponse","config","locale","_prepareRequestParameters","context_length_exceeded","editor","body","ai.openAI.requestParameters","join","choices","split"];return(Qe=function(){return e})()}class Xe{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new Xe({...e,headers:{...e.headers}});var n;return t.query&&(t.query=(n=t.query,Object.keys(n).reduce((e,t)=>{const r=n[t];return{...e,[t]:Array.isArray(r)?[...r]:r}},{}))),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return Xe.clone(this)}}const Ze={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},et=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!Xe.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),Ze)}}),tt={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},nt="X-Amzn-Trace-Id",rt={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},it=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{const{request:r}=n;if(!Xe.isInstance(r)||"node"!==e.runtime)return t(n);const i=Object.keys(r.headers??{}).find(e=>e.toLowerCase()===nt.toLowerCase())??nt;if(r.headers.hasOwnProperty(i))return t(n);const s=process.env.AWS_LAMBDA_FUNCTION_NAME,o=process.env._X_AMZN_TRACE_ID,a=e=>"string"==typeof e&&e.length>0;return a(s)&&a(o)&&(r.headers[nt]=o),t({...n,request:r})})(e),rt)}}),st=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t};const ot={},at=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),ct=(e,t=!1)=>{if(!t)return at.test(e);const n=e.split(".");for(const e of n)if(!ct(e))return!1;return!0},ut=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),dt=e=>ut.test(e)||e.startsWith("[")&&e.endsWith("]"),lt=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!lt(t))return!1;return!0}return!!ct(e)&&(!(e.length<3||e.length>63)&&(e===e.toLowerCase()&&!dt(e)))};let ht=JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","implicitGlobalRegion":"us-east-1","name":"aws","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"ap-northeast-1":{"description":"Asia Pacific (Tokyo)"},"ap-northeast-2":{"description":"Asia Pacific (Seoul)"},"ap-northeast-3":{"description":"Asia Pacific (Osaka)"},"ap-south-1":{"description":"Asia Pacific (Mumbai)"},"ap-south-2":{"description":"Asia Pacific (Hyderabad)"},"ap-southeast-1":{"description":"Asia Pacific (Singapore)"},"ap-southeast-2":{"description":"Asia Pacific (Sydney)"},"ap-southeast-3":{"description":"Asia Pacific (Jakarta)"},"ap-southeast-4":{"description":"Asia Pacific (Melbourne)"},"ap-southeast-5":{"description":"Asia Pacific (Malaysia)"},"ap-southeast-7":{"description":"Asia Pacific (Thailand)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"ca-west-1":{"description":"Canada West (Calgary)"},"eu-central-1":{"description":"Europe (Frankfurt)"},"eu-central-2":{"description":"Europe (Zurich)"},"eu-north-1":{"description":"Europe (Stockholm)"},"eu-south-1":{"description":"Europe (Milan)"},"eu-south-2":{"description":"Europe (Spain)"},"eu-west-1":{"description":"Europe (Ireland)"},"eu-west-2":{"description":"Europe (London)"},"eu-west-3":{"description":"Europe (Paris)"},"il-central-1":{"description":"Israel (Tel Aviv)"},"me-central-1":{"description":"Middle East (UAE)"},"me-south-1":{"description":"Middle East (Bahrain)"},"mx-central-1":{"description":"Mexico (Central)"},"sa-east-1":{"description":"South America (Sao Paulo)"},"us-east-1":{"description":"US East (N. Virginia)"},"us-east-2":{"description":"US East (Ohio)"},"us-west-1":{"description":"US West (N. California)"},"us-west-2":{"description":"US West (Oregon)"}}},{"id":"aws-cn","outputs":{"dnsSuffix":"amazonaws.com.cn","dualStackDnsSuffix":"api.amazonwebservices.com.cn","implicitGlobalRegion":"cn-northwest-1","name":"aws-cn","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^cn\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-cn-global":{"description":"AWS China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"id":"aws-us-gov","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","implicitGlobalRegion":"us-gov-west-1","name":"aws-us-gov","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-us-gov-global":{"description":"AWS GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","implicitGlobalRegion":"us-iso-east-1","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) global region"},"us-iso-east-1":{"description":"US ISO East"},"us-iso-west-1":{"description":"US ISO WEST"}}},{"id":"aws-iso-b","outputs":{"dnsSuffix":"sc2s.sgov.gov","dualStackDnsSuffix":"sc2s.sgov.gov","implicitGlobalRegion":"us-isob-east-1","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","implicitGlobalRegion":"eu-isoe-west-1","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-e-global":{"description":"AWS ISOE (Europe) global region"},"eu-isoe-west-1":{"description":"EU ISOE West"}}},{"id":"aws-iso-f","outputs":{"dnsSuffix":"csp.hci.ic.gov","dualStackDnsSuffix":"csp.hci.ic.gov","implicitGlobalRegion":"us-isof-south-1","name":"aws-iso-f","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-f-global":{"description":"AWS ISOF global region"},"us-isof-east-1":{"description":"US ISOF EAST"},"us-isof-south-1":{"description":"US ISOF SOUTH"}}},{"id":"aws-eusc","outputs":{"dnsSuffix":"amazonaws.eu","dualStackDnsSuffix":"amazonaws.eu","implicitGlobalRegion":"eusc-de-east-1","name":"aws-eusc","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eusc\\\\-(de)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"eusc-de-east-1":{"description":"EU (Germany)"}}}],"version":"1.1"}'),ft="";const pt={isVirtualHostableS3Bucket:lt,parseArn:e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,i,s,o,...a]=t;if("arn"!==n||""===r||""===i||""===a.join(":"))return null;return{partition:r,service:i,region:s,accountId:o,resourceId:a.map(e=>e.split("/")).flat()}},partition:e=>{const{partitions:t}=ht;for(const n of t){const{regions:t,outputs:r}=n;for(const[n,i]of Object.entries(t))if(n===e)return{...r,...i}}for(const n of t){const{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}const n=t.find(e=>"aws"===e.id);if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}}};function mt(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}ot.aws=pt;const gt=/\d{12}\.ddb/;const yt="user-agent",wt="x-amz-user-agent",bt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,vt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;const kt=e=>(t,n)=>async r=>{const{request:i}=r;if(!Xe.isInstance(i))return t(r);const{headers:s}=i,o=n?.userAgent?.map(St)||[],a=(await e.defaultUserAgentProvider()).map(St);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&mt(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();"function"==typeof n.acquireInitialRetryToken?n.constructor?.name?.includes("Adaptive")?mt(e,"RETRY_MODE_ADAPTIVE","F"):mt(e,"RETRY_MODE_STANDARD","E"):mt(e,"RETRY_MODE_LEGACY","D")}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(gt)&&mt(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":mt(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":mt(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":mt(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const t=i;t.accountId&&mt(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))mt(e,n,r)}}(n,e,r);const c=n;a.push(`m/${function(e){let t="";for(const n in e){const r=e[n];if(!(t.length+r.length+1<=1024))break;t.length?t+=","+r:t+=r}return t}(Object.assign({},n.__smithy_context?.features,c.__aws_sdk_context?.features))}`);const u=e?.customUserAgent?.map(St)||[],d=await e.userAgentAppId();d&&a.push(St([`app/${d}`]));const l=(ft?[ft]:[]).concat([...a,...o,...u]).join(" "),h=[...a.filter(e=>e.startsWith("aws-sdk-")),...u].join(" ");return"browser"!==e.runtime?(h&&(s[wt]=s[wt]?`${s[yt]} ${h}`:h),s[yt]=l):s[wt]=l,t({...r,request:i})},St=e=>{const t=e[0].split("/").map(e=>e.replace(bt,"-")).join("/"),n=e[1]?.replace(vt,"-"),r=t.indexOf("/"),i=t.substring(0,r);let s=t.substring(r+1);return"api"===i&&(s=s.toLowerCase()),[i,s,n].filter(e=>e&&e.length>0).reduce((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}},"")},Et={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},At=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),It=e=>At(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,_t="__smithy_context",xt=e=>e[_t]||(e[_t]={});const Rt=(e,t)=>(n,r)=>async i=>{const s=((e,t)=>{if(!t||0===t.length)return e;const n=[];for(const r of t)for(const t of e)t.schemeId.split("#")[1]===r&&n.push(t);for(const t of e)n.find(({schemeId:e})=>e===t.schemeId)||n.push(t);return n})(e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),e.authSchemePreference?await e.authSchemePreference():[]),o=function(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}(e.httpAuthSchemes),a=xt(r),c=[];for(const n of s){const i=o.get(n.schemeId);if(!i){c.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}const s=i.identityProvider(await t.identityProviderConfigProvider(e));if(!s){c.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:u={},signingProperties:d={}}=n.propertiesExtractor?.(e,r)||{};n.identityProperties=Object.assign(n.identityProperties||{},u),n.signingProperties=Object.assign(n.signingProperties||{},d),a.selectedHttpAuthScheme={httpAuthOption:n,identity:await s(n.identityProperties),signer:i.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(c.join("\n"));return n(i)},Ct={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};class Mt{constructor(e){this.authSchemes=new Map;for(const[t,n]of Object.entries(e))void 0!==n&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}const Pt=e=>e=>{throw e},Tt=(e,t)=>{},Ot={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Nt=e=>({applyToStack:e=>{e.addRelativeTo((e,t)=>async n=>{if(!Xe.isInstance(n.request))return e(n);const r=xt(t).selectedHttpAuthScheme;if(!r)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:s,signer:o}=r,a=await e({...n,request:await o.sign(n.request,s,i)}).catch((o.errorHandler||Pt)(i));return(o.successHandler||Tt)(a.response,i),a},Ot)}}),Lt="content-length";const $t={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Dt=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(Xe.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(Lt))try{const t=n(e);r.headers={...r.headers,[Lt]:String(t)}}catch(e){}}return e({...t,request:r})}),$t)}}),Ft=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},Ut=async e=>{};const Bt=e=>{if("string"==typeof e)return Bt(new URL(e));const{hostname:t,pathname:n,port:r,protocol:i,search:s}=e;let o;return s&&(o=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(s)),{hostname:t,port:r?parseInt(r):void 0,protocol:i,path:n,query:o}},jt=e=>"object"==typeof e?"url"in e?Bt(e.url):e:Bt(e);var Ht;!function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(Ht||(Ht={}));const qt=Ht.STANDARD,zt=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Vt=["TimeoutError","RequestTimeout","RequestTimeoutException"],Gt=[500,502,503,504],Wt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Kt=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],Jt=e=>429===e.$metadata?.httpStatusCode||zt.includes(e.name)||1==e.$retryable?.throttling,Yt=(e,t=0)=>(e=>e.$metadata?.clockSkewCorrected)(e)||Vt.includes(e.name)||Wt.includes(e?.code||"")||Kt.includes(e?.code||"")||Gt.includes(e.$metadata?.httpStatusCode||0)||(e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return!!(e&&e instanceof TypeError)&&t.has(e.message)})(e)||void 0!==e.cause&&t<=10&&Yt(e.cause,t+1);class Qt{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(e=>Qt.setTimeoutFn(e,t))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),Jt(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}Qt.setTimeoutFn=setTimeout;const Xt=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(2e4,e),getRetryCost:()=>n});class Zt{constructor(e){this.maxAttempts=e,this.mode=Ht.STANDARD,this.capacity=500,this.retryBackoffStrategy=(()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(2e4,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})(),this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return Xt({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n)){const n=t.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===n?500:100);const r=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),i=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,r):r,s=this.getCapacityCost(n);return this.capacity-=s,Xt({retryDelay:i,retryCount:e.getRetryCount()+1,retryCost:s})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return"TRANSIENT"===e?10:5}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}class en{constructor(e,t){this.maxAttemptsProvider=e,this.mode=Ht.ADAPTIVE;const{rateLimiter:n}=t??{};this.rateLimiter=n??new Qt,this.standardRetryStrategy=new Zt(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}class tn{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}class nn{trace(){}debug(){}info(){}warn(){}error(){}}const rn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let sn;const on=new Uint8Array(16);function an(){if(!sn&&(sn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!sn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return sn(on)}const cn=[];for(let e=0;e<256;++e)cn.push((e+256).toString(16).slice(1));function un(e,t=0){return cn[e[t+0]]+cn[e[t+1]]+cn[e[t+2]]+cn[e[t+3]]+"-"+cn[e[t+4]]+cn[e[t+5]]+"-"+cn[e[t+6]]+cn[e[t+7]]+"-"+cn[e[t+8]]+cn[e[t+9]]+"-"+cn[e[t+10]]+cn[e[t+11]]+cn[e[t+12]]+cn[e[t+13]]+cn[e[t+14]]+cn[e[t+15]]}const dn=function(e,t,n){if(rn.randomUUID&&!t&&!e)return rn.randomUUID();const r=(e=e||{}).random||(e.rng||an)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return un(r)},ln=e=>e?.body instanceof ReadableStream,hn=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),fn=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,pn=e=>{const t={error:e,errorType:mn(e)},n=wn(e.$response);return n&&(t.retryAfterHint=n),t},mn=e=>Jt(e)?"THROTTLING":Yt(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!Yt(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",gn={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},yn=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let i=await e.retryStrategy();const s=await e.maxAttempts();if(!fn(i))return i?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,r);{let e=await i.acquireInitialRetryToken(n.partition_id),o=new Error,a=0,c=0;const{request:u}=r,d=Xe.isInstance(u);for(d&&(u.headers["amz-sdk-invocation-id"]=dn());;)try{d&&(u.headers["amz-sdk-request"]=`attempt=${a+1}; max=${s}`);const{response:n,output:o}=await t(r);return i.recordSuccess(e),o.$metadata.attempts=a+1,o.$metadata.totalRetryDelay=c,{response:n,output:o}}catch(t){const r=pn(t);if(o=hn(t),d&&ln(u))throw(n.logger instanceof nn?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),o;try{e=await i.refreshRetryTokenForRetry(e,r)}catch(e){throw o.$metadata||(o.$metadata={}),o.$metadata.attempts=a+1,o.$metadata.totalRetryDelay=c,o}a=e.getRetryCount();const s=e.getRetryDelay();c+=s,await new Promise(e=>setTimeout(e,s))}}})(e),gn)}}),wn=e=>{if(!tn.isInstance(e))return;const t=Object.keys(e.headers).find(e=>"retry-after"===e.toLowerCase());if(!t)return;const n=e.headers[t],r=Number(n);if(!Number.isNaN(r))return new Date(1e3*r);return new Date(n)},bn=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const e of t)n.push(e);return n},vn=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,kn=()=>{let e=[],t=[],n=!1;const r=new Set,i=n=>(e.forEach(e=>{n.add(e.middleware,{...e})}),t.forEach(e=>{n.addRelativeTo(e.middleware,{...e})}),n.identifyOnResolve?.(a.identifyOnResolve()),n),s=e=>{const t=[];return e.before.forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...s(e))}),t.push(e),e.after.reverse().forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...s(e))}),t},o=(n=!1)=>{const r=[],i=[],o={};e.forEach(e=>{const t={...e,before:[],after:[]};for(const e of bn(t.name,t.aliases))o[e]=t;r.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const e of bn(t.name,t.aliases))o[e]=t;i.push(t)}),i.forEach(e=>{if(e.toMiddleware){const t=o[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${vn(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}});const a=(c=r,c.sort((e,t)=>Sn[t.step]-Sn[e.step]||En[t.priority||"normal"]-En[e.priority||"normal"])).map(s).reduce((e,t)=>(e.push(...t),e),[]);var c;return a},a={add:(t,n={})=>{const{name:i,override:s,aliases:o}=n,a={step:"initialize",priority:"normal",middleware:t,...n},c=bn(i,o);if(c.length>0){if(c.some(e=>r.has(e))){if(!s)throw new Error(`Duplicate middleware name '${vn(i,o)}'`);for(const t of c){const n=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(-1===n)continue;const r=e[n];if(r.step!==a.step||a.priority!==r.priority)throw new Error(`"${vn(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${vn(i,o)}" middleware with ${a.priority} priority in ${a.step} step.`);e.splice(n,1)}}for(const e of c)r.add(e)}e.push(a)},addRelativeTo:(e,n)=>{const{name:i,override:s,aliases:o}=n,a={middleware:e,...n},c=bn(i,o);if(c.length>0){if(c.some(e=>r.has(e))){if(!s)throw new Error(`Duplicate middleware name '${vn(i,o)}'`);for(const e of c){const n=t.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(-1===n)continue;const r=t[n];if(r.toMiddleware!==a.toMiddleware||r.relation!==a.relation)throw new Error(`"${vn(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${vn(i,o)}" middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(n,1)}}for(const e of c)r.add(e)}t.push(a)},clone:()=>i(kn()),use:e=>{e.applyToStack(a)},remove:n=>"string"==typeof n?(n=>{let i=!1;const s=e=>{const t=bn(e.name,e.aliases);if(t.includes(n)){i=!0;for(const e of t)r.delete(e);return!1}return!0};return e=e.filter(s),t=t.filter(s),i})(n):(n=>{let i=!1;const s=e=>{if(e.middleware===n){i=!0;for(const t of bn(e.name,e.aliases))r.delete(t);return!1}return!0};return e=e.filter(s),t=t.filter(s),i})(n),removeByTag:n=>{let i=!1;const s=e=>{const{tags:t,name:s,aliases:o}=e;if(t&&t.includes(n)){const e=bn(s,o);for(const t of e)r.delete(t);return i=!0,!1}return!0};return e=e.filter(s),t=t.filter(s),i},concat:e=>{const t=i(kn());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:i,identify:()=>o(!0).map(e=>{const t=e.step??e.relation+" "+e.toMiddleware;return vn(e.name,e.aliases)+" - "+t}),identifyOnResolve:e=>("boolean"==typeof e&&(n=e),n),resolve:(e,t)=>{for(const n of o().map(e=>e.middleware).reverse())e=n(e,t);return n&&console.log(a.identify()),e}};return a},Sn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},En={high:3,normal:2,low:1};class An{constructor(e){this.config=e,this.middlewareStack=kn()}send(e,t,n){const r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n;let s;if(void 0===r&&!0===this.config.cacheMiddleware){this.handlers||(this.handlers=new WeakMap);const t=this.handlers;t.has(e.constructor)?s=t.get(e.constructor):(s=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,s))}else delete this.handlers,s=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return s(e).then(e=>e.output);s(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{})}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const In=(_n=3e5,e=>xn(e)&&e.expiration.getTime()-Date.now()<_n);var _n;const xn=e=>void 0!==e.expiration,Rn={},Cn={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),Rn[e]=t,Cn[t]=e}function Mn(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(!(r in Cn))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=Cn[r]}return t}function Pn(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Rn[e[n]];return t}const Tn=e=>(new TextEncoder).encode(e),On=e=>"string"==typeof e?Tn(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),Nn="X-Amz-Date",Ln="X-Amz-Signature",$n="X-Amz-Security-Token",Dn="authorization",Fn=Nn.toLowerCase(),Un=[Dn,Fn,"date"],Bn=Ln.toLowerCase(),jn="x-amz-content-sha256",Hn=$n.toLowerCase(),qn={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},zn=/^proxy-/,Vn=/^sec-/,Gn="AWS4-HMAC-SHA256",Wn="AWS4-HMAC-SHA256-PAYLOAD",Kn="aws4_request",Jn={},Yn=[],Qn=(e,t,n)=>`${e}/${t}/${n}/${Kn}`,Xn=(e,t,n)=>{const r=new e(t);return r.update(On(n)),r.digest()},Zn=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(null==e[i])continue;const s=i.toLowerCase();(s in qn||t?.has(s)||zn.test(s)||Vn.test(s))&&(!n||n&&!n.has(s))||(r[s]=e[i].trim().replace(/\s+/g," "))}return r},er=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===jn)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(r=t,"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(r))){const e=new n;return e.update(On(t)),Pn(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class tr{format(e){const t=[];for(const n of Object.keys(e)){const r=Tn(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(i.buffer);return s.set(e.value,3),s;case"string":const o=Tn(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const u=new Uint8Array(9);return u[0]=8,u.set(ir.fromNumber(e.value.valueOf()).bytes,1),u;case"uuid":if(!rr.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(Mn(e.value.replace(/\-/g,"")),1),d}}}var nr;!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(nr||(nr={}));const rr=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ir{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&sr(t),new ir(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&sr(e),parseInt(Pn(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function sr(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const or=e=>{e=Xe.clone(e);for(const t of Object.keys(e.headers))Un.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},ar=e=>encodeURIComponent(e).replace(/[!'()*]/g,cr),cr=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,ur=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class dr{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:s=!0}){this.service=r,this.sha256=i,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=Ft(n),this.credentialProvider=Ft(t)}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===Bn)continue;const i=ar(r);t.push(i);const s=e[r];"string"==typeof s?n[i]=`${i}=${ar(s)}`:Array.isArray(s)&&(n[i]=s.slice(0).reduce((e,t)=>e.concat([`${i}=${ar(t)}`]),[]).sort().join("&"))}return t.sort().map(e=>n[e]).filter(e=>e).join("&")})(e)}\n${r.map(e=>`${e}:${t[e]}`).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n,r){const i=new this.sha256;i.update(On(n));return`${r}\n${e}\n${t}\n${Pn(await i.digest())}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return ar(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}formatDate(e){const t=(n=e,ur(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class lr extends dr{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:s=!0}){super({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:s}),this.headerFormatter=new tr}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:s,signableHeaders:o,hoistableHeaders:a,signingRegion:c,signingService:u}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=c??await this.regionProvider(),{longDate:h,shortDate:f}=this.formatDate(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const p=Qn(f,l,u??this.service),m=((e,t={})=>{const{headers:n,query:r={}}=Xe.clone(e);for(const e of Object.keys(n)){const i=e.toLowerCase();("x-amz-"===i.slice(0,6)&&!t.unhoistableHeaders?.has(i)||t.hoistableHeaders?.has(i))&&(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})(or(e),{unhoistableHeaders:s,hoistableHeaders:a});d.sessionToken&&(m.query[$n]=d.sessionToken),m.query["X-Amz-Algorithm"]=Gn,m.query["X-Amz-Credential"]=`${d.accessKeyId}/${p}`,m.query[Nn]=h,m.query["X-Amz-Expires"]=r.toString(10);const g=Zn(m,i,o);return m.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(g),m.query[Ln]=await this.getSignature(h,p,this.getSigningKey(d,l,f,u),this.createCanonicalRequest(m,g,await er(e,this.sha256))),m}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:i,signingService:s}){const o=i??await this.regionProvider(),{shortDate:a,longDate:c}=this.formatDate(n),u=Qn(a,o,s??this.service),d=await er({headers:{},body:t},this.sha256),l=new this.sha256;l.update(e);const h=Pn(await l.digest()),f=[Wn,c,u,r,h,d].join("\n");return this.signString(f,{signingDate:n,signingRegion:o,signingService:s})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const s=n??await this.regionProvider(),{shortDate:o}=this.formatDate(t),a=new this.sha256(await this.getSigningKey(i,s,o,r));return a.update(On(e)),Pn(await a.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const a=i??await this.regionProvider(),c=or(e),{longDate:u,shortDate:d}=this.formatDate(t),l=Qn(d,a,s??this.service);c.headers[Fn]=u,o.sessionToken&&(c.headers[Hn]=o.sessionToken);const h=await er(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(jn,c.headers)&&this.applyChecksum&&(c.headers[jn]=h);const f=Zn(c,r,n),p=await this.getSignature(u,l,this.getSigningKey(o,a,d,s),this.createCanonicalRequest(c,f,h));return c.headers[Dn]=`${Gn} Credential=${o.accessKeyId}/${l}, SignedHeaders=${this.getCanonicalHeaderList(f)}, Signature=${p}`,c}async getSignature(e,t,n,r){const i=await this.createStringToSign(e,t,r,Gn),s=new this.sha256(await n);return s.update(On(i)),Pn(await s.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const s=`${n}:${r}:${i}:${Pn(await Xn(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(s in Jn)return Jn[s];for(Yn.push(s);Yn.length>50;)delete Jn[Yn.shift()];let o=`AWS4${t.secretAccessKey}`;for(const t of[n,r,i,Kn])o=await Xn(e,o,t);return Jn[s]=o})(this.sha256,e,n,t,r||this.service)}}const hr=e=>{let t,n=e.credentials,r=!!e.credentials;Object.defineProperty(e,"credentials",{set(i){i&&i!==n&&i!==t&&(r=!0),n=i;const s=function(e,{credentials:t,credentialDefaultProvider:n}){let r;r=t?t?.memoized?t:((e,t,n)=>{if(void 0===e)return;const r="function"!=typeof e?async()=>Promise.resolve(e):e;let i,s,o,a=!1;const c=async e=>{s||(s=r(e));try{i=await s,o=!0,a=!1}finally{s=void 0}return i};return void 0===t?async e=>(o&&!e?.forceRefresh||(i=await c(e)),i):async e=>(o&&!e?.forceRefresh||(i=await c(e)),a?i:n(i)?t(i)?(await c(e),i):i:(a=!0,i))})(t,In,xn):n?st(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return r.memoized=!0,r}(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),o=function(e,t){if(t.configBound)return t;const n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}(e,s);r&&!o.attributed?(t=async e=>o(e).then(e=>function(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}(e,"CREDENTIALS_CODE","e")),t.memoized=o.memoized,t.configBound=o.configBound,t.attributed=!0):t=o},get:()=>t,enumerable:!0,configurable:!0}),e.credentials=n;const{signingEscapePath:i=!0,systemClockOffset:s=e.systemClockOffset||0,sha256:o}=e;let a;a=e.signer?st(e.signer):e.regionInfoProvider?()=>st(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{const{signingRegion:r,signingService:s}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||s||e.serviceId;const a={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||lr)(a)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await st(e.region)(),properties:{}},t)).signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;const s={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||lr)(s)};return Object.assign(e,{systemClockOffset:s,signingEscapePath:i,signer:a})};const fr=async(e,t,n)=>({operation:xt(t).operation,region:await Ft(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const pr=e=>{const t=[];return e.operation,t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},mr={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},gr="3.823.0";var yr="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function wr(e){return e instanceof Uint8Array?e:"string"==typeof e?yr(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function br(e){return"string"==typeof e?0===e.length:0===e.byteLength}var vr={name:"SHA-256"},kr={name:"HMAC",hash:vr},Sr=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const Er={};function Ar(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:Er}var Ir=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!br(e)){var t=wr(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return Ar().crypto.subtle.sign(kr,t,e.toHash).then(function(e){return new Uint8Array(e)})}):br(this.toHash)?Promise.resolve(Sr):Promise.resolve().then(function(){return Ar().crypto.subtle.digest(vr,e.toHash)}).then(function(e){return Promise.resolve(new Uint8Array(e))})},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise(function(t,n){Ar().crypto.subtle.importKey("raw",wr(e.secret),kr,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},e}();function _r(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})}function xr(e,t){var n,r,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;function Rr(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;"function"==typeof SuppressedError&&SuppressedError;var Cr=64,Mr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Pr=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Tr=Math.pow(2,53)-1,Or=function(){function e(){this.state=Int32Array.from(Pr),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>Tr)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===Cr&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%Cr>=56){for(var r=this.bufferLength;r<Cr;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<56;r++)t.setUint8(r,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(32);for(r=0;r<8;r++)i[4*r]=this.state[r]>>>24&255,i[4*r+1]=this.state[r]>>>16&255,i[4*r+2]=this.state[r]>>>8&255,i[4*r+3]=this.state[r]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],u=t[7],d=0;d<Cr;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var l=this.temp[d-2],h=(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10,f=((l=this.temp[d-15])>>>7|l<<25)^(l>>>18|l<<14)^l>>>3;this.temp[d]=(h+this.temp[d-7]|0)+(f+this.temp[d-16]|0)}var p=(((o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7))+(o&a^~o&c)|0)+(u+(Mr[d]+this.temp[d]|0)|0)|0,m=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;u=c,c=a,a=o,o=s+p|0,s=i,i=r,r=n,n=p+m|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=s,t[4]+=o,t[5]+=a,t[6]+=c,t[7]+=u},e}(),Nr=function(){function e(e){this.secret=e,this.hash=new Or,this.reset()}return e.prototype.update=function(e){if(!br(e)&&!this.error)try{this.hash.update(wr(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return _r(this,void 0,void 0,function(){return xr(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Or,this.secret){this.outer=new Or;var e=function(e){var t=wr(e);if(t.byteLength>Cr){var n=new Or;n.update(t),t=n.digest()}var r=new Uint8Array(Cr);return r.set(t),r}(this.secret),t=new Uint8Array(Cr);t.set(e);for(var n=0;n<Cr;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n<e.byteLength;n++)e[n]=0}},e}();var Lr=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function $r(e){return e&&Lr.every(function(t){return"function"==typeof e[t]})}var Dr=function(){function e(e){!function(e){return!(!function(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}(e)||"object"!=typeof e.crypto.subtle)&&$r(e.crypto.subtle)}(Ar())?this.hash=new Nr(e):this.hash=new Ir(e)}return e.prototype.update=function(e,t){this.hash.update(wr(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}(),Fr=n(369),Ur=n.n(Fr);const Br=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window&&window?.navigator?.userAgent?Ur().parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",t],["ua","2.1"],[`os/${r?.os?.name||"other"}`,r?.os?.version],["lang/js"],["md/browser",`${r?.browser?.name??"unknown"}_${r?.browser?.version??"unknown"}`]];e&&i.push([`api/${e}`,t]);const s=await(n?.userAgentAppId?.());return s&&i.push([`app/${s}`]),i};var jr;!function(e){e.ENV="env",e.CONFIG="shared config entry"}(jr||(jr={}));!function(){function e(){this.crc32=new qr}e.prototype.update=function(e){br(e)||this.crc32.update(wr(e))},e.prototype.digest=function(){return _r(this,void 0,void 0,function(){return xr(this,function(e){return[2,(t=this.crc32.digest(),new Uint8Array([(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))];var t})})},e.prototype.reset=function(){this.crc32=new qr}}();var Hr,qr=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var r=Rr(e),i=r.next();!i.done;i=r.next()){var s=i.value;this.checksum=this.checksum>>>8^zr[255&(this.checksum^s)]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}(),zr=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);class Vr{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&Gr(t),new Vr(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&Gr(e),parseInt(Pn(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function Gr(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}class Wr{constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){const t=[];for(const n of Object.keys(e)){const r=this.fromUtf8(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(i.buffer);return s.set(e.value,3),s;case"string":const o=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const u=new Uint8Array(9);return u[0]=8,u.set(Vr.fromNumber(e.value.valueOf()).bytes,1),u;case"uuid":if(!ri.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(Mn(e.value.replace(/\-/g,"")),1),d}}parse(e){const t={};let n=0;for(;n<e.byteLength;){const r=e.getUint8(n++),i=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,r));switch(n+=r,e.getUint8(n++)){case 0:t[i]={type:Kr,value:!0};break;case 1:t[i]={type:Kr,value:!1};break;case 2:t[i]={type:Jr,value:e.getInt8(n++)};break;case 3:t[i]={type:Yr,value:e.getInt16(n,!1)},n+=2;break;case 4:t[i]={type:Qr,value:e.getInt32(n,!1)},n+=4;break;case 5:t[i]={type:Xr,value:new Vr(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:const r=e.getUint16(n,!1);n+=2,t[i]={type:Zr,value:new Uint8Array(e.buffer,e.byteOffset+n,r)},n+=r;break;case 7:const s=e.getUint16(n,!1);n+=2,t[i]={type:ei,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s))},n+=s;break;case 8:t[i]={type:ti,value:new Date(new Vr(new Uint8Array(e.buffer,e.byteOffset+n,8)).valueOf())},n+=8;break;case 9:const o=new Uint8Array(e.buffer,e.byteOffset+n,16);n+=16,t[i]={type:ni,value:`${Pn(o.subarray(0,4))}-${Pn(o.subarray(4,6))}-${Pn(o.subarray(6,8))}-${Pn(o.subarray(8,10))}-${Pn(o.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return t}}!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(Hr||(Hr={}));const Kr="boolean",Jr="byte",Yr="short",Qr="integer",Xr="long",Zr="binary",ei="string",ti="timestamp",ni="uuid",ri=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ii{constructor(e,t){this.headerMarshaller=new Wr(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage:()=>e,isEndOfStream:()=>t}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const t=this.isEndOfStream;return{getMessages:()=>e,isEndOfStream:()=>t}}encode({headers:e,body:t}){const n=this.headerMarshaller.format(e),r=n.byteLength+t.byteLength+16,i=new Uint8Array(r),s=new DataView(i.buffer,i.byteOffset,i.byteLength),o=new qr;return s.setUint32(0,r,!1),s.setUint32(4,n.byteLength,!1),s.setUint32(8,o.update(i.subarray(0,8)).digest(),!1),i.set(n,12),i.set(t,n.byteLength+12),s.setUint32(r-4,o.update(i.subarray(8,r-4)).digest(),!1),i}decode(e){const{headers:t,body:n}=function({byteLength:e,byteOffset:t,buffer:n}){if(e<16)throw new Error("Provided message too short to accommodate event stream message overhead");const r=new DataView(n,t,e),i=r.getUint32(0,!1);if(e!==i)throw new Error("Reported message length does not match received message length");const s=r.getUint32(4,!1),o=r.getUint32(8,!1),a=r.getUint32(e-4,!1),c=(new qr).update(new Uint8Array(n,t,8));if(o!==c.digest())throw new Error(`The prelude checksum specified in the message (${o}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(n,t+8,e-12)),a!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(n,t+8+4,s),body:new Uint8Array(n,t+8+4+s,i-s-16)}}(e);return{headers:this.headerMarshaller.parse(t),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}}class si{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=await this.options.deserializer(e);void 0!==t&&(yield t)}}}class oi{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream){const t=this.options.decoder.decode(e);yield t}}}class ai{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=this.options.encoder.encode(e);yield t}this.options.includeEndFrame&&(yield new Uint8Array(0))}}class ci{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream){const t=this.options.serializer(e);yield t}}}function ui(e,t){return async function(n){const{value:r}=n.headers[":message-type"];if("error"===r){const e=new Error(n.headers[":error-message"].value||"UnknownError");throw e.name=n.headers[":error-code"].value,e}if("exception"===r){const r=n.headers[":exception-type"].value,i={[r]:n},s=await e(i);if(s.$unknown){const e=new Error(t(n.body));throw e.name=r,e}throw s[r]}if("event"===r){const t={[n.headers[":event-type"].value]:n},r=await e(t);if(r.$unknown)return;return r}throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}class di{constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new ii(e,t),this.utfEncoder=e}deserialize(e,t){const n=function(e){let t=0,n=0,r=null,i=null;const s=e=>{if("number"!=typeof e)throw new Error("Attempted to allocate an event message where size was not a number: "+e);t=e,n=4,r=new Uint8Array(e),new DataView(r.buffer).setUint32(0,e,!1)};return{[Symbol.asyncIterator]:async function*(){const o=e[Symbol.asyncIterator]();for(;;){const{value:e,done:a}=await o.next();if(a){if(!t)return;if(t!==n)throw new Error("Truncated event message received.");return void(yield r)}const c=e.length;let u=0;for(;u<c;){if(!r){const t=c-u;i||(i=new Uint8Array(4));const r=Math.min(4-n,t);if(i.set(e.slice(u,u+r),n),n+=r,u+=r,n<4)break;s(new DataView(i.buffer).getUint32(0,!1)),i=null}const o=Math.min(t-n,c-u);r.set(e.slice(u,u+o),n),n+=o,u+=o,t&&t===n&&(yield r,r=null,t=0,n=0)}}}}}(e);return new si({messageStream:new oi({inputStream:n,decoder:this.eventStreamCodec}),deserializer:ui(t,this.utfEncoder)})}serialize(e,t){return new ai({messageStream:new ci({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}class li{constructor({utf8Encoder:e,utf8Decoder:t}){this.universalMarshaller=new di({utf8Decoder:t,utf8Encoder:e})}deserialize(e,t){const n=hi(e)?(r=e,{[Symbol.asyncIterator]:async function*(){const e=r.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}}}):e;var r;return this.universalMarshaller.deserialize(n,t)}serialize(e,t){const n=this.universalMarshaller.serialize(e,t);return"function"==typeof ReadableStream?(e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(e){const{done:n,value:r}=await t.next();if(n)return e.close();e.enqueue(r)}})})(n):n}}const hi=e=>"function"==typeof ReadableStream&&e instanceof ReadableStream,fi=e=>new li(e);function pi(e,t){return new Request(e,t)}function mi(e=0){return new Promise((t,n)=>{e&&setTimeout(()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name="TimeoutError",n(t)},e)})}const gi={supported:void 0};class yi{static create(e){return"function"==typeof e?.handle?e:new yi(e)}constructor(e){"function"==typeof e?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===gi.supported&&(gi.supported=Boolean("undefined"!=typeof Request&&"keepalive"in pi("https://[::1]")))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const r=n??this.config.requestTimeout,i=!0===this.config.keepAlive,s=this.config.credentials;if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",Promise.reject(e)}let o=e.path;const a=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=ar(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${ar(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${ar(r)}`),t.push(e)}}return t.join("&")}(e.query||{});a&&(o+=`?${a}`),e.fragment&&(o+=`#${e.fragment}`);let c="";if(null!=e.username||null!=e.password){c=`${e.username??""}:${e.password??""}@`}const{port:u,method:d}=e,l=`${e.protocol}//${c}${e.hostname}${u?`:${u}`:""}${o}`,h="GET"===d||"HEAD"===d?void 0:e.body,f={body:h,headers:new Headers(e.headers),method:d,credentials:s};this.config?.cache&&(f.cache=this.config.cache),h&&(f.duplex="half"),"undefined"!=typeof AbortController&&(f.signal=t),gi.supported&&(f.keepalive=i),"function"==typeof this.config.requestInit&&Object.assign(f,this.config.requestInit(e));let p=()=>{};const m=pi(l,f),g=[fetch(m).then(e=>{const t=e.headers,n={};for(const e of t.entries())n[e[0]]=e[1];return null!=e.body?{response:new tn({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then(t=>({response:new tn({headers:n,reason:e.statusText,statusCode:e.status,body:t})}))}),mi(r)];return t&&g.push(new Promise((e,n)=>{const r=()=>{const e=new Error("Request aborted");e.name="AbortError",n(e)};if("function"==typeof t.addEventListener){const e=t;e.addEventListener("abort",r,{once:!0}),p=()=>e.removeEventListener("abort",r)}else t.onabort=r})),Promise.race(g).finally(p)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}const wi={},bi=new Array(64);for(let e=0,t="A".charCodeAt(0),n="Z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t);wi[n]=e,bi[e]=n}for(let e=0,t="a".charCodeAt(0),n="z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t),r=e+26;wi[n]=r,bi[r]=n}for(let e=0;e<10;e++){wi[e.toString(10)]=e+52;const t=e.toString(10),n=e+52;wi[t]=n,bi[n]=t}wi["+"]=62,bi[62]="+",wi["/"]=63,bi[63]="/";const vi=e=>{let t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let t=0;t<e.length;t+=4){let n=0,i=0;for(let r=t,s=t+3;r<=s;r++)if("="!==e[r]){if(!(e[r]in wi))throw new TypeError(`Invalid character ${e[r]} in base64 string.`);n|=wi[e[r]]<<6*(s-r),i+=6}else n>>=6;const s=t/4*3;n>>=i%8;const o=Math.floor(i/8);for(let e=0;e<o;e++){const t=8*(o-e-1);r.setUint8(s+e,(n&255<<t)>>t)}}return new Uint8Array(n)},ki=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(2!==r.readyState)return n(new Error("Reader aborted too early"));const e=r.result??"",i=e.indexOf(","),s=i>-1?i+1:e.length;t(e.substring(s))},r.onabort=()=>n(new Error("Read aborted")),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}(e),n=vi(t);return new Uint8Array(n)}(e):async function(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:e,value:s}=await n.read();s&&(t.push(s),i+=s.length),r=e}const s=new Uint8Array(i);let o=0;for(const e of t)s.set(e,o),o+=e.length;return s}(e);const Si="function"==typeof TextEncoder?new TextEncoder:null,Ei=e=>{if("string"==typeof e){if(Si)return Si.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error(`Body Length computation failed for ${e}`)},Ai=e=>new Date(Date.now()+e),Ii=e=>tn.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,_i=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(Ai(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},xi=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t};class Ri{async sign(e,t,n){if(!Xe.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await(async e=>{const t=xi("context",e.context),n=xi("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=xi("signer",n.signer),s=await i(r),o=e?.signingRegion,a=e?.signingRegionSet,c=e?.signingName;return{config:n,signer:s,signingRegion:o,signingRegionSet:a,signingName:c}})(n),{config:i,signer:s}=r;let{signingRegion:o,signingName:a}=r;const c=n.context;if(c?.authSchemes?.length){const[e,t]=c.authSchemes;"sigv4a"===e?.name&&"sigv4"===t?.name&&(o=t?.signingRegion??o,a=t?.signingName??a)}return await s.sign(e,{signingDate:Ai(i.systemClockOffset),signingRegion:o,signingService:a})}errorHandler(e){return t=>{const n=t.ServerTime??Ii(t.$response);if(n){const r=xi("config",e.config),i=r.systemClockOffset;r.systemClockOffset=_i(n,r.systemClockOffset);r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=Ii(e);if(n){const e=xi("config",t.config);e.systemClockOffset=_i(n,e.systemClockOffset)}}}function Ci(e){let t;t="string"==typeof e?Tn(e):e;const n="object"==typeof t&&"number"==typeof t.length,r="object"==typeof t&&"number"==typeof t.byteOffset&&"number"==typeof t.byteLength;if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let e=0;e<t.length;e+=3){let n=0,r=0;for(let i=e,s=Math.min(e+3,t.length);i<s;i++)n|=t[i]<<8*(s-i-1),r+=8;const s=Math.ceil(r/6);n<<=6*s-r;for(let e=1;e<=s;e++){const t=6*(s-e);i+=bi[(n&63<<t)>>t]}i+="==".slice(0,4-s)}return i}const Mi=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};const Pi="endpoints";function Ti(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${Ti(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(Ti).join(", ")})`:JSON.stringify(e,null,2)}class Oi extends Error{constructor(e){super(e),this.name="EndpointError"}}const Ni=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new Oi(`Path: '${e}' does not end with ']'`);const i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new Oi(`Invalid array index: '${i}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n})(t).reduce((n,r)=>{if("object"!=typeof n)throw new Oi(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]},e);var Li;!function(e){e.HTTP="http",e.HTTPS="https"}(Li||(Li={}));const $i={[Li.HTTP]:80,[Li.HTTPS]:443},Di={booleanEquals:(e,t)=>e===t,getAttr:Ni,isSet:e=>null!=e,isValidHostLabel:ct,not:e=>!e,parseURL:e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:i="",query:s={}}=e,o=new URL(`${r}//${t}${n?`:${n}`:""}${i}`);return o.search=Object.entries(s).map(([e,t])=>`${e}=${t}`).join("&"),o}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:i,pathname:s,protocol:o,search:a}=t;if(a)return null;const c=o.slice(0,-1);if(!Object.values(Li).includes(c))return null;const u=dt(i);return{scheme:c,authority:`${r}${n.includes(`${r}:${$i[c]}`)||"string"==typeof e&&e.includes(`${r}:${$i[c]}`)?`:${$i[c]}`:""}`,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:u}},stringEquals:(e,t)=>e===t,substring:(e,t,n,r)=>t>=n||e.length<n?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),uriEncode:e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},Fi=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let i=0;for(;i<e.length;){const t=e.indexOf("{",i);if(-1===t){n.push(e.slice(i));break}n.push(e.slice(i,t));const s=e.indexOf("}",t);if(-1===s){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[s+1]&&(n.push(e.slice(t+1,s)),i=s+2);const o=e.substring(t+1,s);if(o.includes("#")){const[e,t]=o.split("#");n.push(Ni(r[e],t))}else n.push(r[o]);i=s+1}return n.join("")},Ui=(e,t,n)=>{if("string"==typeof e)return Fi(e,n);if(e.fn)return Bi(e,n);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,n);throw new Oi(`'${t}': ${String(e)} is not a string, function or reference.`)},Bi=({fn:e,argv:t},n)=>{const r=t.map(e=>["boolean","number"].includes(typeof e)?e:Ui(e,"arg",n)),i=e.split(".");return i[0]in ot&&null!=i[1]?ot[i[0]][i[1]](...r):Di[e](...r)},ji=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new Oi(`'${e}' is already defined in Reference Record.`);const r=Bi(t,n);return n.logger?.debug?.(`${Pi} evaluateCondition: ${Ti(t)} = ${Ti(r)}`),{result:""===r||!!r,...null!=e&&{toAssign:{name:e,value:r}}}},Hi=(e=[],t)=>{const n={};for(const r of e){const{result:e,toAssign:i}=ji(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};i&&(n[i.name]=i.value,t.logger?.debug?.(`${Pi} assign: ${i.name} := ${Ti(i.value)}`))}return{result:!0,referenceRecord:n}},qi=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r.map(e=>{const r=Ui(e,"Header value entry",t);if("string"!=typeof r)throw new Oi(`Header '${n}' value '${r}' is not a string`);return r})}),{}),zi=(e,t)=>{if(Array.isArray(e))return e.map(e=>zi(e,t));switch(typeof e){case"string":return Fi(e,t);case"object":if(null===e)throw new Oi(`Unexpected endpoint property: ${e}`);return Vi(e,t);case"boolean":return e;default:throw new Oi("Unexpected endpoint property type: "+typeof e)}},Vi=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:zi(r,t)}),{}),Gi=(e,t)=>{const n=Ui(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new Oi("Endpoint URL must be a string, got "+typeof n)},Wi=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:i,referenceRecord:s}=Hi(n,t);if(!i)return;const o={...t,referenceRecord:{...t.referenceRecord,...s}},{url:a,properties:c,headers:u}=r;return t.logger?.debug?.(`${Pi} Resolving endpoint from template: ${Ti(r)}`),{...null!=u&&{headers:qi(u,o)},...null!=c&&{properties:Vi(c,o)},url:Gi(a,o)}},Ki=(e,t)=>{const{conditions:n,error:r}=e,{result:i,referenceRecord:s}=Hi(n,t);if(i)throw new Oi(Ui(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...s}}))},Ji=(e,t)=>{const{conditions:n,rules:r}=e,{result:i,referenceRecord:s}=Hi(n,t);if(i)return Yi(r,{...t,referenceRecord:{...t.referenceRecord,...s}})},Yi=(e,t)=>{for(const n of e)if("endpoint"===n.type){const e=Wi(n,t);if(e)return e}else if("error"===n.type)Ki(n,t);else{if("tree"!==n.type)throw new Oi(`Unknown endpoint rule: ${n}`);{const e=Ji(n,t);if(e)return e}}throw new Oi("Rules evaluation failed")},Qi="required",Xi="fn",Zi="argv",es="ref",ts=!0,ns="isSet",rs="booleanEquals",is="error",ss="endpoint",os="tree",as="PartitionResult",cs={[Qi]:!1,type:"String"},us={[Qi]:!0,default:!1,type:"Boolean"},ds={[es]:"Endpoint"},ls={[Xi]:rs,[Zi]:[{[es]:"UseFIPS"},!0]},hs={[Xi]:rs,[Zi]:[{[es]:"UseDualStack"},!0]},fs={},ps={[Xi]:"getAttr",[Zi]:[{[es]:as},"supportsFIPS"]},ms={[Xi]:rs,[Zi]:[!0,{[Xi]:"getAttr",[Zi]:[{[es]:as},"supportsDualStack"]}]},gs=[ls],ys=[hs],ws=[{[es]:"Region"}],bs={version:"1.0",parameters:{Region:cs,UseDualStack:us,UseFIPS:us,Endpoint:cs},rules:[{conditions:[{[Xi]:ns,[Zi]:[ds]}],rules:[{conditions:gs,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:is},{rules:[{conditions:ys,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:is},{endpoint:{url:ds,properties:fs,headers:fs},type:ss}],type:os}],type:os},{rules:[{conditions:[{[Xi]:ns,[Zi]:ws}],rules:[{conditions:[{[Xi]:"aws.partition",[Zi]:ws,assign:as}],rules:[{conditions:[ls,hs],rules:[{conditions:[{[Xi]:rs,[Zi]:[ts,ps]},ms],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:fs,headers:fs},type:ss}],type:os}],type:os},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:is}],type:os},{conditions:gs,rules:[{conditions:[{[Xi]:rs,[Zi]:[ps,ts]}],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:fs,headers:fs},type:ss}],type:os}],type:os},{error:"FIPS is enabled but this partition does not support FIPS",type:is}],type:os},{conditions:ys,rules:[{conditions:[ms],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:fs,headers:fs},type:ss}],type:os}],type:os},{error:"DualStack is enabled but this partition does not support DualStack",type:is}],type:os},{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:fs,headers:fs},type:ss}],type:os}],type:os}],type:os},{error:"Invalid Configuration: Missing Region",type:is}],type:os}]},vs=new class{constructor({size:e,params:t}){this.data=new Map,this.parameters=[],this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(!1===n)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const e=this.data.keys();let t=0;for(;;){const{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(0===n.length)return!1;for(const r of n){const n=String(e[r]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),ks=(e,t={})=>vs.get(e,()=>((e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:i,rules:s}=e;t.logger?.debug?.(`${Pi} Initial EndpointParams: ${Ti(n)}`);const o=Object.entries(i).filter(([,e])=>null!=e.default).map(([e,t])=>[e,t.default]);if(o.length>0)for(const[e,t]of o)n[e]=n[e]??t;const a=Object.entries(i).filter(([,e])=>e.required).map(([e])=>e);for(const e of a)if(null==n[e])throw new Oi(`Missing required parameter: '${e}'`);const c=Yi(s,{endpointParams:n,logger:r,referenceRecord:{}});return t.logger?.debug?.(`${Pi} Resolved endpoint: ${Ti(c)}`),c})(bs,{endpointParams:e,logger:t.logger}));ot.aws=pt;const Ss=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},Es=["in-region","cross-region","mobile","standard","legacy"],As=()=>{const e="undefined"!=typeof window&&window?.navigator?.userAgent?Ur().parse(window.navigator.userAgent):void 0,t=e?.platform?.type;return"tablet"===t||"mobile"===t},Is=e=>{const t=(({defaultsMode:e}={})=>((e,t,n)=>{let r,i,s,o=!1;const a=async()=>{i||(i=e());try{r=await i,s=!0,o=!1}finally{i=void 0}return r};return void 0===t?async e=>(s&&!e?.forceRefresh||(r=await a()),r):async e=>(s&&!e?.forceRefresh||(r=await a()),o?r:n&&!n(r)?(o=!0,r):t(r)?(await a(),r):r)})(async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(As()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Es.join(", ")}, got ${t}`)}}))(e),n=()=>t().then(Ss),r=(e=>({apiVersion:"2023-09-30",base64Decoder:e?.base64Decoder??vi,base64Encoder:e?.base64Encoder??Ci,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??ks,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??pr,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Ri}],logger:e?.logger??new nn,serviceId:e?.serviceId??"Bedrock Runtime",urlParser:e?.urlParser??Bt,utf8Decoder:e?.utf8Decoder??Tn,utf8Encoder:e?.utf8Encoder??Mi}))(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Ei,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Br({serviceId:r.serviceId,clientVersion:gr}),eventStreamPayloadHandlerProvider:e?.eventStreamPayloadHandlerProvider??(()=>{return{handle:(e="event stream request is not supported in browser.",()=>{throw new Error(e)})};var e}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??fi,maxAttempts:e?.maxAttempts??3,region:e?.region??(i="Region is missing",()=>Promise.reject(i)),requestHandler:yi.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||qt),sha256:e?.sha256??Dr,streamCollector:e?.streamCollector??ki,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(false)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(false))};var i};var _s;!function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(_s||(_s={}));const xs=e=>Object.assign((e=>{const t=[];for(const n in _s){const r=_s[n];void 0!==e[r]&&t.push({algorithmId:()=>r,checksumConstructor:()=>e[r]})}return{addChecksumAlgorithm(e){t.push(e)},checksumAlgorithms:()=>t}})(e),(e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy:()=>e.retryStrategy}))(e)),Rs=(e,t)=>{const n=Object.assign((e=>({setRegion(t){e.region=t},region:()=>e.region}))(e),xs(e),(e=>({setHttpHandler(t){e.httpHandler=t},httpHandler:()=>e.httpHandler,updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs:()=>e.httpHandler.httpHandlerConfigs()}))(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,{region:n.region()},(r=n,Object.assign((e=>{const t={};return e.checksumAlgorithms().forEach(e=>{t[e.algorithmId()]=e.checksumConstructor()}),t})(r),(e=>{const t={};return t.retryStrategy=e.retryStrategy(),t})(r))),{httpHandler:n.httpHandler()},(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}))(n));var r};class Cs extends An{config;constructor(...[e]){const t=Is(e||{});super(t),this.initConfig=t;const n=(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"bedrock"}))(t),r=function(e){const t=st(e.userAgentAppId??void 0),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:"string"==typeof n?[[n]]:n,userAgentAppId:async()=>{const n=await t();if(!function(e){return void 0===e||"string"==typeof e&&e.length<=50}(n)){const t="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger:console;"string"!=typeof n?t?.warn("userAgentAppId must be a string or undefined."):n.length>50&&t?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}(n),i=(e=>{const{retryStrategy:t,retryMode:n,maxAttempts:r}=e,i=Ft(r??3);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await Ft(n)()===Ht.ADAPTIVE?new en(i):new Zt(i))})})(r),s=(e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{if("string"==typeof t)return It(t);const e=await t();return It(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!At(e)||("function"!=typeof n?Promise.resolve(!!n):n())}})})(i),o=(e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,s=null!=n?async()=>jt(await Ft(n)()):void 0,o=!!n,a=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:o,useDualstackEndpoint:Ft(r??!1),useFipsEndpoint:Ft(i??!1)});let c;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=Ut(e.serviceId)),c),a})(s);var a;const c=(e=>{const t=hr(e);return Object.assign(t,{authSchemePreference:Ft(e.authSchemePreference??[])})})((a=o,Object.assign(a,{eventStreamMarshaller:a.eventStreamSerdeProvider(a)}))),u=function(e){const t=e.signer,n=e.signer,r=Object.assign(e,{eventSigner:t,messageSigner:n}),i=r.eventStreamPayloadHandlerProvider(r);return Object.assign(r,{eventStreamPayloadHandler:i})}(c),d=Rs(u,e?.extensions||[]);var l;this.config=d,this.middlewareStack.use((l=this.config,{applyToStack:e=>{e.add(kt(l),Et)}})),this.middlewareStack.use(yn(this.config)),this.middlewareStack.use(Dt(this.config)),this.middlewareStack.use(et(this.config)),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add((e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:s,logger:o,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:u}=a,d=c??t.inputFilterSensitiveLog,l=u??t.outputFilterSensitiveLog,{$metadata:h,...f}=r.output;return o?.info?.({clientName:i,commandName:s,input:d(n.input),output:l(f),metadata:h}),r}catch(e){const{clientName:r,commandName:i,logger:s,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:a}=o,c=a??t.inputFilterSensitiveLog;throw s?.error?.({clientName:r,commandName:i,input:c(n.input),error:e,metadata:e.$metadata}),e}},tt)}})),this.middlewareStack.use(it(this.config)),this.middlewareStack.use(((e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(Rt(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),Ct)}}))(this.config,{httpAuthSchemeParametersProvider:fr,identityProviderConfigProvider:async e=>new Mt({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(Nt(this.config))}destroy(){super.destroy()}}const Ms=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1],Ps={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Ts={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Os(e,t,n){return{applyToStack:r=>{r.add(((e,t)=>(n,r)=>async i=>{const{response:s}=await n(i);try{return{response:s,output:await t(s,e)}}catch(e){if(Object.defineProperty(e,"$response",{value:s}),!("$metadata"in e)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{e.message+="\n "+t}catch(e){r.logger&&"NoOpLogger"!==r.logger?.constructor?.name?r.logger?.warn?.(t):console.warn(t)}void 0!==e.$responseBodyText&&e.$response&&(e.$response.body=e.$responseBodyText);try{if(tn.isInstance(s)){const{headers:t={}}=s,n=Object.entries(t);e.$metadata={httpStatusCode:s.statusCode,requestId:Ms(/^x-[\w-]+-request-?id$/,n),extendedRequestId:Ms(/^x-[\w-]+-id-2$/,n),cfId:Ms(/^x-[\w-]+-cf-id$/,n)}}}catch(e){}}throw e}})(e,n),Ps),r.add(((e,t)=>(n,r)=>async i=>{const s=e,o=r.endpointV2?.url&&s.urlParser?async()=>s.urlParser(r.endpointV2.url):s.endpoint;if(!o)throw new Error("No valid endpoint provider available.");const a=await t(i.input,{...e,endpoint:o});return n({...i,request:a})})(e,t),Ts)}}}const Ns=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Ls=/(\d+\.){3}\d+/,$s=/\.\./,Ds=e=>Ns.test(e)&&!Ls.test(e)&&!$s.test(e),Fs=e=>{const[t,n,r,,,i]=e.split(":"),s="arn"===t&&e.split(":").length>=6,o=Boolean(s&&n&&r&&i);if(s&&!o)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return o},Us=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"credentialScope"===e||"CredentialScope"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:"accountId"===e||"AccountId"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:"endpoint"===e||"endpoint"===t?async()=>{if(!1===n.isCustomEndpoint)return;const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?":"+r:""}${i}`}}return e}:r},Bs=async(e,t,n)=>{const r={},i=t?.getEndpointParameterInstructions?.()||{};for(const[t,s]of Object.entries(i))switch(s.type){case"staticContextParams":r[t]=s.value;break;case"contextParams":r[t]=e[s.name];break;case"clientContextParams":case"builtInParams":r[t]=await Us(s.name,t,n)();break;case"operationContextParams":r[t]=s.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return 0===Object.keys(i).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Fs(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Ds(t)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},js=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&function(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}(r,"ENDPOINT_OVERRIDE","N");const s=await(async(e,t,n,r)=>{if(!n.isCustomEndpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await Ut(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(jt(e)),n.isCustomEndpoint=!0)}const i=await Bs(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(i,r)})(i.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=s,r.authSchemes=s.properties?.authSchemes;const o=r.authSchemes?.[0];if(o){r.signing_region=o.signingRegion,r.signing_service=o.signingName;const e=xt(r),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:o.signingRegion,signingRegion:o.signingRegion,signing_service:o.signingName,signingName:o.signingName,signingRegionSet:o.signingRegionSet},o.properties))}return n({...i})},Hs={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Ts.name},qs=(e,t)=>({applyToStack:n=>{n.addRelativeTo(js({config:e,instructions:t}),Hs)}}),zs=e=>"function"==typeof e?e():e;class Vs{constructor(e,t=new Map){this.namespace=e,this.schemas=t}static for(e){return Vs.registries.has(e)||Vs.registries.set(e,new Vs(e)),Vs.registries.get(e)}register(e,t){const n=this.normalizeShapeId(e);Vs.for(this.getNamespace(e)).schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw new Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}getBaseException(){for(const[e,t]of this.schemas.entries())if(e.startsWith("smithy.ts.sdk.synthetic.")&&e.endsWith("ServiceException"))return t}find(e){return[...this.schemas.values()].find(e)}destroy(){Vs.registries.delete(this.namespace),this.schemas.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}getNamespace(e){return this.normalizeShapeId(e).split("#")[0]}}Vs.registries=new Map;class Gs{static assign(e,t){const n=Object.assign(e,t);return Vs.for(n.namespace).register(n.name,n),n}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===this.symbol}return t}getName(){return this.namespace+"#"+this.name}}class Ws extends Gs{constructor(){super(...arguments),this.symbol=Ws.symbol}}Ws.symbol=Symbol.for("@smithy/lis");class Ks extends Gs{constructor(){super(...arguments),this.symbol=Ks.symbol}}Ks.symbol=Symbol.for("@smithy/map");const Js={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class Ys extends Gs{constructor(){super(...arguments),this.symbol=Ys.symbol}}Ys.symbol=Symbol.for("@smithy/sim");class Qs extends Gs{constructor(){super(...arguments),this.symbol=Qs.symbol}}Qs.symbol=Symbol.for("@smithy/str");class Xs{constructor(e,t){this.ref=e,this.memberName=t,this.symbol=Xs.symbol;const n=[];let r=e,i=e;for(this._isMemberSchema=!1;Array.isArray(r);)n.push(r[1]),r=r[0],i=zs(r),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let e=n.length-1;e>=0;--e){const t=n[e];Object.assign(this.memberTraits,Xs.translateTraits(t))}}else this.memberTraits=0;if(i instanceof Xs)return Object.assign(this,i),this.memberTraits=Object.assign({},i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,void(this.memberName=t??i.memberName);if(this.schema=zs(i),this.schema&&"object"==typeof this.schema?this.traits=this.schema?.traits??{}:this.traits=0,this.name=(this.schema instanceof Gs?this.schema.getName?.():void 0)??this.memberName??this.getSchemaName(),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){return Gs[Symbol.hasInstance].bind(this)(e)}static of(e){if(e instanceof Xs)return e;if(Array.isArray(e)){const[t,n]=e;if(t instanceof Xs)return Object.assign(t.getMergedTraits(),Xs.translateTraits(n)),t;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}return new Xs(e)}static translateTraits(e){if("object"==typeof e)return e;e|=0;const t={};let n=0;for(const r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])1==(e>>n++&1)&&(t[r]=1);return t}getSchema(){return this.schema instanceof Xs?(Object.assign(this,{schema:this.schema.getSchema()}),this.schema):this.schema instanceof Ys?zs(this.schema.schemaRef):zs(this.schema)}getName(e=!1){return!e&&this.name&&this.name.includes("#")?this.name.split("#")[1]:this.name||void 0}getMemberName(){if(!this.isMemberSchema())throw new Error(`@smithy/core/schema - non-member schema: ${this.getName(!0)}`);return this.memberName}isMemberSchema(){return this._isMemberSchema}isUnitSchema(){return"unit"===this.getSchema()}isListSchema(){const e=this.getSchema();return"number"==typeof e?e>=Js.LIST_MODIFIER&&e<Js.MAP_MODIFIER:e instanceof Ws}isMapSchema(){const e=this.getSchema();return"number"==typeof e?e>=Js.MAP_MODIFIER&&e<=255:e instanceof Ks}isStructSchema(){const e=this.getSchema();return null!==e&&"object"==typeof e&&"members"in e||e instanceof Qs}isBlobSchema(){return this.getSchema()===Js.BLOB||this.getSchema()===Js.STREAMING_BLOB}isTimestampSchema(){const e=this.getSchema();return"number"==typeof e&&e>=Js.TIMESTAMP_DEFAULT&&e<=Js.TIMESTAMP_EPOCH_SECONDS}isDocumentSchema(){return this.getSchema()===Js.DOCUMENT}isStringSchema(){return this.getSchema()===Js.STRING}isBooleanSchema(){return this.getSchema()===Js.BOOLEAN}isNumericSchema(){return this.getSchema()===Js.NUMERIC}isBigIntegerSchema(){return this.getSchema()===Js.BIG_INTEGER}isBigDecimalSchema(){return this.getSchema()===Js.BIG_DECIMAL}isStreaming(){return!!this.getMergedTraits().streaming||this.getSchema()===Js.STREAMING_BLOB}isIdempotencyToken(){return"number"==typeof this.traits?!(4&~this.traits):"object"==typeof this.traits&&!!this.traits.idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Xs.translateTraits(this.memberTraits)}getOwnTraits(){return Xs.translateTraits(this.traits)}getKeySchema(){if(this.isDocumentSchema())return this.memberFrom([Js.DOCUMENT,0],"key");if(!this.isMapSchema())throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const e=this.getSchema();return"number"==typeof e?this.memberFrom([63&e,0],"key"):this.memberFrom([e.keySchema,0],"key")}getValueSchema(){const e=this.getSchema();if("number"==typeof e){if(this.isMapSchema())return this.memberFrom([63&e,0],"value");if(this.isListSchema())return this.memberFrom([63&e,0],"member")}if(e&&"object"==typeof e){if(this.isStructSchema())throw new Error(`may not getValueSchema() on structure ${this.getName(!0)}`);const t=e;if("valueSchema"in t){if(this.isMapSchema())return this.memberFrom([t.valueSchema,0],"value");if(this.isListSchema())return this.memberFrom([t.valueSchema,0],"member")}}if(this.isDocumentSchema())return this.memberFrom([Js.DOCUMENT,0],"value");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}hasMemberSchema(e){if(this.isStructSchema()){return this.getSchema().memberNames.includes(e)}return!1}getMemberSchema(e){if(this.isStructSchema()){const t=this.getSchema();if(!t.memberNames.includes(e))throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`);const n=t.memberNames.indexOf(e),r=t.memberList[n];return this.memberFrom(Array.isArray(r)?r:[r,0],e)}if(this.isDocumentSchema())return this.memberFrom([Js.DOCUMENT,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no members.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch(e){}return e}getEventStreamMember(){if(this.isStructSchema())for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e;return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema();for(let t=0;t<e.memberNames.length;++t)yield[e.memberNames[t],this.memberFrom([e.memberList[t],0],e.memberNames[t])]}memberFrom(e,t){return e instanceof Xs?Object.assign(e,{memberName:t,_isMemberSchema:!0}):new Xs(e,t)}getSchemaName(){const e=this.getSchema();if("number"==typeof e){const t=63&e,n=192&e,r=Object.entries(Js).find(([,e])=>e===t)?.[0]??"Unknown";switch(n){case Js.MAP_MODIFIER:return`${r}Map`;case Js.LIST_MODIFIER:return`${r}List`;case 0:return r}}return"Unknown"}}Xs.symbol=Symbol.for("@smithy/nor");const Zs="***SensitiveInformation***";function eo(e,t){if(null==t)return t;const n=Xs.of(e);if(n.getMergedTraits().sensitive)return Zs;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return Zs}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return Zs}else if(n.isStructSchema()&&"object"==typeof t){const e=t,r={};for(const[t,i]of n.structIterator())null!=e[t]&&(r[t]=eo(i,e[t]));return r}return t}class to{constructor(){this.middlewareStack=kn()}static classBuilder(){return new no}resolveMiddlewareWithContext(e,t,n,{middlewareFn:r,clientName:i,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,smithyContext:c,additionalContext:u,CommandCtor:d}){for(const i of r.bind(this)(d,e,t,n))this.middlewareStack.use(i);const l=e.concat(this.middlewareStack),{logger:h}=t,f={logger:h,clientName:i,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,[_t]:{commandInstance:this,...c},...u},{requestHandler:p}=t;return l.resolve(e=>p.handle(e.request,n||{}),f)}}class no{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=void 0,this._outputFilterSensitiveLog=void 0,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends to{static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(e._operationSchema?eo.bind(null,e._operationSchema.input):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(e._operationSchema?eo.bind(null,e._operationSchema.output):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const ro="***SensitiveInformation***";class io extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return io.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&("client"===t.$fault||"server"===t.$fault)}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===io?io.isInstance(e):!!io.isInstance(e)&&(t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e))}}const so=(e,t={})=>{Object.entries(t).filter(([,e])=>void 0!==e).forEach(([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)});const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e};class oo extends io{constructor(e){super(e),Object.setPrototypeOf(this,oo.prototype)}}class ao extends oo{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,ao.prototype)}}var co;!function(e){e.visit=(e,t)=>void 0!==e.s3OutputDataConfig?t.s3OutputDataConfig(e.s3OutputDataConfig):t._(e.$unknown[0],e.$unknown[1])}(co||(co={}));class uo extends oo{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,uo.prototype)}}class lo extends oo{name="ThrottlingException";$fault="client";constructor(e){super({name:"ThrottlingException",$fault:"client",...e}),Object.setPrototypeOf(this,lo.prototype)}}class ho extends oo{name="ValidationException";$fault="client";constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,ho.prototype)}}class fo extends oo{name="ConflictException";$fault="client";constructor(e){super({name:"ConflictException",$fault:"client",...e}),Object.setPrototypeOf(this,fo.prototype)}}class po extends oo{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,po.prototype)}}class mo extends oo{name="ServiceQuotaExceededException";$fault="client";constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,mo.prototype)}}class go extends oo{name="ServiceUnavailableException";$fault="server";constructor(e){super({name:"ServiceUnavailableException",$fault:"server",...e}),Object.setPrototypeOf(this,go.prototype)}}var yo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):t._(e.$unknown[0],e.$unknown[1])}(yo||(yo={}));var wo;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):t._(e.$unknown[0],e.$unknown[1])}(wo||(wo={}));var bo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):void 0!==e.s3Location?t.s3Location(e.s3Location):t._(e.$unknown[0],e.$unknown[1])}(bo||(bo={}));var vo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):t._(e.$unknown[0],e.$unknown[1])}(vo||(vo={}));var ko;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):t._(e.$unknown[0],e.$unknown[1])}(ko||(ko={}));var So,Eo;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):void 0!==e.s3Location?t.s3Location(e.s3Location):t._(e.$unknown[0],e.$unknown[1])}(So||(So={})),function(e){e.visit=(e,t)=>void 0!==e.reasoningText?t.reasoningText(e.reasoningText):void 0!==e.redactedContent?t.redactedContent(e.redactedContent):t._(e.$unknown[0],e.$unknown[1])}(Eo||(Eo={}));var Ao,Io;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):void 0!==e.s3Location?t.s3Location(e.s3Location):t._(e.$unknown[0],e.$unknown[1])}(Ao||(Ao={})),function(e){e.visit=(e,t)=>void 0!==e.json?t.json(e.json):void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):void 0!==e.document?t.document(e.document):void 0!==e.video?t.video(e.video):t._(e.$unknown[0],e.$unknown[1])}(Io||(Io={}));var _o;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):void 0!==e.document?t.document(e.document):void 0!==e.video?t.video(e.video):void 0!==e.toolUse?t.toolUse(e.toolUse):void 0!==e.toolResult?t.toolResult(e.toolResult):void 0!==e.guardContent?t.guardContent(e.guardContent):void 0!==e.cachePoint?t.cachePoint(e.cachePoint):void 0!==e.reasoningContent?t.reasoningContent(e.reasoningContent):t._(e.$unknown[0],e.$unknown[1])}(_o||(_o={}));var xo,Ro,Co,Mo,Po,To;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):t._(e.$unknown[0],e.$unknown[1])}(xo||(xo={})),function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.guardContent?t.guardContent(e.guardContent):void 0!==e.cachePoint?t.cachePoint(e.cachePoint):t._(e.$unknown[0],e.$unknown[1])}(Ro||(Ro={})),function(e){e.visit=(e,t)=>void 0!==e.auto?t.auto(e.auto):void 0!==e.any?t.any(e.any):void 0!==e.tool?t.tool(e.tool):t._(e.$unknown[0],e.$unknown[1])}(Co||(Co={})),function(e){e.visit=(e,t)=>void 0!==e.json?t.json(e.json):t._(e.$unknown[0],e.$unknown[1])}(Mo||(Mo={})),function(e){e.visit=(e,t)=>void 0!==e.toolSpec?t.toolSpec(e.toolSpec):void 0!==e.cachePoint?t.cachePoint(e.cachePoint):t._(e.$unknown[0],e.$unknown[1])}(Po||(Po={})),function(e){e.visit=(e,t)=>void 0!==e.message?t.message(e.message):t._(e.$unknown[0],e.$unknown[1])}(To||(To={}));class Oo extends oo{name="ModelErrorException";$fault="client";originalStatusCode;resourceName;constructor(e){super({name:"ModelErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,Oo.prototype),this.originalStatusCode=e.originalStatusCode,this.resourceName=e.resourceName}}class No extends oo{name="ModelNotReadyException";$fault="client";$retryable={};constructor(e){super({name:"ModelNotReadyException",$fault:"client",...e}),Object.setPrototypeOf(this,No.prototype)}}class Lo extends oo{name="ModelTimeoutException";$fault="client";constructor(e){super({name:"ModelTimeoutException",$fault:"client",...e}),Object.setPrototypeOf(this,Lo.prototype)}}var $o,Do,Fo,Uo;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.redactedContent?t.redactedContent(e.redactedContent):void 0!==e.signature?t.signature(e.signature):t._(e.$unknown[0],e.$unknown[1])}($o||($o={})),function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.toolUse?t.toolUse(e.toolUse):void 0!==e.reasoningContent?t.reasoningContent(e.reasoningContent):t._(e.$unknown[0],e.$unknown[1])}(Do||(Do={})),function(e){e.visit=(e,t)=>void 0!==e.toolUse?t.toolUse(e.toolUse):t._(e.$unknown[0],e.$unknown[1])}(Fo||(Fo={}));class Bo extends oo{name="ModelStreamErrorException";$fault="client";originalStatusCode;originalMessage;constructor(e){super({name:"ModelStreamErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,Bo.prototype),this.originalStatusCode=e.originalStatusCode,this.originalMessage=e.originalMessage}}!function(e){e.visit=(e,t)=>void 0!==e.messageStart?t.messageStart(e.messageStart):void 0!==e.contentBlockStart?t.contentBlockStart(e.contentBlockStart):void 0!==e.contentBlockDelta?t.contentBlockDelta(e.contentBlockDelta):void 0!==e.contentBlockStop?t.contentBlockStop(e.contentBlockStop):void 0!==e.messageStop?t.messageStop(e.messageStop):void 0!==e.metadata?t.metadata(e.metadata):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(Uo||(Uo={}));var jo,Ho,qo;!function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):t._(e.$unknown[0],e.$unknown[1])}(jo||(jo={})),function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.modelTimeoutException?t.modelTimeoutException(e.modelTimeoutException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(Ho||(Ho={})),function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.modelTimeoutException?t.modelTimeoutException(e.modelTimeoutException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(qo||(qo={}));const zo=e=>({...e,...e.body&&{body:ro}}),Vo=e=>({...e,...e.body&&{body:ro}}),Go=e=>({...e,...e.body&&{body:ro}}),Wo=e=>({...e,...e.body&&{body:"STREAMING_CONTENT"}});class Ko extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return function(e,t){return"base64"===t?Ko.mutate(vi(e)):Ko.mutate(Tn(e))}(e,t);throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,Ko.prototype),e}transformToString(e="utf-8"){return function(e,t="utf-8"){return"base64"===t?Ci(e):Mi(e)}(this,e)}}const Jo=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Ko.mutate(e);if(!e)return Ko.mutate(new Uint8Array);const n=t.streamCollector(e);return Ko.mutate(await n)},Yo=(e,t)=>((e,t)=>Jo(e,t).then(e=>t.utf8Encoder(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}}),Qo=async(e,t)=>{const n=await Yo(e,t);return n.message=n.message??n.Message,n};function Xo(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function Zo(e,t){return new ea(e,t)}class ea{constructor(e,t){this.input=e,this.context=t,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:e,protocol:t="https",port:n,path:r}=await this.context.endpoint();this.path=r;for(const e of this.resolvePathStack)e(this.path);return new Xe({protocol:t,hostname:this.hostname||e,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,n,r){return this.resolvePathStack.push(i=>{this.path=((e,t,n,r,i,s)=>{if(null==t||void 0===t[n])throw new Error("No value provided for input HTTP label: "+n+".");{const t=r();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");e=e.replace(i,s?t.split("/").map(e=>Xo(e)).join("/"):Xo(t))}return e})(i,this.input,e,t,n,r)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}function ta(e,t,n){let r,i,s;if(void 0===t&&void 0===n)r={},s=e;else{if(r=e,"function"==typeof t)return i=t,s=n,ra(r,i,s);s=t}for(const e of Object.keys(s))Array.isArray(s[e])?ia(r,null,s,e):r[e]=s[e];return r}const na=(e,t)=>{const n={};for(const r in t)ia(n,e,t,r);return n},ra=(e,t,n)=>ta(e,Object.entries(n).reduce((e,[n,r])=>(Array.isArray(r)?e[n]=r:e[n]="function"==typeof r?[t,r()]:[t,r],e),{})),ia=(e,t,n,r)=>{if(null!==t){let i=n[r];"function"==typeof i&&(i=[,i]);const[s=sa,o=oa,a=r]=i;return void(("function"==typeof s&&s(t[a])||"function"!=typeof s&&s)&&(e[r]=o(t[a])))}let[i,s]=n[r];if("function"==typeof s){let t;const n=void 0===i&&null!=(t=s()),o="function"==typeof i&&!!i(void 0)||"function"!=typeof i&&!!i;n?e[r]=t:o&&(e[r]=s())}else{const t=void 0===i&&null!=s,n="function"==typeof i&&!!i(s)||"function"!=typeof i&&!!i;(t||n)&&(e[r]=s)}},sa=e=>null!=e,oa=e=>e,aa=e=>null!=e,ca=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ua=(Math.ceil(2**127*(2-2**-23)),e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}}),da=e=>la(e,32),la=(e,t)=>{const n=ua(e);if(void 0!==n&&ha(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},ha=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},fa=e=>{if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return ma.warn(pa(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},pa=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),ma={warn:console.warn},ga=async(e,t)=>{const n=Zo(e,t),r=ta({},aa,{[Wa]:e[Ga]||"application/octet-stream",[Va]:e[Va],[rc]:e[Qa],[ec]:e[Ka],[tc]:e[Ja],[nc]:e[Ya]});let i;return n.bp("/model/{modelId}/invoke"),n.p("modelId",()=>e.modelId,"{modelId}",!1),void 0!==e.body&&(i=e.body),n.m("POST").h(r).b(i),n.build()},ya=async(e,t)=>{const n=Zo(e,t),r=ta({},aa,{[Wa]:e[Ga]||"application/octet-stream",[Xa]:e[Va],[rc]:e[Qa],[ec]:e[Ka],[tc]:e[Ja],[nc]:e[Ya]});let i;return n.bp("/model/{modelId}/invoke-with-response-stream"),n.p("modelId",()=>e.modelId,"{modelId}",!1),void 0!==e.body&&(i=e.body),n.m("POST").h(r).b(i),n.build()},wa=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return va(e,t);const n=ta({$metadata:za(e),[Ga]:[,e.headers[Wa]],[Ya]:[,e.headers[nc]]}),r=await Jo(e.body,t);return n.body=r,n},ba=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return va(e,t);const n=ta({$metadata:za(e),[Ga]:[,e.headers[Za]],[Ya]:[,e.headers[nc]]}),r=e.body;return n.body=La(r,t),n},va=async(e,t)=>{const n={...e,body:await Qo(e.body,t)},r=((e,t)=>{const n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=n(e.headers,"x-amzn-errortype");if(void 0!==i)return r(e.headers[i]);if(t&&"object"==typeof t){const e=n(t,"code");if(e&&void 0!==t[e])return r(t[e]);if(void 0!==t.__type)return r(t.__type)}})(e,n.body);switch(r){case"AccessDeniedException":case"com.amazonaws.bedrockruntime#AccessDeniedException":throw await Ea(n,t);case"InternalServerException":case"com.amazonaws.bedrockruntime#InternalServerException":throw await Ia(n,t);case"ResourceNotFoundException":case"com.amazonaws.bedrockruntime#ResourceNotFoundException":throw await Ma(n,t);case"ServiceQuotaExceededException":case"com.amazonaws.bedrockruntime#ServiceQuotaExceededException":throw await Pa(n,t);case"ThrottlingException":case"com.amazonaws.bedrockruntime#ThrottlingException":throw await Oa(n,t);case"ValidationException":case"com.amazonaws.bedrockruntime#ValidationException":throw await Na(n,t);case"ModelErrorException":case"com.amazonaws.bedrockruntime#ModelErrorException":throw await _a(n,t);case"ModelNotReadyException":case"com.amazonaws.bedrockruntime#ModelNotReadyException":throw await xa(n,t);case"ModelTimeoutException":case"com.amazonaws.bedrockruntime#ModelTimeoutException":throw await Ca(n,t);case"ServiceUnavailableException":case"com.amazonaws.bedrockruntime#ServiceUnavailableException":throw await Ta(n,t);case"ModelStreamErrorException":case"com.amazonaws.bedrockruntime#ModelStreamErrorException":throw await Ra(n,t);case"ConflictException":case"com.amazonaws.bedrockruntime#ConflictException":throw await Aa(n,t);default:const i=n.body;return ka({output:e,parsedBody:i,errorCode:r})}},ka=(Sa=oo,({output:e,parsedBody:t,errorCode:n})=>{(({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{const i=ca(e),s=i.httpStatusCode?i.httpStatusCode+"":void 0,o=new n({name:t?.code||t?.Code||r||s||"UnknownError",$fault:"client",$metadata:i});throw so(o,t)})({output:e,parsedBody:t,exceptionCtor:Sa,errorCode:n})});var Sa;const Ea=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new ao({$metadata:za(e),...n});return so(s,e.body)},Aa=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new fo({$metadata:za(e),...n});return so(s,e.body)},Ia=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new uo({$metadata:za(e),...n});return so(s,e.body)},_a=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa,originalStatusCode:da,resourceName:fa});Object.assign(n,i);const s=new Oo({$metadata:za(e),...n});return so(s,e.body)},xa=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new No({$metadata:za(e),...n});return so(s,e.body)},Ra=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa,originalMessage:fa,originalStatusCode:da});Object.assign(n,i);const s=new Bo({$metadata:za(e),...n});return so(s,e.body)},Ca=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new Lo({$metadata:za(e),...n});return so(s,e.body)},Ma=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new po({$metadata:za(e),...n});return so(s,e.body)},Pa=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new mo({$metadata:za(e),...n});return so(s,e.body)},Ta=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new go({$metadata:za(e),...n});return so(s,e.body)},Oa=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new lo({$metadata:za(e),...n});return so(s,e.body)},Na=async(e,t)=>{const n=ta({}),r=e.body,i=na(r,{message:fa});Object.assign(n,i);const s=new ho({$metadata:za(e),...n});return so(s,e.body)},La=(e,t)=>t.eventStreamMarshaller.deserialize(e,async n=>null!=n.chunk?{chunk:await Ua(n.chunk,t)}:null!=n.internalServerException?{internalServerException:await $a(n.internalServerException,t)}:null!=n.modelStreamErrorException?{modelStreamErrorException:await Da(n.modelStreamErrorException,t)}:null!=n.validationException?{validationException:await Ha(n.validationException,t)}:null!=n.throttlingException?{throttlingException:await ja(n.throttlingException,t)}:null!=n.modelTimeoutException?{modelTimeoutException:await Fa(n.modelTimeoutException,t)}:null!=n.serviceUnavailableException?{serviceUnavailableException:await Ba(n.serviceUnavailableException,t)}:{$unknown:e}),$a=async(e,t)=>{const n={...e,body:await Yo(e.body,t)};return Ia(n,t)},Da=async(e,t)=>{const n={...e,body:await Yo(e.body,t)};return Ra(n,t)},Fa=async(e,t)=>{const n={...e,body:await Yo(e.body,t)};return Ca(n,t)},Ua=async(e,t)=>{const n={},r=await Yo(e.body,t);return Object.assign(n,qa(r,t)),n},Ba=async(e,t)=>{const n={...e,body:await Yo(e.body,t)};return Ta(n,t)},ja=async(e,t)=>{const n={...e,body:await Yo(e.body,t)};return Oa(n,t)},Ha=async(e,t)=>{const n={...e,body:await Yo(e.body,t)};return Na(n,t)},qa=(e,t)=>na(e,{bytes:t.base64Decoder}),za=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Va="accept",Ga="contentType",Wa="content-type",Ka="guardrailIdentifier",Ja="guardrailVersion",Ya="performanceConfigLatency",Qa="trace",Xa="x-amzn-bedrock-accept",Za="x-amzn-bedrock-content-type",ec="x-amzn-bedrock-guardrailidentifier",tc="x-amzn-bedrock-guardrailversion",nc="x-amzn-bedrock-performanceconfig-latency",rc="x-amzn-bedrock-trace";class ic extends(to.classBuilder().ep(mr).m(function(e,t,n,r){return[Os(n,this.serialize,this.deserialize),qs(n,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").f(Go,Wo).ser(ya).de(ba).build()){}class sc extends(to.classBuilder().ep(mr).m(function(e,t,n,r){return[Os(n,this.serialize,this.deserialize),qs(n,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").f(zo,Vo).ser(ga).de(wa).build()){}function oc(e,t){const n=cc();return(oc=function(e,t){return n[e-=116]})(e,t)}const ac=oc;function cc(){const e=["_prepareRequestHeaders","Human:\n","Your task is to execute the instruction using the provided HTML content. Follow the instruction closely. Your answer must be a properly formatted HTML code. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","_processProxyRequest","decode","_bedrockClientConfig","<<SYS>>\n","json","1875325yscNNL","_processAWSRequest","AWSTextAdapter","2923218duqbcz","body","ai21.j2","read","156716GAoxCc","_readStreamableResponse","POST","application/json","_readAsyncIterableResponse","preparePrompt","signal","data","generation","312XupHei","completions","568750jDeGxg","config","abortController","parse","anthropic.claude","\nYou must keep the text formatting.\n\nContent:\n","_getGeneratedText","text","locale","cohere.command","map","stringify","resolve","meta.llama","2714704dlMmsb","get","_requestHeaders","Instruction:\n","generations","ai.aws.apiUrl","utf-8","ai.aws.bedrockClientConfig","ai.aws.requestParameters","_readStaticResponse","editor","test","completion","bytes","bedrock-2023-05-31","anthropic.claude-v2","getReader","_apiUrl","_requestParameters","getModelFamily","ai.aws.requestHeaders","64054bkdJVY","sendRequest","12ENqwxG","join","chunk","send","pluginName","\n[/INST]","split","7530696cNHDMx","\n<</SYS>>\n[INST]\n","AI_ERROR_UNSUPPORTED_MODEL","8FIwcOG","filter","length","define","_prepareRequestParameters","Your task is to generate HTML content accordingly to the given instruction. Never include <img> tag in your response even if asked for. Your answer must be a well-structured and properly formatted HTML code. Answer only with the generated HTML content. Do not add any additional remarks or notes. Do not act like a chatbot or a real person.","\n\nAssistant:"];return(cc=function(){return e})()}!function(e){const t=oc,n=e();for(;;)try{if(553473===-parseInt(t(147))/1*(parseInt(t(135))/2)+parseInt(t(165))/3+parseInt(t(194))/4+-parseInt(t(162))/5*(parseInt(t(137))/6)+parseInt(t(169))/7*(-parseInt(t(178))/8)+parseInt(t(144))/9+-parseInt(t(180))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(cc);class uc extends We{[ac(131)];[ac(116)];[ac(159)];[ac(132)];static get[ac(141)](){return ac(164)}constructor(e){const t=ac;super(e),e[t(181)][t(195)](t(122))||e[t(181)][t(150)](t(122),{model:t(129),max_tokens_to_sample:2e3,temperature:1,top_p:1,top_k:250,anthropic_version:t(128),stream:!0}),this[t(131)]=e[t(181)][t(195)](t(119)),this[t(159)]=e[t(181)][t(195)](t(121)),this[t(116)]=e[t(181)][t(195)](t(134)),this[t(132)]=e[t(181)][t(195)](t(122))}async[ac(136)]({query:e,context:t,onData:n,actionId:r}){const i=ac,{model:s,stream:o,...a}=await this[i(151)](this[i(132)],r),c={prompt:await this[i(174)](e,t,s,r),...a};this[i(131)]?await this[i(157)](c,s,o,n,r):await this[i(163)](c,s,o,n)}async[ac(174)](e,t,n,r){const i=ac;let s,o;return t?(s=i(156),o=i(117)+e+i(185)+t):(s=i(152),o=e),i(193)==this[i(133)](n)?i(160)+s+i(145)+o+i(142):i(155)+s+"\n"+o+i(153)}[ac(133)](e){const t=ac;if(/^anthropic\.claude/[t(125)](e))return t(184);if(/^ai21\.j2/[t(125)](e))return t(167);if(/^cohere\.command/[t(125)](e))return t(189);if(/^meta\.llama/[t(125)](e))return t(193);throw new b(v(this[t(124)][t(188)],t(146),e))}async[ac(157)](e,t,n,r,i){const s=ac,o={method:s(171),headers:await this[s(154)](this[s(116)],i),body:JSON[s(191)]({...e,model:t,stream:n}),signal:this[s(182)][s(175)]},a=await fetch(this[s(131)],o);n?await this[s(170)](a,t,r):await this[s(123)](a,t,r)}async[ac(163)](e,t,n,r){const i=ac,s=new Cs(this[i(159)]),o={body:JSON[i(191)](e),contentType:i(172),accept:i(172),modelId:t};let a;if(n){const e=new ic(o);a=await s[i(140)](e,{abortSignal:this[i(182)][i(175)]}),await this[i(173)](a,t,r)}else{const e=new sc(o);a=await s[i(140)](e,{abortSignal:this[i(182)][i(175)]}),await this[i(123)](a,t,r)}}async[ac(173)](e,t,n){const r=ac,i=e[r(166)],s=new TextDecoder(r(120));let o="";for await(const e of i)if(e[r(139)]){const i=s[r(158)](e[r(139)][r(127)]),a=JSON[r(183)](i);o+=this[r(186)](a,t),n(o)}return Promise[r(192)]()}async[ac(170)](e,t,n){const r=ac,i=e[r(166)],s=new TextDecoder(r(120)),o=i[r(130)]();let a="",c="",u=!1;for(;!u;){const{done:e,value:i}=await o[r(168)]();if(u=e,u)break;const d=(a+s[r(158)](i))[r(143)]("\n")[r(190)](e=>{const t=r;try{return a="",JSON[t(183)](e)}catch{return a=e,null}})[r(148)](e=>null!==e);d[r(149)]&&(c+=d[r(190)](e=>this[r(186)](e,t))[r(138)](""),n(c))}return Promise[r(192)]()}async[ac(123)](e,t,n){const r=ac;let i;return i=e instanceof Response?await e[r(161)]():JSON[r(183)](new TextDecoder(r(120))[r(158)](e[r(166)])),n(this[r(186)](i,t)),Promise[r(192)]()}[ac(186)](e,t){const n=ac;switch(this[n(133)](t)){case n(184):return e[n(126)];case n(167):return e[n(179)][0][n(176)][n(187)];case n(189):return e[n(118)][0][n(187)];case n(193):return e[n(177)]}}}function dc(){var e=["7089560DeCvNR","1938trGFRo","16887OOLBuY","15186204yaBUwD","11221AZDUuf","1500266IjZbde","724LcknYU","3595505Cynosh","810106xXlDzU"];return(dc=function(){return e})()}function lc(e,t){var n=dc();return(lc=function(e,t){return n[e-=191]})(e,t)}!function(e){for(var t=lc,n=e();;)try{if(523167===-parseInt(t(193))/1+parseInt(t(199))/2+parseInt(t(196))/3*(parseInt(t(191))/4)+-parseInt(t(192))/5+-parseInt(t(195))/6*(parseInt(t(198))/7)+-parseInt(t(194))/8+parseInt(t(197))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(dc)})(),(window.CKEditor5=window.CKEditor5||{}).ai=r})();