@salla.sa/twilight-components 2.14.301 → 2.14.302

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 (138) hide show
  1. package/dist/cjs/{filepond-CiGLkWY7.js → filepond-BRWi-MWe.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-113aCl-e.js → filepond-plugin-file-poster-BeKSlvGr.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CiZz56Xi.js → filepond-plugin-file-validate-size-nonPpUBw.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DTb9Ct3C.js → filepond-plugin-file-validate-type-BucCOm94.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BL6ixM-6.js → filepond-plugin-image-edit-GnrEKFw1.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-DVosclA-.js → filepond-plugin-image-exif-orientation-CcyyVfMq.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CNqKulm7.js → filepond-plugin-image-preview-C9Z27UBx.js} +1 -1
  8. package/dist/cjs/{index-DHfe8MsY.js → index--gjiun-h.js} +1 -1
  9. package/dist/cjs/{index-cNY_E-l7.js → index-BWcgfy8W.js} +2 -2
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +9 -9
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +3 -2
  18. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  45. package/dist/cjs/twilight.cjs.js +1 -1
  46. package/dist/collection/components/salla-contacts/salla-contacts.js +2 -1
  47. package/dist/components/index.js +2 -2
  48. package/dist/components/salla-contacts.js +2 -1
  49. package/dist/esm/{filepond-C7eUn4lx.js → filepond-DIi7VF0c.js} +1 -1
  50. package/dist/esm/{filepond-plugin-file-poster-vmXXIkL6.js → filepond-plugin-file-poster-C7auTp2H.js} +1 -1
  51. package/dist/esm/{filepond-plugin-file-validate-size-BZZqHehK.js → filepond-plugin-file-validate-size-DqiYtpc2.js} +1 -1
  52. package/dist/esm/{filepond-plugin-file-validate-type-BbwD6h-S.js → filepond-plugin-file-validate-type-Drt0dfiK.js} +1 -1
  53. package/dist/esm/{filepond-plugin-image-edit-xJ4IGVgP.js → filepond-plugin-image-edit-B8vrHstP.js} +1 -1
  54. package/dist/esm/{filepond-plugin-image-exif-orientation-BG7bHX2B.js → filepond-plugin-image-exif-orientation-CEFy5_xT.js} +1 -1
  55. package/dist/esm/{filepond-plugin-image-preview-DNRiGZ1w.js → filepond-plugin-image-preview-BJIFb11t.js} +1 -1
  56. package/dist/esm/{index-wTZ5u3Qu.js → index-DKAYrLM1.js} +2 -2
  57. package/dist/esm/{index-DMx0pIZZ.js → index-lg6hKynk.js} +1 -1
  58. package/dist/esm/loader.js +2 -2
  59. package/dist/esm/salla-accordion_62.entry.js +9 -9
  60. package/dist/esm/salla-advertisement.entry.js +1 -1
  61. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  62. package/dist/esm/salla-apps-icons.entry.js +1 -1
  63. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  64. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  65. package/dist/esm/salla-contacts.entry.js +3 -2
  66. package/dist/esm/salla-custom-fields.entry.js +1 -1
  67. package/dist/esm/salla-filters-widget.entry.js +1 -1
  68. package/dist/esm/salla-filters.entry.js +1 -1
  69. package/dist/esm/salla-installment.entry.js +1 -1
  70. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  71. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  72. package/dist/esm/salla-metadata.entry.js +1 -1
  73. package/dist/esm/salla-notification-item.entry.js +1 -1
  74. package/dist/esm/salla-notifications.entry.js +1 -1
  75. package/dist/esm/salla-offer.entry.js +1 -1
  76. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  77. package/dist/esm/salla-order-details-options.entry.js +1 -1
  78. package/dist/esm/salla-order-details.entry.js +1 -1
  79. package/dist/esm/salla-order-summary.entry.js +1 -1
  80. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  81. package/dist/esm/salla-orders.entry.js +1 -1
  82. package/dist/esm/salla-payments.entry.js +1 -1
  83. package/dist/esm/salla-price-range.entry.js +1 -1
  84. package/dist/esm/salla-review-card.entry.js +1 -1
  85. package/dist/esm/salla-reviews-page.entry.js +1 -1
  86. package/dist/esm/salla-reviews.entry.js +1 -1
  87. package/dist/esm/salla-social.entry.js +1 -1
  88. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  89. package/dist/esm/salla-tooltip.entry.js +1 -1
  90. package/dist/esm/salla-trust-badges.entry.js +1 -1
  91. package/dist/esm/salla-verify.entry.js +1 -1
  92. package/dist/esm/salla-wallet.entry.js +1 -1
  93. package/dist/esm/twilight.js +2 -2
  94. package/dist/twilight/{p-509bef7a.entry.js → p-02ec6e21.entry.js} +1 -1
  95. package/dist/twilight/{p-b1c59aed.entry.js → p-04bf9f1e.entry.js} +1 -1
  96. package/dist/twilight/{p-1f90b598.entry.js → p-09e11910.entry.js} +1 -1
  97. package/dist/twilight/{p-19f51013.entry.js → p-0b6606df.entry.js} +1 -1
  98. package/dist/twilight/{p-21106ddd.entry.js → p-1276c373.entry.js} +1 -1
  99. package/dist/twilight/{p-7c851abe.entry.js → p-1b144eb9.entry.js} +1 -1
  100. package/dist/twilight/{p-0f8e76f9.entry.js → p-210fdc70.entry.js} +1 -1
  101. package/dist/twilight/{p-fcbf87ce.entry.js → p-407e93bd.entry.js} +1 -1
  102. package/dist/twilight/{p-9eea4938.entry.js → p-4f275162.entry.js} +1 -1
  103. package/dist/twilight/{p-fa941083.entry.js → p-5143a824.entry.js} +1 -1
  104. package/dist/twilight/{p-3578f709.entry.js → p-61f7623a.entry.js} +1 -1
  105. package/dist/twilight/{p-f17f2815.entry.js → p-6a14e2e4.entry.js} +1 -1
  106. package/dist/twilight/{p-6a22cdb0.entry.js → p-78f36598.entry.js} +1 -1
  107. package/dist/twilight/{p-620bf923.entry.js → p-7ca07684.entry.js} +1 -1
  108. package/dist/twilight/{p-31e4965e.entry.js → p-824bba69.entry.js} +1 -1
  109. package/dist/twilight/{p-d338a839.entry.js → p-83125835.entry.js} +1 -1
  110. package/dist/twilight/{p-32cc9ddd.entry.js → p-933fbd4d.entry.js} +1 -1
  111. package/dist/twilight/{p-E_gyshLJ.js → p-CF24vbMv.js} +1 -1
  112. package/dist/twilight/{p-DUi-y-L3.js → p-CXXmrPiy.js} +1 -1
  113. package/dist/twilight/{p-wTZ5u3Qu.js → p-DKAYrLM1.js} +1 -1
  114. package/dist/twilight/{p-CZNpa8Wt.js → p-DTof2E91.js} +1 -1
  115. package/dist/twilight/{p-cBibjZzs.js → p-Dukd0jtD.js} +1 -1
  116. package/dist/twilight/{p-492f76aa.entry.js → p-a5201709.entry.js} +1 -1
  117. package/dist/twilight/{p-7e77c246.entry.js → p-a6a38898.entry.js} +1 -1
  118. package/dist/twilight/{p-c89ca00d.entry.js → p-aaba5a2f.entry.js} +1 -1
  119. package/dist/twilight/{p-ffe0b3f8.entry.js → p-b54bb957.entry.js} +1 -1
  120. package/dist/twilight/{p-10d2d437.entry.js → p-ba2ce400.entry.js} +1 -1
  121. package/dist/twilight/{p-41a59f32.entry.js → p-bf9620c6.entry.js} +1 -1
  122. package/dist/twilight/{p-57fdc503.entry.js → p-c163648b.entry.js} +1 -1
  123. package/dist/twilight/{p-c7e91395.entry.js → p-c786edfa.entry.js} +1 -1
  124. package/dist/twilight/{p-1f3223b5.entry.js → p-c98d22e3.entry.js} +1 -1
  125. package/dist/twilight/{p-b1d0f305.entry.js → p-da5abb49.entry.js} +1 -1
  126. package/dist/twilight/{p-680fd54e.entry.js → p-dbac72c9.entry.js} +1 -1
  127. package/dist/twilight/{p-67354cb0.entry.js → p-dfb34dbd.entry.js} +1 -1
  128. package/dist/twilight/{p-a5774669.entry.js → p-e382c1f5.entry.js} +1 -1
  129. package/dist/twilight/{p-ec00e74e.entry.js → p-ee2e2c06.entry.js} +1 -1
  130. package/dist/twilight/{p-1015c659.entry.js → p-f10f54b7.entry.js} +2 -2
  131. package/dist/twilight/{p-21ffae60.entry.js → p-f10f5a36.entry.js} +1 -1
  132. package/dist/twilight/{p-95f2f372.entry.js → p-faddd04f.entry.js} +1 -1
  133. package/dist/twilight/{p-j-xabI8F.js → p-hhYSmY98.js} +2 -2
  134. package/dist/twilight/{p-B1qckR0H.js → p-pqbC2f_4.js} +1 -1
  135. package/dist/twilight/{p-ZsI3fS_o.js → p-vQaSX60M.js} +1 -1
  136. package/dist/twilight/{p-DMdYXt9I.js → p-zRye1rCZ.js} +1 -1
  137. package/dist/twilight/twilight.esm.js +1 -1
  138. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as t,H as s,a as e}from"./p-wTZ5u3Qu.js";const i=class{constructor(t){if(a(this,t),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(a){salla.log("Bad json passed via entityId prop")}}getValue(a){if("file"===a.type)return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===a.type)return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`;if("date"===a.type){const t=new Date(a.value);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}return a.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const a=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=a.data[0]?.sections}render(){if(this.specs.length)return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};i.style="";export{i as salla_metadata}
4
+ import{r as a,h as t,H as s,a as e}from"./p-DKAYrLM1.js";const i=class{constructor(t){if(a(this,t),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(a){salla.log("Bad json passed via entityId prop")}}getValue(a){if("file"===a.type)return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===a.type)return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`;if("date"===a.type){const t=new Date(a.value);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}return a.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const a=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=a.data[0]?.sections}render(){if(this.specs.length)return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};i.style="";export{i as salla_metadata}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as i,H as e}from"./p-wTZ5u3Qu.js";var s,a;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(s||(s={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(a||(a={}));const n=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t));if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((({data:t})=>{t.forEach((({id:t,url:i,image:e})=>{this.products[t]={url:i,image:e}}))}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===a.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}getCheckpointContent(t){if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return salla.money(t.value);if(t.type!==s.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;return i===a.PRODUCT_COUNT?salla.lang.choice("blocks.header.products_count",t.min_spend):i===a.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,a){const n=(t-i)*(a-s)/(e-i)+s;return n===Number.POSITIVE_INFINITY?100:n===Number.NEGATIVE_INFINITY?0:this.clamp(n,0,100)}getCheckPointView(t,e){const s=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),a=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[s-1]?.min_spend??0,t.min_spend,0,100),n=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${a}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(n?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(n?"active":""),innerHTML:this.products&&this.getCheckpointContent(t)}),i("div",{class:"s-conditional-offer-checkpoint-label "+(n?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:n},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};n.style=":host{display:block}";export{n as salla_conditional_offer}
4
+ import{r as t,h as i,H as e}from"./p-DKAYrLM1.js";var s,a;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(s||(s={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(a||(a={}));const n=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t));if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((({data:t})=>{t.forEach((({id:t,url:i,image:e})=>{this.products[t]={url:i,image:e}}))}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===a.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}getCheckpointContent(t){if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return salla.money(t.value);if(t.type!==s.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;return i===a.PRODUCT_COUNT?salla.lang.choice("blocks.header.products_count",t.min_spend):i===a.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,a){const n=(t-i)*(a-s)/(e-i)+s;return n===Number.POSITIVE_INFINITY?100:n===Number.NEGATIVE_INFINITY?0:this.clamp(n,0,100)}getCheckPointView(t,e){const s=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),a=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[s-1]?.min_spend??0,t.min_spend,0,100),n=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${a}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(n?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(n?"active":""),innerHTML:this.products&&this.getCheckpointContent(t)}),i("div",{class:"s-conditional-offer-checkpoint-label "+(n?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:n},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};n.style=":host{display:block}";export{n as salla_conditional_offer}
@@ -1,9 +1,9 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as e}from"./p-wTZ5u3Qu.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var n,i,E={exports:{}},T=n?E.exports:(n=1,E.exports=(i=function(e){var t=e.addFilter,n=e.utils,i=n.Type,E=n.isString,T=n.replaceInString,r=n.guesstimateMimeType,u=n.getExtensionFromFilename,o=n.getFilenameFromURL,_=function(e,t){return e.some((function(e){return/\*$/.test(e)?(n=e,(/^[^/]+/.exec(t)||[]).pop()===n.slice(0,-2)):e===t;var n}))},a=function(e,t,n){if(0===t.length)return!0;var i=function(e){var t="";if(E(e)){var n=o(e),i=u(n);i&&(t=r(i))}else t=e.type;return t}(e);return n?new Promise((function(E,T){n(e,i).then((function(e){_(t,e)?E():T()})).catch(T)})):_(t,i)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var n=t.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||a(e,n("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var n=t.query;return new Promise((function(t,i){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var E=n("GET_ACCEPTED_FILE_TYPES"),r=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),u=a(e,E,r),o=function(){var e,t=E.map((e=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(t){return null!==e[t]&&(e[t]||t)})).filter((function(e){return!1!==e})),r=t.filter((function(e,n){return t.indexOf(e)===n}));i({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:T(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:r.join(", "),allButLastType:r.slice(0,-1).join(", "),lastType:r[t.length-1]})}})};if("boolean"==typeof u)return u?t(e):o();u.then((function(){t(e)})).catch(o)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i)),r=t({__proto__:null,default:e(T)},[T]);
4
+ import{d as e}from"./p-DKAYrLM1.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var n,i,E={exports:{}},r=n?E.exports:(n=1,E.exports=(i=function(e){var t=e.addFilter,n=e.utils,i=n.Type,E=n.isString,r=n.replaceInString,T=n.guesstimateMimeType,u=n.getExtensionFromFilename,o=n.getFilenameFromURL,_=function(e,t){return e.some((function(e){return/\*$/.test(e)?(n=e,(/^[^/]+/.exec(t)||[]).pop()===n.slice(0,-2)):e===t;var n}))},a=function(e,t,n){if(0===t.length)return!0;var i=function(e){var t="";if(E(e)){var n=o(e),i=u(n);i&&(t=T(i))}else t=e.type;return t}(e);return n?new Promise((function(E,r){n(e,i).then((function(e){_(t,e)?E():r()})).catch(r)})):_(t,i)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var n=t.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||a(e,n("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var n=t.query;return new Promise((function(t,i){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var E=n("GET_ACCEPTED_FILE_TYPES"),T=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),u=a(e,E,T),o=function(){var e,t=E.map((e=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(t){return null!==e[t]&&(e[t]||t)})).filter((function(e){return!1!==e})),T=t.filter((function(e,n){return t.indexOf(e)===n}));i({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:r(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:T.join(", "),allButLastType:T.slice(0,-1).join(", "),lastType:T[t.length-1]})}})};if("boolean"==typeof u)return u?t(e):o();u.then((function(){t(e)})).catch(o)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i)),T=t({__proto__:null,default:e(r)},[r]);
5
5
  /*!
6
6
  * FilePondPluginFileValidateType 1.2.8
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
8
8
  * Please visit https://pqina.nl/filepond/ for details.
9
- */export{r as f}
9
+ */export{T as f}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as t}from"./p-wTZ5u3Qu.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}}))})),Object.freeze(t)}var i,r={exports:{}},e=(i||(i=1,r.exports=function(){function t(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=[],r=!0,e=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(r=(o=u.next()).done)&&(i.push(o.value),i.length!==n);r=!0);}catch(t){e=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(e)throw a}}return i}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n=function(t,n){return e(t.x*n,t.y*n)},i=function(t,n){return e(t.x+n.x,t.y+n.y)},r=function(t,n,i){var r=Math.cos(n),a=Math.sin(n),o=e(t.x-i.x,t.y-i.y);return e(i.x+r*o.x-a*o.y,i.y+a*o.x+r*o.y)},e=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},a=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*i:"number"==typeof t?t*(r?n[r]:Math.min(n.width,n.height)):void 0},o=function(t){return null!=t},u=function(t,n){return Object.keys(n).forEach((function(i){return t.setAttribute(i,n[i])}))},c=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg",t);return n&&u(i,n),i},f={contain:"xMidYMid meet",cover:"xMidYMid slice"},E={left:"start",center:"middle",right:"end"},_=function(t){return function(n){return c(t,{id:n.id})}},s={image:function(t){var n=c("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return n.onload=function(){n.setAttribute("opacity",t.opacity||1)},n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),n},rect:_("rect"),ellipse:_("ellipse"),text:_("text"),path:_("path"),line:function(t){var n=c("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=c("line");n.appendChild(i);var r=c("path");n.appendChild(r);var e=c("path");return n.appendChild(e),n}},l={rect:function(t){return u(t,Object.assign({},t.rect,t.styles))},ellipse:function(t){return u(t,Object.assign({cx:t.rect.x+.5*t.rect.width,cy:t.rect.y+.5*t.rect.height,rx:.5*t.rect.width,ry:.5*t.rect.height},t.styles))},image:function(t,n){u(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:f[n.fit]||"none"}))},text:function(t,n,i,r){var e=a(n.fontSize,i,r);u(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":n.fontWeight||"normal","font-size":e,"font-family":n.fontFamily||"sans-serif","text-anchor":E[n.textAlign]||"start"})),t.text!==n.text&&(t.text=n.text,t.textContent=n.text.length?n.text:" ")},path:function(t,n,i,r){var e;u(t,Object.assign({},t.styles,{fill:"none",d:(e=n.points.map((function(t){return{x:a(t.x,i,r,"width"),y:a(t.y,i,r,"height")}})),e.map((function(t,n){return"".concat(0===n?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,o,c,f){u(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var E=t.childNodes[1],_=t.childNodes[2],s=t.rect,l={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(u(t.childNodes[0],{x1:s.x,y1:s.y,x2:l.x,y2:l.y}),o.lineDecoration){E.style.display="none",_.style.display="none";var v=function(t){var n=Math.sqrt(t.x*t.x+t.y*t.y);return 0===n?{x:0,y:0}:e(t.x/n,t.y/n)}({x:l.x-s.x,y:l.y-s.y}),h=a(.05,c,f);if(-1!==o.lineDecoration.indexOf("arrow-begin")){var I=n(v,h),d=i(s,I),p=r(s,2,d),M=r(s,-2,d);u(E,{style:"display:block;",d:"M".concat(p.x,",").concat(p.y," L").concat(s.x,",").concat(s.y," L").concat(M.x,",").concat(M.y)})}if(-1!==o.lineDecoration.indexOf("arrow-end")){var g=n(v,-h),m=i(l,g),T=r(l,2,m),A=r(l,-2,m);u(_,{style:"display:block;",d:"M".concat(T.x,",").concat(T.y," L").concat(l.x,",").concat(l.y," L").concat(A.x,",").concat(A.y)})}}}},v=function(t,n,i,r,e){"path"!==n&&(t.rect=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=a(t.x,n,i,"width")||a(t.left,n,i,"width"),e=a(t.y,n,i,"height")||a(t.top,n,i,"height"),u=a(t.width,n,i,"width"),c=a(t.height,n,i,"height"),f=a(t.right,n,i,"width"),E=a(t.bottom,n,i,"height");return o(e)||(e=o(c)&&o(E)?n.height-c-E:E),o(r)||(r=o(u)&&o(f)?n.width-u-f:f),o(u)||(u=o(r)&&o(f)?n.width-r-f:0),o(c)||(c=o(e)&&o(E)?n.height-e-E:0),{x:r||0,y:e||0,width:u||0,height:c||0}}(i,r,e)),t.styles=function(t,n,i){var r=t.borderStyle||t.lineStyle||"solid",e=t.backgroundColor||t.fontColor||"transparent",o=t.borderColor||t.lineColor||"transparent",u=a(t.borderWidth||t.lineWidth,n,i);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":u||0,"stroke-dasharray":"string"==typeof r?"":r.map((function(t){return a(t,n,i)})).join(","),stroke:o,fill:e,opacity:t.opacity||1}}(i,r,e),l[n](t,i,r,e)},h=["x","y","left","top","right","bottom","width","height"],I=function(n){var i=t(n,2),r=i[0],e=i[1],a=e.points?{}:h.reduce((function(t,n){return t[n]="string"==typeof(i=e[n])&&/%/.test(i)?parseFloat(i)/100:i,t;var i}),{});return[r,Object.assign({zIndex:0},e,a)]},d=function(t,n){return t[1].zIndex>n[1].zIndex?1:t[1].zIndex<n[1].zIndex?-1:0},p=function(n){return n.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(n){var i=n.root,r=n.props;if(r.dirty){var e=r.crop,a=r.resize,o=r.markup,u=r.width,c=r.height,f=e.width,E=e.height;if(a){var _=a.size,l=_&&_.width,h=_&&_.height,p=a.mode;l&&!h&&(h=l),h&&!l&&(l=h);var M=f<l&&E<h;if(!M||M&&a.upscale){var g,m=l/f,T=h/E;"force"===p?(f=l,E=h):("cover"===p?g=Math.max(m,T):"contain"===p&&(g=Math.min(m,T)),f*=g,E*=g)}}var A={width:u,height:c};i.element.setAttribute("width",A.width),i.element.setAttribute("height",A.height);var w=Math.min(u/f,c/E);i.element.innerHTML="";var R=i.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");o.filter(R).map(I).sort(d).forEach((function(n){var r=t(n,2),e=r[0],a=r[1],o=function(t,n){return s[t](n)}(e,a);v(o,e,a,A,w),i.element.appendChild(o)}))}}})},M=function(t,n){return{x:t,y:n}},g=function(t,n){return M(t.x-n.x,t.y-n.y)},m=function(t,n){return Math.sqrt(function(t,n){return function(t,n){return t.x*n.x+t.y*n.y}(g(t,n),g(t,n))}(t,n))},T=function(t,n){var i=t,r=n,e=1.5707963267948966-n,a=Math.sin(1.5707963267948966),o=Math.sin(r),u=Math.sin(e),c=Math.cos(e),f=i/a;return M(c*(f*o),c*(f*u))},A=function(t,n,i,r){var e=2*(r.x>.5?1-r.x:r.x)*t.width,a=2*(r.y>.5?1-r.y:r.y)*t.height,o=function(t,n){var i=t.height,r=T(t.width,n),e=T(i,n),a=M(t.x+Math.abs(r.x),t.y-Math.abs(r.y)),o=M(t.x+t.width+Math.abs(e.y),t.y+Math.abs(e.x)),u=M(t.x-Math.abs(e.y),t.y+t.height-Math.abs(e.x));return{width:m(a,o),height:m(a,u)}}(n,i);return Math.max(o.width/e,o.height/a)},w=function(t,n){var i=t.width,r=i*n;return r>t.height&&(i=(r=t.height)/n),{x:.5*(t.width-i),y:.5*(t.height-r),width:i,height:r}},R=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.zoom,r=n.rotation,e=n.center,a=n.aspectRatio;a||(a=t.height/t.width);var o=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.height/t.width,e=1,a=r;a>n&&(e=(a=n)/r);var o=Math.max(1/e,n/a),u=t.width/(i*o*e);return{width:u,height:u*n}}(t,a,i),u=void 0===n.scaleToFit||n.scaleToFit,c=i*A(t,w({width:o.width,height:o.height},a),r,u?e:{x:.5,y:.5});return{widthFloat:o.width/c,heightFloat:o.height/c,width:Math.round(o.width/c),height:Math.round(o.height/c)}},y={type:"spring",stiffness:.5,damping:.45,mass:10},G=function(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(t){var n=t.props;n.background&&(t.root.element.style.backgroundColor=n.background)},create:function(n){var i=n.root,r=n.props;i.ref.image=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:y,originY:y,scaleX:y,scaleY:y,translateX:y,translateY:y,rotateZ:y}},create:function(n){var i=n.root,r=n.props;r.width=r.image.width,r.height=r.image.height,i.ref.bitmap=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(t){t.root.appendChild(t.props.image)}})}(t),{image:r.image}))},write:function(t){var n=t.props.crop.flip,i=t.root.ref.bitmap;i.scaleX=n.horizontal?-1:1,i.scaleY=n.vertical?-1:1}})}(t),Object.assign({},r))),i.ref.createMarkup=function(){i.ref.markup||(i.ref.markup=i.appendChildView(i.createChildView(p(t),Object.assign({},r))))},i.ref.destroyMarkup=function(){i.ref.markup&&(i.removeChildView(i.ref.markup),i.ref.markup=null)};var e=i.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==e&&(i.element.dataset.transparencyIndicator="grid"===e?e:"color")},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=i.crop,a=i.markup,o=i.resize,u=i.dirty,c=i.width,f=i.height;n.ref.image.crop=e;var E={width:c,height:f,center:{x:.5*c,y:.5*f}},_={width:n.ref.image.width,height:n.ref.image.height},s={x:e.center.x*_.width,y:e.center.y*_.height},l={x:E.center.x-_.width*e.center.x,y:E.center.y-_.height*e.center.y},v=2*Math.PI+e.rotation%(2*Math.PI),h=void 0===e.scaleToFit||e.scaleToFit,I=A(_,w(E,e.aspectRatio||_.height/_.width),v,h?e.center:{x:.5,y:.5}),d=e.zoom*I;a&&a.length?(n.ref.createMarkup(),n.ref.markup.width=c,n.ref.markup.height=f,n.ref.markup.resize=o,n.ref.markup.dirty=u,n.ref.markup.markup=a,n.ref.markup.crop=R(_,e)):n.ref.markup&&n.ref.destroyMarkup();var p=n.ref.image;if(r)return p.originX=null,p.originY=null,p.translateX=null,p.translateY=null,p.rotateZ=null,p.scaleX=null,void(p.scaleY=null);p.originX=s.x,p.originY=s.y,p.translateX=l.x,p.translateY=l.y,p.rotateZ=v,p.scaleX=d,p.scaleY=d}})},P=0,D=function(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(n){self.postMessage({id:t.data.id,message:n},[n])}))}},O=function(){self.onmessage=function(t){for(var n=t.data.message.imageData,i=t.data.message.colorMatrix,r=n.data,e=r.length,a=i[0],o=i[1],u=i[2],c=i[3],f=i[4],E=i[5],_=i[6],s=i[7],l=i[8],v=i[9],h=i[10],I=i[11],d=i[12],p=i[13],M=i[14],g=i[15],m=i[16],T=i[17],A=i[18],w=i[19],R=0,y=0,G=0,P=0,D=0;R<e;R+=4)y=r[R]/255,G=r[R+1]/255,P=r[R+2]/255,D=r[R+3]/255,r[R]=Math.max(0,Math.min(255*(y*a+G*o+P*u+D*c+f),255)),r[R+1]=Math.max(0,Math.min(255*(y*E+G*_+P*s+D*l+v),255)),r[R+2]=Math.max(0,Math.min(255*(y*h+G*I+P*d+D*p+M),255)),r[R+3]=Math.max(0,Math.min(255*(y*g+G*m+P*T+D*A+w),255));self.postMessage({id:t.data.id,message:n},[n.data.buffer])}},x={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,n){return[-1,0,0,-1,t,n]},4:function(t,n){return[1,0,0,-1,0,n]},5:function(){return[0,1,1,0,0,0]},6:function(t,n){return[0,1,-1,0,n,0]},7:function(t,n){return[0,-1,-1,0,n,t]},8:function(t){return[0,-1,1,0,0,t]}},L=function(t,n,i,r){n=Math.round(n),i=Math.round(i);var e=document.createElement("canvas");e.width=n,e.height=i;var a=e.getContext("2d");if(r>=5&&r<=8){var o=[i,n];n=o[0],i=o[1]}return function(t,n,i,r){-1!==r&&t.transform.apply(t,x[r](n,i))}(a,n,i,r),a.drawImage(t,0,0,n,i),e},C=function(t){return/^image/.test(t.type)&&!/svg/.test(t.type)},W=function(t){var n=Math.min(10/t.width,10/t.height),i=document.createElement("canvas"),r=i.getContext("2d"),e=i.width=Math.ceil(t.width*n),a=i.height=Math.ceil(t.height*n);r.drawImage(t,0,0,e,a);var o=null;try{o=r.getImageData(0,0,e,a).data}catch(t){return null}for(var u=o.length,c=0,f=0,E=0,_=0;_<u;_+=4)c+=o[_]*o[_],f+=o[_+1]*o[_+1],E+=o[_+2]*o[_+2];return{r:c=S(c,u),g:f=S(f,u),b:E=S(E,u)}},S=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},k=function(t){var n=t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(t){var n=t.root,i=t.props,r='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var e=new URL(window.location.href.replace(window.location.hash,"")).href;r=r.replace(/url\(\#/g,"url("+e+"#")}P++,n.element.classList.add("filepond--image-preview-overlay-".concat(i.status)),n.element.innerHTML=r.replace(/__UID__/g,P)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),i=function(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:y,scaleY:y,translateY:y,opacity:{type:"tween",duration:400}}},create:function(n){var i=n.root,r=n.props;i.ref.clip=i.appendChildView(i.createChildView(G(t),{id:r.id,image:r.image,crop:r.crop,markup:r.markup,resize:r.resize,dirty:r.dirty,background:r.background}))},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=n.ref.clip,a=i.image,o=i.crop,u=i.markup,c=i.resize,f=i.dirty;if(e.crop=o,e.markup=u,e.resize=c,e.dirty=f,e.opacity=r?0:1,!r&&!n.rect.element.hidden){var E=o.aspectRatio||a.height/a.width,_=n.rect.inner.width,s=n.rect.inner.height,l=n.query("GET_IMAGE_PREVIEW_HEIGHT"),v=n.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),h=n.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=n.query("GET_PANEL_ASPECT_RATIO"),d=n.query("GET_ALLOW_MULTIPLE");I&&!d&&(l=_*I,E=I);var p=null!==l?l:Math.max(v,Math.min(_*E,h)),M=p/E;M>_&&(p=(M=_)*E),p>s&&(p=s,M=s/E),e.width=M,e.height=p}}})}(t),r=t.utils.createWorker,e=function(t,n,i){return new Promise((function(e){t.ref.imageData||(t.ref.imageData=i.getContext("2d").getImageData(0,0,i.width,i.height));var a=function(t){var n;try{n=new ImageData(t.width,t.height)}catch(i){n=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return n.data.set(new Uint8ClampedArray(t.data)),n}(t.ref.imageData);if(!n||20!==n.length)return i.getContext("2d").putImageData(a,0,0),e();var o=r(O);o.post({imageData:a,colorMatrix:n},(function(t){i.getContext("2d").putImageData(t,0,0),o.terminate(),e()}),[a.data.buffer])}))},a=function(t){var n=t.root,r=t.image,e=t.props.id,a=n.query("GET_ITEM",{id:e});if(a){var o,u,c=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},f=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),E=!1;n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(o=a.getMetadata("markup")||[],u=a.getMetadata("resize"),E=!0);var _=n.appendChildView(n.createChildView(i,{id:e,image:r,crop:c,resize:u,markup:o,dirty:E,background:f,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),n.childViews.length);n.ref.images.push(_),_.opacity=1,_.scaleX=1,_.scaleY=1,_.translateY=0,setTimeout((function(){n.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:e})}),250)}},o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},u=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return t.utils.createView({name:"image-preview-wrapper",create:function(t){var i=t.root;i.ref.images=[],i.ref.imageData=null,i.ref.imageViewBin=[],i.ref.overlayShadow=i.appendChildView(i.createChildView(n,{opacity:0,status:"idle"})),i.ref.overlaySuccess=i.appendChildView(i.createChildView(n,{opacity:0,status:"success"})),i.ref.overlayError=i.appendChildView(i.createChildView(n,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(t){t.root.ref.images.forEach((function(t){t.image.width=1,t.image.height=1}))},didWriteView:function(t){t.root.ref.images.forEach((function(t){t.dirty=!1}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(t){var n=t.root,i=n.ref.images[n.ref.images.length-1];i.translateY=0,i.scaleX=1,i.scaleY=1,i.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var n,i,r,e=t.root,a=t.props.id,o=e.query("GET_ITEM",a);if(o){var u=URL.createObjectURL(o.file);n=u,i=function(t,n){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:n})},(r=new Image).onload=function(){var t=r.naturalWidth,n=r.naturalHeight;r=null,i(t,n)},r.src=n}},DID_FINISH_CALCULATE_PREVIEWSIZE:function(t){var n,i,o,u=t.root,c=t.props,f=u.query("GET_ITEM",c.id);if(f){var E=URL.createObjectURL(f.file),_=function(){var t;(t=E,new Promise((function(n,i){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){n(r)},r.onerror=function(t){i(t)},r.src=t}))).then(s)},s=function(t){URL.revokeObjectURL(E);var n=(f.getMetadata("exif")||{}).orientation||-1,i=t.width,r=t.height;if(i&&r){if(n>=5&&n<=8){var o=[r,i];i=o[0],r=o[1]}var _=Math.max(1,.75*window.devicePixelRatio),s=u.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*_,l=r/i,v=u.rect.element.width,h=u.rect.element.height,I=v,d=I*l;l>1?d=(I=Math.min(i,v*s))*l:I=(d=Math.min(r,h*s))/l;var p=L(t,I,d,n),M=function(){var n=u.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?W(data):null;f.setMetadata("color",n,!0),"close"in t&&t.close(),u.ref.overlayShadow.opacity=1,a({root:u,props:c,image:p})},g=f.getMetadata("filter");g?e(u,g,p).then(M):M()}};if(n=f.file,i=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),null!==(o=i?parseInt(i[1]):null)&&o<=58||!("createImageBitmap"in window)||!C(n))_();else{var l=r(D);l.post({file:f.file},(function(t){l.terminate(),t?s(t):_()}))}}},DID_UPDATE_ITEM_METADATA:function(t){var n,i,r=t.root,o=t.props,u=t.action;if(/crop|filter|markup|resize/.test(u.change.key)&&r.ref.images.length){var c=r.query("GET_ITEM",{id:o.id});if(c)if(/filter/.test(u.change.key))e(r,u.change.value,r.ref.images[r.ref.images.length-1].image);else if(/crop|markup|resize/.test(u.change.key)){var f=c.getMetadata("crop"),E=r.ref.images[r.ref.images.length-1];if(f&&f.aspectRatio&&E.crop&&E.crop.aspectRatio&&Math.abs(f.aspectRatio-E.crop.aspectRatio)>1e-5){var _=function(t){var n=t.root,i=n.ref.images.shift();return i.opacity=0,i.translateY=-15,n.ref.imageViewBin.push(i),i}({root:r});a({root:r,props:o,image:(n=_.image,(i=i||document.createElement("canvas")).width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0),i)})}else!function(t){var n=t.root,i=n.query("GET_ITEM",{id:t.props.id});if(i){var r=n.ref.images[n.ref.images.length-1];r.crop=i.getMetadata("crop"),r.background=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(r.dirty=!0,r.resize=i.getMetadata("resize"),r.markup=i.getMetadata("markup"))}}({root:r,props:o})}}},DID_THROW_ITEM_LOAD_ERROR:u,DID_THROW_ITEM_PROCESSING_ERROR:u,DID_THROW_ITEM_INVALID:u,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o},(function(t){var n=t.root,i=n.ref.imageViewBin.filter((function(t){return 0===t.opacity}));n.ref.imageViewBin=n.ref.imageViewBin.filter((function(t){return t.opacity>0})),i.forEach((function(t){return function(t,n){t.removeChildView(n),n.image.width=1,n.image.height=1,n._destroy()}(n,t)})),i.length=0}))})},V=function(t){var n=t.addFilter,i=t.utils,r=i.Type,e=i.createRoute,a=i.isFile,o=k(t);return n("CREATE_VIEW",(function(t){var n=t.view,i=t.query;if((0,t.is)("file")&&i("GET_ALLOW_IMAGE_PREVIEW")){var r=function(t){t.root.ref.shouldRescale=!0};n.registerWriter(e({DID_RESIZE_ROOT:r,DID_STOP_RESIZE:r,DID_LOAD_ITEM:function(t){var r=t.root,e=t.props.id,u=i("GET_ITEM",e);if(u&&a(u.file)&&!u.archived){var c=u.file;if(function(t){return/^image/.test(t.type)}(c)&&i("GET_IMAGE_PREVIEW_FILTER_ITEM")(u)){var f="createImageBitmap"in(window||{}),E=i("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!f&&E&&c.size>E)){r.ref.imagePreview=n.appendChildView(n.createChildView(o,{id:e}));var _=r.query("GET_IMAGE_PREVIEW_HEIGHT");_&&r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:u.id,height:_});var s=!f&&c.size>i("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:e},s)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(t){var n=t.root,i=t.action;n.ref.imageWidth=i.width,n.ref.imageHeight=i.height,n.ref.shouldRescale=!0,n.ref.shouldDrawPreview=!0,n.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(t){"crop"===t.action.change.key&&(t.root.ref.shouldRescale=!0)}},(function(t){var n=t.root,i=t.props;n.ref.imagePreview&&(n.rect.element.hidden||(n.ref.shouldRescale&&(function(t,n){if(t.ref.imagePreview){var i=t.query("GET_ITEM",{id:n.id});if(i){var r=t.query("GET_PANEL_ASPECT_RATIO"),e=t.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(r||e||a)){var o=t.ref,u=o.imageWidth,c=o.imageHeight;if(u&&c){var f=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),E=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),_=(i.getMetadata("exif")||{}).orientation||-1;if(_>=5&&_<=8){var s=[c,u];u=s[0],c=s[1]}if(!C(i.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var l=2048/u;u*=l,c*=l}var v=c/u,h=(i.getMetadata("crop")||{}).aspectRatio||v,I=Math.max(f,Math.min(c,E)),d=Math.min(t.rect.element.width*h,I);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:d})}}}}}(n,i),n.ref.shouldRescale=!1),n.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){n.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:i.id})}))})),n.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,r.BOOLEAN],imagePreviewFilterItem:[function(){return!0},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[!1,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[!1,r.BOOLEAN],imagePreviewMarkupShow:[!0,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},r.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:V})),V}()),r.exports),a=n({__proto__:null,default:t(e)},[e]);
4
+ import{d as t}from"./p-DKAYrLM1.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}}))})),Object.freeze(t)}var i,r={exports:{}},e=(i||(i=1,r.exports=function(){function t(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var i=[],r=!0,e=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(r=(o=u.next()).done)&&(i.push(o.value),i.length!==n);r=!0);}catch(t){e=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(e)throw a}}return i}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n=function(t,n){return e(t.x*n,t.y*n)},i=function(t,n){return e(t.x+n.x,t.y+n.y)},r=function(t,n,i){var r=Math.cos(n),a=Math.sin(n),o=e(t.x-i.x,t.y-i.y);return e(i.x+r*o.x-a*o.y,i.y+a*o.x+r*o.y)},e=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},a=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*i:"number"==typeof t?t*(r?n[r]:Math.min(n.width,n.height)):void 0},o=function(t){return null!=t},u=function(t,n){return Object.keys(n).forEach((function(i){return t.setAttribute(i,n[i])}))},c=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg",t);return n&&u(i,n),i},f={contain:"xMidYMid meet",cover:"xMidYMid slice"},E={left:"start",center:"middle",right:"end"},_=function(t){return function(n){return c(t,{id:n.id})}},s={image:function(t){var n=c("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return n.onload=function(){n.setAttribute("opacity",t.opacity||1)},n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),n},rect:_("rect"),ellipse:_("ellipse"),text:_("text"),path:_("path"),line:function(t){var n=c("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=c("line");n.appendChild(i);var r=c("path");n.appendChild(r);var e=c("path");return n.appendChild(e),n}},l={rect:function(t){return u(t,Object.assign({},t.rect,t.styles))},ellipse:function(t){return u(t,Object.assign({cx:t.rect.x+.5*t.rect.width,cy:t.rect.y+.5*t.rect.height,rx:.5*t.rect.width,ry:.5*t.rect.height},t.styles))},image:function(t,n){u(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:f[n.fit]||"none"}))},text:function(t,n,i,r){var e=a(n.fontSize,i,r);u(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":n.fontWeight||"normal","font-size":e,"font-family":n.fontFamily||"sans-serif","text-anchor":E[n.textAlign]||"start"})),t.text!==n.text&&(t.text=n.text,t.textContent=n.text.length?n.text:" ")},path:function(t,n,i,r){var e;u(t,Object.assign({},t.styles,{fill:"none",d:(e=n.points.map((function(t){return{x:a(t.x,i,r,"width"),y:a(t.y,i,r,"height")}})),e.map((function(t,n){return"".concat(0===n?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,o,c,f){u(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var E=t.childNodes[1],_=t.childNodes[2],s=t.rect,l={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(u(t.childNodes[0],{x1:s.x,y1:s.y,x2:l.x,y2:l.y}),o.lineDecoration){E.style.display="none",_.style.display="none";var v=function(t){var n=Math.sqrt(t.x*t.x+t.y*t.y);return 0===n?{x:0,y:0}:e(t.x/n,t.y/n)}({x:l.x-s.x,y:l.y-s.y}),h=a(.05,c,f);if(-1!==o.lineDecoration.indexOf("arrow-begin")){var I=n(v,h),d=i(s,I),p=r(s,2,d),M=r(s,-2,d);u(E,{style:"display:block;",d:"M".concat(p.x,",").concat(p.y," L").concat(s.x,",").concat(s.y," L").concat(M.x,",").concat(M.y)})}if(-1!==o.lineDecoration.indexOf("arrow-end")){var g=n(v,-h),m=i(l,g),T=r(l,2,m),A=r(l,-2,m);u(_,{style:"display:block;",d:"M".concat(T.x,",").concat(T.y," L").concat(l.x,",").concat(l.y," L").concat(A.x,",").concat(A.y)})}}}},v=function(t,n,i,r,e){"path"!==n&&(t.rect=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=a(t.x,n,i,"width")||a(t.left,n,i,"width"),e=a(t.y,n,i,"height")||a(t.top,n,i,"height"),u=a(t.width,n,i,"width"),c=a(t.height,n,i,"height"),f=a(t.right,n,i,"width"),E=a(t.bottom,n,i,"height");return o(e)||(e=o(c)&&o(E)?n.height-c-E:E),o(r)||(r=o(u)&&o(f)?n.width-u-f:f),o(u)||(u=o(r)&&o(f)?n.width-r-f:0),o(c)||(c=o(e)&&o(E)?n.height-e-E:0),{x:r||0,y:e||0,width:u||0,height:c||0}}(i,r,e)),t.styles=function(t,n,i){var r=t.borderStyle||t.lineStyle||"solid",e=t.backgroundColor||t.fontColor||"transparent",o=t.borderColor||t.lineColor||"transparent",u=a(t.borderWidth||t.lineWidth,n,i);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":u||0,"stroke-dasharray":"string"==typeof r?"":r.map((function(t){return a(t,n,i)})).join(","),stroke:o,fill:e,opacity:t.opacity||1}}(i,r,e),l[n](t,i,r,e)},h=["x","y","left","top","right","bottom","width","height"],I=function(n){var i=t(n,2),r=i[0],e=i[1],a=e.points?{}:h.reduce((function(t,n){return t[n]="string"==typeof(i=e[n])&&/%/.test(i)?parseFloat(i)/100:i,t;var i}),{});return[r,Object.assign({zIndex:0},e,a)]},d=function(t,n){return t[1].zIndex>n[1].zIndex?1:t[1].zIndex<n[1].zIndex?-1:0},p=function(n){return n.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(n){var i=n.root,r=n.props;if(r.dirty){var e=r.crop,a=r.resize,o=r.markup,u=r.width,c=r.height,f=e.width,E=e.height;if(a){var _=a.size,l=_&&_.width,h=_&&_.height,p=a.mode;l&&!h&&(h=l),h&&!l&&(l=h);var M=f<l&&E<h;if(!M||M&&a.upscale){var g,m=l/f,T=h/E;"force"===p?(f=l,E=h):("cover"===p?g=Math.max(m,T):"contain"===p&&(g=Math.min(m,T)),f*=g,E*=g)}}var A={width:u,height:c};i.element.setAttribute("width",A.width),i.element.setAttribute("height",A.height);var w=Math.min(u/f,c/E);i.element.innerHTML="";var R=i.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");o.filter(R).map(I).sort(d).forEach((function(n){var r=t(n,2),e=r[0],a=r[1],o=function(t,n){return s[t](n)}(e,a);v(o,e,a,A,w),i.element.appendChild(o)}))}}})},M=function(t,n){return{x:t,y:n}},g=function(t,n){return M(t.x-n.x,t.y-n.y)},m=function(t,n){return Math.sqrt(function(t,n){return function(t,n){return t.x*n.x+t.y*n.y}(g(t,n),g(t,n))}(t,n))},T=function(t,n){var i=t,r=n,e=1.5707963267948966-n,a=Math.sin(1.5707963267948966),o=Math.sin(r),u=Math.sin(e),c=Math.cos(e),f=i/a;return M(c*(f*o),c*(f*u))},A=function(t,n,i,r){var e=2*(r.x>.5?1-r.x:r.x)*t.width,a=2*(r.y>.5?1-r.y:r.y)*t.height,o=function(t,n){var i=t.height,r=T(t.width,n),e=T(i,n),a=M(t.x+Math.abs(r.x),t.y-Math.abs(r.y)),o=M(t.x+t.width+Math.abs(e.y),t.y+Math.abs(e.x)),u=M(t.x-Math.abs(e.y),t.y+t.height-Math.abs(e.x));return{width:m(a,o),height:m(a,u)}}(n,i);return Math.max(o.width/e,o.height/a)},w=function(t,n){var i=t.width,r=i*n;return r>t.height&&(i=(r=t.height)/n),{x:.5*(t.width-i),y:.5*(t.height-r),width:i,height:r}},R=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.zoom,r=n.rotation,e=n.center,a=n.aspectRatio;a||(a=t.height/t.width);var o=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.height/t.width,e=1,a=r;a>n&&(e=(a=n)/r);var o=Math.max(1/e,n/a),u=t.width/(i*o*e);return{width:u,height:u*n}}(t,a,i),u=void 0===n.scaleToFit||n.scaleToFit,c=i*A(t,w({width:o.width,height:o.height},a),r,u?e:{x:.5,y:.5});return{widthFloat:o.width/c,heightFloat:o.height/c,width:Math.round(o.width/c),height:Math.round(o.height/c)}},y={type:"spring",stiffness:.5,damping:.45,mass:10},G=function(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(t){var n=t.props;n.background&&(t.root.element.style.backgroundColor=n.background)},create:function(n){var i=n.root,r=n.props;i.ref.image=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:y,originY:y,scaleX:y,scaleY:y,translateX:y,translateY:y,rotateZ:y}},create:function(n){var i=n.root,r=n.props;r.width=r.image.width,r.height=r.image.height,i.ref.bitmap=i.appendChildView(i.createChildView(function(t){return t.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(t){t.root.appendChild(t.props.image)}})}(t),{image:r.image}))},write:function(t){var n=t.props.crop.flip,i=t.root.ref.bitmap;i.scaleX=n.horizontal?-1:1,i.scaleY=n.vertical?-1:1}})}(t),Object.assign({},r))),i.ref.createMarkup=function(){i.ref.markup||(i.ref.markup=i.appendChildView(i.createChildView(p(t),Object.assign({},r))))},i.ref.destroyMarkup=function(){i.ref.markup&&(i.removeChildView(i.ref.markup),i.ref.markup=null)};var e=i.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==e&&(i.element.dataset.transparencyIndicator="grid"===e?e:"color")},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=i.crop,a=i.markup,o=i.resize,u=i.dirty,c=i.width,f=i.height;n.ref.image.crop=e;var E={width:c,height:f,center:{x:.5*c,y:.5*f}},_={width:n.ref.image.width,height:n.ref.image.height},s={x:e.center.x*_.width,y:e.center.y*_.height},l={x:E.center.x-_.width*e.center.x,y:E.center.y-_.height*e.center.y},v=2*Math.PI+e.rotation%(2*Math.PI),h=void 0===e.scaleToFit||e.scaleToFit,I=A(_,w(E,e.aspectRatio||_.height/_.width),v,h?e.center:{x:.5,y:.5}),d=e.zoom*I;a&&a.length?(n.ref.createMarkup(),n.ref.markup.width=c,n.ref.markup.height=f,n.ref.markup.resize=o,n.ref.markup.dirty=u,n.ref.markup.markup=a,n.ref.markup.crop=R(_,e)):n.ref.markup&&n.ref.destroyMarkup();var p=n.ref.image;if(r)return p.originX=null,p.originY=null,p.translateX=null,p.translateY=null,p.rotateZ=null,p.scaleX=null,void(p.scaleY=null);p.originX=s.x,p.originY=s.y,p.translateX=l.x,p.translateY=l.y,p.rotateZ=v,p.scaleX=d,p.scaleY=d}})},P=0,D=function(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(n){self.postMessage({id:t.data.id,message:n},[n])}))}},O=function(){self.onmessage=function(t){for(var n=t.data.message.imageData,i=t.data.message.colorMatrix,r=n.data,e=r.length,a=i[0],o=i[1],u=i[2],c=i[3],f=i[4],E=i[5],_=i[6],s=i[7],l=i[8],v=i[9],h=i[10],I=i[11],d=i[12],p=i[13],M=i[14],g=i[15],m=i[16],T=i[17],A=i[18],w=i[19],R=0,y=0,G=0,P=0,D=0;R<e;R+=4)y=r[R]/255,G=r[R+1]/255,P=r[R+2]/255,D=r[R+3]/255,r[R]=Math.max(0,Math.min(255*(y*a+G*o+P*u+D*c+f),255)),r[R+1]=Math.max(0,Math.min(255*(y*E+G*_+P*s+D*l+v),255)),r[R+2]=Math.max(0,Math.min(255*(y*h+G*I+P*d+D*p+M),255)),r[R+3]=Math.max(0,Math.min(255*(y*g+G*m+P*T+D*A+w),255));self.postMessage({id:t.data.id,message:n},[n.data.buffer])}},x={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,n){return[-1,0,0,-1,t,n]},4:function(t,n){return[1,0,0,-1,0,n]},5:function(){return[0,1,1,0,0,0]},6:function(t,n){return[0,1,-1,0,n,0]},7:function(t,n){return[0,-1,-1,0,n,t]},8:function(t){return[0,-1,1,0,0,t]}},L=function(t,n,i,r){n=Math.round(n),i=Math.round(i);var e=document.createElement("canvas");e.width=n,e.height=i;var a=e.getContext("2d");if(r>=5&&r<=8){var o=[i,n];n=o[0],i=o[1]}return function(t,n,i,r){-1!==r&&t.transform.apply(t,x[r](n,i))}(a,n,i,r),a.drawImage(t,0,0,n,i),e},C=function(t){return/^image/.test(t.type)&&!/svg/.test(t.type)},W=function(t){var n=Math.min(10/t.width,10/t.height),i=document.createElement("canvas"),r=i.getContext("2d"),e=i.width=Math.ceil(t.width*n),a=i.height=Math.ceil(t.height*n);r.drawImage(t,0,0,e,a);var o=null;try{o=r.getImageData(0,0,e,a).data}catch(t){return null}for(var u=o.length,c=0,f=0,E=0,_=0;_<u;_+=4)c+=o[_]*o[_],f+=o[_+1]*o[_+1],E+=o[_+2]*o[_+2];return{r:c=S(c,u),g:f=S(f,u),b:E=S(E,u)}},S=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},k=function(t){var n=t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(t){var n=t.root,i=t.props,r='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var e=new URL(window.location.href.replace(window.location.hash,"")).href;r=r.replace(/url\(\#/g,"url("+e+"#")}P++,n.element.classList.add("filepond--image-preview-overlay-".concat(i.status)),n.element.innerHTML=r.replace(/__UID__/g,P)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),i=function(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:y,scaleY:y,translateY:y,opacity:{type:"tween",duration:400}}},create:function(n){var i=n.root,r=n.props;i.ref.clip=i.appendChildView(i.createChildView(G(t),{id:r.id,image:r.image,crop:r.crop,markup:r.markup,resize:r.resize,dirty:r.dirty,background:r.background}))},write:function(t){var n=t.root,i=t.props,r=t.shouldOptimize,e=n.ref.clip,a=i.image,o=i.crop,u=i.markup,c=i.resize,f=i.dirty;if(e.crop=o,e.markup=u,e.resize=c,e.dirty=f,e.opacity=r?0:1,!r&&!n.rect.element.hidden){var E=o.aspectRatio||a.height/a.width,_=n.rect.inner.width,s=n.rect.inner.height,l=n.query("GET_IMAGE_PREVIEW_HEIGHT"),v=n.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),h=n.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=n.query("GET_PANEL_ASPECT_RATIO"),d=n.query("GET_ALLOW_MULTIPLE");I&&!d&&(l=_*I,E=I);var p=null!==l?l:Math.max(v,Math.min(_*E,h)),M=p/E;M>_&&(p=(M=_)*E),p>s&&(p=s,M=s/E),e.width=M,e.height=p}}})}(t),r=t.utils.createWorker,e=function(t,n,i){return new Promise((function(e){t.ref.imageData||(t.ref.imageData=i.getContext("2d").getImageData(0,0,i.width,i.height));var a=function(t){var n;try{n=new ImageData(t.width,t.height)}catch(i){n=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return n.data.set(new Uint8ClampedArray(t.data)),n}(t.ref.imageData);if(!n||20!==n.length)return i.getContext("2d").putImageData(a,0,0),e();var o=r(O);o.post({imageData:a,colorMatrix:n},(function(t){i.getContext("2d").putImageData(t,0,0),o.terminate(),e()}),[a.data.buffer])}))},a=function(t){var n=t.root,r=t.image,e=t.props.id,a=n.query("GET_ITEM",{id:e});if(a){var o,u,c=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},f=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),E=!1;n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(o=a.getMetadata("markup")||[],u=a.getMetadata("resize"),E=!0);var _=n.appendChildView(n.createChildView(i,{id:e,image:r,crop:c,resize:u,markup:o,dirty:E,background:f,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),n.childViews.length);n.ref.images.push(_),_.opacity=1,_.scaleX=1,_.scaleY=1,_.translateY=0,setTimeout((function(){n.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:e})}),250)}},o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},u=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return t.utils.createView({name:"image-preview-wrapper",create:function(t){var i=t.root;i.ref.images=[],i.ref.imageData=null,i.ref.imageViewBin=[],i.ref.overlayShadow=i.appendChildView(i.createChildView(n,{opacity:0,status:"idle"})),i.ref.overlaySuccess=i.appendChildView(i.createChildView(n,{opacity:0,status:"success"})),i.ref.overlayError=i.appendChildView(i.createChildView(n,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(t){t.root.ref.images.forEach((function(t){t.image.width=1,t.image.height=1}))},didWriteView:function(t){t.root.ref.images.forEach((function(t){t.dirty=!1}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(t){var n=t.root,i=n.ref.images[n.ref.images.length-1];i.translateY=0,i.scaleX=1,i.scaleY=1,i.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var n,i,r,e=t.root,a=t.props.id,o=e.query("GET_ITEM",a);if(o){var u=URL.createObjectURL(o.file);n=u,i=function(t,n){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:n})},(r=new Image).onload=function(){var t=r.naturalWidth,n=r.naturalHeight;r=null,i(t,n)},r.src=n}},DID_FINISH_CALCULATE_PREVIEWSIZE:function(t){var n,i,o,u=t.root,c=t.props,f=u.query("GET_ITEM",c.id);if(f){var E=URL.createObjectURL(f.file),_=function(){var t;(t=E,new Promise((function(n,i){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){n(r)},r.onerror=function(t){i(t)},r.src=t}))).then(s)},s=function(t){URL.revokeObjectURL(E);var n=(f.getMetadata("exif")||{}).orientation||-1,i=t.width,r=t.height;if(i&&r){if(n>=5&&n<=8){var o=[r,i];i=o[0],r=o[1]}var _=Math.max(1,.75*window.devicePixelRatio),s=u.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*_,l=r/i,v=u.rect.element.width,h=u.rect.element.height,I=v,d=I*l;l>1?d=(I=Math.min(i,v*s))*l:I=(d=Math.min(r,h*s))/l;var p=L(t,I,d,n),M=function(){var n=u.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?W(data):null;f.setMetadata("color",n,!0),"close"in t&&t.close(),u.ref.overlayShadow.opacity=1,a({root:u,props:c,image:p})},g=f.getMetadata("filter");g?e(u,g,p).then(M):M()}};if(n=f.file,i=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),null!==(o=i?parseInt(i[1]):null)&&o<=58||!("createImageBitmap"in window)||!C(n))_();else{var l=r(D);l.post({file:f.file},(function(t){l.terminate(),t?s(t):_()}))}}},DID_UPDATE_ITEM_METADATA:function(t){var n,i,r=t.root,o=t.props,u=t.action;if(/crop|filter|markup|resize/.test(u.change.key)&&r.ref.images.length){var c=r.query("GET_ITEM",{id:o.id});if(c)if(/filter/.test(u.change.key))e(r,u.change.value,r.ref.images[r.ref.images.length-1].image);else if(/crop|markup|resize/.test(u.change.key)){var f=c.getMetadata("crop"),E=r.ref.images[r.ref.images.length-1];if(f&&f.aspectRatio&&E.crop&&E.crop.aspectRatio&&Math.abs(f.aspectRatio-E.crop.aspectRatio)>1e-5){var _=function(t){var n=t.root,i=n.ref.images.shift();return i.opacity=0,i.translateY=-15,n.ref.imageViewBin.push(i),i}({root:r});a({root:r,props:o,image:(n=_.image,(i=i||document.createElement("canvas")).width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0),i)})}else!function(t){var n=t.root,i=n.query("GET_ITEM",{id:t.props.id});if(i){var r=n.ref.images[n.ref.images.length-1];r.crop=i.getMetadata("crop"),r.background=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),n.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(r.dirty=!0,r.resize=i.getMetadata("resize"),r.markup=i.getMetadata("markup"))}}({root:r,props:o})}}},DID_THROW_ITEM_LOAD_ERROR:u,DID_THROW_ITEM_PROCESSING_ERROR:u,DID_THROW_ITEM_INVALID:u,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o},(function(t){var n=t.root,i=n.ref.imageViewBin.filter((function(t){return 0===t.opacity}));n.ref.imageViewBin=n.ref.imageViewBin.filter((function(t){return t.opacity>0})),i.forEach((function(t){return function(t,n){t.removeChildView(n),n.image.width=1,n.image.height=1,n._destroy()}(n,t)})),i.length=0}))})},V=function(t){var n=t.addFilter,i=t.utils,r=i.Type,e=i.createRoute,a=i.isFile,o=k(t);return n("CREATE_VIEW",(function(t){var n=t.view,i=t.query;if((0,t.is)("file")&&i("GET_ALLOW_IMAGE_PREVIEW")){var r=function(t){t.root.ref.shouldRescale=!0};n.registerWriter(e({DID_RESIZE_ROOT:r,DID_STOP_RESIZE:r,DID_LOAD_ITEM:function(t){var r=t.root,e=t.props.id,u=i("GET_ITEM",e);if(u&&a(u.file)&&!u.archived){var c=u.file;if(function(t){return/^image/.test(t.type)}(c)&&i("GET_IMAGE_PREVIEW_FILTER_ITEM")(u)){var f="createImageBitmap"in(window||{}),E=i("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!f&&E&&c.size>E)){r.ref.imagePreview=n.appendChildView(n.createChildView(o,{id:e}));var _=r.query("GET_IMAGE_PREVIEW_HEIGHT");_&&r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:u.id,height:_});var s=!f&&c.size>i("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:e},s)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(t){var n=t.root,i=t.action;n.ref.imageWidth=i.width,n.ref.imageHeight=i.height,n.ref.shouldRescale=!0,n.ref.shouldDrawPreview=!0,n.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(t){"crop"===t.action.change.key&&(t.root.ref.shouldRescale=!0)}},(function(t){var n=t.root,i=t.props;n.ref.imagePreview&&(n.rect.element.hidden||(n.ref.shouldRescale&&(function(t,n){if(t.ref.imagePreview){var i=t.query("GET_ITEM",{id:n.id});if(i){var r=t.query("GET_PANEL_ASPECT_RATIO"),e=t.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(r||e||a)){var o=t.ref,u=o.imageWidth,c=o.imageHeight;if(u&&c){var f=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),E=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),_=(i.getMetadata("exif")||{}).orientation||-1;if(_>=5&&_<=8){var s=[c,u];u=s[0],c=s[1]}if(!C(i.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var l=2048/u;u*=l,c*=l}var v=c/u,h=(i.getMetadata("crop")||{}).aspectRatio||v,I=Math.max(f,Math.min(c,E)),d=Math.min(t.rect.element.width*h,I);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:d})}}}}}(n,i),n.ref.shouldRescale=!1),n.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){n.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:i.id})}))})),n.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,r.BOOLEAN],imagePreviewFilterItem:[function(){return!0},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[!1,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[!1,r.BOOLEAN],imagePreviewMarkupShow:[!0,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},r.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:V})),V}()),r.exports),a=n({__proto__:null,default:t(e)},[e]);
5
5
  /*!
6
6
  * FilePondPluginImagePreview 4.6.12
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as i}from"./p-wTZ5u3Qu.js";function n(i,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(t){if("default"!==t&&!(t in i)){var e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:function(){return n[t]}})}}))})),Object.freeze(i)}var t,e,o,E={exports:{}},r=t?E.exports:(t=1,E.exports=(e=function(i){return/^image/.test(i.type)},o=function(i){var n=i.addFilter,t=i.utils,o=t.Type,E=t.createRoute,r=t.createItemAPI,l=void 0===r?function(i){return i}:r,_=i.views.fileActionButton;n("SHOULD_REMOVE_ON_REVERT",(function(i,n){var t=n.item,o=n.query;return new Promise((function(i){var n=t.file;i(!(o("GET_ALLOW_IMAGE_EDIT")&&o("GET_IMAGE_EDIT_ALLOW_EDIT")&&e(n)))}))})),n("DID_LOAD_ITEM",(function(i,n){var t=n.query,o=n.dispatch;return new Promise((function(n,E){if(i.origin>1)n(i);else{var r=i.file;if(t("GET_ALLOW_IMAGE_EDIT")&&t("GET_IMAGE_EDIT_INSTANT_EDIT"))if(e(r)){var l=function(i,n,t){return function(e){a.shift(),e?n(i):t(i),o("KICK"),_()}},_=function(){if(a.length){var i=a[0],n=i.item;o("EDIT_ITEM",{id:n.id,handleEditorResponse:l(n,i.resolve,i.reject)})}};u({item:i,resolve:n,reject:E}),1===a.length&&_()}else n(i);else n(i)}}))})),n("DID_CREATE_ITEM",(function(i,n){var t=n.dispatch;i.extend("edit",(function(){t("EDIT_ITEM",{id:i.id})}))}));var a=[],u=function(i){return a.push(i),i};return n("CREATE_VIEW",(function(i){var n=i.is,t=i.view,o=i.query;if(o("GET_ALLOW_IMAGE_EDIT")){var r=o("GET_ALLOW_IMAGE_PREVIEW");if(n("file-info")&&!r||n("file")&&r){var a=o("GET_IMAGE_EDIT_EDITOR");if(a){a.filepondCallbackBridge||(a.outputData=!0,a.outputFile=!1,a.filepondCallbackBridge={onconfirm:a.onconfirm||function(){},oncancel:a.oncancel||function(){}});t.registerDestroyer((function(i){var n=i.root;n.ref.buttonEditItem&&n.ref.buttonEditItem.off("click",n.ref.handleEdit),n.ref.editButton&&n.ref.editButton.removeEventListener("click",n.ref.handleEdit)}));var u={EDIT_ITEM:function(i){var n=i.root,t=i.props.id,e=i.action.handleEditorResponse;a.cropAspectRatio=n.query("GET_IMAGE_CROP_ASPECT_RATIO")||a.cropAspectRatio,a.outputCanvasBackgroundColor=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||a.outputCanvasBackgroundColor;var o=n.query("GET_ITEM",t);if(o){var E=o.file,r=o.getMetadata("crop"),_=o.getMetadata("resize"),u=o.getMetadata("filter")||null,f=o.getMetadata("filters")||null,I=o.getMetadata("colors")||null,c=o.getMetadata("markup")||null,T={crop:r||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},size:_?{upscale:_.upscale,mode:_.mode,width:_.size.width,height:_.size.height}:null,filter:f?f.id||f.matrix:n.query("GET_ALLOW_IMAGE_FILTER")&&n.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!I?u:null,color:I,markup:c};a.onconfirm=function(i){var n=i.data,t=n.crop,E=n.size,r=n.filter,_=n.color,u=n.colorMatrix,f=n.markup,I={};if(t&&(I.crop=t),E){var c=(o.getMetadata("resize")||{}).size,T={width:E.width,height:E.height};T.width&&T.height||!c||(T.width=c.width,T.height=c.height),(T.width||T.height)&&(I.resize={upscale:E.upscale,mode:E.mode,size:T})}f&&(I.markup=f),I.colors=_,I.filters=r,I.filter=u,o.setMetadata(I),a.filepondCallbackBridge.onconfirm(n,l(o)),e&&(a.onclose=function(){e(!0),a.onclose=null})},a.oncancel=function(){a.filepondCallbackBridge.oncancel(l(o)),e&&(a.onclose=function(){e(!1),a.onclose=null})},a.open(E,T)}},DID_LOAD_ITEM:function(i){var n=i.root,E=i.props;if(o("GET_IMAGE_EDIT_ALLOW_EDIT")){var l=E.id,a=o("GET_ITEM",l);if(a&&e(a.file))if(n.ref.handleEdit=function(i){i.stopPropagation(),n.dispatch("EDIT_ITEM",{id:l})},r){var u=t.createChildView(_,{label:"edit",icon:o("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});u.element.classList.add("filepond--action-edit-item"),u.element.dataset.align=o("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),u.on("click",n.ref.handleEdit),n.ref.buttonEditItem=t.appendChildView(u)}else{var f=t.element.querySelector(".filepond--file-info-main"),I=document.createElement("button");I.className="filepond--action-edit-item-alt",I.innerHTML=o("GET_IMAGE_EDIT_ICON_EDIT")+"<span>edit</span>",I.addEventListener("click",n.ref.handleEdit),f.appendChild(I),n.ref.editButton=I}}}};r&&(u.DID_IMAGE_PREVIEW_SHOW=function(i){var n=i.root;n.ref.buttonEditItem&&(n.ref.buttonEditItem.opacity=1)}),t.registerWriter(E(u))}}}})),{options:{allowImageEdit:[!0,o.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",o.STRING],imageEditInstantEdit:[!1,o.BOOLEAN],imageEditAllowEdit:[!0,o.BOOLEAN],imageEditIconEdit:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M8.5 17h1.586l7-7L15.5 8.414l-7 7V17zm-1.707-2.707l8-8a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-8 8A1 1 0 0 1 10.5 19h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707z" fill="currentColor" fill-rule="nonzero"/></svg>',o.STRING],imageEditEditor:[null,o.OBJECT]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:o})),o)),l=n({__proto__:null,default:i(r)},[r]);
4
+ import{d as i}from"./p-DKAYrLM1.js";function n(i,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(t){if("default"!==t&&!(t in i)){var e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:function(){return n[t]}})}}))})),Object.freeze(i)}var t,e,o,E={exports:{}},r=t?E.exports:(t=1,E.exports=(e=function(i){return/^image/.test(i.type)},o=function(i){var n=i.addFilter,t=i.utils,o=t.Type,E=t.createRoute,r=t.createItemAPI,l=void 0===r?function(i){return i}:r,_=i.views.fileActionButton;n("SHOULD_REMOVE_ON_REVERT",(function(i,n){var t=n.item,o=n.query;return new Promise((function(i){var n=t.file;i(!(o("GET_ALLOW_IMAGE_EDIT")&&o("GET_IMAGE_EDIT_ALLOW_EDIT")&&e(n)))}))})),n("DID_LOAD_ITEM",(function(i,n){var t=n.query,o=n.dispatch;return new Promise((function(n,E){if(i.origin>1)n(i);else{var r=i.file;if(t("GET_ALLOW_IMAGE_EDIT")&&t("GET_IMAGE_EDIT_INSTANT_EDIT"))if(e(r)){var l=function(i,n,t){return function(e){a.shift(),e?n(i):t(i),o("KICK"),_()}},_=function(){if(a.length){var i=a[0],n=i.item;o("EDIT_ITEM",{id:n.id,handleEditorResponse:l(n,i.resolve,i.reject)})}};u({item:i,resolve:n,reject:E}),1===a.length&&_()}else n(i);else n(i)}}))})),n("DID_CREATE_ITEM",(function(i,n){var t=n.dispatch;i.extend("edit",(function(){t("EDIT_ITEM",{id:i.id})}))}));var a=[],u=function(i){return a.push(i),i};return n("CREATE_VIEW",(function(i){var n=i.is,t=i.view,o=i.query;if(o("GET_ALLOW_IMAGE_EDIT")){var r=o("GET_ALLOW_IMAGE_PREVIEW");if(n("file-info")&&!r||n("file")&&r){var a=o("GET_IMAGE_EDIT_EDITOR");if(a){a.filepondCallbackBridge||(a.outputData=!0,a.outputFile=!1,a.filepondCallbackBridge={onconfirm:a.onconfirm||function(){},oncancel:a.oncancel||function(){}});t.registerDestroyer((function(i){var n=i.root;n.ref.buttonEditItem&&n.ref.buttonEditItem.off("click",n.ref.handleEdit),n.ref.editButton&&n.ref.editButton.removeEventListener("click",n.ref.handleEdit)}));var u={EDIT_ITEM:function(i){var n=i.root,t=i.props.id,e=i.action.handleEditorResponse;a.cropAspectRatio=n.query("GET_IMAGE_CROP_ASPECT_RATIO")||a.cropAspectRatio,a.outputCanvasBackgroundColor=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||a.outputCanvasBackgroundColor;var o=n.query("GET_ITEM",t);if(o){var E=o.file,r=o.getMetadata("crop"),_=o.getMetadata("resize"),u=o.getMetadata("filter")||null,f=o.getMetadata("filters")||null,I=o.getMetadata("colors")||null,c=o.getMetadata("markup")||null,T={crop:r||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},size:_?{upscale:_.upscale,mode:_.mode,width:_.size.width,height:_.size.height}:null,filter:f?f.id||f.matrix:n.query("GET_ALLOW_IMAGE_FILTER")&&n.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!I?u:null,color:I,markup:c};a.onconfirm=function(i){var n=i.data,t=n.crop,E=n.size,r=n.filter,_=n.color,u=n.colorMatrix,f=n.markup,I={};if(t&&(I.crop=t),E){var c=(o.getMetadata("resize")||{}).size,T={width:E.width,height:E.height};T.width&&T.height||!c||(T.width=c.width,T.height=c.height),(T.width||T.height)&&(I.resize={upscale:E.upscale,mode:E.mode,size:T})}f&&(I.markup=f),I.colors=_,I.filters=r,I.filter=u,o.setMetadata(I),a.filepondCallbackBridge.onconfirm(n,l(o)),e&&(a.onclose=function(){e(!0),a.onclose=null})},a.oncancel=function(){a.filepondCallbackBridge.oncancel(l(o)),e&&(a.onclose=function(){e(!1),a.onclose=null})},a.open(E,T)}},DID_LOAD_ITEM:function(i){var n=i.root,E=i.props;if(o("GET_IMAGE_EDIT_ALLOW_EDIT")){var l=E.id,a=o("GET_ITEM",l);if(a&&e(a.file))if(n.ref.handleEdit=function(i){i.stopPropagation(),n.dispatch("EDIT_ITEM",{id:l})},r){var u=t.createChildView(_,{label:"edit",icon:o("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});u.element.classList.add("filepond--action-edit-item"),u.element.dataset.align=o("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),u.on("click",n.ref.handleEdit),n.ref.buttonEditItem=t.appendChildView(u)}else{var f=t.element.querySelector(".filepond--file-info-main"),I=document.createElement("button");I.className="filepond--action-edit-item-alt",I.innerHTML=o("GET_IMAGE_EDIT_ICON_EDIT")+"<span>edit</span>",I.addEventListener("click",n.ref.handleEdit),f.appendChild(I),n.ref.editButton=I}}}};r&&(u.DID_IMAGE_PREVIEW_SHOW=function(i){var n=i.root;n.ref.buttonEditItem&&(n.ref.buttonEditItem.opacity=1)}),t.registerWriter(E(u))}}}})),{options:{allowImageEdit:[!0,o.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",o.STRING],imageEditInstantEdit:[!1,o.BOOLEAN],imageEditAllowEdit:[!0,o.BOOLEAN],imageEditIconEdit:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M8.5 17h1.586l7-7L15.5 8.414l-7 7V17zm-1.707-2.707l8-8a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-8 8A1 1 0 0 1 10.5 19h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707z" fill="currentColor" fill-rule="nonzero"/></svg>',o.STRING],imageEditEditor:[null,o.OBJECT]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:o})),o)),l=n({__proto__:null,default:i(r)},[r]);
5
5
  /*!
6
6
  * FilePondPluginImageEdit 1.6.3
7
7
  * Licensed under MIT, https://opensource.org/licenses/MIT/
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{d as i}from"./p-wTZ5u3Qu.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,n,s,a={exports:{}};var r,o=s?n:(s=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var n=t[e];t[e]={name:n[0],iso2:n[1],dialCode:n[2],priority:n[3]||0,areaCodes:n[4]||null}}function s(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),n=0;n<e.length;n++)t(e[n],i[e[n]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var n=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var s=t||{};this.options={},l(h,(function(i,t){n.options[i]=s.hasOwnProperty(i)?s[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return n=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,n){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var s=0;s<this.countryCodes[e].length;s++)if(this.countryCodes[e][s]===t)return;this.countryCodes[e][n!==i?n:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var n=this.countries[e];if(n.areaCodes)for(var s=this.countryCodes[n.dialCode][0],a=0;a<n.areaCodes.length;a++){for(var r=n.areaCodes[a],o=1;o<r.length;o++){var h=n.dialCode+r.substr(0,o);this._addCountryCode(s,h),this._addCountryCode(n.iso2,h)}this._addCountryCode(n.iso2,n.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var n=document.createElement(i);return t&&l(t,(function(i,t){return n.setAttribute(i,t)})),e&&e.appendChild(n),n}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,n=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),n&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||n||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach((function(t){s(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),n&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var n=0;n<i.length;n++){var s=i[n],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(s.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":s.dialCode,"data-country-code":s.iso2,"aria-selected":"false"},this.countryList);s.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(s.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(s.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(s.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,n=this._getDialCode(e),s=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;n&&!s?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):n&&s?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,n=t.top+e,s=this.dropdownContent.offsetHeight,a=n+this.telInput.offsetHeight+s<e+window.innerHeight,r=!this.options.countrySearch&&!a&&n-s>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(n+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",n=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),n&&clearTimeout(n),e+=t.key.toLowerCase(),i._searchForCountry(e),n=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var s=null;this._handleSearchChange=function(){s&&clearTimeout(s),s=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),s=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],n=!0;this.countryList.innerHTML="";for(var s=0;s<this.countries.length;s++){var a=this.countries[s],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),n&&(this._highlightListItem(a.node,!1),n=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,n=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?n.NATIONAL:n.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,n=this.selectedCountryData.dialCode;e&&"1"===n&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&n&&"+"!==e.charAt(0)&&(e="+".concat(n).concat(e));var s=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(s){var o=this.countryCodes[this._getNumeric(s)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=s.length-1;if(!("1"===n&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,n){for(var s=e?t:this.countries,a=0;a<s.length;a++)if(s[a].iso2===i)return s[a];if(n)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,n=t.separateDialCode,s=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),s&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,n),n){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var n=e.offsetWidth;return i.parentNode.removeChild(i),n}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,n=window.pageYOffset||document.documentElement.scrollTop,s=e.offsetHeight,a=e.getBoundingClientRect().top+n,r=a+s,o=i.offsetHeight,h=i.getBoundingClientRect().top+n,u=h+o,l=h-a+e.scrollTop,c=s/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(s-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,n="+".concat(i);if("+"===e.charAt(0)){var s=this._getDialCode(e);t=s?e.replace(s,n):n,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?n+e:n)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var n="",s=0;s<i.length;s++){var a=i.charAt(s);if(!isNaN(parseInt(a,10))){if(n+=a,t)this.countryCodes[n]&&(e=i.substr(0,s+1));else if(this.dialCodes[n]){e=i.substr(0,s+1);break}if(n.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,a(n.key),n)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e;var n,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var n=document.createElement("script");n.onload=function(){c("handleUtils"),t&&t()},n.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},n.className="iti-load-utils",n.async=!0,n.src=i,document.body.appendChild(n)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),n=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}
4
+ import{d as i}from"./p-DKAYrLM1.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,n,s,a={exports:{}};var r,o=s?n:(s=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var n=t[e];t[e]={name:n[0],iso2:n[1],dialCode:n[2],priority:n[3]||0,areaCodes:n[4]||null}}function s(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),n=0;n<e.length;n++)t(e[n],i[e[n]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var n=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var s=t||{};this.options={},l(h,(function(i,t){n.options[i]=s.hasOwnProperty(i)?s[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return n=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,n){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var s=0;s<this.countryCodes[e].length;s++)if(this.countryCodes[e][s]===t)return;this.countryCodes[e][n!==i?n:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var n=this.countries[e];if(n.areaCodes)for(var s=this.countryCodes[n.dialCode][0],a=0;a<n.areaCodes.length;a++){for(var r=n.areaCodes[a],o=1;o<r.length;o++){var h=n.dialCode+r.substr(0,o);this._addCountryCode(s,h),this._addCountryCode(n.iso2,h)}this._addCountryCode(n.iso2,n.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var n=document.createElement(i);return t&&l(t,(function(i,t){return n.setAttribute(i,t)})),e&&e.appendChild(n),n}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,n=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),n&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||n||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach((function(t){s(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),n&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var n=0;n<i.length;n++){var s=i[n],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(s.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":s.dialCode,"data-country-code":s.iso2,"aria-selected":"false"},this.countryList);s.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(s.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(s.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(s.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,n=this._getDialCode(e),s=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;n&&!s?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):n&&s?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,n=t.top+e,s=this.dropdownContent.offsetHeight,a=n+this.telInput.offsetHeight+s<e+window.innerHeight,r=!this.options.countrySearch&&!a&&n-s>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(n+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",n=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),n&&clearTimeout(n),e+=t.key.toLowerCase(),i._searchForCountry(e),n=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var s=null;this._handleSearchChange=function(){s&&clearTimeout(s),s=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),s=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],n=!0;this.countryList.innerHTML="";for(var s=0;s<this.countries.length;s++){var a=this.countries[s],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),n&&(this._highlightListItem(a.node,!1),n=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,n=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?n.NATIONAL:n.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,n=this.selectedCountryData.dialCode;e&&"1"===n&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&n&&"+"!==e.charAt(0)&&(e="+".concat(n).concat(e));var s=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(s){var o=this.countryCodes[this._getNumeric(s)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=s.length-1;if(!("1"===n&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,n){for(var s=e?t:this.countries,a=0;a<s.length;a++)if(s[a].iso2===i)return s[a];if(n)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,n=t.separateDialCode,s=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),s&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,n),n){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var n=e.offsetWidth;return i.parentNode.removeChild(i),n}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,n=window.pageYOffset||document.documentElement.scrollTop,s=e.offsetHeight,a=e.getBoundingClientRect().top+n,r=a+s,o=i.offsetHeight,h=i.getBoundingClientRect().top+n,u=h+o,l=h-a+e.scrollTop,c=s/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(s-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,n="+".concat(i);if("+"===e.charAt(0)){var s=this._getDialCode(e);t=s?e.replace(s,n):n,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?n+e:n)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var n="",s=0;s<i.length;s++){var a=i.charAt(s);if(!isNaN(parseInt(a,10))){if(n+=a,t)this.countryCodes[n]&&(e=i.substr(0,s+1));else if(this.dialCodes[n]){e=i.substr(0,s+1);break}if(n.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,a(n.key),n)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e;var n,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var n=document.createElement("script");n.onload=function(){c("handleUtils"),t&&t()},n.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},n.className="iti-load-utils",n.async=!0,n.src=i,document.body.appendChild(n)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),n=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}