@choiceform/os-client-core 2.1.62 → 2.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +1 -1
- package/dist/modern/core.js +1 -1
- package/dist/modern/web-core.js +2 -2
- package/dist/support/atcp.js +1 -1
- package/dist/web-core.js +2 -2
- package/package.json +1 -1
package/dist/modern/web-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=82)}([function(e,t,n){"use strict";n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return h}));var r=n(8),i=n(1);let o,a=null,c=null,s=Object(i.a)(()=>r.a.trigger("SET_PROPS"),150);function u(e){c=e}function l(){if(!c)throw new Error("Env not yet initialized");return c}function f(e){a=e,a.silentSetter&&(s=null)}function d(){if(!a)throw new Error("Client not yet initialized");return a}function p(){return d().realTimePreview?"realtime_preview":d().preview?"preview":"formal"}function b(e,t){e&&t&&(o(e,t),s&&s())}function h(e){o=e}r.a.on("ERROR_ABORT",(e,t)=>{d().error(t)})},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"t",(function(){return a})),n.d(t,"k",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return l})),n.d(t,"s",(function(){return f})),n.d(t,"l",(function(){return d})),n.d(t,"g",(function(){return p})),n.d(t,"f",(function(){return b})),n.d(t,"p",(function(){return h})),n.d(t,"m",(function(){return m})),n.d(t,"o",(function(){return g})),n.d(t,"b",(function(){return O})),n.d(t,"c",(function(){return j})),n.d(t,"a",(function(){return v})),n.d(t,"q",(function(){return w})),n.d(t,"r",(function(){return y})),n.d(t,"n",(function(){return _})),n.d(t,"j",(function(){return x}));var r=n(7);const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");function o(e){return e.replace(/</g,"_-v-w^l-t-_").replace(/>/g,"^-v-w_g-t-^")}function a(e){return e.replace(/_-v-w\^l-t-_/g,"<").replace(/\^-v-w_g-t-\^/g,">")}function c(e,t){return t}function s(e=1,t=5){const n=p(e,t),r=i.length;let o="";for(let e=0;e<n;e++){const e=p(0,r);o+=i[e]}return o}function u(e,t){return t&&t.forEach(t=>{e+="-"+f(t.varList[t.currentIndex].uuid)}),e}function l(){const e=new Array(36);let t,n=0;for(let r=0;r<36;r++)8==r||13==r||18==r||23==r?e[r]="-":14==r?e[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),t=15&n,n>>=4,e[r]=i[19==r?3&t|8:t]);return e.join("").toLowerCase()}function f(e){return e.substr(e.length-8)}function d(e="",t=""){return e=e.toLowerCase(),t=t.toLowerCase(),8===e.length&&t.length>8?e===f(t):e.length>8&&8===t.length?f(e)===t:e===t}function p(e,t){return e>t&&([e,t]=[t,e]),e+b(t-e+1)}function b(e){return Math.floor(Math.random()*e)}function h(e,t){const n=[...e];if(Object(r.b)(t))return n;if(0===(t=Number(t)))return[];if(t<0||isNaN(t))return n;if(1===t)return n.splice(b(n.length),1);const i=[];for(n.length<t&&(t=n.length);i.length<t;){const e=b(n.length);i.push(n.splice(e,1)[0])}return i}function m(e,t){e&&"object"==typeof e&&Object.keys(e).forEach(n=>{const r=e[n];Array.isArray(r)&&r.forEach(e=>{m(e,t)}),"object"==typeof r&&m(r,t),t(e,n)})}function g(e,t){if(e<t)throw new Error("can not random distribute");const n=function(e,t){const n=[];for(;n.length<t;){const t=p(1,e-1);n.includes(t)||n.push(t)}return n.sort((e,t)=>e>t?1:-1),n}(e,t-1),r=n.map((e,t)=>e-(n[t-1]||0));return r.push(e-n[n.length-1]),r}function O(e){const t=new WeakMap;return function e(n){if(!n||"object"!=typeof n)return n;if(n instanceof Array)return n.map(t=>e(t));const r=t.get(n);if(r)return r;const i={};return t.set(n,i),Object.keys(n).forEach(t=>{i[t]=e(n[t])}),i}(e)}function j(e){setTimeout(()=>{throw"string"==typeof e?new Error(e):e})}function v(e,t=0){let n=-1;return function(){const r=arguments,i=this;clearTimeout(n),n=setTimeout(()=>{e.apply(i,r)},t)}}async function w(e,t,n){const r=[];e.replace(t,(e,...t)=>(r.push(n(e,...t)),e));const i=await Promise.all(r);return e.replace(t,()=>i.shift())}function y(e=0){return new Promise(t=>setTimeout(t,e))}function _(e){return Promise.resolve(e)}function x(e){return e instanceof Promise?e:_(e)}},function(e,t,n){"use strict";n.d(t,"g",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"f",(function(){return h}));var r=n(8),i=n(3),o=n(0),a=n(9);let c=!1;const s=["zh_cn","en_us"];async function u(e){const t=i.d();let n=t[e=e.toLowerCase()];n||(n=t[e="zh_cn"]);if(!i.c()[e]){let t;try{t=await Object(a.b)(n,{type:"GET"})}catch(e){t=await Object(a.b)(n.replace(".com/",".io/"),{type:"GET"})}i.g(e,t)}}function l(e,t){let n=Object(o.c)().storage.get("language")||function(){const e=Object(o.c)().system.getLang();return e?e.replace(/-/g,"_").toLowerCase():"zh_cn"}();if(e&&t){e.some(e=>e.id===n)||(n=t)}return n}function f(e,t){e!==Object(o.c)().storage.get("language")&&(p(e,!0),t&&Object(o.c)().storage.set("lang-resume","true"),Object(o.c)().hook.beforeForceLeave(),Object(o.c)().app.reload())}function d(e){let t="zh_cn";s.includes(e)&&(t=e),i.h(t),Object(o.b)().setLocale(t),r.a.trigger("LANG_CHANGE"),Object(o.c)().hook.onLangChange(t)}function p(e="zh_cn",t=!1){return Object(o.c)().storage.set("language",e),t||d(e),c=!0,e}function b(e){return e.replace(/\{(\w+),.+?(\w+)\}\s?\}/g,(e,t,n)=>`{${t}} ${n}`)}function h(e,t){c||c||p(l());const n=i.e(e);return n?t?Object(o.c)().system.translate(n,t):n:`missing translation for ${e} ${i.b()}`}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"f",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"e",(function(){return h}));const r={en_us:"https://media.choiceform.com/os-client-core/assets/en_us-8617c82e.json",zh_cn:"https://media.choiceform.com/os-client-core/assets/zh_cn-477e771a.json"};let i=!1,o=new Proxy({},{get(){throw new Error("Cannot access LANG before initializing")}}),a="zh_cn";const c={},s=(e,t,n)=>{const r=n||{};return Object.keys(e).forEach(i=>{const o=e[i],a=t?t+"."+i:i;r[i]="string"==typeof o?a:s(e[i],a,n&&n[i])}),r};function u(e){e&&Object.keys(e).forEach(t=>{r[t.toLowerCase()]=e[t]})}function l(){return{...r}}function f(){return{...c}}function d(e,t){i||(o=s(t,"",{}),i=!0),c[e]=t}function p(e){a=e.toLowerCase()}function b(){return a}function h(e){const t=c[a];if(!t)throw new Error("cannot translate before lang loading");try{const n=e.split(".");let r=n.shift(),i=t[r];for(;"object"==typeof i;)r=n.shift(),i=i[r];return i}catch(e){console.error(e)}return""}},function(e,t,n){"use strict";n.d(t,"i",(function(){return f})),n.d(t,"u",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"d",(function(){return b})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"s",(function(){return g})),n.d(t,"v",(function(){return O})),n.d(t,"r",(function(){return j})),n.d(t,"p",(function(){return v})),n.d(t,"q",(function(){return w})),n.d(t,"m",(function(){return y})),n.d(t,"o",(function(){return _})),n.d(t,"n",(function(){return x})),n.d(t,"g",(function(){return T})),n.d(t,"e",(function(){return k})),n.d(t,"j",(function(){return E})),n.d(t,"k",(function(){return N})),n.d(t,"a",(function(){return I})),n.d(t,"y",(function(){return C})),n.d(t,"z",(function(){return A})),n.d(t,"w",(function(){return P})),n.d(t,"l",(function(){return R})),n.d(t,"h",(function(){return M})),n.d(t,"x",(function(){return D})),n.d(t,"t",(function(){return U}));var r=n(6),i=n(1),o=n(5),a=n(2),c=n(0),s=n(3);const u={valid:!0,message:""},l=["region","location","area","describe","end","logic","loop","lottery","verify"];function f(e){return!0===e.answerRequired}function d(e){return"matrix"===e.type?function(e){const{randomType:t}=e;return"col"===t||"row_col"===t||"row"===t}(e):!0===e.randomOptionY}function p(e){const t=e.loopStack,n=e.nodeUuid;return Object(i.h)(n,t)}function b(e){return e.find(e=>"start"===e.type)}function h(e,t){if(t)return e.find(e=>e.input&&Object(i.l)(e.input.uuid,t)||e.loopEnd&&Object(i.l)(e.loopEnd.uuid,t))}function m(e,t,n){const r=t.find(e=>Object(i.l)(e.selfPortId,n));if(r&&r.destInputId)return h(e,r.destInputId)}function g(e){return"matrix"===e.type?"multi"===e.matrixSelect:!0===e.multiSelect}function O(e){return"matrix"===e.type?"single"===e.matrixSelect:!0!==e.multiSelect}function j(e){return"single_row"===e.matrixSelect}function v(e){return"single_col"===e.matrixSelect}function w(e){return"single_row_col"===e.matrixSelect}function y(e){return g(e)&&"all"===e.multiType}function _(e){return g(e)&&"row"===e.multiType}function x(e){return g(e)&&"col"===e.multiType}async function T(e){const t=!0===e.limitEnabled,{parent:n}=e;let r=t?await Object(o.e)(e.maxUploadCount,{state:n}):e.options.length,i=t?await Object(o.e)(e.minUploadCount,{state:n}):1;const a=e.options.length;return i||(i=1),r||(r=a),i>a&&(i=a),i>r&&(i=r),{max:r,min:i}}async function k(e){if(!g(e))return{min:1,max:1};const t="matrix"===e.type,{multiMin:n,multiMax:i}=e,{parent:a}=e;let c=await Object(o.e)(n,{state:a}),s=await Object(o.e)(i,{state:a});const u=Object(r.c)(e).length;return t||(c=function(e,t){const n={};Object(r.c)(e).forEach(e=>{Object(r.n)(e)||(n[e.mutexNumber]?n[e.mutexNumber]+=1:n[e.mutexNumber]=1)});const i=Object.keys(n).reduce((e,t)=>("0"===t||"undefined"===t?e+=n[t]:Number(t)<10&&(e+=1),e),0);return t>i&&(t=i),t}(e,c)),c||(c=1),s||(s=u),c>u&&(c=u),c>s&&(c=s),{min:c,max:s}}const S=(e,t,n,r)=>{let i=0;i=r?e.filter(e=>e[r]===t[r]&&e.selected).length:e.filter(e=>e.selected).length;const o=i<n;let c="";return o||(c=r?"xid"===r?Object(a.f)(s.a.matrix.colLimitMax,{max:n}):Object(a.f)(s.a.matrix.rowLimitMax,{max:n}):Object(a.f)(s.a.select.limitMax,{max:n})),{valid:o,message:c}};async function E(e,t){if(!g(e)||-1===t.mutexNumber||-1===t.xMutexNumber||-1===t.yMutexNumber)return u;const n=y(e);if(!n&&!Object(r.o)(t))return u;const i=Object(r.c)(e),{max:o}=await k(e);return n?S(i,t,o):x(e)?S(i,t,o,"xid"):_(e)?S(i,t,o,"yid"):u}async function N(e,t){if(!g(e))return u;const{max:n}=await k(e),i=Object(r.c)(e).filter(e=>e.selected).length===n,{mutexNumber:o}=t,c=!i||-1===o||Object(r.m)(e,o);return{valid:c,message:c?"":Object(a.f)(s.a.select.limitMax,{max:n})}}function I(e,t){return e.find(e=>Object(i.l)(e.nodeUuid,t))}const C=["logic","random","loop"],L=[...C,"data"];function A(e){Object(c.b)().preview&&e.autoSkip&&e.parent.previewShadowNodes&&!L.includes(e.type)&&(e.shadowNodes=!0,e.readonly=!0)}function P(e){if(e.forceSkipReason)return e.forceSkipReason;if("data"===e.type)return"data_hidden";if(e.autoSkip)return function(e){return Object(c.b)().preview&&e.parent.previewShadowNodes&&!L.includes(e.type)}(e)?"":"setting";if(e.randomAbandoned)return"random_group";const t=Object(r.c)(e);return!(l.indexOf(e.type)>-1)&&t&&0===t.length?"no_options":""}function R(e,t){return!(!e.circleNode1Id&&!e.circleNode2Id)&&(Object(i.l)(e.circleNode1Id,t.circleNode1Id)&&Object(i.l)(e.circleNode2Id,t.circleNode2Id))}async function M(e){const{parent:t,options:n}=e;let r=await Object(o.e)(e.total,{state:t})||100,i=0;for(const e of n){const n=await Object(o.e)(e.maxMark,{state:t});if(void 0===n){i=-1;break}i+=n}return i>0&&i<r&&(r=i),r}const D=["end","lottery","gift"];function U(e,t){return!(!e||!t)&&(!D.includes(e.type)&&!D.includes(t.type)&&(e.groupSingle&&t.groupSingle&&function(e,t){return!(!e.groupId||!t.groupId||t.groupId!==e.groupId)&&(!t.loop&&!e.loop||!(t.loop&&!e.loop||!t.loop&&e.loop||t.loop.destInputId!==e.loop.destInputId||t.loop.currentIndex!==e.loop.currentIndex))}(e,t)))}},function(e,t,n){"use strict";n.d(t,"i",(function(){return v})),n.d(t,"d",(function(){return T})),n.d(t,"f",(function(){return S})),n.d(t,"k",(function(){return E})),n.d(t,"h",(function(){return I})),n.d(t,"c",(function(){return C})),n.d(t,"g",(function(){return L})),n.d(t,"e",(function(){return A})),n.d(t,"b",(function(){return P})),n.d(t,"j",(function(){return R})),n.d(t,"a",(function(){return M}));var r=n(65);function i(e){let t=!0;try{t=!!Object(r.a)(e,!0)}catch(t){console.info("error bool: ",e)}return t}function o(e,t,n){return function(e,t,n){return!!(t.length&&""!==n&&e&&e[e.length-1].match(/[\d)]/))}(e,t,n)&&(e+=t[t.length-1]),e+n}function a(e){return"("===e[e.length-1]&&(e+="0"),e+")"}var c=n(1),s=n(46),u=n(38),l=n(40),f=n(13),d=n(42),p=n(16),b=n(22),h=n(0),m=n(34),g=n(7),O=n(10);function j(e){return e&&("var-html"===e.type||"var-request"===e.type||"var-loop"===e.type)}function v(e="",t=!1){if(e=(e=y(e,t)).replace(/</g,"<").replace(/>/g,">"),t)for(;e.indexOf("<")>-1||e.indexOf(">")>-1;)e=e.replace(/</g,"<").replace(/>/g,">");return e}function w(e=""){return e.replace(/</g,"<").replace(/>/g,">")}function y(e="",t=!1){if(e=e.replace(/&/g,"&"),t)for(;e.indexOf("&")>-1;)e.replace(/&/g,"&");return e}function _(e="",t,n,r,i){let o='<span var-name="'+n+'" class="var-light '+t+('"'+(r?'in-edist="1">':">"))+e+"</span>";return i&&(o=Object(c.d)(o)),o}function x(e=""){e.match(/<(\w+).+?<\/\1>/)||(e=`<span>${e}</span>`);return Object(m.c)(e).children}async function T(e="",t,n=!1){e+="";const{state:r,innerJoinBy:i,varInfo:o,usage:a}=t,s=t.spaceRep||"";e=y(e.replace(/ /g,s));const u=t.joinBy||" ";if(Object(f.j)(e)){const s=Object(f.l)(e),d=Object(f.i)(e,s);for(const e of d){const t=Object(f.f)(r,e);let c="";if(t?c=await C({state:r,varInfo:t,joinBy:i||u}):Object(h.b)().realTimePreview&&(c=_(e.getInnerHtml(),"var-empty",e.getText(),!1,!0)),c=Object(g.b)(c)?"":Object(g.a)(c).trim(),a){const n=t||{mapId:Object(f.c)(Object(f.g)(e))};Object(l.d)(a,n,c)}const s=!o&&t&&c&&!n;let d=[];j(t)?(s&&(c=_(c,t.type,t.name,t.inEdist,!1)),d=c?x(c):[""]):(s&&(c=_(c,t.type,t.name,t.inEdist,!0)),e.setText(c),d=[new m.b(e.getInnerHtml())]),k(e,d)}return N(function(e,t,n=""){if(j(t))return v(e.getInnerHtml());let r="";if(n){const i=[];for(const n of e.children){let e="";if(Object(c.k)(n,"node"===n.type)){if("span"===n.name&&!n.getText()&&0===n.children.length)continue;e=n.getOuterHtml()}else e=n.getText().trim(),t||(e=w(e));e&&i.push(y(e))}r=i.join(n)}else r=y(e.getInnerHtml());return r=r.replace(/([\r\n]|^\s*|\s*$)/g,"").replace(/<br>/g,""),r=y(Object(c.t)(r)),r}(s,o,u),t)}return e+""}function k(e,t){const n=e.parent;t.forEach(t=>{if("string"==typeof t){if(""!==t){const r=new m.b(t);n.insertBefore(r,e)}}else n.insertBefore(t,e)}),n.removeChild(e)}async function S(e="",t,n="NAME"){return N(E(await T(e,t,!0),n),t)}function E(e="",t="NAME"){if(!e||"string"!=typeof e)return e;e=e.replace(/<style>.*?<\/style>/g,"");let n=Object(f.l)(e).getText();return n=Object(f.l)(n).getText(),"NAME"===t?n=Object(d.c)(n):"URL"===t&&(n=Object(d.d)(n)),n.trim()}function N(e,t){return","===t.joinBy?(e+"").trim().replace(/(?:^\s*,|\s*,\s*,\s*|\s*,$)/,""):e}async function I(e="",t){let n=await T(e,{...t,innerJoinBy:","},!0);return n=E(v(n,!0)),n=n.replace(/####/g,"|").replace(/##/g,"").replace(/\s+/g,""),n=N(n,t),n}function C(e){const{varInfo:t}=e;return t.getText?t.getText(e):t.nodePart||t.question?Object(f.e)(e):"var-string"===t.type?function(e){const{varInfo:t}=e;if(t.getText)return t.getText(e);return T(t.value,e)}(e):"var-expression"===t.type?async function(e){const t=Object(b.a)(),{varInfo:n,state:i}=e;let c="";const s=Object(f.l)(n.value).children,u=[];let l="";for(const e of s)if(Object(f.k)(e)){if(l){const e=parseFloat(l);if(isNaN(e))return e;c=o(c,u,e),l=""}const n=Object(f.f)(i,e);if(n){const e=n.split;if(n.uuid===t.EXP_OP.uuid)c+="(";else if(n.uuid===t.EXP_CP.uuid)c=a(c);else if(e)c=o(c,u,n.expOpr),u.push(e);else if(n.expOpr)u.length&&(c=a(c),u.pop()),c=o(c,u,n.expOpr);else{const e=u[u.length-1],t=await C({state:i,varInfo:n,joinBy:e||"+"})||0;c=o(c,u,t)}}else l+="0"}else l+=e.getText().replace(/\s/g,"");l&&(c=o(c,u,parseFloat(l)));for(;u.length;)c=a(c),u.pop();return function(e){let t=0;try{t=Object(r.a)(e,!0)}catch(n){t=NaN,console.info("error exp: ",e)}return t}(c)}(e):"var-media"===t.type?async function(e){const{varInfo:t,state:n}=e,{imgSize:r}=t,i=e.joinBy||" ",o=Object(f.i)(t.value),a=[];for(const e of o){const t=Object(f.f)(n,e);if(!t)continue;r&&(t.imgSize=r);const o=await C({state:n,varInfo:t,joinBy:i});Object(g.b)(o)||a.push(o)}return a.join(i)}(e):"var-bool"===t.type?async function(e){const{varInfo:t,state:n}=e;if(t.getBool)return t.getBool(e);const{nodePart:r,question:o}=t;if(r||o)return Object(f.d)(e);const a=Object(f.i)(t.value);let c="";for(const t of a){const r=Object(f.f)(n,t);if(r)if(r.blOpr)c+=r.blOpr;else if(r.getBool)c+=i(await r.getBool(e))?"1":"0";else{const e=await C({state:n,varInfo:r});c+="string"==typeof e?"0"===e?e:e?"1":"0":i(e)?"1":"0"}}return i(c)}(e):"var-request"===t.type?async function(e){const{varInfo:{request:t,paramConfig:n},state:r}=e;if(t){let e=null;if(n){e=JSON.parse(n);for(const t of Object.keys(e))e[t]=await S(e[t],{state:r,joinBy:","},"URL")}const{result:i}=await Object(s.c)(r,t,e,!1,!1);return"string"!=typeof i?i:Object(u.a)(i)}return""}(e):"var-html"===t.type?async function(e){const{varInfo:t,state:n}=e,r=t.getText?await t.getText(e):await T(t.value,e),i=Object(u.a)(v(r));return await function(e,t,n){const r=e?JSON.parse(e):{};return Object(c.q)(t,/{{{?(.+?)}}}?/g,async(e,t)=>{const i=t.indexOf("=");let o=t,a="";i>-1&&(o=t.substr(0,i),a=t.substr(i+1));const c=r[o]||"";let s="";return c&&(s=e.startsWith("{{{")?await T(c,{state:n}):await S(c,{state:n},"URL")),s||a})}(t.paramConfig,i,n)}(e):Object(c.n)("")}async function L(e="",t,n=!1){if("number"==typeof e)return e;if(Object(g.b)(e))return n?NaN:"";const r=Number(e);if(isNaN(r)){const r=await S(e,t);if(Object(g.b)(r))return n?NaN:"";const i=Number(r);return isNaN(i)?n?NaN:r:i}return r}async function A(e="",t){if("number"==typeof e)return e;const n=await L(e,t,!0);return Number(n)}async function P(e,t){if(e.match(/key(?:\d+)?/))return Object(O.c)()[e];{const n=Object(p.c)(e);if(n){return E(await C({varInfo:n,state:t,joinBy:","}))}return""}}function R(e="",t,n=!1){if(Object(g.b)(e))return Object(c.n)("");return Object(c.q)(Object(g.a)(e),/{{(.+?)}}/g,async(e,r)=>{let i=await P(r,t);return i&&n&&(i=encodeURIComponent(i)),""+(i||"")})}function M(e=""){return e.replace(/(?:^<div>|<\/div>$)/g,"")}},function(e,t,n){"use strict";n.d(t,"h",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"m",(function(){return s})),n.d(t,"n",(function(){return u})),n.d(t,"l",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"o",(function(){return g})),n.d(t,"g",(function(){return O})),n.d(t,"i",(function(){return j})),n.d(t,"p",(function(){return v})),n.d(t,"e",(function(){return w}));var r=n(1),i=n(5),o=n(25);function a(e,t){const n=e.loopStack,i=t.uuid;return Object(r.h)(i,n)}function c(e,t){return e.find(e=>Object(r.l)(e.uuid,t))}function s(e,t){if(!t)return!1;return p(e).some(e=>e.selected&&e.mutexNumber===t)}function u(e){return"comment"===e.optionType}function l(e){return p(e).some(e=>e.selected)}function f(e){return p(e).filter(t=>Object(o.b)(t,e)).length}function d(e){return p(e).some(t=>Object(o.b)(t,e))}function p(e){let t=[];const{options:n,otherOptions:r}=e;return n&&(t=[...t,...n]),r&&(t=[...t,...r]),t}function b(e){let t=p(e);const{hiddenOptions:n}=e;return n&&(t=[...t,...n]),t}function h(e){const{renderOptionsX:t,renderOptionsY:n,otherOptions:r}=e;return t.concat(n,r)}function m(e){const{options:t}=e,n=t.find(e=>!0===e.seqTarget);return n&&n.selected?e.origin.options[n.sortNo-1]:e.output}function g(e){return!!e.yid&&!!e.xid}async function O(e,t){const{parent:n}=t;return{itemsMax:await Object(i.e)(e.itemsMax,{state:n}),itemsMin:await Object(i.e)(e.itemsMin,{state:n})}}function j(e){return e.passRef||{}}function v(e,t){const n=j(e);return e[t]||n[t]}function w(e){if(!e.assistValue)return"";return Object.keys(e.assistValue).reduce((t,n)=>(e.assistValue[n]&&(t+=e.assistValue[n])&&(t+=" "),t),"")}},function(e,t,n){"use strict";function r(e){return o(e)?"":String(e)}function i(e){if(o(e))return"";const t=Number(e);return isNaN(t)?e:t}function o(e){return e instanceof Array?0===e.length:"boolean"!=typeof e&&0!==e&&!e}n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u}));var r=n(0),i=n(1);let o,a={};const c={on(e,t){a[e]||(a[e]=[]),a[e].push(t)},off(e,t){e||(a={}),a[e]&&(a[e]=t?a[e].filter(e=>e!==t):[])},one(e,t){const n=r=>{t(r),c.off(e,n)};c.on(e,n)},trigger(e,t={}){if(a[e])try{a[e].forEach(n=>n({type:e,...t,data:t},t))}catch(e){Object(i.c)(e)}}};function s(e){"gift"!==e.type&&(c.trigger("ANSWER_CHANGE",e),e.dynamicNodeProps())}function u(e,t=!1){c.trigger("SWITCH_NODE",e),e!==o&&(o=e,t&&Object(r.c)().hook.onSwitchPage())}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"r",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"q",(function(){return O})),n.d(t,"f",(function(){return j})),n.d(t,"g",(function(){return v})),n.d(t,"k",(function(){return w})),n.d(t,"l",(function(){return y})),n.d(t,"m",(function(){return _})),n.d(t,"j",(function(){return x})),n.d(t,"o",(function(){return T})),n.d(t,"h",(function(){return k})),n.d(t,"n",(function(){return S})),n.d(t,"i",(function(){return E})),n.d(t,"e",(function(){return N}));var r=n(10),i=n(2),o=n(0),a=n(3),c=n(1),s=n(69),u=n(73);let l="";const f={diagram_has_errors:"diagram_has_errors",survey_not_exist:"survey_not_exist",survey_offline:"survey_offline",oauth_error:"oauth_error",interviewee_missing_error:"interviewee_missing_error",interviewee_invalid_error:"interviewee_invalid_error",multi_responses_error:"multi_responses_error",quota_full:"quota_full",quota_not_match:"quota_not_match",red_envelope_duplicated:"red_envelope_duplicated",red_envelope_expired:"red_envelope_expired",red_envelope_received_by_yourself:"red_envelope_received_by_yourself",red_envelope_received_by_others:"red_envelope_received_by_others",red_envelope_intercepted:"red_envelope_intercepted",red_envelope_send_error:"red_envelope_send_error"},d=[400,401,402,403,404,405,422,500];async function p(e,t){try{const r=await Object(o.c)().network.request(e,t);if((n=r).status>=200&&n.status<300)return function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}(r.response);throw r}catch(e){throw e}var n}function b(e){e&&d.includes(e.status)||Object(o.b)().error(Object(i.f)(a.a.global.downloadError))}function h(e){const t=JSON.parse(e&&e.response||"{}");return t&&d.includes(t.status)?t.code+"":""}function m(e){const t=h(e);t!==l&&t&&(f[t]?Object(o.b)().error(N(t)):Object(o.b)().notify(N(t)))}async function g(e,t={type:"GET"}){try{return await p(e,t)}catch(n){throw m(n),Object(c.c)(`api error: ${t.type}:${e} ${JSON.stringify(n)}`),n}}function O(e,t={type:"GET"}){return g(e,t={...t,contentType:"application/json"})}function j(e){if(Object(o.b)().preview)return async function(e){if("00000000-0000-0000-0000-000000000000"===e)return{smaller_diagram_url:"http://localhost:12345/unit_test_payload.json"};const t=Object(r.c)(),n=t.type;let i=Object(o.b)().hostConfig.qApiHost+"/surveys/"+e+"/preview";"preview_template"===n?i=Object(o.b)().hostConfig.host+"/v1/public_templates/"+e:"edit_template"===n&&(i=Object(o.b)().hostConfig.host+"/v1/templates/"+e);const a=await O(i,{type:"GET",jwt:t.jwt}),{diagram:c}=a;return{smaller_diagram_url:a.diagram_url||c.diagram_url,langs:a.langs}}(e);const t=Object(o.c)().auth.retrieveAuthMeta();if(t)return Object(c.n)(t);return O(Object(o.b)().hostConfig.qApiHost+"/surveys/"+e,{type:"GET"}).catch(e=>{throw b(e),e})}function v(e){const t=Object(o.b)().hostConfig.qApiHost+"/responses";return l=f.multi_responses_error,O(t,{type:"POST",data:e}).then(e=>(l="",e)).catch(()=>{l=""})}function w(e,t){return O(Object(o.b)().hostConfig.qApiHost+"/responses/"+t+"/examine",{type:"PUT",data:e})}function y(e,t){return O(Object(o.b)().hostConfig.qApiHost+"/responses/"+t+"/skip",{type:"PUT",data:e})}function _(e,t){return O(Object(o.b)().hostConfig.qApiHost+"/responses/"+t,{type:"PUT",data:e})}async function x(e){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(a.a.preview.noMessage)),{};const t=Object(o.b)().hostConfig.qApiHost+"/validations";e.question_id=e.question_id.toLowerCase();const n=await O(t,{type:"POST",data:e});return e.phone_num&&Object(o.b)().notify(Object(i.f)(a.a.verify.sendSuccess)),n}function T(e,t){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(a.a.preview.noMessage)),Object(c.n)({});return O(Object(o.b)().hostConfig.qApiHost+"/validations/"+t,{type:"PUT",data:e})}function k(e,t){if(Object(o.b)().preview)return Object(c.n)({recipient:Object(u.a)()});const n=Object(o.c)().storage.get("gift-"+e.code);if(n)return Object(c.n)(JSON.parse(n));return g(Object(o.b)().hostConfig.qApiHost+"/rewards/"+t+"/red_envelope",{type:"POST",data:e})}async function S(e,t){if(Object(o.b)().preview)return{};const n=Object(o.b)().hostConfig.qApiHost+"/rewards/"+t+"/custom";try{const t=await g(n,{type:"PUT",data:e});return Object(o.b)().notify(Object(i.f)(a.a.verify.sendSuccess)),t}catch(e){throw Object(o.b)().notify(Object(i.f)(a.a.verify.sendFailed)),e}}function E(e){Object(s.a)(e);const{preview:t}=Object(o.b)(),{dev:{autoRun:n,infer:r}}=Object(o.c)();if(t||n||r)return Object(c.n)(null);return g(Object(o.b)().hostConfig.qApiHost+"/webhooks",{type:"POST",data:e})}function N(e){return Object(i.f)("backEnd."+e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"d",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p}));var r=n(3),i=n(0),o=n(2),a=n(34);let c;function s(){return c||(c=Object(i.c)().app.getParams()),c}function u(){c=null}function l(e){const t=new a.a("div");t.setInnerHtml(e),e=t.getText();const n=Object.create(null);return"string"!=typeof e?n:(e=e.trim().replace(/^([?#&])/,""))?(e.split("&").forEach(e=>{const t=e.replace(/\+/g," ").split("=");let r=t.shift(),i=t.length>0?t.join("="):void 0;r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),void 0===n[r]?n[r]=i:Array.isArray(n[r])?n[r].push(i):n[r]=[n[r],i]}),{...n}):n}function f(e){Object(i.b)().preview||Object(i.c)().dev.autoRun?Object(i.b)().notify(Object(o.f)(r.a.preview.noLink)):(Object(i.c)().hook.beforeForceLeave(),Object(i.c)().app.openWebLink(e),Object(i.b)().customAbort())}function d(e,t){if("string"==typeof t)try{t=JSON.parse(t)}catch(e){}const n=function(e){const t=[];return Object.keys(e).forEach(n=>{if(void 0!==e[n]){const r=`${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`;t.push(r)}}),t.join("&")}(t),r=e.match(/\?/)?"&":"?";return e+r+n}function p(e,t){const n=Object.keys(t),r=["key","dev","rid","aid","cid","qid","tid","rtpl","infer_id","sid","type","jwt","ban_preview_bar","fake_port","real_port","auto_path","lite_template"];for(const i of n){const n=e.includes("?")?"&":"?";(r.includes(i)||i.match(/^key\d\d?$/))&&(e+=`${n}${i}=${t[i]}`)}return e}},function(e,t,n){"use strict";n.d(t,"A",(function(){return j})),n.d(t,"B",(function(){return v})),n.d(t,"q",(function(){return w})),n.d(t,"b",(function(){return y})),n.d(t,"p",(function(){return _})),n.d(t,"r",(function(){return x})),n.d(t,"k",(function(){return T})),n.d(t,"u",(function(){return k})),n.d(t,"t",(function(){return S})),n.d(t,"s",(function(){return E})),n.d(t,"n",(function(){return N})),n.d(t,"m",(function(){return I})),n.d(t,"f",(function(){return C})),n.d(t,"v",(function(){return L})),n.d(t,"g",(function(){return A})),n.d(t,"y",(function(){return P})),n.d(t,"a",(function(){return R})),n.d(t,"z",(function(){return M})),n.d(t,"i",(function(){return D})),n.d(t,"l",(function(){return U})),n.d(t,"j",(function(){return B})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return F})),n.d(t,"e",(function(){return V})),n.d(t,"o",(function(){return z})),n.d(t,"h",(function(){return H})),n.d(t,"x",(function(){return X})),n.d(t,"w",(function(){return G}));var r=n(33),i=n(40),o=n(1),a=n(5),c=n(20),s=n(9),u=n(6),l=n(0),f=n(10);let d=[];let p=-1;function b(){const{dev:{local:e}}=Object(l.c)(),{preview:t,realTimePreview:n,hostConfig:{recordUrl:r}}=Object(l.b)();return!(e||t||n||!r)}function h(e,t=!1){if(Object(c.b)()&&(!t||"start"===e.type))return;e.description=Object(a.k)(e.description);const n=e.description;if(b()){const r=d[d.length-1];r&&(n.indexOf(r.description)>-1||r.description.indexOf(n)>-1)&&d.pop(),d.push(e),t&&m()}}function m(){if(b()){if(clearTimeout(p),d.length>0){const e=d;d=[];const t=Object(l.b)().hostConfig.recordUrl;Object(s.q)(t,{type:"POST",data:{records:e}}).catch(()=>{Object(o.c)("failed to send record")})}p=setTimeout(m,1e4)}}function g(e,t,n,r,i){const{surveyId:o,transactionID:a,userInfo:c}=n;let s,u,d,p,b,h,m;("gift"===r||"start"===r&&c)&&(s=c.nickname,u=c.openid,s&&(p=Object(l.c)().name)),"start"===r&&(d=JSON.stringify(Object(f.c)())),t&&("matrix"===t.type?(h=e?e.yid:void 0,m=e?e.xid:void 0):b=e?e.uuid.toLowerCase():void 0);return{survey_id:o,collector_id:n.parsedPayload&&n.parsedPayload.basicConfig&&n.parsedPayload.basicConfig.collector&&n.parsedPayload.basicConfig.collector.id,response_id:a,node_id:t?t.nodeUuid.toLowerCase():void 0,option_id:b,row_option_id:h,col_option_id:m,description:i,type:r,recorded_at:new Date,provider:p,user_name:s,user_id:u,query_params:d}}function O(e){const t=e.loop?`[${e.nodeName}:${e.title||""}]`:`[${e.nodeName}]`;return Object(a.k)(t)}function j(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e,"used_phone",`在题目:${O(t)}中检测到重复使用的手机号:${e.phoneNumber}`))}function v(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e,"verify_fail",`在题目:${O(t)}高级验证失败`))}function w(e,t){if(Object(l.c)().dev.infer)return;const{type:n,parent:r}=t;if("upload"===n||"verify"===n||"gift"===n)return;let o,c="",s="";if("menu"===n||"cascade"===n)s=Object(u.c)(t).reduce((t,n)=>(n.selected&&(t+=`[${n.text}]`),e=n,t),""),o=s?"select":"deselect",c=s?"选中":"清除所有选中";else{const r=e.selected;o=r?"select":"deselect",c=r?"选中":"取消选中",s="select_icon"===n||"select_image"===n?`[${Object(i.b)(e)}]`:"matrix"===t.type?`[${Object(a.k)(e.xText)} ${Object(a.k)(e.yText)}]`:`[${Object(a.k)(e.text)}]`}const f=`在题目:${O(t)}中${c}选项:${s}`;h(g(e,t,r,o,f))}function y(e,t,n){if(Object(l.c)().dev.infer)return;const r=`在题目:${O(n)}的选项:[${Object(a.k)(t.text)}]中输入自动填充触发文字:${e}`;h(g(t,n,n.parent,"auto_complete",r))}function _(e,t,n){if(Object(l.c)().dev.infer)return;const r=n.parent;let i,o;"value_mark"===n.type||"icon_mark"===n.type||"slide_rate"===n.type||"weight"===n.type?(i="打分:"+t.value,o="rate"):"upload"===n.type?(i=e?"上传图片":"清除图片",o="upload"):(i="输入:"+t.value,o="input");h(g(t,n,r,o,`在题目:${O(n)}的选项:[${Object(a.k)(t.text)}]中${i}`))}function x(e,t){if(Object(l.c)().dev.infer)return;const n=t.parent,r=t.options[e];if(!r)return;h(g(r,t,n,"sort",`在题目:${O(t)}中将选项:[${Object(a.k)(r.text)}]排序到第${e+1}位`))}function T(e){if(Object(l.c)().dev.infer)return;const t=`在题目:${O(e)}中 定位失败`;h(g(null,e,e.parent,"locate_failed",t))}function k(e,t){if(Object(l.c)().dev.infer)return;const n=t.parent,r=t.type,i=t.value;let o="input",a="输入";if("region"===r)a="输入:"+i;else if("location"===r||"area"===r)o="locate",a="定位到:"+i;else if("verify"===r){const t=typeof e;if("string"===t)a="输入:"+e;else if("object"===t){const{code:t,phoneNumber:n}=e;void 0!==n?(o="input_phone",a="的手机号码中输入:"+n):(o="input_code",a="的密码/验证码中输入:"+t)}}h(g(null,t,n,o,`在题目:${O(t)}中${a}`))}function S(e){if(Object(l.c)().dev.infer)return;h(g(null,e,e.parent,"prev",`在题目:${O(e)}中点击上一题`))}function E(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e.parent,"prev",`返回到题目: ${O(t)},由题目:${O(e)}后退而来`))}function N(e){if(Object(l.c)().dev.infer)return;h(g(null,e,e.parent,"next",`在题目:${O(e)}中点击下一题`))}function I(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e.parent,"next","end"===t.type?`到达结束节点: ${O(t)},由题目:${O(e)}前进而来`:`进入题目: ${O(t)},由题目:${O(e)}前进而来`))}function C(e,t,n){if(Object(l.c)().dev.infer)return;h(g(null,t,n,"check_fail",`从${O(e)}走向甄别失败`),!0)}function L(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e.current,e,"quota_fail","配额失败,答案数:"+t),!0)}function A(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e.current,e,"check_submit","甄别提交,答案数:"+t))}function P(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"time_less","答题时间太少被排除"),!0)}function R(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"abandon_answer","按结束节点要求抛弃答案"),!0)}function M(e){if(Object(l.c)().dev.infer)return;h(g(null,e.current,e,"time_over","答题超时未完成"),!0)}function D(e,t,n,r){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"full_submit",`正式提交,答案数:${n}个答案 \n 提交回应:${JSON.stringify(r)}`),!0)}function U(e,t,n=!1){if(Object(l.c)().dev.infer)return;h(g(null,e,t,n?"lottery_goal":"lottery_fail",n?"抽奖:中奖":"抽奖:未中奖"),!0)}function B(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"gift","领奖"),!0)}function q(e,t,n,r,i){if(Object(l.c)().dev.infer)return;h(g(t,n,e,"auto_input",`在题目:${O(n)}中自动填充选项:[${r}],期待值:[${i}]`))}function F(e,t,n,r="成功"){if(Object(l.c)().dev.infer)return;h(g(null,n,e,"auto_skip",`在题目:${O(n)}中尝试自动选中选项:[${Object(a.k)(t.text)}]${r}`))}function V(e,t,n){if(Object(l.c)().dev.infer)return;let r=`自动跳过题目:${O(t)} by ${n}`;"logic"===t.type&&(r+=" logicResult:"+t.logicResult);h(g(null,t,e,"auto_skip",r))}function z(e,t,n){if(Object(l.c)().dev.infer)return;h(g(null,n,e,"opt_display",`在题目:${O(n)}中显示选项:[${Object(a.k)(t.text)}]`))}function $(){let e=Object(l.c)().storage.get("browser_uuid");return e||(e=Object(o.i)(),Object(l.c)().storage.set("browser_uuid",e)),e}function H(){if(Object(l.c)().dev.infer)return;const e=Object(f.c)();if(e.code&&e.state)return;h({type:"enter",collector_code:Object(l.b)().sid,browser_uuid:$(),recorded_at:Object(r.c)(),description:"来自"+Object(l.c)().system.getReferer()},!0)}function X(e,t){if(Object(l.c)().dev.infer)return;let n=`开始答题,进入到题目: ${O(t)} `;const{browser:r,device:i,engine:o,os:a}=Object(l.c)().system.device;r&&(n+=`browser:${r.name||""} ${r.version||""}, `),i&&(n+=`device:${i.type||""} ${i.vendor||""} ${i.model||""}, `),o&&(n+=`engine:${o.name||""} ${o.version}, `),a&&(n+=`os:${a.name||""} ${a.version||""}`);const c=g(null,t,e,"start",n);c.browser_uuid=$(),c.collector_code=Object(l.b)().sid,h(c,!0)}function G(e,t){if(Object(l.c)().dev.infer)return;h(g(null,null,e,"resume","开始断点续答:"+t),!0)}},function(e,t,n){"use strict";n.d(t,"l",(function(){return N})),n.d(t,"e",(function(){return L})),n.d(t,"h",(function(){return A})),n.d(t,"f",(function(){return P})),n.d(t,"g",(function(){return R})),n.d(t,"n",(function(){return M})),n.d(t,"m",(function(){return D})),n.d(t,"d",(function(){return U})),n.d(t,"b",(function(){return B})),n.d(t,"k",(function(){return F})),n.d(t,"j",(function(){return V})),n.d(t,"i",(function(){return z})),n.d(t,"c",(function(){return $})),n.d(t,"a",(function(){return H}));var r=n(8),i=n(10),o=n(4),a=n(11),c=n(17),s=n(35),u=n(59),l=n(19),f=n(57),d=n(71),p=n(0),b=n(2),h=n(47),m=n(48),g=n(3),O=n(20),j=n(9),v=n(46),w=n(5),y=n(21),_=n(69);const x={},T={};async function k(e,t,n){const{actions:r}=t;if(r&&!Object(O.b)()&&!Object(p.b)().realTimePreview){if("forward_enter"===e){if(x[t.renderId])return;x[t.renderId]=!0}if("backward_leave"===e&&delete x[t.renderId],"forward_leave"===e){if(T[t.renderId])return;T[t.renderId]=!0}"backward_leave"===e&&delete T[t.renderId];for(const i of r){if(i.disabled||i.event!==e)continue;const{activeConfig:r}=i;if(!r||await Object(y.b)(n,r.options,r.logicType))if("http_request"===i.type)Object(_.a)(i),await Object(v.b)(n,i.request,null,!0,!1);else{const r={state:n},o={question_id:t.nodeUuid,response_id:n.transactionID,locale:n.language,event:e,type:i.type};if("email"===i.type){const{email:e}=i,t={...o,email:(await Object(w.f)(e.address,r)).replace(/\s/g,""),content:await Object(w.d)(e.content,r),title:(await Object(w.f)(e.title,r)).trim()};await Object(j.i)(t)}else{const{sms:e}=i,t={};for(const n of e.params)t[n.name]=(await Object(w.f)(n.value,r)).trim();const n={...o,url:(await Object(w.f)(e.url,r)).replace(/\s/g,""),content:t};await Object(j.i)(n)}}}}}var S=n(14);let E;function N(){return!!E}const I=["end","gift","lottery"];function C(e){let{prev:t}=e;const n=[];let r=t&&Object(o.w)(t);for(;r;)n.push({question:t,reason:r}),t=t.prev,r=t&&Object(o.w)(t);return{prev:t,skipList:n,current:e}}function L(e){const{parent:t}=e,{renderList:n}=t,r=n.indexOf(e);return R(t,n,r)}function A(e){if(Object(p.b)().realTimePreview)return"";const{prevEnabled:t,themeMode:n}=e,r=e.first(),{prev:i}=C(r),o=r.type;if(t&&n&&"end"!==o&&"lottery"!==o)return e.prevBtnText;if(Object(p.b)().preview&&"end"===o)return Object(b.f)(g.a.global.backTest);return t&&i&&(r.checkMode===i.checkMode||Object(p.b)().preview)&&I.indexOf(o)<0?e.inSingleGroup?e.inSingleGroup.prevText||Object(b.f)(g.a.global.previous):e.prevBtnText:""}async function P(e){const{formalResult:t}=e,n=e.current,{type:r,linkUrl:i,goal:o,qrCode:a}=n;if("end"===r){const r=n.endBtnText||Object(b.f)(g.a.global.go);if(i)return r;if(t&&t.reward||Object(p.b)().preview&&n.useReward)return a||e.fakeCommitted?"":r;{const{node:t}=await h.a.findNext(e.nodeList,n,e);return t&&"lottery"===t.type?r:""}}if("lottery"===r){const e=Object(b.f)(g.a.reward.get);return i?n.endBtnText||e:o?a?"":e:""}return e.inSingleGroup?e.inSingleGroup.nextText||Object(b.f)(g.a.global.next):e.nextBtnText}function R(e,t,n){const r=[];let i=1;const a=t[n];let c=t[n+i],s=c&&Object(o.w)(c);for(;c&&s;)r.push({question:c,reason:s}),i+=1,c=t[n+i],s=c&&Object(o.w)(c);return{next:c,skipList:r,current:a}}async function M(e){const t=await Object(s.c)(e.nodes,!0);if(t.valid){if(Object(l.c)(e)){Object(p.g)(e,{current:e.nodes[e.nodes.length-1]});for(const t of e.nodes)await k("forward_leave",t,e)}else await k("forward_leave",e.current,e);return await Object(c.f)(e,e.current,{type:"page_next",delay:200}),!0}return function(e,t){const{valid:n,message:i,dueToNode:o,dueToOption:a}=t,c={valid:n,message:i};a&&(c.optId=a.uuid,c.optText=a.text,a.label&&(c.message=a.label+":"+c.message));o&&(c.nodeId=o.nodeUuid,c.nodeName=o.nodeName,c.nodeType=o.type,c.message=o.nodeName+":"+c.message);if(r.a.trigger("NEXT_FAIL",c),"vital"===t.type)throw Object(p.b)().error(t.message),new Error("next vital error: "+t.message);"alert"===t.type?Object(p.b)().alert(t.message):(e.inSingleGroup||Object(p.b)().notify(t.message),Object(s.a)(t,e))}(e,t),!1}function D(e,t){Object(p.g)(e,{nextLoading:t}),Object(O.c)()}function U(e){D(e,!0),E={state:e}}async function B(e){D(e,!1),E&&(await V(E.state),E=void 0)}function q(e,t){if(Object(r.c)(t,!0),"red_envelope"!==t.giftType||Object(p.b)().preview)Object(p.c)().hook.beforeForceLeave(),Object(p.c)().app.openWebLink(Object(p.c)().app.getRewardUrl(Object(i.c)())),Object(p.b)().customAbort();else{const n={...Object(i.c)(),tid:e.transactionID,qid:e.surveyId,rid:e.rewardInfo.goalId};t.template&&(n.rtpl=t.template.id);const{formalResult:{authorizer:{app_id:r,component_appid:o}}}=e;Object(p.c)().auth.authorizeGift(r,o,n),Object(p.b)().customAbort()}}function F(e,t){t.linkUrl?(Object(p.c)().hook.beforeForceLeave(),Object(p.c)().app.openWebLink(t.linkUrl),Object(p.b)().customAbort()):q(e,Object(o.a)(e.nodeList,t.rewardNodeId))}async function V(e){const t=function(e){const{renderList:t}=e,n=e.nodes[e.nodes.length-1];return R(0,t,Object(c.b)(t,n))}(e),{current:n,next:s}=t;if("end"===n.type)return async function(e,t){Object(p.c)().storage.remove("reward_info");const n=t.linkUrl;if(n)return void Object(i.d)(n);const c=Object(o.c)(e.nodeList,t.destList,t.output&&t.output.uuid);if(!c)return;const s=await Object(u.b)(e,c);if("lottery"===c.type){const t=await Object(l.e)(c,s,e);Object(a.l)(c,e,s.goal),Object(p.g)(e,{current:t}),Object(r.c)(c,!0)}else q(e,c);return e.dynamicStateProps()}(e,n);return(await Object(f.b)(e,{valid:!0,message:""},n,s)).valid?async function(e,t){const{next:n,current:i}=t;Object(p.g)(e,{current:n}),n.reached=!0,Object(a.m)(i,n),Object(r.c)(n,!0),Object(m.a)(e),Object(S.j)(e),await e.dynamicStateProps(),D(e,!1),i.dynamicNodeProps(),Object(c.e)(e,e.current),r.a.trigger("NEXT_OK")}(e,t):D(e,!1)}async function z(e){const t=e.first(),{prev:n,skipList:i}=C(t);if(n){if(t.groupSingle){const t=[...e.nodes].reverse();for(const n of t)await k("backward_leave",n,e)}else await k("backward_leave",t,e);for(const t of i)await k("backward_enter",t.question,e),await k("backward_leave",t.question,e);if(Object(p.g)(e,{current:n,currentStartTime:(new Date).getTime()}),Object(r.c)(n,!0),Object(m.a)(e),Object(S.j)(e),await e.dynamicStateProps(),Object(a.s)(t,n),Object(c.e)(e,e.current),r.a.trigger("PREV_OK"),n.groupSingle){const t=[...e.nodes].reverse();for(const n of t)await k("backward_enter",n,e)}else await k("backward_enter",n,e)}}async function $(e,t){const{nodeList:n,current:r}=e,i=await Object(d.b)(n,r,e),{node:o}=i;return o?H(e,i,t):null}async function H(e,t,n){const r=e.current,{node:i,loop:c,random:s,loopStack:u}=t,f={prev:r,origin:i,...i,loop:c,random:s,loopStack:u};if(n&&n(f))return null;const d=await Object(l.f)(f,e);await k("forward_enter",d,e),Object(p.g)(e,{current:d});const b=Object(o.w)(d);return b&&(Object(a.e)(e,d,b),await k("forward_leave",d,e)),d}},function(e,t,n){"use strict";n.d(t,"l",(function(){return b})),n.d(t,"i",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"k",(function(){return g})),n.d(t,"g",(function(){return O})),n.d(t,"f",(function(){return j})),n.d(t,"c",(function(){return v})),n.d(t,"h",(function(){return w})),n.d(t,"b",(function(){return y})),n.d(t,"d",(function(){return _})),n.d(t,"e",(function(){return x})),n.d(t,"a",(function(){return T}));var r=n(5),i=n(49),o=n(1),a=n(31),c=n(6),s=n(39),u=n(17),l=n(16),f=n(22),d=n(34),p=n(7);function b(e){return Object(d.c)(e)}function h(e="",t){return t||(t=b(e)),t.queryByClass("var-tag")}function m(e=""){return!!(e&&e.indexOf("var-tag")>-1)}function g(e){return Object(o.k)(e,"node"===e.type)&&e.hasClass("var-tag")}function O(e){return{name:e.getText(),uuid:(t=e,t.attributes["data-id"]),limit:e.attributes["data-limit"],limitSrc:Number(e.attributes["data-limit-src"]||void 0),imgSize:e.attributes["data-img-size"],limitRnd:Number(e.attributes["data-limit-rnd"]||void 0),paramConfig:e.attributes["data-ph-cfg"],disorder:"1"===e.attributes["data-disorder"],inEdist:e.parent&&!!e.parent.attributes.edist};var t}function j(e,t){return w(e,O(t))}function v(e){const{uuid:t,limitSrc:n,limit:r,limitRnd:i,paramConfig:o}=e;let a=t;return Object(p.b)(n)||(a+="_"+n),Object(p.b)(r)||(a+="_"+r),Object(p.b)(i)||(a+="_"+i),Object(p.b)(o)||(a+="_"+o),a}function w(e,t){const n=v(t),{uuid:r,limitSrc:i,paramConfig:a,name:d,disorder:b,inEdist:h}=t;let{imgSize:m,limitRnd:g,limit:O}=t;O=O||"1:0:0",m=m||"0:0",g=Object(p.b)(g)?-1:g;const j=r.split(":");let w="";s.f(r)&&(w=r.substr(0,8));const y=j.length;if(0===y)return;if(1===y){const e=j[0],t=Object(l.e)(e);return t&&{...t,name:d,uuid:r,limit:O,limitSrc:i,limitRnd:g,imgSize:m,loopNodeId:w,mapId:n,paramConfig:a,inEdist:h}}let _;if(!w&&(_=function(e,t=""){const{loopStack:n,context:r}=e;let{renderList:i}=e;const a=Object(o.h)("",n);return r.question&&(i=[...i,r.question]),i.find(e=>{const n=e.nodeUuid+a;return Object(o.l)(e.nodeUuid,t)&&Object(u.d)(e.renderId,n)})}(e,j[0]),!_))return;const x=Object(f.b)(j[1]);if(2===y)return x&&{name:d,question:_,nodePart:x,limit:O,limitSrc:i,limitRnd:g,uuid:r,imgSize:m,loopNodeId:w,isMedia:"var-media"===x.type,type:x.type,mapId:n,paramConfig:a,inEdist:h};const T=Object(f.b)(j[2],_),k=T&&"var-media"===T.type;if(3===y&&!j[1].match(/^[a-z0-9]{8}$/))return T&&{inEdist:h,name:d,question:_,nodePart:x,optionPart:T,limit:O,limitSrc:i,limitRnd:g,disorder:b,uuid:r,imgSize:m,loopNodeId:w,isMedia:k,type:T.type,mapId:n,paramConfig:a};const S=Object(c.a)(Object(c.b)(_),j[1]);return S?T&&{inEdist:h,name:d,question:_,option:S,optionPart:T,limit:O,limitSrc:i,limitRnd:g,disorder:b,uuid:r,imgSize:m,loopNodeId:w,isMedia:k,type:T.type,mapId:n,paramConfig:a}:void 0}async function y(e,t){let n=[];const{varInfo:{nodePart:c,option:s,disorder:u}}=e,l=await Object(r.e)(e.varInfo.limitRnd,e);if(0===l&&!t)return[];const f=e.specifiedOpt||s;n=f&&await Object(i.b)(e)?[f]:c&&c.filter?await c.filter(e):[];const d=t?t(n,l):Object(o.p)(n,l);return u?Object(a.c)(d):Object(a.d)(d)}async function _(e){const{varInfo:{nodePart:t,optionPart:n,option:r}}=e,o=e.specifiedOpt||r;if(t&&t.getBool)return t.getBool(e);if(o){return await Object(i.b)(e)&&await n.getBool({...e,specifiedOpt:o})}if(n.inBunch)return n.getBool(e);{const t=await y(e),r=[];for(const i of t){const t=await n.getText({...e,specifiedOpt:i});t&&r.push(t)}return r.length>0}}async function x(e){const{varInfo:{nodePart:t,optionPart:n,option:r}}=e,o=e.specifiedOpt||r,a=e.joinBy||" ";if(t&&t.getText)return t.getText(e);if(o){return await Object(i.b)(e)?n.getText({...e,specifiedOpt:o}):""}if(n.inBunch)return n.getText(e);{const t=await y(e),r=[];for(const i of t){const t=await n.getText({...e,specifiedOpt:i});Object(p.b)(t)||r.push(t)}return r.join(a)}}async function T(e){const t={};t.text=await x(e);const n=await async function(e){const{varInfo:{nodePart:t,optionPart:n,option:r,isMedia:o}}=e;if(!o)return[];const a=e.specifiedOpt||r;if(t&&t.getImages)return t.getImages(e);if(a){return await Object(i.b)(e)&&n.getImages?n.getImages({...e,specifiedOpt:a}):[]}{const t=await y(e),r=[];if(n.getImages)for(const i of t){const t=await n.getImages({...e,specifiedOpt:i});r.push(t[0])}return r}}(e);t.image=n[0];const r=await async function(e){const{varInfo:{optionPart:t,option:n}}=e;if(!t)return[];const r=e.specifiedOpt||n;if(r){return await Object(i.b)(e)&&t.getIcon?[t.getIcon({...e,specifiedOpt:r})]:[]}{const n=await y(e);return t.getIcon?n.map(n=>t.getIcon({...e,specifiedOpt:n})):[]}}(e);return t.icon=r[0],t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return N})),n.d(t,"e",(function(){return C})),n.d(t,"i",(function(){return A})),n.d(t,"c",(function(){return P})),n.d(t,"g",(function(){return R})),n.d(t,"h",(function(){return M})),n.d(t,"f",(function(){return D})),n.d(t,"b",(function(){return U})),n.d(t,"j",(function(){return B})),n.d(t,"d",(function(){return q}));var r=n(6),i=n(4),o=n(15),a=n(8),c=n(36),s=n(0),u=n(1),l=n(3);const f={};function d(e,t){t.startTime=e.startTime,t.costTime=e.costTime,t.validateFailTimes=e.validateFailTimes,t.validateFailed=e.validateFailed,t.type=e.type}f.max_diff={cache(e,t){t.tasks=e.tasks.map(e=>({items:e.items.map(e=>({uuid:e.option.uuid,value:e.value,round:e.round})),done:e.done}))},use(e,t){e.tasks&&(t.tasks=e.tasks.map(e=>({items:e.items.map(e=>({option:Object(r.a)(t.options,e.uuid),value:e.value,round:e.round})),done:e.done})))}},f.cascade={use(e,t){!function e(t,n){n&&t&&(n.selected=t.selected,n.list&&t.list&&n.list.forEach(n=>{const r=t.list.find(e=>e.resultId===n.resultId);r&&e(r,n)}))}(e.cascade,t.cascade)},cache(e,t){t.cascade=function e(t){return t?{selected:t.selected,resultId:t.resultId,list:t.list&&t.list.map(t=>e(t))}:null}(e.cascade)}},f.verify={borrow(e,t){t.code=e.code,t.phoneNumber=e.phoneNumber}},f.region={borrow(e,t){t.indexes=e.indexes,t.position=e.position,t.value=e.value}},f.location=f.area={borrow(e,t){f.region.borrow(e,t),t.succeed=e.succeed,t.failed=e.failed,t.failedSkipActivated=e.failedSkipActivated}},f.sequence={use(e,t){t.options.sort((e,t)=>e.sortNo>t.sortNo?1:-1)}};const p=["select","select_icon","select_image","menu","hot_spot"];var b=n(56),h=n(7);const m={};function g(e,t,n){t.value=e.value,t.selected=e.selected,e.assistValue&&(t.assistValue=t.assistValue||{},Object.keys(e.assistValue).forEach(n=>{Object(h.b)(e.assistValue[n])||(t.assistValue[n]=e.assistValue[n])}),"cache"===n&&0===Object.keys(t.assistValue).length&&delete t.assistValue)}function O(e,t,n){if(g(e,t,"use"),!t.isOtherOpt){const r=m[n];r&&(r.use?r.use(e,t):r.borrow&&r.borrow(e,t))}}m.max_diff={borrow(e,t){e.records&&(t.records=e.records.map(e=>({...e})))}},m.sequence={borrow(e,t){t.sortNo=e.sortNo}},m.heat_map={borrow(e,t){e.point&&(t.point={...e.point})}},m.upload={borrow(e,t){t.fileName=e.fileName,t.fileType=e.fileType,t.name=e.name,t.isImage=e.isImage},cache(e,t){m.upload.borrow(e,t),t.value=e.miniValue||e.value},use(e,t){m.upload.borrow(e,t),t.fileName&&Object(b.c)(t,{width:64,height:64},e)}};let j=!1,v="";const w=["data","describe","logic","random","loop"];let y,_;let x,T,k={responseId:"",data:{},point:"",count:0,randomList:[],lang:""};function S(e){const{offlineTaskId:t}=Object(s.b)(),n="response_cache_"+Object(u.s)(e);return t?n+"_with_"+t:n}function E(e,t){const n={};return function(e,t,n){if(t.uuid=e.uuid,g(e,t,"cache"),!e.isOtherOpt){const r=m[n];r&&(r.cache?r.cache(e,t):r.borrow&&r.borrow(e,t))}}(e,n,t),n}function N(e){if(Object(s.c)().dev.infer||j)return;if(Object(i.w)(e)||w.includes(e.type)||e.readonly)return;const t={};!function(e,t){d(e,t);const n=f[t.type];n&&(n.cache?n.cache(e,t):n.borrow&&n.borrow(e,t))}(e,t);const n=Object(o.a)(e);if(n&&n.items){const r=n.items.map(e=>e.option_id.toLowerCase()),i=e=>!!n.items&&r.includes(e.uuid.toLowerCase()),{options:o,otherOptions:a}=e;o&&(t.options=o.filter(i).map(t=>E(t,e.type))),a&&(t.otherOptions=a.filter(i).map(t=>E(t,e.type)))}k.responseId=e.parent.transactionID,k.data[e.renderId]=t;const r=e.parent.randomList;r&&(k.randomList=r.map(e=>({nodeId:e.node.nodeUuid,destPortIds:e.destPortIds}))),I(e.parent)}function I(e){const{sid:t,renderList:n}=e,r=S(t);k.lang=Object(l.b)();const i=Object.keys(k.data);k.count=0;for(const e of n)if(i.includes(e.renderId)&&(k.count+=1),e.renderId===k.point)break;Object(s.b)().preview||Object(s.c)().storage.set(r,JSON.stringify(L(k)))}function C(e){const t=S(e),n=Object(s.c)().storage.get(t);if(n){const e=JSON.parse(n);return v||(v=e.lang),e}return null}function L(e){const t=e.data,n={};return Object.keys(t).forEach(e=>{const r={...t[e]};"upload"===r.type&&(r.options=r.options.map(e=>((e={...e}).miniValue&&(e.value=e.miniValue,delete e.miniValue),e))),n[e]=r}),{...e,data:n}}function A(e){if(Object(s.c)().dev.infer)return e;if(Object(i.w)(e)||w.includes(e.type)||e.readonly)return e;const t=k.data[e.renderId];return t?(function(e,t,n){const i=Object(r.c)(e);let o=[];t.options&&(o=[...o,...t.options]),t.otherOptions&&(o=[...o,...t.otherOptions]);for(const e of i){const t=Object(r.a)(o,e.uuid);t&&O(t,e,n)}}(e,t,e.type),function(e,t){d(e,t);const n=f[t.type];n&&(n.use?n.use(e,t):n.borrow&&n.borrow(e,t))}(t,e),function(e){if(Object(i.s)(e))return;const{options:t,otherOptions:n,type:r}=e;let o=n||[];p.includes(r)&&(o=[...o,...t]);const a=o.filter(e=>e.selected);if(a.length<=1)return;const c=[];a.forEach(e=>{e.autoSelectMarked?Object(s.g)(e,{selected:!1,autoSelectMarked:!1}):c.push(e)}),c.length>1&&c.forEach((e,t)=>{t<c.length-1&&Object(s.g)(e,{selected:!1})})}(e),y&&y(e),e):(y&&y(e),e)}function P(e=!1){return e?L(k):k}async function R(e,t,n){k=e,x=[...e.randomList||[]],T=e.point;const r=k.count;let i=0;j=!0,y=()=>{i>=r?_({failed:!1,error:""}):(n.onProgress(`${i}/${r}`),i++)},_=e=>{o(),y=null,_=null,a.a.trigger("END_MEMORY",t.current),setTimeout(()=>{n.onEnd(e)},250)};const o=()=>{a.a.off("NEXT_OK",u),a.a.off("STRETCH_OK",u),a.a.off("NEXT_OK",s),j=!1},s=(e,t)=>{"NEXT_FAIL"===e.type&&t?n.onSuspend():_({failed:!0,error:t})},u=()=>t.current.renderId===T?_({failed:!1,error:""}):t.handleEvents.handleNextClick();a.a.one("STRETCH_OK",u),a.a.on("NEXT_FAIL",s),a.a.on("NEXT_OK",u),a.a.trigger("START_MEMORY"),await Object(c.b)()}function M(e,t){if(!x)return e;const n=x.find(e=>e.nodeId===t.nodeUuid);if(!n)return e;const r=n.destPortIds,i=[],o=[];return e.forEach(e=>{r.includes(e)?i.push(e):o.push(e)}),i.sort((e,t)=>r.indexOf(e)>r.indexOf(t)?1:-1),[...i,...o]}function D(){k={responseId:"",data:{},point:"",count:0,randomList:[],lang:""}}function U(e){D();const t=S(e.sid);Object(s.c)().storage.remove(t)}function B(e){j||(k.point=e.current.renderId,I(e))}function q(e){return e?(v||C(e),v):""}},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"c",(function(){return _})),n.d(t,"e",(function(){return x})),n.d(t,"b",(function(){return k})),n.d(t,"d",(function(){return S}));var r=n(6),i=n(37),o=n(40),a=n(43),c=n(1),s=n(5),u=n(4),l=n(55),f=n(10),d=n(7),p=n(25);const b=["select","icon_mark","value_mark","upload","menu","slide_rate"],h=["fill","verify"];function m(e){const{type:t}=e;return"region"===t?"predef":t}function g(e,t){let n;if(t.isOtherOpt)n=t.optionType;else if(!0===t.useComment)n="option_comment";else{const{type:t}=e;n="region"===t?"predef_region":b.includes(t)?"option":h.includes(t)?"comment":t}return n}function O(e,t){const n=function(e){const{loop:t}=e;let n;return t&&(n=t.replacements.map(e=>({node_id:e.loopNodeId.toLowerCase(),index:e.index,option_id:e.uuid.toLowerCase()}))),n}(e),{nodeUuid:r}=e,i=t&&t(e);return{type:m(e),node_id:r.toLowerCase(),items:i,start_time:e.startTime,cost_time:Math.round(e.costTime||0),loop_ctxs:n}}function j(e,t){const n=t,i=Object(r.e)(n),o=Object(p.a)(n,e),a={value:Object(d.b)(o)?"":o,other:!!n.isOtherOpt,type:g(e,n)};return a.option_id=n.uuid.toLowerCase(),"matrix"===e.type&&n.yid?(a.row_option_id=n.yid.toLowerCase(),a.col_option_id=n.xid.toLowerCase(),a.row_content=Object(s.k)(n.yText),a.col_content=Object(s.k)(n.xText),a.content=a.col_content+"-"+a.row_content):a.content=i||Object(s.k)(n.text),n.visible||(a.hidden=!0),a}function v(e){return Object(r.b)(e).reduce((t,n)=>((n.selected||Object(p.b)(n,e))&&t.push(j(e,n)),t),[])}const w={};function y(e){const t=w[e.type];return t&&t(e)}function _(e){return"object"==typeof e.value?JSON.stringify(e.value):e.value}function x(e,t){return"all"===t||(e?"check"===t:"normal"===t)}function T(){return function(e){const t={};return Object.keys(e).forEach(n=>{n.match(/key\d{0,2}/)&&(t[n]=e[n])}),t}(Object(f.c)())}async function k(e,t="all",n="committed_url"){const{costTime:r,answers:a}=function(e,t,n=!1){const r=[];let i=0;return e.renderList.forEach(e=>{if(!x(e.checkMode,t))return;if("data"===e.type)return;const o=y(e);o&&(n&&(o.content=e.title,o.name=e.number),r.push(o),i+=o.cost_time)}),{answers:r,costTime:i}}(e,t),s={webhook_params:await Object(l.a)(e,n),answers:a,var_map_info:Object(o.a)(e,t),options_display_info:Object(i.a)(e,t),query_params:T(),cost_time:r,status:e.responseStatus};return Object(c.m)(s.answers,(e,t)=>{"string"==typeof e[t]&&(e[t]=e[t].replace(/,/g,",").replace(/[\r\n]/g," "))}),s}function S(e){switch(e.type){case"verify":return!!e.code;case"location":case"region":case"area":return!!e.value;case"describe":case"lottery":case"end":return!1;default:return Object(r.k)(e)||Object(r.l)(e)}}w.select=w.select_image=w.menu=w.select_icon=w.hot_spot=e=>{const t=O(e,v);if(Object(u.v)(e)&&t.items){let e=!1,n=!1;t.items.forEach(t=>{"comment"!==t.type&&(t.hidden?e=!0:n=!0),delete t.hidden}),e&&n&&(t.items=t.items.filter(e=>!e.hidden))}return t},w.cascade=w.icon_mark=w.value_mark=w.matrix=w.weight=w.slide_rate=w.sequence=w.upload=w.heat_map=w.fill=w.max_diff=e=>{const t=O(e,v);return t.items&&t.items.forEach(e=>{delete e.hidden}),t},w.location=e=>{const t=O(e,t=>{const n=Object(r.b)(e).find(e=>e.selected);if(!n)return[];return[j(t,n)]}),{position:n,indexes:i}=e;return n&&(n.indexes=i,t.location=n),t},w.region=e=>{const t=w.location(e);return t.region=Object(a.b)(e.value),t},w.area=e=>w.location(e),w.data=e=>O(e,e=>Object(r.b)(e).reduce((t,n)=>(n.selected&&t.push(j(e,n)),t),[])),w.verify=e=>{const t=O(e),{phoneNumber:n,validateType:r,code:i}=e;return"sms"===r&&(t.phone_num=n),t.code=i,t},w.end=e=>({type:m(e),node_id:e.nodeUuid.toLowerCase(),start_time:e.startTime,cost_time:0}),w.logic=e=>{const t=O(e);return t.logic_result=e.logicResult,t}},function(e,t,n){"use strict";n.d(t,"g",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return g}));var r=n(5),i=n(24),o=n(1),a=n(22),c=n(0);let s=[],u=[];function l(){s=[],u=[]}function f(e){s=e.imageList,u=e.variables,function(e){const t=function(e){const{varInfo:{imgSize:t},pureText:n}=e;if(n)return Object(o.n)(this.fileName);const r=g(Object(i.a)(this.serverFileName),t,this.fileName);return Object(o.n)(r)};e.forEach(e=>{e.getText=t,e.isMedia=!0,e.type="var-media"})}(s),function(){let e="";u.forEach(t=>{t.name.indexOf("TO_GLOBAL")>-1&&"var-html"===t.type&&(e+=Object(r.i)(t.value).replace(/<style>/g,"").replace(/<\/style>/g,""))}),Object(c.c)().ui.setGlobalStyle(e)}(),function(e){if(e){const t=p(e.allJson,null)+p(e.strJson,"var-string")+p(e.expJson,"var-expression")+p(e.reqJson,"var-request")+p(e.loopJson,"var-loop");Object(c.c)().ui.setVarStyle(t,e)}}(e.varStyles)}function d(e){let t="";return e.bold&&(t+="font-weight: bold;"),e.italic&&(t+="font-style: italic;"),e.underline?t+="text-decoration: underline;":e.lineThrough&&(t+="text-decoration: line-through;"),e.color&&(t+=`color: ${e.color};`),e.backgroundColor&&(t+=`background-color: ${e.backgroundColor};`),e.fontSize&&(t+=`font-size: ${e.fontSize};`,t+="line-height: 1.4;"),t}function p(e,t){if(!e)return"";let n=t?`.var-light.${t}:not([in-edist]) {`:".var-light:not([in-edist]) {";return n+=d(e),n+="}",n}function b(e=""){return u.find(t=>t.name===e)}function h(e=""){return s.find(t=>Object(o.l)(t.id,e))}function m(e=""){return Object(a.b)(e)||u.find(t=>Object(o.l)(t.uuid,e))||h(e)}function g(e="",t="0:0",n="Image",r=!1){let i="##"+e;if(!r){const e=t.split(":");i+=`?w=${e[0]||0}&h=${e[1]||0}`,n&&(i+="#"+n)}return i+"##"}},function(e,t,n){"use strict";n.d(t,"d",(function(){return p})),n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return g})),n.d(t,"e",(function(){return O})),n.d(t,"c",(function(){return j}));var r=n(12),i=n(4),o=n(52),a=n(1),c=n(19),s=n(0),u=n(36),l=n(48),f=n(8);let d=-1;function p(e,t){return t===e||t.indexOf(e)>-1&&t.substr(e.length).indexOf("-")>-1}function b(e,t){return t=t.toLowerCase(),e.find(e=>p(e.renderId.toLowerCase(),t))}function h(e,t){for(let i=0;i<e.length;i++){const o=e[i];if(n=o,r=t,Object(a.l)(n.renderId,r.renderId))return i}var n,r;return-1}function m(e,t){Object(s.g)(e,{refreshing:t})}function g(e,t,n){if(m(e,!0),clearTimeout(d),n.initial&&Object(f.c)(e.current,!0),n.delay){const r=Object(s.c)().dev.autoRun||Object(s.c)().dev.infer?0:n.delay;return new Promise((i,o)=>{d=setTimeout(async()=>{try{await v(e,t,n)}catch(e){o(e)}i()},r)})}return v(e,t,n)}function O(e,t){const{circleNode1Id:n}=t;n?Object(s.g)(e,{loopStack:Object(a.b)(t.loopStack)}):Object(s.g)(e,{loopStack:[]});const r=e.randomList,i=t.random;r.forEach(e=>{if(i)if(Object(a.l)(e.node.nodeUuid,i.node.nodeUuid))e.currentIndex=i.currentIndex;else{i.stack.some(t=>Object(a.l)(e.node.nodeUuid,t.node.nodeUuid))||(e.currentIndex=-1)}else e.currentIndex=-1})}function j(e,t){const n=function(e,t){let n=e;if(!t)return n;for(const e of t)n+="-"+Object(a.s)(e.option_id);return n}(t.node_id,t.loop_ctxs);return b(e.renderList,n)}async function v(e,t,n){m(e,!0);const a=e.renderList;O(e,t=t||e.current);const f=h(a,t),d=await async function(e,t,n){const a=n.type;let u=[...e.renderList];u=u.length>0?u:[t];const l=h(u,t);if(l<0)return u;u.length=l,u.push(t),Object(s.g)(e,{renderList:u}),Object(c.c)(e)&&await Object(o.a)(t);let f=null;const d=e=>!Object(i.t)(e,f);let p=null;for("page_inner"===a&&(f=t,p=d);;){const t=await Object(r.c)(e,p);if(!t)break;if(u.push(t),i.x.includes(t.type))break;if(!Object(i.w)(t)){f||(f=t,f.groupSingle&&(p=d));if(!Object(i.t)(f,t))break;await Object(o.a)(t)}}return u}(e,t,n),p=n.initial?Object(r.g)(e,d,f).next:t;Object(s.g)(e,{current:p}),m(e,!1),O(e,t),await e.dynamicStateProps(),n.initial||(await Object(r.b)(e),e.inSingleGroup&&Object(l.a)(e)),Object(u.d)()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return O})),n.d(t,"d",(function(){return j})),n.d(t,"e",(function(){return v}));var r=n(6),i=n(5),o=n(1),a=n(40),c=n(31),s=n(13),u=n(42),l=n(22),f=n(0),d=n(24);function p(e,t){const{loop:n}=t,r=n&&n.node.nodeUuid;return Object(l.a)().QUES_IMAGE.getImages({state:e,varInfo:{question:t,loopNodeId:r}})}async function b(e,t){const{parent:n,loop:r}=e,i=r&&r.node.nodeUuid,{image:o,text:c}=t,s=Object(l.a)(),u=(await s.OPT_IMAGE.getImages({state:n,varInfo:{option:t,loopNodeId:i}}))[0];return!c&&u&&o&&"variable"===o.type&&Object(a.d)({question:e,option:t},{mapId:o.id},u.originName),u}function h(e){return!!Object(f.b)().realTimePreview||e&&!!(e.text||e.image||e.icon)}async function m(e,t,n){const{optionPart:i,nodePart:o}=t,{option:a}=t;if(!i||i.inBunch)return{valid:!0};if(a)return{valid:!0,option:a};{const i=await o.filter({state:e,varInfo:t}),a=Object(r.a)(i,n.refOptId);return{valid:!!a,option:a}}}function g(e,t){return e?e.find(e=>e.uuid===t):null}async function O(e,t,n){const r={...e};if(t.context.option=r,r.mapping){const e={...r.mapping};for(const n of Object.keys(e)){const r=n,o=e[r];if("string"==typeof o)e[r]=await Object(i.d)(o,{state:t});else{const t=o;e[r]=Object(d.c)(t)}}r.mapping=e,"data"===n&&(r.value=e.field_1,r.number=e.field_2,r.optComment=e.field_3,r.image=e.field_4)}return r.assistValue={field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""},t.context.option=null,r}async function j(e,t,n){const r=[];for(const i of e)r.push(await O(i,t,n));return r}async function v(e,t,n,u=!1){let l=[];const f=t;let{refOptions:d,options:p,optionRefers:b}=f;if("xid"===n?(d=f.refOptionsX,p=f.optionsX,b=f.optionXRefers):"yid"===n&&(d=f.refOptionsY,p=f.optionsY,b=f.optionYRefers),p&&d&&0!==d.length){l=[...p];const t={};for(const n of d){const o=g(b,n.referId),a=await Object(i.e)(n.limitRnd,{state:e});if(0===a)continue;let c=null;const l=Object(s.h)(e,{uuid:n.varId,limit:n.limit,limitSrc:n.limitSrc,limitRnd:n.limitRnd});if(!l)continue;const{valid:f,option:d}=await m(e,l,n);if(!f)continue;d&&(n.refIndex=d.index,n.refRealIndex=d.realIndex);const p={state:e,varInfo:l,specifiedOpt:d,pureText:!u,keepWrap:!0};if(l.question?(c=await Object(s.a)(p),d&&(c.passRef={value:d.value,optComment:d.optComment,image:Object(r.p)(d,"image"),number:d.number,text:d.text,label:d.label,mapping:d.mapping&&{...d.mapping}})):c=await w(p),h(c)){const e={...n,...c},r=n.referId+n.varId;t[r]?t[r].list.push(e):t[r]={list:[e],limitRnd:a,varInfo:l,disorder:o&&o.disorder}}}Object.keys(t).forEach(e=>{const{limitRnd:n,list:r,varInfo:i,disorder:s}=t[e];let u=Object(o.p)(r,n);u=s?Object(c.c)(u):Object(c.e)(u),Object(a.e)(f,i,u),l=l.concat(u)})}else l=p;return j(l,e,f.type)}async function w(e){return{text:await Object(i.c)(e),image:Object(u.b)(e.varInfo)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return ae})),n.d(t,"c",(function(){return ce})),n.d(t,"d",(function(){return le})),n.d(t,"f",(function(){return fe})),n.d(t,"e",(function(){return de})),n.d(t,"a",(function(){return pe}));var r=n(31),i=n(6),o=n(4),a=n(18),c=n(37),s=n(5);var u=n(0);const l=["select","sequence","menu"];function f(e,t){return t.options?t=function(e,t){if(Object(u.b)().realTimePreview)return t;let n;return l.indexOf(e.type)>-1?n=e=>!!e.text:"select_image"===e.type?n=e=>!!e.image:"slide_rate"===e.type&&(n=e=>!!e.text||!!e.image),n&&(t.options=t.options.filter(n)),t}(e,t):t}var d=n(61),p=n(11),b=n(7);const h={done:!1,expectedValue:"",actualValue:""};function m(e){const{autoInputConfig:t}=e;if(!t)return"";const{defaultValue:n}=t;return n&&Object(b.a)(n).trim()?n:""}const g={};async function O(e,t,n,r,i){if(!m(e))return h;const{parent:o}=t,a=await Object(s.e)(m(e),{state:o});let c=a;return a>=n&&a<=r||(c=i),Object(u.g)(e,{value:c}),{done:!0,actualValue:c,expectedValue:a}}async function j(e,t){const n=g[t.type];if(n){t.parent.context.option=e;const r=await n(e,t);return!!r.done&&(Object(p.c)(t.parent,e,t,r.actualValue,r.expectedValue),!0)}return!1}g.fill=async(e,t)=>{if(!m(e))return h;const{parent:n}=t,r=await Object(s.f)(m(e),{state:n});return Object(u.g)(e,{value:r}),{done:!0,actualValue:r,expectedValue:r}},g.value_mark=(e,t)=>O(e,t,e.minValue,e.maxValue,""),g.icon_mark=(e,t)=>O(e,t,0,e.count,""),g.slide_rate=(e,t)=>{const{rateOptions:n}=t;return O(e,t,0,n.length,"")},g.weight=(e,t)=>O(e,t,0,e.maxValue||t.weightTotal,""),g.sequence=async(e,t)=>{if(!m(e))return h;const n=t.options.length,{parent:r}=t,i=await Object(s.e)(m(e),{state:r});let o=i;return i>=1&&i<=n||(o=-1),Object(u.g)(e,{sortNo:o,selected:o>=1}),{done:!0,actualValue:o,expectedValue:i}};var v=n(21),w=n(1);async function y(e,t){const n=t.parent;n.context.option=e;const r=await function(e,t){return t?Object(v.b)(e,t.options,t.logicType):Object(w.n)(!1)}(n,e.selectConfig);e.autoSelectMarked=!!r}const _=["select","select_icon","select_image","menu","hot_spot"];var x=n(42),T=n(14),k=n(8);async function S(e,t,n,r,i=!1){const o=(n.options||[]).find(n=>n.xid===e.uuid&&n.yid===t.uuid),s={...o,index:o.number,realIndex:o.number,label:o.label||"",xid:e.uuid,yid:t.uuid,xText:e.text,yText:t.text,text:i?e.text:t.text,xNumber:e.number,xMutexNumber:e.mutexNumber,yMutexNumber:t.mutexNumber,yNumber:t.number,renderId:Object(w.h)(o.uuid,n.loopStack),headLength:r,selected:!1},u=await Object(a.c)(s,n.parent,n.type),l=await Object(c.b)(n.parent,u,n);return u.disabled=!l,u}async function E(e,t,n){const{parent:r}=e;return t={...t,customData:{},isOther:!!t.isOtherOpt,_selected:!1,inputType:n||N(t),value:t.value||"",renderId:Object(i.h)(e,t)},r.context.option=t,t.text=await Object(s.d)(t.text,{state:r,usage:{question:e,option:t}}),Object.defineProperty(t,"selected",{get(){return this._selected},set(e){"select-input"===this.inputType&&(e?Object(u.g)(this,{value:this.cachedValue||this.value}):Object(u.g)(this,{cachedValue:this.value,value:""})),Object(u.g)(this,{_selected:e}),e&&-1===this.mutexNumber&&setTimeout(()=>{k.a.trigger("OPT_EXCLUDE",this)}),k.a.trigger("OPT_SELECT")}}),t.isOtherOpt&&(await function(e,t){return Object(u.g)(e,{inputType:N(e)}),C(e,t)}(t,e),Object(i.n)(t)||await y(t,e)),function(e){!0===e.useComment?Object(u.g)(e,{placeholder:e.optComment}):"input"===e.inputType&&Object(u.g)(e,{placeholder:e.text})}(t),t}function N(e){let t="select";return Object(i.n)(e)?t="input":!0===e.useComment&&(t="select-input"),t}const I={chars:"count",date:"date",date_range:"dateRange",email:"email",float:"float",integer:"int",phone_number:"mobile",postcode:"postCode",time:"time",time_range:"timeRange",time_duration:"timeSpan",url:"link",auto_complete:"autoComplete",list_select:"dropdown",none:"noValidation"};async function C(e,t){const n=e.fillType;if(!n)return;const{parent:r}=t;let i,o,a,c=await Object(s.e)(e.fillStart,{state:r}),l=await Object(s.e)(e.fillEnd,{state:r});if(isNaN(c)&&(c=void 0),isNaN(l)&&(l=void 0),"date"===n){const e=(new Date).getFullYear(),t=c,n=l;void 0!==c&&(c=new Date(c,0,1),e<t&&(i=c)),void 0!==l&&(l=new Date(l,11,31),e>n&&(i=l))}"auto_complete"===n&&(o=function(e,t=[]){const{autoCpltGroups:n}=e;return t.reduce((e,t)=>{const r=n.find(e=>e.id===t);return r&&(e=e.concat(r.data)),e},[])}(r,e.autoCpltIds),a=Object(T.d)(t.parent.sid));let f=[];if("list_select"===n){f=M((await Object(s.f)(e.selectText,{state:r,joinBy:","})).split(","))}Object(u.g)(e,{inputRule:I[e.fillType]||"noValidation",validateMin:c,validateMax:l,defaultValue:i,completeGroups:o,selectList:f,prevCpltLang:a})}async function L(e,t,n=!1){const{options:i,otherOptions:o,hiddenOptions:a}=e,c={options:[],otherOptions:[],hiddenOptions:[]};if(i)for(const n of Object(r.b)(e,i))c.options.push(await t(n));if(o)for(const t of o)c.otherOptions.push(await E(e,t));if(a)for(const e of a)c.hiddenOptions.push(await t(e));return n&&D([...c.options,...c.otherOptions]),c}const A={};async function P(e,t){if(!e.image||!e.image.reformed){return await Object(a.b)(t,e)}return e.image}function R(e){return e.replace("/outline/","/glyph/")}function M(e){const t={};return e.map(e=>{const n=t[e];if(n){const r=n+1;return t[e]=r,`${e}(${n})`}return t[e]=2,e})}function D(e){M(e.map(e=>e.text)).forEach((t,n)=>{e[n].text=t})}function U(e){return e?"string"==typeof e?e:e.path?Object(u.b)().hostConfig.cdnHost+e.path:"":""}function B(e){const{icon:t}=e,n=U(t);Object(u.g)(e,{icon:n,iconActive:R(n)})}async function q(e,t){const n=await async function(e,t){const n=e;if("matrix"===n.type){const e=await Object(a.e)(t,n,"xid");n.optionsX=await Object(c.c)(t,e,n);const r=await Object(a.e)(t,n,"yid");n.optionsY=await Object(c.c)(t,r,n);const i=await Object(a.d)(n.otherOptions,t,n.type),o=await Object(c.d)(t,i,n);return n.otherOptions=o.visibleList,n}if(n.options){let e=await Object(a.e)(t,n);if(n.otherOptions){const r=await Object(a.d)(n.otherOptions,t,n.type);e=e.concat(r)}const r=await Object(c.d)(t,e,n);return n.options=[],n.otherOptions=[],r.visibleList.forEach(e=>{e.isOtherOpt?n.otherOptions.push(e):n.options.push(e)}),n.hiddenOptions=r.hiddenList,n}return n}(e,t),r=A[n.type],i=r?await r(n):void 0,s=i&&f(n,i);return Object(u.g)(n,s),function(e){const{options:t,otherOptions:n,type:r,parent:i}=e;let a=n||[];_.includes(r)&&(a=[...a,...t]);const c=a.filter(e=>e.autoSelectMarked).reverse();if(Object(o.s)(e))c.forEach(t=>{Object(u.g)(t,{selected:!0}),Object(p.d)(i,t,e)});else{const[t,...n]=c;n.forEach(t=>{t.autoSelectMarked=!1,Object(p.d)(i,t,e,"因冲突被终止")}),t&&(Object(u.g)(t,{selected:!0}),Object(p.d)(i,t,e))}}(n),t.context.option=null,s}A.select=e=>L(e,(async function(t){const n=await E(e,t);return await C(n,e),await y(n,e),n})),A.fill=e=>L(e,(async function(t){const n=await E(e,t,"input");return await C(n,e),n.placeholder=Object(s.k)(n.text),await j(n,e),n})),A.value_mark=e=>L(e,(async function(t){const{parent:n}=e,r=await E(e,t,"input");r.value="";const i=await Object(s.e)(e.markMin,{state:n}),o=await Object(s.e)(e.markMax,{state:n});return Object(u.g)(r,{minValue:i,step:e.markStep,maxValue:o,minValueText:e.minText,maxValueText:e.maxText}),await j(r,e),r})),A.icon_mark=e=>L(e,(async function(t){const n=await E(e,t,"input");return n.value="",Object(u.g)(n,{count:e.markImgCount||5,icon:e.markImgName||"rating-number"}),await j(n,e),n})),A.sequence=async e=>{let t=!1;const n=await L(e,async n=>{const r=await E(e,n,"input");Object(u.g)(r,{icon:"ranking",sortNo:-1});return await j(r,e)&&(t=!0),r});return t&&n.options.sort((e,t)=>e.sortNo>t.sortNo?1:-1),n},A.matrix=async e=>{const t=Object(r.a)(e),{optionsX:n,optionsY:i}=t,{parent:a}=e,c=[];for(const t of n)c.push({...t,text:await Object(s.d)(t.text,{state:a,usage:{question:e,option:t}})});const u=[];for(const t of i)u.push({...t,text:await Object(s.d)(t.text,{state:a,usage:{question:e,option:t}})});const l=[];for(const n of t.otherOptions)l.push(await E(e,n));const f={otherOptions:l,renderOptionsX:c.filter(e=>e.visible),renderOptionsY:u.filter(e=>e.visible)},d=Object(o.r)(e)||Object(o.o)(e),p=await async function(e,t,n,r=!1){const i=[],o=[];let a=e,c=t;r&&(a=t,c=e);for(const[e,t]of a.entries())if(t.visible){const a=t.text.length,s={length:a,text:t.text,list:[]};let u=0;for(const e of c)if(e.visible){let i=t,c=e;r&&(c=t,i=e);const l=await S(i,c,n,a,r);u=Math.max(u,l.text.length),o.push(l),s.list.push(l)}0===e&&s.list.forEach(e=>{e.length=u}),i.push(s)}return{flatten:i,options:o,fullOptions:o}}(c,u,e,d),b=function(e,t,n){const r=[];return t.forEach(t=>{if(t.visible){const i=[];e.forEach(e=>{if(e.visible){const r=n.find(n=>n.xid===e.uuid&&n.yid===t.uuid);if(!r)throw new Error("matrix item not found");i.push(r)}}),r.push(i)}}),{matrix:r}}(c,u,p.options);return{...f,...p,...b}},A.select_image=e=>L(e,async t=>{const n=await E(e,t);return n.text=Object(s.k)(n.text),n.image=await P(n,e),await y(n,e),n}),A.upload=e=>L(e,async t=>{const n=await E(e,t,"input");return n.text=Object(s.k)(n.text),n.icon="camera",n.name="",n.value="",n.fileName="",n.fileType="",n.progress=0,n.isImage=!1,n.fileLimits=[...n.fileLimits||["image"]],n.accept=Object(d.a)(n.fileLimits),n}),A.menu=e=>L(e,async t=>{const n=await E(e,t);return await C(n,e),n.text=Object(s.k)(n.text).trim(),await y(n,e),n},!0),A.select_icon=e=>L(e,async t=>{const n=await E(e,t);return B(n),await y(n,e),n}),A.weight=e=>{const{parent:t}=e;return L(e,async n=>{const r=await E(e,n,"input");let i=await Object(s.e)(r.maxMark,{state:t});const a=await Object(o.h)(e);return(!i||i>a)&&(i=a),Object(u.g)(r,{percent:"0%",color:r.color,maxValue:i,value:""}),await j(r,e),r})},A.cascade=e=>L(e,t=>(t.text="",E(e,t))),A.data=async e=>{const t={state:e.parent,loop:e.loop},n=[];for(const r of e.options){const i=await E(e,r);B(i),Object(u.g)(i,{value:await Object(s.g)(i.value,t),number:await Object(s.g)(i.number,t),optComment:await Object(s.d)(i.optComment,t),image:await Object(a.b)(e,i)}),await y(i,e),n.push(i)}return{options:n}},A.hot_spot=async e=>{const t=await L(e,async t=>{const n=await E(e,t);await C(n,e),await y(n,e);const{area:r,pathD:i}=n.points.reduce((e,t,r)=>{e.pathD?e.pathD+=" L":e.pathD+="M",e.pathD+=t.x+" "+t.y;const i=n.points[r+1];return i?e.area+=t.y+i.y*(i.x-t.x)/2:e.pathD+=" Z",e},{area:0,pathD:""});return Object(u.g)(n,{area:r,pathD:i,transform:`translate(${n.x},${n.y})`}),n});return t.options.sort((e,t)=>e.area<t.area?1:-1),t},A.heat_map=e=>L(e,(async function(t){return await E(e,t,"input")})),A.max_diff=e=>L(e,(async function(t){const n=await E(e,t,"input");return n.value=0,n.image=await P(n,e),n.records=[],n})),A.slide_rate=async e=>{const{rateOptions:t}=e,n=await L(e,async t=>{const n=await E(e,t,"input");return Object(u.g)(n,{image:await P(n,e),text:Object(x.c)(n.text),value:""}),await j(n,e),n}),r=[];for(const n of t){await Object(c.b)(e.parent,n,e)&&r.push(n)}return{...n,rateOptions:r.map(e=>{const{icon:t}=e,n=U(t);return{url:U(t),urlActive:R(n),text:Object(s.a)(e.text),value:e.value,uuid:e.uuid,customData:{}}})}};var F=n(43),V=n(2),z=n(3);const $={typeName:"",typeDescription:""},H={};H.select=async e=>{const t=Object(o.s)(e);let n=Object(V.f)(z.a.select.single);if(t){n=Object(V.f)(z.a.select.multi);const{min:t,max:r}=await Object(o.e)(e);return{typeName:n,typeDescription:Object(V.f)(z.a.select.limitBetween,{min:t,max:r})}}return{typeName:n,typeDescription:""}},H.value_mark=()=>Object(w.n)({typeName:Object(V.f)(z.a.mark.value)}),H.icon_mark=()=>Object(w.n)({typeName:Object(V.f)(z.a.mark.graph)}),H.weight=e=>{const t=e.weightTotal;let n=Object(V.f)(z.a.weight.total,{total:t});return n+=!0===e.relax?Object(V.f)(z.a.weight.relax):Object(V.f)(z.a.weight.strict),Object(w.n)({typeName:Object(V.f)(z.a.weight.name),typeDescription:n})},H.fill=()=>Object(w.n)({typeName:Object(V.f)(z.a.fill.name)}),H.slide_rate=()=>Object(w.n)({typeName:Object(V.f)(z.a.slideRate.name)}),H.sequence=e=>{const t=e.rankCount,n=Number(t)?Object(V.f)(z.a.rank.limitMin,{min:t}):Object(V.f)(z.a.rank.limitAll);return Object(w.n)({typeName:Object(V.f)(z.a.rank.name),typeDescription:n})},H.menu=async e=>({...await H.select(e),typeName:Object(V.f)(z.a.menu.name)}),H.select_icon=e=>H.select(e),H.select_image=e=>H.select(e),H.upload=async e=>{const t=Object(V.f)(z.a.upload.name);if(!0===e.limitEnabled){const{min:n,max:r}=await Object(o.g)(e);return{typeName:t,typeDescription:Object(V.f)(z.a.upload.amountLimit,{min:n,max:r})}}return{typeName:t,typeDescription:""}},H.location=()=>Object(w.n)({typeName:Object(V.f)(z.a.locate.name)}),H.area=()=>Object(w.n)({typeName:Object(V.f)(z.a.site.name)}),H.region=()=>Object(w.n)({typeName:Object(V.f)(z.a.region.name)}),H.verify=()=>Object(w.n)({typeName:Object(V.f)(z.a.verify.name)}),H.cascade=()=>Object(w.n)({typeName:Object(V.f)(z.a.cascade.name)}),H.matrix=async e=>{if(Object(o.v)(e))return{typeName:Object(V.f)(z.a.matrix.single)};if(Object(o.s)(e)){const{min:t,max:n}=await Object(o.e)(e);let r=Object(V.f)(z.a.matrix.multi),i=Object(V.f)(z.a.select.limitBetween,{min:t,max:n});return Object(o.n)(e)?(r=Object(V.f)(z.a.matrix.multiCol),i=Object(V.f)(z.a.matrix.colLimitBetween,{min:t,max:n})):Object(o.o)(e)&&(r=Object(V.f)(z.a.matrix.multiRow),i=Object(V.f)(z.a.matrix.rowLimitBetween,{min:t,max:n})),{typeName:r,typeDescription:i}}return Object(o.r)(e)?{typeName:Object(V.f)(z.a.matrix.singleRow),typeDescription:Object(V.f)(z.a.matrix.eachRowOne)}:Object(o.p)(e)?{typeName:Object(V.f)(z.a.matrix.singleCol),typeDescription:Object(V.f)(z.a.matrix.eachColOne)}:Object(o.q)(e)?{typeName:Object(V.f)(z.a.matrix.singleRowCol),typeDescription:Object(V.f)(z.a.matrix.eachRowColOne)}:{typeName:Object(V.f)(z.a.matrix.single)}},H.hot_spot=()=>Object(w.n)({typeName:Object(V.f)(z.a.hotSpot.name)}),H.heat_map=()=>Object(w.n)({typeName:Object(V.f)(z.a.heatMap.name)}),H.max_diff=()=>Object(w.n)({typeName:Object(V.f)(z.a.maxDiff.name)});var X=n(24);const G=["select","menu","select_image","select_icon","upload"];function K(e){return async function(e){if("sequence"===e.type){const t=Object(i.c)(e);if(1===t.length){const n=t[0];Object(u.g)(n,{selected:!0,sortNo:1}),Object(p.r)(0,e)}}else if(G.indexOf(e.type)>-1){if(!await Object(v.f)(e.showWithSingleRefOpt,e.parent)){const t=Object(i.c)(e)||[];if(1===t.length){const n=t[0];n.isRef&&(Object(u.g)(n,{selected:!0}),Object(p.d)(e.parent,n,e,"single_ref_select_opt"),e.forceSkipReason="single_ref_select_opt",e.autoSkip=!0)}}return e}return e}(e)}var J=n(40),W=n(60),Y=n(15),Z=n(12),Q=n(22),ee=n(10);function te(e){return 1===e?"bottom":2===e?"top":"center"}async function ne(e,t){const{destList:n,cascadeStart:r}=t,a=Object(o.c)(e.nodeList,n,r.uuid);if(!a)return;const c=await async function e(t,n,r,a,c){c?((c=await E(t,c)).text=Object(x.c)(Object(s.k)(c.text)),await C(c,t)):c={uuid:"",text:""};const{nodeList:u}=n,l=a?a+"=>"+Object(w.s)(c.uuid):Object(w.s)(c.uuid),f={option:c,groupId:a,resultId:l,text:c.text||c.optComment};if(!r)return f;f.placeholder=r.placeholder||Object(V.f)(z.a.menu.clickToSelect),(r={...r,options:await re(r,n,t)}).parent=n;const d=Object(o.s)(r),{min:p,max:b}=await Object(o.e)(r),{destList:h,output:m}=r,g=Object(o.i)(r),O=[],j=d?Object(V.f)(z.a.cascade.selectBetween,{min:p||1,max:b}):Object(V.f)(z.a.cascade.selectSome,{amount:1}),v={...f,list:O,multiple:d,min:p,max:b,hint:j,required:g,display:te(r.menuType),multiLine:r.lineCount},y=Object(o.c)(u,h,m.uuid),_=Object(i.c)(r);D(_);for(const r of _){const i=Object(o.c)(u,h,r.uuid)||y,a=await e(t,n,i,l,r);O.push(a)}return v}(t,e,a,"");t.cascade=c}async function re(e,t,n){let i=n.cachedCasMenuOpts;i||(i=n.cachedCasMenuOpts={});const o=i[e.nodeUuid];if(o)return o;{const o=await Object(a.e)(t,e),s=await Object(c.d)(t,o,n),u=Object(r.b)(e,s.visibleList);return i[e.nodeUuid]=u,u}}function ie(e,t,n){const r=function(e){const t=[];return e.forEach(e=>{const{pickedTimes:n}=e;t[n]?t[n].push(e):t[n]=[e]}),t}(e),i={items:[],done:!1};let o=t;for(const e of r)if(e){const t=Object(w.p)(e,o);if(t.forEach(e=>{i.items.push({option:e.option,value:0,round:n}),e.option.records.push({round:n,value:0}),e.pickedTimes+=1}),o-=t.length,0===o)break}return i}function oe(e){const{options:t,itemCountPerTask:n,taskCount:r}=e,i=t.map(e=>({option:e,pickedTimes:0})),o=[];for(let e=0;e<r;e++)o.push(ie(i,n,e+1));return o}function ae(e){const{current:t,renderList:n}=e,r=[t],i=n.indexOf(t);let a=i-1,c=t;for(;;){const e=n[a--];if(!Object(o.t)(e,c))break;Object(o.w)(e)||(r.unshift(e),c=e)}let s=i+1,l=t;for(;;){const e=n[s++];if(!Object(o.t)(e,l))break;Object(o.w)(e)||(r.push(e),l=e)}return r[0].groupSingle&&(r.forEach(e=>{Object(u.g)(e,{pageEnd:!1,pageStart:!1})}),Object(u.g)(r[0],{pageStart:!0}),Object(u.g)(r[r.length-1],{pageEnd:!0})),r}function ce(e){const t=e.first();return t&&t.groupSingle}function se(e){return["province","city","county","street"].indexOf(e)+1||1}const ue={};async function le(e){const t=e,{parent:n}=t,r=await Object(s.d)(t.describe,{state:n,usage:{question:t,exclusiveId:"description"}});Object(u.g)(t,{description:r})}async function fe(e,t){const n={...e,dynamicNodeProps(){Object(u.g)(this,{hasAnswer:Object(Y.d)(this),next:Object(Z.e)(this).next})}};if(o.y.indexOf(n.type)>-1)return async function(e,t){e.parent=t,Object(u.g)(e,{autoSkip:!0,renderId:Object(o.f)(e),number:""});const n=ue[e.type];return n&&await n(e),e}(n,t);const{qNumberRequired:r}=t;n.parent=t;const i=Object(o.f)(n);Object(u.g)(n,{customData:{},template:await Object(u.c)().ui.initNodeTemplate(n.template,t,n.loop),startTime:(new Date).toISOString(),costTime:0,realtimePreview:Object(u.b)().realTimePreview,validateFailTimes:0,renderId:i,images:await Object(a.a)(t,n),asterisks:!0===n.answerRequired&&t.asterisksRequired,selectType:Object(o.s)(n)?"checkbox":"radio",value:""}),await q(n,t);const c=ue[n.type];c&&await c(n),t.context.question=n,await async function(e){const t=e,{loop:n,parent:r}=t,i=await Object(s.d)(t.questionText,{spaceRep:" ",state:r,usage:{question:t,exclusiveId:"title"}});let o=t.nodeName.split("/")[0];if(o&&t.circleNode1Id&&!t.lockLoopCount&&!Object(u.b)().realTimePreview){const e=Object(Q.a)();let i=await e.C_OL_LBL.getText({state:r});if(i||(i=n.node.nodeName+"_"+await e.C_OL_IDX.getText({state:r})),o=i+"_"+o,t.circleNode2Id){let t=await e.C_IL_LBL.getText({state:r});t||(t=n.node.nodeName+"_"+await e.C_IL_IDX.getText({state:r})),o=t+"_"+o}}Object(u.g)(t,{title:i,realNodeName:o})}(n),await le(n),r&&function(e){"end"!==e.type&&"describe"!==e.type&&Object(u.g)(e,{number:e.realNodeName})}(n),Object(u.c)().dev.infer||Object(u.g)(n,await async function(e){if(!e.parent.nodeTypeInfoRequired)return $;const t=H[e.type],n=t?await t(e):$;return n.typeDescription="",n}(n)),Object(o.z)(n);return Object(T.i)(await K(n))}async function de(e,t,n){const r=await fe({origin:e,...e,parent:n,activityName:t.activityName,rewardName:t.rewardName,rewardTime:t.sendTime,goal:t.goal,rewardNodeId:t.rewardNodeId,rewardCount:t.lotteryCount,rewardImage:t.rewardImage,rewardTitle:t.rewardTitle,rewardDescribe:t.rewardDescribe,rewardList:e.showRewards?e.options.map(e=>({rewardName:e.rewardName,rewardNumbering:e.rewardCount})):null},n);if(!Object(u.b)().preview){const{formalResult:{reward:e}}=n;!Object(u.c)().app.canHandleReward()&&e&&"red_envelope"===e.type&&await pe(n,r)}return r}async function pe(e,t){const{formalResult:{reward:n,authorizer:r},nodeList:i}=e,{app_id:a,component_appid:c}=r,l=Object(o.a)(i,n.gift_id),f=await Object(s.h)(l.linkUrl,{state:e});t.linkUrl=f,t.endBtnText=l.endBtnText||"";const d={rid:Object(b.a)(n.id),aid:a,cid:c,qid:e.surveyId,tid:e.transactionID,sid:Object(ee.c)().sid};l.template&&(d.rtpl=l.template.id),t.qrCode=Object(u.c)().app.getRewardUrl(d)}ue.select=e=>(Object(u.g)(e,{quesType:"choice"}),Object(w.n)()),ue.region=e=>(Object(u.g)(e,{quesType:"region",indexes:"0 0 0",value:"",regions:Object(F.d)(),grade:se(e.infoRange),placeholder:Object(V.f)(z.a.menu.clickToSelect)}),Object(w.n)()),ue.describe=e=>(Object(u.g)(e,{quesType:"intro-page"}),Object(w.n)()),ue.end=async e=>{const{parent:t}=e,n=await Object(s.h)(e.linkUrl,{state:t});Object(u.g)(e,{quesType:"end-page",hasReward:!1,logoText:e.parent.customText,logoImage:e.parent.customLogo,linkUrl:n})},ue.fill=e=>(Object(u.g)(e,{quesType:"short-text"}),Object(w.n)()),ue.gift=e=>(Object(u.g)(e,{quesType:"reward"}),Object(w.n)()),ue.select_icon=e=>(Object(u.g)(e,{quesType:"icon"}),Object(w.n)()),ue.location=e=>(Object(u.g)(e,{quesType:"location",regions:Object(F.d)(),grade:se(e.infoRange),value:""}),Object(w.n)()),ue.lottery=e=>(Object(u.g)(e,{quesType:"lottery"}),Object(w.n)()),ue.value_mark=e=>(Object(u.g)(e,{quesType:"range"}),Object(w.n)()),ue.icon_mark=e=>(Object(u.g)(e,{quesType:"rating"}),Object(w.n)()),ue.matrix=e=>(Object(u.g)(e,{quesType:"matrix"}),Object(w.n)()),ue.menu=e=>(Object(u.g)(e,{quesType:"dropdown",value:"",placeholder:e.placeholder||Object(V.f)(z.a.menu.clickToSelect),icon:"arrows-small-down",...Object(o.e)(e),multiple:Object(o.s)(e),display:te(e.menuType),multiLine:e.lineCount}),Object(w.n)()),ue.select_image=e=>(Object(u.g)(e,{quesType:"picture-choice"}),Object(w.n)()),ue.sequence=e=>(Object(u.g)(e,{quesType:"ranking"}),Object(w.n)()),ue.area=e=>(Object(u.g)(e,{quesType:"location",grade:3,regions:Object(F.d)()}),Object(w.n)()),ue.upload=e=>(Object(u.g)(e,{quesType:"file-upload"}),Object(w.n)()),ue.verify=e=>(Object(u.g)(e,{quesType:"verification",value:"",phoneNumber:"",code:""}),Object(w.n)()),ue.weight=async e=>{const t=await Object(o.h)(e);Object(u.g)(e,{quesType:"weight",weightTotal:t})},ue.max_diff=e=>(Object(u.g)(e,{quesType:"max-diff",tasks:oe(e)}),Object(w.n)()),ue.cascade=async e=>{await ne(e.parent,e),function(e){const t=[],n=e=>{t.push(e),e.list&&e.list.forEach(e=>n(e))};n(e.cascade),e.options.forEach(e=>{if(e.useComment){const n=t.find(t=>t.resultId===e.cascadePath);e.inputType=N(n.option)}})}(e),function e(t,n,r,i,o=""){const{resultId:a,text:c}=n,s=a&&t.options.find(e=>e.cascadePath===a),u=o?o+"=>"+c:c;return s&&(s.text=u),r.nodeTypeInfoRequired||(n.hint=""),n.list&&n.list.forEach(n=>{n.text=e(t,n,r,i,u)}),n.text}(e,e.cascade,e.parent,e.loop,""),Object(u.g)(e,{quesType:"cascade"}),e.options=e.options.filter(e=>!!e.text),Object(J.c)(e,e.options)},ue.data=e=>(Object(u.g)(e,{quesType:"intro-page"}),Object(w.n)()),ue.hot_spot=e=>(Object(u.g)(e,{quesType:"hot-spot",mapImage:e.mapImage&&Object(X.b)(e.mapImage)}),Object(w.n)()),ue.heat_map=e=>(Object(u.g)(e,{quesType:"heat-map",clickTimes:0,mapImage:e.mapImage&&Object(X.b)(e.mapImage)}),Object(w.n)()),ue.slide_rate=e=>(Object(u.g)(e,{quesType:"slide-rate"}),Object(w.n)()),ue.loop=async e=>{const{parent:t}=e;if(!Object(W.a)(e,t)){const n=await Object(W.b)(t,e);e.varList=n}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return b}));var r=n(14),i=n(11),o=n(0),a=n(2),c=n(3),s=n(1),u=n(8);class l{constructor(e,t){if(e&&e.data&&Object.keys(e.data).length>0){const{langResume:n}=t;this.holder=e,this.state=t,this.show=!0,this.title=n?Object(a.f)(c.a.langResume.title):Object(a.f)(c.a.memory.title),this.message=n?"":Object(a.f)(c.a.memory.message),this.sureText=n?"":Object(a.f)(c.a.memory.sure),this.denyText=n?"":Object(a.f)(c.a.memory.deny)}}handleSure(){if(!this.holder||p())return Object(s.n)();const e=this;return Object(o.g)(e,{sureText:"",denyText:"",show:!0,resuming:!0}),Object(i.w)(this.state,e.holder.responseId||""),Object(r.g)(this.holder,this.state,{onEnd(){e.end()},onProgress(t){Object(o.g)(e,{show:!0}),Object(o.g)(e,{message:t})},onSuspend(){e.suspend()}})}handleDeny(){p()||(Object(r.b)(this.state),this.end())}end(){Object(o.g)(this,{show:!1,holder:null,message:"",resuming:!1}),b()}suspend(){Object(o.g)(this,{show:!1})}}let f=null;function d(e){const t=Object(r.e)(e.sid);return f=new l(t,e),f}function p(){return f&&f.resuming}function b(){p()||u.a.trigger("UPDATE_UI")}},function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"a",(function(){return h})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return O})),n.d(t,"f",(function(){return j}));var r=n(17),i=n(1),o=n(5),a=n(15),c=n(13),s=n(7);const u={1:(e,t,n)=>(t>n&&([t,n]=[n,t]),u[5](e,t,0)&&u[6](e,n,0)),2:(e,t,n)=>!u[1](e,t,n),11:(e,t)=>{const n=Object(s.a)(e).split(",").filter(e=>""!==e.trim()),r=Object(s.a)(t).split(",").filter(e=>""!==e.trim());return n.some(e=>(e=e.trim(),r.some(t=>(t=t.trim(),e.indexOf(t)>-1))))},12:(e,t)=>!u[11](e,t,0),3:(e,t)=>Object(s.a)(e)===Object(s.a)(t),4:(e,t)=>!u[3](e,t,0),5:(e,t)=>{const n=Object(s.c)(e),r=Object(s.c)(t);return"number"==typeof n&&"number"==typeof r?n>r:Object(s.a)(n)>Object(s.a)(r)},6:(e,t)=>{const n=Object(s.c)(e),r=Object(s.c)(t);return"number"==typeof n&&"number"==typeof r?n<r:Object(s.a)(n)<Object(s.a)(r)},7:(e,t)=>!u[6](e,t,0),8:(e,t)=>!u[5](e,t,0),9:(e,t)=>{const n=Object(s.a)(e).split(",").filter(e=>""!==e.trim()),r=Object(s.a)(t).split(",").filter(e=>""!==e.trim());return n.some(e=>(e=e.trim(),r.some(t=>(t=t.trim())===e)))},10:(e,t)=>!u[9](e,t,0),13:e=>Object(s.a)(e).split(",").every(e=>""===e.trim()),14:(e,t)=>!u[13](e,t),15:(e,t)=>!u[16](e,t),16:(e,t)=>Object(s.a)(e).split(",").every(e=>{const t=e.trim();return"false"===t||""===t})},l={request:e=>!!e,bool:e=>!!e,mark:(e,t)=>l.input(e,t),input:(e,t)=>{const{markId:n,markStart:r,markEnd:i}=t;return u[n](e,r,i)}};function f(e,t){"string"==typeof e&&(e=Object(o.k)(e));const n=l[t.limitType],r=n?n(e,t):!!e;return{value:r,reason:r?void 0:{type:"value_unmatch",expected:t.markStart,expectedEnd:t.markEnd,limit:t.markId,actual:e}}}async function d(e,t){const{text:n}=e.relatedEmbed,r=h(e.markId)?",":void 0;return f(await Object(o.d)(n,{state:t,joinBy:r}),e)}async function p(e,t){const{relatedVarId:n}=e,r=Object(c.h)(t,{uuid:n});if(!r)return{value:!1,reason:{type:"var_not_found"}};const i=h(e.markId)?",":void 0;return f(await Object(o.c)({state:t,varInfo:r,joinBy:i}),e)}function b(e,t){const{loopStack:n,renderList:o}=e,{relatedNodeId:c,relatedOptionId:s,limitType:u,markId:f}=t,d=Object(i.h)(c,n),p=Object(r.a)(o,d);if(!p)return-2===f?{value:!0}:{value:!1,reason:{type:"node_not_found",nodeId:c}};const b=Object(a.a)(p);if(!b||!b.items)return-2===f?{value:!0}:{value:!1,reason:{type:"answer_not_found",nodeId:c}};const h=b.items.find(e=>function(e,t){return Object(i.l)(e.option_id,t)}(e,s)),m=l[u];if(m){const e=h?Object(a.c)(h):"",n=m(e,t),r={value:n};return n||(r.reason={type:"node_unmatch",limit:f,actual:e,expected:t.markStart,expectedEnd:t.markEnd,nodeId:c,optionId:s}),r}{const e=-2===f?!h:!!h,t={value:e};return e||(t.reason={type:"node_unmatch",limit:f,nodeId:c,optionId:s,expected:-1===f,actual:2===f}),t}}function h(e){return 9===e||10===e||11===e||12===e||13===e||14===e||15===e||16===e}async function m(e,t){return{start:h(e.markId)?await Object(o.f)(e.markStart,{state:t,joinBy:","}):await Object(o.g)(e.markStart,{state:t}),end:await Object(o.g)(e.markEnd,{state:t})}}async function g(e,t,n){return(await O(e,t,n)).value}async function O(e,t,n){if(!t)return{value:!0};const r=[];for(const n of t){const t={...n},{relatedVarId:i,relatedEmbed:o,isGroup:a,groupLogicList:c,groupLogicType:s}=t,{start:u,end:l}=await m(t,e);let f;t.markEnd=l,t.markStart=u,f=a?await O(e,c,s):o?await d(t,e):i?await p(t,e):b(e,t),r.push(f)}return{value:!r["and"===n?"some":"every"](e=>!e.value),details:r}}function j(e,t){return"object"==typeof e&&null!==e?g(t,e.options,e.logicType):Object(i.n)(!!e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return g})),n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return x}));var r=n(51),i=n(16),o=n(13),a=n(6),c=n(1),s=n(7),u=n(41);function l(e){e.OPT_INPUT.getText=e=>{const t=Object(a.p)(e.specifiedOpt,"value");return Object(c.n)(t)},e.OPT_LABEL.getText=e=>{const t=e.specifiedOpt.label||"";return Object(c.n)(t)},u.a.forEach(t=>{!function(t){const n=t.split("_")[1];e["OPT_MAP_"+n].getText=e=>{const{specifiedOpt:n}=e,{mapping:i}=n,o=Object(r.b)(i,t,e);return Object(c.n)(o)}}(t),function(t){const n=t.split("_")[1];e["OPT_ASTV_"+n].getText=e=>{const n=e.specifiedOpt.assistValue,r=n&&n[t]||"";return Object(c.n)(r)}}(t)}),e.OPT_MARK.getText=e.OPT_INPUT.getText,e.OPT_TEXT.getText=e=>{const t=e.specifiedOpt,n=Object(a.e)(t);if(n)return Object(c.n)(n);const r=t.xText?t.xText+"_"+t.yText:Object(a.p)(t,"text");return Object(c.n)(r)},e.OPT_NUMBER.getText=e=>{const t=Object(s.a)(e.specifiedOpt.number);return Object(c.n)(t)},e.OPT_RANK.getText=e=>{const t=e.specifiedOpt.sortNo;return Object(c.n)(Object(s.a)(t))},e.OPT_TEXT_X.getText=e=>{const t=e.specifiedOpt.xText;return Object(c.n)(t)},e.OPT_TEXT_Y.getText=e=>{const t=e.specifiedOpt.yText;return Object(c.n)(t)},e.OPT_NUMBER_X.getText=e=>{const t=e.specifiedOpt.xNumber;return Object(c.n)(Object(s.a)(t))},e.OPT_NUMBER_Y.getText=e=>{const t=e.specifiedOpt.yNumber;return Object(c.n)(Object(s.a)(t))},e.OPT_IMAGE.getText=e=>{const{varInfo:{imgSize:t},specifiedOpt:n,pureText:r}=e,o=Object(a.p)(n,"image");if(r)return Object(c.n)(n.text);if(o){const e=Object(i.b)(o.url,t,o.originName);return Object(c.n)(e)}return Object(c.n)("")},e.OPT_ICON.getText=e=>{const t=e.specifiedOpt.text;return Object(c.n)(t)},e.OPT_COUNT.getText=async e=>{const t=await Object(o.b)(e);return Object(s.a)(t.length)}}var f=n(49),d=n(54);function p(e,t){!function(e,t){t.forEach(t=>{const n=e[t];"function"==typeof n.getText&&(n.getBool=async function(e){const t=await this.getText(e);return!Object(s.b)(t)})}),e.OPT_COUNT.getBool=async function(e){return!!await this.getText(e)}}(e,t),e.OPT_SAME_MARK.getBool=async e=>{const t=await Object(o.b)(e);return function(e,t){if(Object(s.b)(t))return!0;(t<0||t>e.length)&&(t=e.length);const n={};for(const r of e){const e=r.value;if(n[e]?n[e]+=1:n[e]=1,n[e]>=t)return!0}return!1}(t,t.length)},e.OPT_DIFF_MARK.getBool=async e=>{const t=await Object(o.b)(e);return function(e,t){if(Object(s.b)(t))return!0;(t<0||t>e.length)&&(t=e.length);const n={};for(const r of e)if(n[r.value]=!0,Object.keys(n).length>=t)return!0;return!1}(t,t.length)},e.OPT_SAME_VALUE.getBool=e.OPT_SAME_MARK.getBool,e.OPT_SAME_VALUE.getText=e.OPT_SAME_MARK.getText,e.OPT_DIFF_VALUE.getBool=e.OPT_DIFF_MARK.getBool,e.OPT_DIFF_VALUE.getText=e.OPT_DIFF_MARK.getText,e.FAIL_SKIP.getBool=e=>{const t=e.varInfo.question;return Promise.resolve(!!t.failedSkipActivated)},e.FAILED.getBool=e=>{const t=e.varInfo.question;return Object(c.n)(!!t.failed)},e.SUCCEED.getBool=e=>{const t=e.varInfo.question;return Object(c.n)(!!t.succeed)},e.USED_PHONE.getBool=e=>Object(c.n)(!!e.state.phoneUsed),e.VALIDATE_FAILED.getBool=e=>Object(c.n)(e.varInfo.question.validateFailed),e.Q_TIME_OVER.getBool=e=>{const{maxAnswerTime:t,costTime:n}=e.varInfo.question,r=1e3*t;return Object(c.n)(!!(r&&n&&r<n))},e.Q_TIME_LESS.getBool=e=>{const{minAnswerTime:t,costTime:n}=e.varInfo.question,r=1e3*t;return Object(c.n)(!!(r&&n&&r>n))},function(e,t){function n(e){return this.getBool(e)}t.forEach(t=>{const r=e[t];"function"==typeof r.getBool&&r.getText===g&&(r.getText=n)})}(e,t)}var b=n(42),h=n(45),m=n(39);const g="waiting fo extend";let O=!1;Math.avg=(...e)=>{let t=0;const n=e.length;for(let r=0;r<n;r++)t+=Number(e[r]);return t/n};const j={YEAR:{uuid:"YEAR",type:"var-string",getText:g},MONTH:{uuid:"MONTH",type:"var-string",getText:g},DATE:{uuid:"DATE",type:"var-string",getText:g},DAY:{uuid:"DAY",type:"var-string",getText:g},URL_KEY:{uuid:"URL_KEY",type:"var-string",getText:g},QUES_ID:{uuid:"QUES_ID",type:"var-string",getText:g},WX_ID:{uuid:"WX_ID",type:"var-string",getText:g},WX_SRC:{uuid:"WX_SRC",type:"var-string",getText:g},WX_NAME:{uuid:"WX_NAME",type:"var-string",getText:g},WX_UN_ID:{uuid:"WX_UN_ID",type:"var-string",getText:g},RES_ID:{uuid:"RES_ID",type:"var-string",getText:g},CLTR_ID:{uuid:"CLTR_ID",type:"var-string",getText:g},CLTR_CODE:{uuid:"CLTR_CODE",type:"var-string",getText:g},CLTR_NAME:{uuid:"CLTR_NAME",type:"var-string",getText:g},CURR:{uuid:"CLANG",type:"var-string",getText:g},LKTP:{uuid:"LKTP",type:"var-string",getText:g},START_TIME:{uuid:"S_T",type:"var-string",getText:g},COST_TIME:{uuid:"C_T",type:"var-string",getText:g},DVC_OSN:{uuid:"DVC_OSN",type:"var-string",getText:g},DVC_OSV:{uuid:"DVC_OSV",type:"var-string",getText:g},DVC_BRSN:{uuid:"DVC_BRSN",type:"var-string",getText:g},DVC_BRSV:{uuid:"DVC_BRSV",type:"var-string",getText:g},DVC_VDR:{uuid:"DVC_VDR",type:"var-string",getText:g},DVC_MDL:{uuid:"DVC_MDL",type:"var-string",getText:g},DVC_TYPE:{uuid:"DVC_TYPE",type:"var-string",category:"DEVICE",getText:g},RESULT:{uuid:"RESULT",type:"var-string",getText:g},C_OPT_TEXT:{uuid:"COTTX",type:"var-string",getText:g},C_OPT_NUM:{uuid:"CONUM",type:"var-string",getText:g},C_OPT_VAL:{uuid:"COVAL",type:"var-string",getText:g},C_OPT_LBL:{uuid:"COLBL",type:"var-string",getText:g},C_OPT_IPT:{uuid:"COIPT",type:"var-string",category:"CTPT",getText:g},C_OPT_ASI:{uuid:"COASI",type:"var-string",category:"CTPT",getText:g},C_OL_TXT:{uuid:"COLTXT",type:"var-string",getText:g},C_OL_IDX:{uuid:"COLIDX",type:"var-string",getText:g},C_OL_VAL:{uuid:"COLVAL",type:"var-string",getText:g},C_OL_NUM:{uuid:"COLNUM",type:"var-string",getText:g},C_OL_LBL:{uuid:"COLLBL",type:"var-string",getText:g},C_IL_TXT:{uuid:"CILTXT",type:"var-string",getText:g},C_IL_IDX:{uuid:"CILIDX",type:"var-string",getText:g},C_IL_VAL:{uuid:"CILVAL",type:"var-string",getText:g},C_IL_NUM:{uuid:"CILNUM",type:"var-string",getText:g},C_IL_LBL:{uuid:"CILLBL",type:"var-string",getText:g},POSITION:{uuid:"_P_OS",type:"var-string",getText:g},FAIL_SKIP:{uuid:"L_FAIL_SKIP",type:"var-bool",getText:g,getBool:g},FAILED:{uuid:"L_FAILED",type:"var-bool",getText:g,getBool:g},SUCCEED:{uuid:"L_SUCCEED",type:"var-bool",getText:g,getBool:g},COUNTRY:{uuid:"_C_NTY",type:"var-string",getText:g},PROVINCE:{uuid:"_P_ROV",type:"var-string",getText:g},CITY:{uuid:"_C_ITY",type:"var-string",getText:g},DISTRICT:{uuid:"_D_TRT",type:"var-string",getText:g},QUES_IMAGE:{uuid:"QI",type:"var-media",getText:g,getImages:g},QUES_TEXT:{uuid:"QT",type:"var-string",getText:g},QUES_LABEL:{uuid:"QL",type:"var-string",getText:g},QUES_DESC:{uuid:"QD",type:"var-string",getText:g},QUES_NAME:{uuid:"QN",type:"var-string",getText:g},PHONE_NUMBER:{uuid:"PN",type:"var-string",getText:g},PASSWORD:{uuid:"PSW",type:"var-string",getText:g},USED_PHONE:{uuid:"UPN",type:"var-bool",getText:g,getBool:g},VALIDATE_FAILED:{uuid:"VF",type:"var-bool",getText:g,getBool:g},VALIDATE_FAIL_TIMES:{uuid:"VFT",type:"var-expression",getText:g,getBool:g},QUES_TIME:{uuid:"DRTN",type:"var-string",getText:g,getBool:g},QUES_RS:{uuid:"QRS",type:"var-string",getText:g},Q_TIME_OVER:{uuid:"QTOR",type:"var-bool",getText:g,getBool:g},Q_TIME_LESS:{uuid:"QTLS",type:"var-bool",getText:g,getBool:g},MATCHED_OPTS:{uuid:"MTO",type:"var-string",filter:g},UNMATCHED_OPTS:{uuid:"UMTO",type:"var-string",filter:g},MARKED_OPTS:{uuid:"MKO",type:"var-string",filter:g},UNMARKED_OPTS:{uuid:"UMKO",type:"var-string",filter:g},RANKED_OPTS:{uuid:"RKO",type:"var-string",filter:g},UNRANKED_OPTS:{uuid:"URKO",type:"var-string",filter:g},CHECKED_OPTS:{uuid:"CKO",type:"var-string",filter:g},UNCHECKED_OPTS:{uuid:"UCKO",type:"var-string",filter:g},INPUTTED_OPTS:{uuid:"INO",type:"var-string",filter:g},UN_INPUTTED_OPTS:{uuid:"UINO",type:"var-string",filter:g},ALL_OPTS:{uuid:"ALO",type:"var-string",filter:g},SPECIFIED_OPT:{uuid:"SPO",type:"var-string"},OPT_TEXT:{uuid:"OTXX",type:"var-string",getText:g},OPT_TEXT_X:{uuid:"OTXY",type:"var-string",getText:g},OPT_TEXT_Y:{uuid:"OTX",type:"var-string",getText:g},OPT_NUMBER:{uuid:"ONM",type:"var-string",getText:g},OPT_NUMBER_X:{uuid:"ONMX",type:"var-string",getText:g},OPT_NUMBER_Y:{uuid:"ONMY",type:"var-string",getText:g},OPT_IMAGE:{uuid:"OMG",type:"var-media",getText:g,getImages:g},OPT_ICON:{uuid:"OIC",type:"var-string",getText:g,getIcon:g},OPT_MARK:{uuid:"OMA",type:"var-string",getText:g},OPT_RANK:{uuid:"ORA",type:"var-string",getText:g},OPT_INPUT:{uuid:"OIN",type:"var-string",getText:g},OPT_LABEL:{uuid:"OLB",type:"var-string",getText:g},OPT_COUNT:{uuid:"OCT",type:"var-expression",inBunch:!0,getText:g},OPT_SAME_MARK:{uuid:"OSM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_MARK:{uuid:"ODM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_SAME_VALUE:{uuid:"OSV",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_VALUE:{uuid:"ODV",type:"var-bool",inBunch:!0,getBool:g,getText:g},EXP_PLUS:{uuid:"EP",type:"var-expression",expOpr:"+"},EXP_MINUS:{uuid:"EM",type:"var-expression",expOpr:"-"},EXP_MULTIPLY:{uuid:"EPL",type:"var-expression",expOpr:"*"},EXP_DIVIDE:{uuid:"ED",type:"var-expression",expOpr:"/"},EXP_SUM:{uuid:"ES",type:"var-expression",expOpr:"(",split:"+"},EXP_MIN:{uuid:"EMN",type:"var-expression",expOpr:"Math.min(",split:","},EXP_MAX:{uuid:"EMX",type:"var-expression",expOpr:"Math.max(",split:","},EXP_AVG:{uuid:"EAG",type:"var-expression",expOpr:"Math.avg(",split:","},EXP_RD:{uuid:"ERD",type:"var-expression",expOpr:"Math.round(",split:"+"},EXP_FLR:{uuid:"EFLR",type:"var-expression",expOpr:"Math.floor(",split:"+"},EXP_CL:{uuid:"ECL",type:"var-expression",expOpr:"Math.ceil(",split:"+"},EXP_OP:{uuid:"EOP",type:"var-expression"},EXP_CP:{uuid:"ECP",type:"var-expression"},BOOL_AND:{uuid:"BAND",type:"var-bool",blOpr:"&&"},BOOL_OR:{uuid:"BOR",type:"var-bool",blOpr:"||"},BOOL_NOT:{uuid:"BNOT",type:"var-bool",blOpr:"!"},BOOL_OP:{uuid:"BOP",type:"var-bool",blOpr:"("},BOOL_CP:{uuid:"BCP",type:"var-bool",blOpr:")"},LOOP:{uuid:"LP",type:"var-loop",getText:g,getImages:g},LOOP_IMG:{uuid:"LPIMG",type:"var-loop",getText:g,getImages:g},LOOP_INDEX:{uuid:"LPIDX",type:"var-loop",getText:g},LOOP_VAL:{uuid:"LPVAL",type:"var-loop",getText:g},LOOP_NUM:{uuid:"LPNUM",type:"var-loop",getText:g},LOOP_LBL:{uuid:"LPLBL",type:"var-loop",getText:g}};for(const e of h.a){const t="LANG_"+e.id.toUpperCase(),n=t;j[t]={uuid:n,type:"var-string",getText:()=>Object(c.n)(e.id)}}for(let e=2;e<21;e++){const t="URL_KEY_"+e;j[t]={uuid:t,type:"var-string",getText:g}}function v(e,t){const n=t.optionMappingHeads;if(n){const t=n.find(t=>t.field==="field_"+e);if(t)return{type:"image"===t.type?"var-media":"var-string"}}return null}for(let e=1;e<7;e++)j["OPT_ASTV_"+e]={uuid:"OASTV_"+e,type:"var-string",getText:g},j["OPT_MAP_"+e]={uuid:"OM_"+e,type:"var-string",getText:g,getDynamicProps:t=>v(e,t)},j["C_OPT_MAP_"+e]={uuid:"COMAP"+e,type:"var-string",getText:g},j["C_OL_MAP_"+e]={uuid:"COLMAP"+e,type:"var-string",getText:g},j["C_IL_MAP_"+e]={uuid:"CILMAP"+e,type:"var-string",getText:g},j["LOOP_MAP_"+e]={uuid:"LPMAP"+e,type:"var-loop",getText:g};const w=Object.keys(j);function y(e,t){for(const n of w)if(j[n].uuid===e){let e=j[n];if(e.getDynamicProps&&t){const n=e.getDynamicProps(t);n&&(e={...e,...n})}return e}}function _(){O||(!function(){const e=[];w.forEach(t=>{if(!(j[t]instanceof Function)){if(e.indexOf(j[t].uuid)>0)throw new Error("error duplicated uuid in implicit var config: "+j[t].uuid);e.push(j[t].uuid)}})}(),Object(r.a)(j),Object(m.c)(j),Object(m.b)(j),l(j),function(e){async function t(e,t){const{varInfo:n,needOtherOpt:r}=e,i=n.question,o=Object(a.b)(i),c=[];for(const n of o)!r&&n.isOtherOpt||t&&!t(n,i)||!await Object(f.b)({...e,specifiedOpt:n})||c.push(n);return c}e.MATCHED_OPTS.filter=e=>t(e,d.c),e.RANKED_OPTS.filter=e.MATCHED_OPTS.filter,e.CHECKED_OPTS.filter=e.MATCHED_OPTS.filter,e.UNMATCHED_OPTS.filter=e=>t(e,d.e),e.UNRANKED_OPTS.filter=e.UNMATCHED_OPTS.filter,e.UNCHECKED_OPTS.filter=e.UNMATCHED_OPTS.filter,e.MARKED_OPTS.filter=e=>t(e,d.b),e.INPUTTED_OPTS.filter=e.MARKED_OPTS.filter,e.UNMARKED_OPTS.filter=e=>t(e,d.d),e.UN_INPUTTED_OPTS.filter=e.UNMARKED_OPTS.filter,e.ALL_OPTS.filter=e=>{if(!Object(f.a)(e)){const t=e.varInfo.question.options;return Object(c.n)(t)}return t(e)}}(j),p(j,w),Object(b.a)(j),function(){let e="";if(w.forEach(t=>{const n=j[t];if(["filter","getText","getImages","getIcon","getBool"].forEach(r=>{n[r]===g&&(e+=t+"=>"+r+"\n")}),n.getText){const e=n.getText;n.getText=async function(t){const{keepWrap:n}=t,r=e.apply(this,arguments),i=await r;if("string"==typeof i&&!n){const e=/<span var-name=".+?" class="var-light var-(\w+?)">(.+?)<\/span>/g;return Object(s.a)(i).replace(e,(e,t,n)=>"media"===t?e:n)}return Object(s.b)(i)?"":i}}}),e)throw new Error("lack var implement for:\n"+e)}(),O=!0)}function x(){return O||_(),j}_()},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"c",(function(){return p}));var r=n(7),i=n(21),o=n(5);function a(e,t){if(Object(r.b)(t)||e.length<=t)return[...e];return c(e.map(e=>({...e.option,cascade:e})),t).map(e=>e.cascade)}function c(e,t){if(Object(r.b)(t)||e.length<=t)return[...e];return f(e.map(e=>{const t=e.inferList.reduce((e,t)=>(t.active&&"select"===t.type&&(e+=t.weight),e),0);return{option:e,weight:t}}),t).map(e=>e.option)}function s(e){return e.filter(e=>{const{option:t}=e;return!(!t||!t.inferList)&&t.inferList.some(e=>e.active)})}function u(e,t){return e.filter(e=>e.inferList.some(e=>e.active&&e.type===t))}async function l(e,t){if(!e)return;const n=t.parent;e.inferList=e.inferList||[];for(const t of e.inferList){const{activeConfig:r}=t;if(r){const{options:o,logicType:a}=r;n.context.option=e,t.active=await Object(i.b)(n,o,a),n.context.option=null}else t.active=!0}}function f(e,t){if(e=[...e],Object(r.b)(t)||e.length<=t)return e;const n=e.reduce((e,t)=>e+=t.weight,0);let i=0,o=0,a=e.map(e=>{const t=e.weight/n;o=i+t;const r={item:e,floor:i,ceil:o};return i=o,r});const c=[];for(;c.length<t;){const e=Math.random()*o,t=a.find(t=>t.floor<=e&&t.ceil>e);t&&(c.push(t.item),a=a.filter(e=>e!==t))}return c}async function d(e,t){const{parent:n}=t,r=[];for(const t of e)r.push(await Object(o.f)(t.candidates,{state:n,joinBy:","}));return r.join(",")}function p(e){const t={},n=[];return e.split(",").forEach(e=>{let r=e,i=1;const o=e.match(/\(([\d\.]+)\)$/);o&&(r=e.replace(/\([\d\.]+\)$/,""),i=parseFloat(o[1]));const a=t[r];if(a)a.weight+=i;else{const e={text:r,weight:i};n.push(e),t[r]=e}}),n.filter(e=>0!==e.weight)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c}));var r=n(61),i=n(0);function o(e){return Object(i.b)().hostConfig.cdnHost+"/"+e}function a(e){const{width:t,height:n,name:i,id:a,originName:c}=e,s=o(i);return{ratio:Math.round(n/t*1e5)/1e5,url:s,natural:Object(r.b)(s,"@m720"),thumbnail:Object(r.b)(s,"@avatar"),large:Object(r.b)(s,"@m1080"),width:t,height:n,reformed:!0,id:a,originName:c,name:i}}function c(e){if(!e)return;if(e&&e.reformed)return e;const{name:t,width:n,height:r,id:i,originName:o}=e;return t?a({width:n,height:r,name:t,id:i,originName:o}):void 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return u}));var r=n(7),i=n(5);const o={};function a(e,t){let n="";const r=o[t.type];return n=e.isOtherOpt||!r?e.value:r(e),"string"==typeof n&&(n=Object(i.k)(n)),n}function c(e,t){let n=a(e,t);return"string"==typeof n&&(n=n.trim()),!Object(r.b)(n)}o.upload=e=>e.name,o.sequence=e=>e.sortNo,o.heat_map=e=>e.point,o.max_diff=e=>e.records;const s={};function u(e,t){return(s[t.type]||c)(e,t)}s.sequence=(e,t)=>-1!==e.sortNo&&c(e,t)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u}));var r=n(0),i=n(30);function o(){return{value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""}}const a={};function c(e,t,n){t.options.forEach(t=>{t!==e&&(t.mutexNumber!==e.mutexNumber&&-1!==e.mutexNumber||n(t))})}function s(e,t){if(e.isOtherOpt&&e.mutexNumber){const n=a[t.type];n?n(e,t):c(e,t,e=>{Object(r.g)(e,{value:"",selected:!1})})}}function u(e,t){t.otherOptions.filter(t=>!(!t.mutexNumber||t===e)&&(t.mutexNumber===e.mutexNumber||-1===t.mutexNumber)).forEach(e=>{Object(r.g)(e,{selected:!1})})}a.heat_map=(e,t)=>{c(e,t,e=>{Object(r.g)(e,{point:null,value:""})})},a.cascade=(e,t)=>{t.options.forEach(e=>{Object(r.g)(e,{selected:!1})}),Object(i.b)(t.cascade)},a.upload=(e,t)=>{c(e,t,e=>{const t={value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""};Object(r.g)(e,{...t,image:null})}),t.fullUploaded=!1},a.weight=(e,t)=>{c(e,t,e=>{Object(r.g)(e,{value:""})}),t.options.forEach(e=>{Object(r.g)(e,{percent:""})})},a.sequence=(e,t)=>{c(e,t,e=>{Object(r.g)(e,{selected:!1,sortNo:-1})}),t.options.sort((e,t)=>e.number>t.number?1:-1)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"d",(function(){return m}));var r=n(1),i=n(5),o=n(2),a=n(6),c=n(3),s=n(7);function u(e){return/^1[0-9][0-9]\d{8}$/i.test(e)}function l(e){return/[-a-zA-Z0-9@:%_+.~#?&/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_+.~#?&/=]*)?/gi.test(e)}async function f(e,t){const{parent:n}=t;let r=await Object(i.e)(e.fillStart,{state:n}),o=await Object(i.e)(e.fillEnd,{state:n});return Object(s.b)(r)&&(r=-1/0),Object(s.b)(o)&&(o=1/0),{start:r,end:o}}function d(e,t,n){return t<=e&&n>=e}function p(e,t,n){return d(e,t,n)?"":Object(o.f)(c.a.fill.valueLimit,{min:t,max:n})}const b={};async function h(e,t,n){const{itemsMax:r,itemsMin:i}=await Object(a.g)(t,n),s=e.split(/[,,]/).reduce((e,t)=>t.trim()?e+1:e,0);let u="";return(s<i||s>r)&&(u=Object(o.f)(c.a.fill.itemsLimit,{min:i,max:r})),{valid:!u,message:u}}async function m(e,t){const n=Object(s.a)(e.value),r=e.fillType,i=b[r];if(!i||Object(s.b)(n)&&"auto_complete"!==r)return{valid:!0,message:""};const{parent:o}=t;o.context.option=e;const a=await i(n,e,t);return o.context.option=null,a.valid||(a.dueToOption=e,a.dueToNode=t),a}b.chars=async(e,t,n)=>{const{start:r,end:i}=await f(t,n);let{tolerance:a}=t;a=a||[];const s=function(e,t=[]){if(0===t.length)return"";e=e.replace(/[\s,,]/g,"");let n="";const r=[];t.includes("number")&&(n+="0-9",r.push(Object(o.f)(c.a.fill.number))),t.includes("alphabet")&&(n+="a-zA-Z",r.push(Object(o.f)(c.a.fill.alphabet))),t.includes("chinese")&&(n+="一-龥",r.push(Object(o.f)(c.a.fill.chinese)));const i=r.join(" "),a=new RegExp("^["+n+"]+$");return e.match(a)?"":Object(o.f)(c.a.fill.onlyAllow,{text:i})}(e,a)||function(e,t,n){return d(e.length,t,n)?"":Object(o.f)(c.a.fill.charsLimit,{min:t,max:n})}(e,r,i);return{valid:!s,message:s}},b.email=e=>{const t=function(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]+$/i.test(e)}(e),n=t?"":Object(o.f)(c.a.fill.needEmail);return Object(r.n)({valid:t,message:n})},b.float=async(e,t,n)=>{if(!function(e){return/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)}(e))return{valid:!1,message:Object(o.f)(c.a.fill.inputNumber)};const{start:r,end:i}=await f(t,n),a=p(1*Number(e),r,i);return{valid:!a,message:a}},b.integer=async(e,t,n)=>{if(!function(e){return/^[-]?\d+$/.test(e)}(e=e.replace(/\s/g,"")))return{valid:!1,message:Object(o.f)(c.a.fill.inputInteger)};const r=Number(e),{start:i,end:a}=await f(t,n),s=p(1*r,i,a);return{valid:!s,message:s}},b.none=()=>Object(r.n)({valid:!0,message:""}),b.phone_number=e=>{const t=u(e),n=t?"":Object(o.f)(c.a.fill.needPhoneNumber);return Object(r.n)({valid:t,message:n})},b.postcode=e=>{const t=function(e){return/^[0-9][0-9]{5}$/.test(e)}(e),n=t?"":Object(o.f)(c.a.fill.needZipCode);return Object(r.n)({valid:t,message:n})},b.url=e=>{const t=l(e),n=t?"":Object(o.f)(c.a.fill.needUrl);return Object(r.n)({valid:t,message:n})},b.auto_complete=(e,t,n)=>{if(!e&&t.atcpTrigger){const e={valid:!1,message:Object(o.f)(c.a.fill.atcpLabelOnly),dueToNode:n,dueToOption:t};return Object(r.n)(e)}return h(e,t,n)},b.list_select=(e,t,n)=>h(e,t,n)},function(e,t,n){"use strict";n.d(t,"a",(function(){return O})),n.d(t,"c",(function(){return j})),n.d(t,"d",(function(){return v})),n.d(t,"b",(function(){return T}));var r=n(6),i=n(27),o=n(35),a=n(4),c=n(11),s=n(5),u=n(1),l=n(0),f=n(2),d=n(30),p=n(3),b=n(9),h=n(20),m=n(26);const g={},O={refresh:!1,result:!1},j={refresh:!0,result:!0},v={refresh:!1,result:!0};function w(e,t,n){t.forEach(t=>{Object(u.l)(t.uuid,e.uuid)||t[n]!==e[n]||Object(l.g)(t,{selected:!1})})}function y(e,t){t.forEach(t=>{t.uuid!==e.uuid&&Object(l.g)(t,{selected:!1})})}function _(e,t,n="mutexNumber"){const i=e[n],o=function(e,t,n="mutexNumber"){const i=Object(r.c)(t);return"xMutexNumber"===n?i.filter(t=>t.yid===e.yid):"yMutexNumber"===n?i.filter(t=>t.xid===e.xid):i}(e,t,n);i?function(e,t,n="mutexNumber"){const r=e[n];t.forEach(t=>{r&&-1!==r&&t[n]!==r&&-1!==t[n]||t.uuid!==e.uuid&&Object(l.g)(t,{selected:!1})})}(e,o,n):function(e,t){e.forEach(e=>{-1===e[t]&&Object(l.g)(e,{selected:!1})})}(o,n)}function x(e,t,n=!1){return e.selected?Object(l.g)(e,{selected:!1}):(Object(l.g)(e,{selected:!0}),y(e,n?t.otherOptions:Object(r.c)(t)),Object(m.b)(e,t)),j}async function T(e,t){const n=g[t.type];if(n){const r=await n(e,t);return r.noValidate||Object(o.b)(t),r}return O}g.select=async(e,t)=>{if(e.selected)return Object(l.g)(e,{selected:!1}),j;const n=await Object(a.k)(t,e);return n.valid?(Object(l.g)(e,{selected:!0}),Object(a.s)(t)?_(e,t):y(e,Object(r.c)(t)),j):(Object(l.b)().notify(n.message),O)},g.select_icon=g.select,g.select_image=g.select,g.matrix=async(e,t)=>{if(e.selected)return Object(l.g)(e,{selected:!1}),j;const n=await Object(a.j)(t,e);return n.valid?(Object(l.g)(e,{selected:!0}),Object(a.v)(t)?y(e,Object(r.c)(t)):Object(a.q)(t)?(w(e,t.options,"yid"),w(e,t.options,"xid")):Object(a.r)(t)?w(e,t.options,"yid"):Object(a.p)(t)?w(e,t.options,"xid"):Object(a.s)(t)&&(_(e,t),e.isOtherOpt||(_(e,t,"xMutexNumber"),_(e,t,"yMutexNumber"))),j):(Object(l.b)().notify(n.message),O)},g.upload=async(e,t)=>{if(e.isOtherOpt)return x(e,t,!0);{const{parent:n,fullUploaded:r}=t;let i=await Object(s.e)(t.maxUploadCount,{state:n});i=i||t.options.length;const o=e.value;if(r&&!o)return Object(l.b)().notify(Object(f.f)(p.a.upload.amountLimitMax,{max:i})),O;const a={onprogress(t){Object(l.g)(e,{progress:t}),Object(h.c)()},accept:e.accept},c=await Object(l.c)().network.upload(a);return await n.handleEvents.handleOptionInput(c,e,t),v}},g.verify=async(e,t)=>{const{parent:n,nodeUuid:r,phoneNumber:o,validateType:a}=t,{transactionID:s}=n;let u=!1,d={response_id:s,question_id:r};if("sms"===a){if(Object(l.b)().preview)return Object(l.b)().notify(Object(f.f)(p.a.preview.noMessage)),{...O,noValidate:!0};if(!o||!Object(i.b)(o))return Object(l.b)().notify(Object(f.f)(p.a.fill.needPhoneNumber)),{...O,noValidate:!0};d={...d,phone_num:o},t.messageGetFailed=!1;try{const e=await Object(b.j)(d);t.serverValidations=e,n.phoneNumber=o,n.phoneUsed=e.phone_num_used,n.phoneUsed&&Object(c.A)(n,t),u=!0}catch(e){t.messageGetFailed=!0}}else if("image"===a){const e=await Object(b.j)(d);t.serverValidations=e,Object(l.g)(t,{captcha:e.image}),u=!0}return{...v,noValidate:!0,result:u}},g.gift=async(e,t)=>{if(Object(l.b)().preview)return Object(l.b)().notify(Object(f.f)(p.a.preview.noMessage)),O;const{phoneNumber:n,goalId:r}=t;if(!Object(i.b)(n))return Object(l.b)().notify(Object(f.f)(p.a.fill.needPhoneNumber)),O;t.messageGetFailed=!1;try{await Object(b.n)({phone_num:n},r)}catch(e){t.messageGetFailed=!0}return j},g.menu=g.select,g.cascade=(e,t)=>{if(e.isOtherOpt)x(e,t,!0);else{let{resultList:n}=e;const{list:r}=e;if(!r||!n)return Object(u.n)(v);n=n instanceof Array?n:n?[n]:[];const{addList:i,cancelList:o}=Object(d.d)(r,n);o.forEach(e=>{Object(d.a)(e,t)}),i.forEach(e=>{Object(d.h)(e,t)}),Object(d.c)(t);const a=i[i.length-1];a&&Object(m.c)(a.option,t)}return Object(u.n)(j)},g.hot_spot=g.select,g.icon_mark=g.value_mark=g.slide_rate=g.fill=g.weight=g.heat_map=(e,t)=>e.isOtherOpt?Object(u.n)(x(e,t,!0)):Object(u.n)(v),g.sequence=(e,t)=>{if(e.isOtherOpt)return Object(u.n)(x(e,t,!0));{const{options:n,operationType:r}=t;if(-1===e.sortNo){const t=n.map(e=>e.sortNo).filter(e=>e>0);let r=-1;for(let e=1;e<=n.length;e++)if(!t.includes(e)){r=e;break}r>0&&Object(l.g)(e,{sortNo:r,selected:!0})}else{const t=e.sortNo;Object(l.g)(e,{sortNo:-1,selected:!1}),"collapse-pick"===r&&n.forEach(e=>{e.sortNo>t&&Object(l.g)(e,{sortNo:e.sortNo-1})})}return Object(u.n)(v)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return f}));var r=n(2),i=n(0),o=n(3);let a=null;function c(){return{default:"minimal",primary:"rgba(128,128,128,1)",secondary:"rgba(255,255,255,1)",contrast:"rgba(202,32,39,1)",background:"#FFFFFF",error:"rgba(202,32,39,1)",button:"rgba(202,32,39,1)",fontSize:"24px",fontWeight:"normal",descFontSize:"16px",descFontWeight:"normal",optFontSize:"16px",optFontWeight:"normal",btnFontSize:"16px",btnFontWeight:"normal",name:"minimal",fontFamily:"SimSun",titleFontSize:"25px",titleFontWeight:"normal",boxWidth:"auto",bgOpacity:100,bgImageUrl:"",effect:"normal",dynamic:Object(i.b)().dynamic,client:Object(i.b)().clientName}}function s(e){if(!e)return c();const t="string"==typeof e?JSON.parse(e):e;let n=t.usingTheme;return n.background||(n={...c()},n.primary=t.usingTheme.primary,n.secondary=t.usingTheme.secondary,n.contrast=t.usingTheme.contrast),{...n,default:"minimal"}}function u(e=c()){e.error=e.error||e.contrast,e.button=e.button||e.contrast,a=e,Object(i.b)().setTheme(e),Object(i.c)().storage.set("theme",JSON.stringify(e))}function l(){return a||c()}function f(e="Legacy"){const t=Object(i.b)().clientName;if("ALL"!==t&&e!==t)throw Object(i.b)().error(Object(r.f)(o.a.global.clientError)),Object(i.b)().customAbort(),new Error("client not matched")}},function(e,t,n){"use strict";n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p})),n.d(t,"c",(function(){return b})),n.d(t,"h",(function(){return h})),n.d(t,"d",(function(){return m}));var r=n(6),i=n(2),o=n(0),a=n(3),c=n(7);function s(e){return"tabs"===e.layout.optMark}function u(e){return e.selected&&!Object(r.n)(e.option)}function l(e,t,n,i){const a=n.list.filter(e=>e.option.useComment)[t];Object(o.g)(a.option,{value:e});const c=i.options.find(e=>e.cascadePath===a.resultId);return Object(r.n)(a.option)&&(e?h(a,i):p(a,i),b(i)),c}function f(e,t,n){let l,f;const d=s(n),p=t.list.filter(e=>!Object(r.n)(e.option))[e];let b=t.list.filter(e=>u(e));const h=-1===b.indexOf(p),m=n.cascade;if(h&&d&&m.multiple&&!t.selected){let e=null;if(m.list.reduce((t,n)=>(u(n)&&(t+=1),n.list&&n.list.includes(p)&&(e=n),t),0)===m.max&&!Object(r.n)(e.option))return Object(o.b)().notify(Object(i.f)(a.a.menu.limitMax,{text:Object(i.f)(a.a.menu.topList),max:Object(c.a)(m.max)})),null}if(t.multiple){if(h){const{mutexNumber:e}=p.option;-1===e?b=[p]:(b=b.filter(t=>(!e||t.option.mutexNumber!==e)&&-1!==t.option.mutexNumber),b.push(p))}else b=b.filter(e=>e!==p);if(b.length>t.max)return Object(o.b)().notify(Object(i.f)(a.a.menu.limitMax,{text:t.text?Object(i.f)(a.a.menu.listItem)+t.text:Object(i.f)(a.a.menu.topList),max:Object(c.a)(t.max)})),null;l=b.map(e=>e.text)}else l=h?[p.text]:[];return f=l.map(e=>e),{resultList:l,list:t.list,group:t,result:f}}function d(e){Object(o.g)(e,{selected:!1}),Object(o.g)(e.option,{selected:!1});const t=e.list;t&&0!==t.length&&t.forEach(e=>{d(e)})}function p(e,t){d(e),t.options.forEach(t=>{t.cascadePath.includes(e.resultId)&&Object(o.g)(t,{selected:!1})})}function b(e){s(e)&&e.cascade.list.forEach(e=>{e.selected=e.list&&e.list.some(e=>e.selected)})}function h(e,t){Object(o.g)(e,{selected:!0}),Object(o.g)(e.option,{selected:!0}),t.options.forEach(t=>{e.resultId.includes(t.cascadePath)&&Object(o.g)(t,{selected:!0})})}function m(e,t){const n=[],r=[];return e.forEach(e=>{const i=t.some(t=>t.trim()===e.text.trim()),o=u(e);i&&!o?n.push(e):!i&&o&&r.push(e)}),{addList:n,cancelList:r}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return p}));var r=n(1),i=n(4);function o(e){const t=[];return e.forEach((e,n)=>{const i=Object(r.f)(n+1);t.splice(i,0,e)}),t}function a(e,t){return e.forEach((e,t)=>e.realIndex=t),t&&t.forEach((t,n)=>t.realIndex=n+e.length),e}const c={};function s(e,t){let n=[];return n=e.circulation?u(t):e.followRandom||e.groupRandom||e.groupInnerRandom?function(e,t){const{followRandom:n,groupRandom:i,groupInnerRandom:o}=e,a=[],c={},s={};t.forEach((e,t)=>{if(e.refOptId){let r="";if(n?r=e.refNodeId:i&&e.refGroupNumber&&(r=e.refNodeId+"_"+e.refGroupNumber),r){e.groupName=r;const n=s[r];n?h(e,n.list,o):s[r]={headIndex:t,list:[e]}}else a.push(e)}else if(e.groupNumber){const n=e.groupNumber;e.groupName=n;const r=c[n];r?h(e,r.list,o):c[n]={headIndex:t,list:[e]}}else a.push(e)});let u=[];return a.forEach(e=>{const t=Object(r.f)(u.length+1);u.splice(t,0,e)}),[c,s].forEach((e,t)=>{Object.keys(e).forEach(o=>{const{list:a,headIndex:c}=e[o];1===t&&n&&d(a);let s=c;i&&(s=Object(r.f)(u.length+1)),u=function(e,t,n){if(0===n)return e.concat(t);{for(;n<t.length-1&&b(t[n],t[n-1]);)n++;if(n>=t.length-1)return t.concat(e);const r=t.slice(0,n),i=t.slice(n);return r.concat(e,i)}}(a,u,s)})}),u}(e,t):function(e){const t=[];return e.forEach(e=>{const n=Object(r.f)(t.length+1);t.splice(n,0,e)}),t}(t),a(n,e.otherOptions)}function u(e,t){return t=(t||Math.round(10*Math.random()))%e.length,e.slice(t).concat(e.slice(0,t))}function l(e,t){if(!Object(i.u)(e))return a(t,e.otherOptions);if(e.groupSingle){let n=c[e.nodeUuid];if(n)return t.sort((e,t)=>n[e.uuid]>n[t.uuid]?1:-1);{const r=s(e,t);return c[e.nodeUuid]=n={},r.forEach((e,t)=>{n[e.uuid]=t}),r}}return s(e,t)}function f(e){let{optionsX:t,optionsY:n}=e;const{otherOptions:r}=e,{randomType:i}=e;return"col"!==i&&"row_col"!==i||(t=l(e,t)),"row"!==i&&"row_col"!==i||(n=l(e,n)),"col_loop"===i&&(t=u(t)),"row_loop"===i&&(n=u(n)),{optionsX:a(t,null),optionsY:a(n,null),otherOptions:a(r,null)}}function d(e){return e.sort((e,t)=>e.refRealIndex>t.refRealIndex?1:-1),e}function p(e){return e.sort((e,t)=>e.realIndex>t.realIndex?1:-1),e}function b(e,t){return!(!e.groupName&&!t.groupName)&&e.groupName===t.groupName}function h(e,t,n=!1){if(n){const n=Object(r.f)(t.length+1);t.splice(n,0,e)}else t.push(e)}},function(e,t,n){"use strict";n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"e",(function(){return g})),n.d(t,"a",(function(){return v}));var r=n(6),i=n(1),o=n(27),a=n(23),c=n(9);let s=null;async function u(e,t){let{start:n,end:r}=await Object(o.a)(e,t);return n===-1/0&&(n=-9999,n>r&&(n=r-9999)),r===1/0&&(r=9999,r<n&&(r=n+9999)),{start:n,end:r}}function l(e,t,n){return!!t&&t.some(t=>{if(t.startsWith("/")&&t.endsWith("/")){const n=t.substr(1,t.length-2),r=new RegExp(n);return!!e.match(r)}return n?n(e,t):e===t})}async function f(e,t,n){let r=0,i=await e();for(;l(i,t,n);)if(i=await e(),r++,r>10)throw new Error("Hard to infer, rejected 10 times");return i}async function d(e,t,n=1){if(!e.inferList)return{value:"",antis:null};const r=e.inferList.filter(e=>e.active&&"input"===e.type);if(0===r.length)return{value:"",antis:null};const i=await Object(a.e)(r,t);if(""===i.replace(/,/g,""))return{value:"__FORCE_EMPTY__",antis:null};const o=[];if(i.split(",").forEach(e=>{e.startsWith("!")?o.push(e.substr(1)):e.match(/\(0\)$/)&&o.push(e.replace(/\(0\)$/,""))}),o.length)return{value:"",antis:o};const c=Object(a.c)(i);return{value:Object(a.f)(c,n).map(e=>e.text).join(","),antis:null}}function p(){return"1"+m(1e9,9999999999)}function b(e){return s[e]||Math.random().toString().replace("0.","")}async function h(){if(s)return s;const e=await Object(c.p)("https://media.choiceform.com/infer/infer.json",{type:"GET",contentType:"application/json"});return s=e,s}function m(e=0,t=10,n=0){const r=Math.pow(10,n);e*=r,t*=r;return(Object(i.g)(e,t)/r).toString()}function g(e,t=1,n=10){let r=b(e);for(;r.length<n;)r+=b(e);const o=r.length,a=Object(i.g)(n,o),c=a-Object(i.g)(t,n),s=r.substring(c,a);return""===s.trim()?g(e,t,n):s}function O(e=0,t=5e3,n=3){e=Math.max(e,0),t=Math.min(t,5e3);let r=Object(i.g)(e,t).toString();if(n>1){r=r+" "+Object(i.g)(1,12)}if(n>2){r=r+" "+Object(i.g)(1,28)}return r}const j={};async function v(e,t){const n=j[e.fillType]||j.none,r=await n(e,t);return"__FORCE_EMPTY__"===r?"":r}j.auto_complete=async(e,t)=>{let{completeGroups:n}=e;const{itemsMax:o,itemsMin:a}=await Object(r.g)(e,t),c=Object(i.g)(a,o)||1,{value:s,antis:u}=await d(e,t,c);if(s)return s;u&&(n=n.filter(e=>!l(e.name,u)));return Object(i.p)(n,c).map(e=>e.name).join(",")},j.chars=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{tolerance:i}=e,{start:o,end:a}=await u(e,t);return f(()=>!i||0===i.length||i.includes("chinese")?g("chinese",o,a):i.includes("alphabet")?g("alphabet",o,a):g("number",o,a),r)},j.date=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{grade:i}=e,{start:o,end:a}=await u(e,t);return f(()=>O(o,a,i),r)},j.date_range=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const i=O(1960,2050,3),o=Number(i.split(" ")[0]);return f(()=>{const e=O(o,2060);return i+" - "+e},r)},j.email=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return f(()=>(Object(i.e)(1,6)+"@"+Object(i.e)(1,6)+"."+Object(i.e)(1,4)).toLowerCase(),r)},j.float=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{scale:i}=e;return f(async()=>{const{start:n,end:r}=await u(e,t);return m(n,r,i)},r)},j.integer=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{start:i,end:o}=await u(e,t);return f(()=>m(i,o),r)},j.list_select=async(e,t)=>{let{selectList:n}=e;const{itemsMax:o,itemsMin:a}=await Object(r.g)(e,t),c=Object(i.g)(a||1,o||1)||1,{value:s,antis:u}=await d(e,t,c);if(s)return s;u&&(n=n.filter(e=>!l(e,u)));return Object(i.p)(n,c).join(",")},j.none=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return f(()=>g("chinese",1,10),r)},j.phone_number=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return f(()=>p(),r)},j.postcode=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>m(1e5,999999),r)},j.time=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>m(1,25)+":"+m(1,60),r)},j.time_range=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>{const e=m(1,20);return e+":"+m(1,60)+" - "+(m(Number(e)+1,24)+":"+m(1,60))},r)},j.time_duration=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{grade:i}=e;return await f(()=>{if(i<=3){let e=m(1,20)+"d";return i>1&&(e+=" "+m(1,24)+"h"),i>2&&(e+=" "+m(1,60)+"m"),e}{let e=m(1,60)+"h";return i>4&&(e+=m(1,60)+"m"),i>5&&(e+=m(1,60)),e}},r)},j.url=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>("https://"+Object(i.e)(1,3)+"."+Object(i.e)(1,6)+"."+Object(i.e)(1,3)).toLowerCase(),r)}},function(e,t,n){"use strict";function r(e){if(!e)return"00:00";const t=e%60;return i((e-t)/60)+":"+i(t)}function i(e){let t=e+"";return 1===t.length&&(t="0"+t),t}function o(){const e=new Date;return e.getFullYear()+"-"+i(e.getMonth()+1)+"-"+i(e.getDate())+" "+i(e.getHours())+":"+i(e.getMinutes())+":"+i(e.getSeconds())}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return p}));var r=n(1);const i=String.fromCharCode(160),o=new RegExp(i,"g");function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g,i)}class c{constructor(e){this.type="node",this.name=e,this.children=[],this.attributes={}}hasClass(e){const{attributes:t}=this,n=t&&t.class;return n&&n.split(" ").includes(e)}insertBefore(e,t){const n=this.children.indexOf(t);e.parent=this,this.children.splice(n,0,e)}getOuterHtml(){let e=Object.keys(this.attributes).map(e=>{let t=this.attributes[e]||"";return t&&(t=t.replace(/&/g,"&").replace(o," ").replace(/"/g,""")),`${e}="${t}"`}).join(" ");e&&(e=" "+e);let t=`<${this.name}${e}>`;return l(this.name)||(t+=this.getInnerHtml(),t+=`</${this.name}>`),t}getInnerHtml(){return this.children.map(e=>Object(r.k)(e,"node"===e.type)?e.getOuterHtml():e.getText().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(o," ")).join("")}setInnerHtml(e){this.empty(),d(e,this)}setText(e){this.empty(),this.children.push(new s(e))}getText(){return this.children.map(e=>e.getText()).join("")}empty(){this.children.forEach(e=>e.parent=null),this.children=[]}removeChild(e){this.children=this.children.filter(t=>t!==e)}appendChild(e){this.children.includes(e)||(e.parent=this,this.children.push(e))}queryByClass(e){let t=[];return this.children.forEach(n=>{const{children:i,type:o}=n;if(Object(r.k)(n,"node"===o)&&(n.hasClass(e)&&t.push(n),i&&i.length>0)){const r=n.queryByClass(e);r.length>0&&(t=[...t,...r])}}),t}}class s{constructor(e){this.type="text",this.setText(e)}getText(){return this._text}setText(e){this._text=e}}const u=["area","base","br","col","command","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function l(e){return u.includes(e)}function f(e){e=Object(r.t)(e);const t={},n=/(\S+?)=(["'])(.*?)\2[\/\s>]/g;let o=n.exec(e);for(;o;)t[o[1]]=o[3].replace(/&/g,"&").replace(/ /g,i).replace(/"/g,'"'),o=n.exec(e);return t}function d(e,t){e=function(e){return e.replace(/\S+?=(["']).*?\1/g,e=>Object(r.d)(e))}(e).replace(/\n/g," ");const n=/<(\w+).*?>/g,i=[];let o=n.exec(e);const u=t||new c("div");for(;o;){const t=o[1],r=o.index+o[0].length;i.push({type:"open",name:t,value:o[0],start:o.index,end:r}),n.lastIndex=r,o=n.exec(e)}if(0===i.length)return u.appendChild(new s(a(e))),u;const d=/<\/(\w+)>/g;let p=d.exec(e);for(;p;){const t=p[1],n=p.index+p[0].length;i.push({type:"close",name:t,value:p[0],start:p.index,end:n}),p=d.exec(e)}i.sort((e,t)=>e.start>t.start?1:-1);const b=[...i];let h=u,m=0,g=b.shift();const O=[];for(;g;){const{start:t,end:n,name:r,type:i,value:o}=g;if(m<t&&h.children.push(new s(a(e.substring(m,t)))),"open"===i){const e=new c(r);e.attributes=f(o),h.appendChild(e),l(r)||(h=e,O.push(g))}else if(!l(r)){const e=O[O.length-1];e&&e.name===g.name&&(h=h.parent,O.pop())}m=n,g=b.shift()}return m<e.length&&u.appendChild(new s(a(e.substring(m)))),u}function p(e){const t=d(e),n=e=>{const t={type:e.type};return Object(r.k)(e,"node"===e.type)?(t.name=e.name,t.attrs=e.attributes,t.children=e.children.map(n)):t.text=e.getText(),t};return t.children.map(n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return k})),n.d(t,"b",(function(){return E})),n.d(t,"c",(function(){return N}));var r=n(6),i=n(27),o=n(4),a=n(52),c=n(5),s=n(1),u=n(0),l=n(2),f=n(30),d=n(3),p=n(9),b=n(25);const h={valid:!0,message:""};function m(e){if(!Object(o.i)(e))return h;const t=Object(r.l)(e)||Object(r.k)(e);return{valid:t,message:t?"":Object(l.f)(d.a.global.answerRequired),dueToNode:e}}function g(e,t){const{otherOptions:n}=e;return n.some(e=>e.selected)?0:t}async function O(e){if(!Object(o.i)(e)&&!Object(r.k)(e))return h;const{options:t}=e,{parent:n}=e;let i=await Object(c.e)(e.fillMin,{state:n});i=i||t.length,i>t.length&&(i=t.length),i=g(e,i);let a=0;for(const n of t)if(Object(b.b)(n,e))a+=1;else if(!0===n.fillRequired)return{valid:!1,message:Object(l.f)(d.a.fill.required,{text:n.text||""}),dueToNode:e};const s=i<=a;return s?h:{valid:s,message:Object(l.f)(d.a.fill.inputLimitMin,{min:i}),dueToNode:e}}function j(e,t=!1){const n=t?e.otherOptions:Object(r.c)(e),i=Object(o.i)(e);let a;const c=!n.some(t=>(a=t,function(e,t){const n=!0===e.fillRequired,i=e.selected;return n&&(i||Object(r.n)(e)&&t)}(t,i)&&!Object(b.b)(t,e)));return c?h:{valid:c,message:Object(l.f)(d.a.fill.required,{text:a.text}),dueToNode:e,dueToOption:a}}async function v(e,t=!1){const n=t?e.options:Object(r.c)(e);for(const t of n){if(!Object(b.b)(t,e))continue;const n=await Object(i.d)(t,e);if(!n.valid)return n}return h}function w(e){return Object(o.s)(e)&&Object(r.l)(e)?y(e):Object(s.n)(h)}async function y(e){if(function(e){if("matrix"===e.type)return!1;const t=Object(r.c)(e).find(e=>e.selected);return!(!t||-1!==t.mutexNumber)}(e))return h;const{min:t}=await Object(o.e)(e);return Object(r.c)(e).filter(e=>!Object(r.n)(e)).filter(e=>e.selected).length>=t?h:{valid:!1,message:Object(l.f)(d.a.select.limitMin,{min:t}),dueToNode:e}}function _(e){return Object(o.v)(e)?Object(s.n)(h):Object(o.i)(e)||Object(r.l)(e)?Object(o.m)(e)?y(e):Object(o.r)(e)||Object(o.p)(e)||Object(o.q)(e)?Object(s.n)(function(e){let t,n,r;Object(o.r)(e)?(t="yid",n=e.renderOptionsY,r=!1):Object(o.p)(e)?(t="xid",n=e.renderOptionsX,r=!0):Object(o.q)(e)&&(e.renderOptionsX.length>e.renderOptionsY.length?(t="yid",n=e.renderOptionsY,r=!1):(t="xid",n=e.renderOptionsX,r=!0));const i=e.options;for(const o of n){const n=o.uuid;if(!i.some(e=>e.selected&&Object(s.l)(e[t],n))){return{valid:!1,message:r?Object(l.f)(d.a.matrix.colLimitMin,{min:1}):Object(l.f)(d.a.matrix.rowLimitMin,{min:1}),dueToNode:e}}}return h}(e)):async function(e){const t=Object(o.n)(e);let{min:n}=await Object(o.e)(e);const r=t?"xid":"yid",i=e[t?"renderOptionsX":"renderOptionsY"],a=e[t?"renderOptionsY":"renderOptionsX"];n>a.length&&(n=a.length);const c=e.options;for(const o of i){const i=o.uuid;if(c.filter(e=>e.selected&&Object(s.l)(e[r],i)).length<n){return{valid:!1,message:t?Object(l.f)(d.a.matrix.colLimitMin,{min:n}):Object(l.f)(d.a.matrix.rowLimitMin,{min:n}),dueToNode:e}}}return h}(e):Object(s.n)(h)}const x={};function T(e,t){Object(u.g)(e,{errorMessage:t.message||""})}function k(e,t){Object(u.b)().locateError(e,t)}async function S(e,t){if(Object(o.w)(e)||e.readonly)return h;const n=function(e){const{canSkipVideo:t,video:n}=e;return t||!n||n.ended?h:{valid:!1,message:Object(l.f)(d.a.video.watchAll),dueToNode:e}}(e);if(!n.valid)return n;const r=x[e.type];let i=r?await r(e):h;return i.valid&&t&&(i=await Object(a.a)(e)),i.valid&&T(e,i),i}x.select=async e=>{const t=m(e);if(!t.valid)return t;let n=await w(e);return n.valid?(n=j(e,!1),n.valid?v(e,!1):n):n},x.select_image=e=>x.select(e),x.fill=async e=>{const t=m(e);if(!t.valid)return t;let n=await O(e);return n.valid?(n=j(e,!0),n.valid?v(e,!1):n):n},x.value_mark=async e=>{const t=m(e);if(!t.valid)return t;let n=await O(e);return n.valid?(n=j(e,!0),n.valid?v(e,!0):n):n},x.icon_mark=async e=>{const t=await x.value_mark(e);if(!t.valid)return t;if(Object(o.i)(e)){if(e.options.some(e=>0===e.value))return{valid:!1,message:Object(l.f)(d.a.global.answerRequired),dueToNode:e}}return h},x.sequence=e=>{let t=m(e);if(!t.valid)return Object(s.n)(t);const{options:n}=e;let r=Object(o.i)(e)?e.rankCount||n.length:0;const i=n.length;r>i&&(r=i),r=g(e,r);let a=0;const c=n.filter(e=>e.sortNo>0).sort((e,t)=>e.sortNo>t.sortNo?1:-1);for(let e=0;e<c.length&&c[e].sortNo===e+1;e++)a++;return r>a?Object(s.n)({valid:!1,message:Object(l.f)(d.a.rank.limitMin,{min:r}),dueToNode:e}):(t=j(e,!0),t.valid?v(e,!0):Object(s.n)(t))},x.matrix=async e=>{const t=m(e);if(!t.valid)return t;let n=await _(e);return n.valid?(n=j(e,!0),n.valid?v(e,!0):n):n},x.region=e=>{const t=!Object(o.i)(e)||e.value?h:{valid:!1,message:Object(l.f)(d.a.global.answerRequired),dueToNode:e};return Object(s.n)(t)},x.location=async e=>{const t=await x.region(e);return t.valid||(t.message=Object(l.f)(d.a.locate.required)),t},x.upload=async e=>{const t=m(e);if(!t.valid)return t;let n=!0,i="";const a=Object(r.f)(e);if(!Object(o.i)(e)&&0===a)return h;const c=await Object(o.g)(e),{max:s}=c,u=g(e,c.min);return a<u?(n=!1,i=Object(l.f)(d.a.upload.amountLimitMin,{min:u})):a>s&&(n=!1,i=Object(l.f)(d.a.upload.amountLimitMax,{max:s})),{valid:n,message:i,dueToNode:e}},x.verify=async e=>{if(Object(u.b)().preview||Object(u.c)().dev.infer){if(!e.code)return{valid:!1,message:Object(l.f)(d.a.global.answerRequired),dueToNode:e}}else{const t={valid:!1,message:Object(l.f)(d.a.verify.invalidFailed),dueToNode:e},{validateType:n}=e,{code:r,parent:i,nodeUuid:o}=e,a=()=>(e.validateFailTimes+=1,t);if("image"===n){const{serverValidations:n}=e;if(!n)return t;{const{id:e}=n;try{return await Object(p.o)({code:r},e),h}catch(e){return a()}}}else if("password"===n){const{transactionID:e}=i,t={response_id:e,question_id:o,code:r};try{return await Object(p.j)(t),h}catch(e){return a()}}else if("sms"===n){const{serverValidations:n}=e;if(!n)return t;{const{id:e}=n;try{return await Object(p.o)({code:r},e),h}catch(e){return a()}}}}return h},x.menu=x.select,x.area=e=>Object(s.n)(m(e)),x.select_icon=e=>{const t=m(e);return t.valid?w(e):Object(s.n)(t)},x.weight=e=>{if(!Object(o.i)(e)&&!Object(r.k)(e))return Object(s.n)(h);const t=m(e);if(!t.valid)return Object(s.n)(t);let{weightTotal:n}=e;n=g(e,n);const{options:i}=e;return n>i.reduce((e,t)=>e+Number(t.value),0)&&!0!==e.relax?Object(s.n)({valid:!1,message:Object(l.f)(d.a.weight.totalLimitMin,{min:n}),dueToNode:e}):Object(s.n)(h)},x.cascade=e=>{if(!Object(o.i)(e)&&!Object(r.l)(e))return Object(s.n)(h);const{cascade:t}=e,n=m(e);return n.valid?async function e(t,n,r=0){if(!n.list)return h;const o=Object(f.e)(t),{multiple:a,min:c,max:s,required:u}=n,p=n.text?Object(l.f)(d.a.menu.listItem)+n.text:Object(l.f)(d.a.menu.topList),b=n.list.filter(e=>{let t=e.selected;return o&&e.list&&(t=t&&e.list.some(e=>e.selected)),t});for(const e of b){const{option:n}=e;if(n.fillRequired&&!(n.value||"").toString().trim())return{valid:!1,dueToNode:t,message:Object(l.f)(d.a.menu.inputReq,{text:n.text})};const r=await Object(i.d)(n,t);if(!r.valid)return{...r,message:Object(l.f)(d.a.menu.inputRule,{text:n.text,rule:r.message})}}const m=b.length;if(u&&0===m&&(!o||0===r))return{valid:!1,dueToNode:t,message:Object(l.f)(d.a.menu.required,{text:p})};if(a&&m<c&&(!o||m>0))return{valid:!1,dueToNode:t,message:Object(l.f)(d.a.menu.requiredBetween,{text:p,min:c,max:s})};for(const r of n.list){if(!r.selected)continue;const n=await e(t,r,m);if(!n.valid)return n}return h}(e,t):Object(s.n)(n)},x.hot_spot=x.select,x.heat_map=e=>Object(s.n)(m(e)),x.slide_rate=x.value_mark,x.max_diff=e=>{const t=e.tasks.every(e=>e.done),n={valid:t,dueToNode:t?null:e,message:t?"":Object(l.f)(d.a.maxDiff.all)};return Object(s.n)(n)};const E=Object(s.a)(async(e,t)=>{if(t){const n=await Object(i.d)(t,e);t.errorMessage!==n.message&&T(t,n)}if(e){const t=await N([e]);t.message||T(e,t)}},250);async function N(e,t=!1){const n=[],r=e.length>1;for(const r of e){const e=await S(r,t);n.push(e)}let i=null;return n.forEach(e=>{e.valid||(r&&T(e.dueToNode,e),i||(i=e))}),i||h}},function(e,t,n){"use strict";n.d(t,"d",(function(){return R})),n.d(t,"b",(function(){return H})),n.d(t,"c",(function(){return K})),n.d(t,"a",(function(){return J}));var r=n(4),i=n(71),o=n(12),a=n(33),c=n(56),s=n(28),u=n(74),l=n(58),f=n(19),d=n(43),p=n(11),b=n(52),h=n(17),m=n(9),g=n(44),O=n(57),j=(n(15),n(30)),v=n(8),w=n(14),y=n(20),_=n(0),x=n(2),T=n(45),k=(n(6),n(64)),S=n(1),E=n(48),N=n(3),I=n(67),C=n(72),L=n(50),A=n(10),P=n(75);const R=Object(S.a)(()=>{Object(_.b)().realTimePreview||F(null)||v.a.trigger("STRETCH_OK")});let M;function D(){return M}function U(e){const t=["region","location","area"];return e.some(e=>e.used&&t.indexOf(e.type)>-1)}function B(e){const{parsedPayload:t,userInfo:n,theme:r,hasVar:i,sid:d,langTable:b,startNode:m,surveyId:g,summary:O,language:T,images:E,langResume:N,title:I,transactionID:L,status:A,platform:R,digest:M,channel:D,customLogo:B,customText:z,useCustomLogo:$}=e,{nodeList:H,basicConfig:X,testCases:G}=t;let K=!1;Object(_.b)().offlineTaskId||X.collector&&(K=!1===X.collector.multiple_response);const{fakedServers:J,autoCpltGroups:W,noWxShare:Y,previewShadowNodes:Z,qNumberRequired:Q,asterisksRequired:ee,progressBarRequired:te,nodeTypeInfoRequired:ne,limitTime:re,minTime:ie,timeoutText:oe,timeLessText:ae,resumeEnabled:ce}=m,se={previewShadowNodes:Z&&!Object(_.c)().dev.autoRun,langResume:N,langTable:b,testCases:G,progress:0,resumeEnabled:ce||!!Object(_.b)().offlineTaskId,images:E,eventHub:v.a,language:T,sid:d,parsedPayload:t,digest:M,channel:D,transactionID:L,status:A,platform:R,fakedServers:J,autoCpltGroups:W,noWxShare:Y,needRegions:U(H),theme:r,userInfo:n,responseStatus:"created",context:{question:void 0,option:void 0},completeUrl:"",quotaFullUrl:"",screenOutUrl:"",title:I,summary:O,useCustomLogo:$,customText:z,customLogo:B,bonusLimitTime:"",nodeList:H,companyID:"",oneReplyPerTerminal:K,surveyId:g,qNumberRequired:Q,asterisksRequired:ee,progressBarRequired:te,nodeTypeInfoRequired:ne,preview:Object(_.b)().preview,nextBtnText:"",prevBtnText:"",prevEnabled:!1,randomList:[],loopStack:[],startTime:0,currentStartTime:0,renderList:[],current:void 0,limitTime:re||void 0,minTime:ie,timeoutText:oe||"",timeLessText:ae||"",timer:-1,restTime:Object(a.b)(re),hasVar:i,nextLoading:!1,refreshing:!1,phoneUsed:!1,phoneNumber:"",startNode:m,nodes:[],prevButton:"",nextButton:"",inSingleGroup:null,needProgressBar:!1,first(){return Object(f.b)(this)[0]||this.current},last(){const e=Object(f.b)(this);return e[e.length-1]||this.current},async dynamicStateProps(){const e=Object(f.b)(this);Object(_.g)(this,{nodes:e});let t=null;if(Object(f.c)(this)){const e=this.first();t=e&&this.parsedPayload.nodeGroups.find(t=>t.id===e.groupId)}Object(_.g)(this,{inSingleGroup:t});const n=await Object(o.f)(this);Object(_.g)(this,{prevButton:Object(o.h)(this),nextButton:n,needProgressBar:this.progressBarRequired&&"lottery"!==this.current.type}),e.forEach((t,n)=>{t.next=e[n+1]})},handleEvents:{...k.a,handleQuickAnswer:e=>Object(C.b)(e),handleLangChange:e=>Object(S.n)(Object(x.a)(e.id,!0)),handleCascadeInput(e,t,n,r){if(F(r))return Object(S.n)();const i=Object(j.g)(e,t,n,r);return this.handleOptionInput(e,i,r).then(e=>(Object(y.c)(),e))},handleOptionAssistInput:(e,t,n,r)=>(Object(_.g)(n.assistValue,{[t]:e}),V({result:!0},r)),async handleCascadeClick(e,t,n){const r=()=>t.list.filter(e=>e.selected).map(e=>e.text);if(F(n))return r();const i=Object(j.f)(e,t,n);return i?(await this.handleOptionClick(i,n),Object(y.c)(),i.result):r()},async handleMenuClick(e,t){const n=()=>t.options.filter(e=>e.selected).map(e=>e.text);if(F(t))return n();await this.handleOptionClick(t.options[e],t);const r=n();return Object(y.c)(),r},async handleOptionClick(e,t){if(F(t))return;const n=await Object(s.b)(e,t);return n.result&&Object(p.q)(e,t),V(n,t).then(e=>(Object(y.c)(),e))},async handleOptionInput(e,t,n){if(F(n))return;const r=await Object(c.b)(e,t,n);return r.result&&Object(p.p)(e,t,n),V(r,n).then(e=>(Object(y.c)(),e))},handleAutoCpltInput:(e,t,n)=>(Object(c.a)(e,t,n),Object(S.n)(Object(p.b)(e,t,n))),handleOptionDrop(e,t,n){if(F(n))return Object(S.n)([]);const r=Object(u.a)(e,t,n);return r.result&&Object(p.r)(t,n),V(r,n).then(e=>(Object(y.c)(),e))},handleQuestionInput(e,t){if(F(t))return Object(S.n)();const n=Object(l.b)(e,t);return n.result&&Object(p.u)(e,t),V(n,t).then(e=>(Object(y.c)(),e))},handleLocateFailed(e){const t=Object(l.a)(e);return t.result&&Object(p.k)(e),V(t,e).then(e=>(Object(y.c)(),e))},handlePrevClick:()=>Object(_.b)().realTimePreview||q()||!se.prevButton||F(null)?Object(S.n)():(Object(p.t)(se.current),Object(o.i)(se).then(e=>(Object(y.c)(),e))),handleMaxDiffInput:(e,t,n,r)=>V(Object(P.a)(e,t,n,r),r).then(e=>(Object(y.c)(),e)),async handleNextClick(){if(Object(_.b)().realTimePreview||F(se.current)||q()&&Object(o.l)())return;Object(o.m)(se,!0),function(e){const{current:t,currentStartTime:n,nodes:r}=e,i=t.costTime||0,o=(new Date).getTime(),a=o-n;if(t.groupSingle&&r.length>1){const e=Math.abs(a/r.length);r.forEach(t=>{Object(_.g)(t,{costTime:e,endTime:o}),Object(w.a)(t)})}else Object(_.g)(e.current,{costTime:Math.abs(i+a),endTime:o}),Object(w.a)(e.current);Object(_.g)(e,{currentStartTime:o})}(se);const{current:e}=se;if(Object(p.n)(e),"lottery"===e.type)Object(o.k)(se,e),Object(o.m)(se,!1);else{if(await Object(o.n)(se)){if(!q())return Object(o.j)(se);Object(o.d)(se)}else Object(o.m)(se,!1)}}}};return Object.keys(se.handleEvents).forEach(e=>{const t=se.handleEvents[e];se.handleEvents[e]=async(...e)=>{Object(h.e)(se,se.current);const n=await t.apply(se.handleEvents,e);return Object(h.e)(se,se.current),n}}),se}function q(){return M.refreshing}function F(e){let t=M.nextLoading||q();return e&&(t=t&&e!==e.parent.current),t}async function V(e,t){if(await Object(f.d)(t),Object(_.b)().liteTemplate)return!1;Object(v.c)(t),Object(w.a)(t);const n=t.parent;return Object(_.b)().realTimePreview||(n.inSingleGroup?(Object(_.g)(n,{current:t}),await Object(h.f)(n,t,{type:"page_inner",delay:60})):R()),Object(v.b)(t),e.result}function z(e){const t=e;return{nodeName:t.nodeName,nodeUuid:t.nodeUuid,type:"describe",image:t.image,images:t.image?[t.image]:void 0,imgPosition:"before",imgTransTime:2e3,imgTransType:"slide",layout:t.layout}}async function $(e){if(M=e,Object(_.b)().liteTemplate)await async function(e){const{nodeList:t}=e,n=t.find(e=>"start"===e.type),r=t.find(e=>"end"===e.type),i={...z(n),questionText:n.startName,describe:n.questionText},o={...z(r),questionText:r.questionText,describe:r.describe},a=[i,...t.filter(e=>"start"!==e.type&&"end"!==e.type).sort((e,t)=>e.x>t.x?1:-1),o];let c;const s=[];for(const t of a){const n={prev:c,origin:t,...t},r=await Object(f.f)(n,e);c&&(c.next=r),c=r,s.push(r)}Object(_.g)(e,{renderList:s,nodes:s,nextButton:"",prevButton:""})}(e);else if(await X(e),function(e){let t=e.limitTime;t&&(e.timer=setInterval(()=>{t--,t||(Object(p.z)(e),clearInterval(e.timer),Object(_.b)().error(e.timeoutText||Object(x.f)(N.a.global.timeOver))),Object(_.g)(e,{restTime:Object(a.b)(t)})},1e3))}(e),e.langResume||e.resumeEnabled&&!Object(_.b)().preview){const t=Object(y.a)(e);Object(_.g)(e,{memoryTool:t,answerResumer:t}),e.langResume&&setTimeout(()=>e.answerResumer.handleSure(),1e3)}}function H(e,t={}){return e=e||D(),Object(_.g)(e,{renderList:[],current:null,loopStack:[],randomList:[],...t}),X(e)}async function X(e){Object(o.m)(e,!0);const t=e.nodeList,n=Object(r.d)(t),a=await Object(i.a)(t,e,n);!function(e,t){const n=(new Date).getTime();Object(_.g)(e,{nextBtnText:t.nextBtnText||Object(x.f)(N.a.global.next),prevBtnText:t.prevBtnText||Object(x.f)(N.a.global.previous),prevEnabled:!0===t.goBackEnabled,startTime:n,currentStartTime:n})}(e,n),await Object(o.a)(e,a,null);const{current:c}=e,s=Object(r.w)(c),u=Object(f.c)(e);if(s||u){const t=u?"page_inner":"page_next";await Object(h.f)(e,c,{type:t,initial:!0})}else Object(_.g)(e,{renderList:[c]}),await e.dynamicStateProps(),R();Object(E.a)(e);const l=e.current;return l.reached=!0,Object(p.x)(e,l),Object(w.j)(e),c!==l&&await Object(O.b)(e,{valid:!0,message:""},c,l),Object(v.c)(e.current,!0),Object(o.m)(e,!1),e}async function G(){const e=Object(_.b)().sid,t=Object(_.b)().startState;if(t||(Object(_.c)().app.gotoStartPage(Object(A.c)()),Object(_.b)().customAbort()),Object(_.b)().preview)return t;const{parsedPayload:{basicConfig:n}}=t,{payload_digest:r,channel:i,interviewee:o}=n;!function(e,t){if(!Object(_.c)().dev.autoRun&&Object(_.c)().storage.get(e)&&t&&!Object(_.b)().preview)throw Object(_.b)().error(Object(x.f)(N.a.global.antiAgain)),new Error(" _custom_abort_ _multi_reply")}(e,!1===n.collector.multiple_response);const a={code:e,payload_digest:r,platform:i.type,interviewee_id:o&&o.id};try{const e=await Object(m.g)(a);return t.transactionID=e.id,t.status=e.status,t.platform=e.platform,t.digest=r,t.channel=i,Object(_.c)().network.connectSocket(e.id,n.collector.id),t}catch(e){throw Object(m.c)(e),e}}function K(){M=null}async function J(){const e=Object(_.c)();if(M)return M;const t=await G();await async function(e){if(Object(_.b)().preview)return;const{parsedPayload:t}=e,{basicConfig:{diagram_url:n}}=t;let r;try{r=await Object(m.p)(n)}catch(e){throw Object(_.b)().error(Object(x.f)(N.a.global.downloadError)),e}const i=await Object(I.a)(r);t.nodeList=Object(g.b)(i.nodes,t.nodeGroups);const{nodeList:o,langStore:a}=t;a&&Object(T.c)({nodes:o},a)}(t);const n=B(t);Object(_.b)().surveyState=n,await e.network.initUploader(n),await Object(L.b)(n),await async function(e){e.needRegions&&await Object(d.a)()}(n);const{startNode:{templates:r},theme:i}=n;return await e.ui.loadUiTemplates(i,r),await async function(e){const{startNode:t}=e,n=await Object(b.a)({...t,parent:e},!0);n.valid?t.passed=!0:(Object(_.b)().error(n.message||Object(x.f)(N.a.verify.failed)),Object(_.b)().customAbort())}(n),await $(n),await e.hook.afterFetchSurvey(n),n}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return l}));var r=n(21),i=n(6),o=n(11),a=n(15);async function c(e,t,n){const i=t.displayConfig;if(i){n.hasOptShowHide=!0,e.context.option=t;const a=await Object(r.b)(e,i.options,i.logicType);return a&&Object(o.o)(e,t,n),e.context.option=null,a}return!0}async function s(e,t,n){const r=[],i=[];for(const o of t){await c(e,o,n)?(o.visible=!0,r.push(o)):(o.visible=!1,i.push(o))}return{visibleList:r,hiddenList:i}}async function u(e,t,n){for(const r of t)r.visible=await c(e,r,n);return t}function l(e,t){const{renderList:n}=e,r=[];return n.forEach(e=>{if(!Object(a.e)(e.checkMode,t))return;const{hasOptShowHide:n,nodeUuid:o,loop:c}=e;if(n){const t="matrix"===e.type?Object(i.d)(e):Object(i.c)(e);let n;c&&(n=c.replacements.map(e=>e.index)),r.push({node_id:o.toLowerCase(),loop_idxs:n,option_ids:t.map(e=>e.uuid.toLowerCase())})}}),r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(34);const i=["beforecopy","beforepaste","beforecut","copy","paste","cut","animationstart","animationend","animationiteration","transitionend","scroll","wheel","blur","click","dblclick","focus","focusin","focusout","input","keypress","keyup","keydown","select","change","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","touchcancel","touchend","touchmove","touchstart","unload","cancel","close","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","loadedmetadata","loadeddata","durationchange","timeupdate","play","pause","ratechange","volumechange","suspend","emptied","stalled","invalid","reset","submit","invalid","reset","submit","show","contextmenu","drag","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop","webglcontextcreationerror","webglcontextlost","webglcontextrestored","error","load","loadend","loadstart","progress"];function o(e){if(!e||e.includes("data-safe-html="))return e;const t=new r.a("div");return t.setInnerHtml(e),function e(t){if("script"===t.name)t.parent&&t.parent.removeChild(t);else{i.forEach(e=>{delete t.attributes["on"+e]});for(let n=t.children.length-1;n>=0;n--){const r=t.children[n];"node"===r.type&&e(r)}}}(t),t.getInnerHtml()}},function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"e",(function(){return b})),n.d(t,"b",(function(){return w})),n.d(t,"c",(function(){return y}));var r=n(1),i=n(16),o=n(22),a=n(51),c=n(7),s=n(41);let u;function l(e){const{loopStack:t}=e;return t?t[t.length-1]:null}function f(e,t,n){const{state:{loopStack:i}}=e,o=i[t];if(o){const e=o.replacements[t];if(e)return Object(r.j)(n(e))}return Object(r.j)(n())}function d(e,t){const{varInfo:{loopNodeId:n,imgSize:i},state:o}=e,a=l(o);if(!a)return Object(r.n)("");const c=b(n,a.replacements);return Object(r.j)(t(c,i))}function p(e){const t=e.split(":")[1];return function(){if(!u){const e=Object(o.a)();u=[],Object.keys(e).forEach(t=>{const{uuid:n,type:r}=e[t];"var-loop"===r&&u.push(n)})}return u}().indexOf(t)>-1}function b(e,t){return t.find(t=>Object(r.l)(t.loopNodeId,e))}function h(e,t="0:0"){if(e){let n=void 0===e.refText?e.text:e.refText;if(n.match(/^##.+##$/)&&"0:0"!==t){const e=t.split(":");n=n.replace(/\?w=0&h=0/,`?w=${e[0]||0}&h=${e[1]||0}`)}return n}return""}function m(e,t="0:0"){if(e&&e.image){const{image:n}=e;return Object(i.b)(n.url,t)}return""}function g(e){return e&&Object(c.a)(e.index+1)}function O(e){return e&&e.value}function j(e){return e&&Object(c.a)(e.number)}function v(e){return e&&e.label}function w(e){e.C_OL_TXT.getText=e=>f(e,0,h),e.C_OL_IDX.getText=e=>f(e,0,g),e.C_OL_NUM.getText=e=>f(e,0,j),e.C_OL_VAL.getText=e=>f(e,0,O),e.C_OL_LBL.getText=e=>f(e,0,v),e.C_IL_TXT.getText=e=>f(e,1,h),e.C_IL_IDX.getText=e=>f(e,1,g),e.C_IL_NUM.getText=e=>f(e,1,j),e.C_IL_VAL.getText=e=>f(e,1,O),e.C_IL_LBL.getText=e=>f(e,1,v),s.a.forEach(t=>{!function(t){const n=t.split("_")[1],r="C_IL_MAP_"+n,i=(e,n)=>f(e,n,n=>{if(!n)return"";const{mapping:r}=n;return Object(a.b)(r,t,e)});e["C_OL_MAP_"+n].getText=e=>i(e,0),e[r].getText=e=>i(e,1)}(t)})}function y(e){e.LOOP.getText=e=>d(e,h),e.LOOP_IMG.getText=e=>d(e,m),e.LOOP_INDEX.getText=e=>d(e,g),e.LOOP_NUM.getText=e=>d(e,j),e.LOOP_VAL.getText=e=>d(e,O),e.LOOP_LBL.getText=e=>d(e,v),s.a.forEach(t=>{!function(t){const n=t.split("_")[1];e["LOOP_MAP_"+n].getText=e=>d(e,n=>Object(a.b)(n.mapping,t,e))}(t)})}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return l}));var r=n(5),i=n(15);function o(e,t,n){const{question:r,option:i,exclusiveId:o}=e;let a=r.embedVarMaps;if(a||(a=r.embedVarMaps=[]),o){const e=a.find(e=>e.exclusiveId===o&&e.var_id===t.mapId);if(e)return void(e.value=n)}a.push({type:"embed",var_id:t.mapId,value:n,option_id:i&&i.uuid.toLowerCase(),exclusiveId:o})}function a(e){const{text:t,image:n,icon:r}=e;if(t)return t;if(n)return n.originName;if(r){const e=r.match(/#[^#]+$/);return e&&e[0]||""}return""}function c(e,t,n){e.referVarMaps||(e.referVarMaps=[]);const r=n.map(e=>({option_id:e.uuid.toLowerCase(),value:a(e),type:"ref",var_id:t.uuid}));e.referVarMaps=e.referVarMaps.concat(r)}function s(e,t){const n=e.casVarMaps=[];t.forEach(e=>{e.text&&n.push({type:"cascade",option_id:e.uuid.toLowerCase(),value:e.text})})}function u(e){if(e){let t=[];const n=[];return e.forEach(e=>{delete e.exclusiveId,e.option_id?t.push(e):n.push(e)}),t=function(e){let t=[];const n={};return e.forEach(e=>{const{var_id:t,value:r}=e;let i=n[t];i?(i.values.indexOf(r)<0&&i.values.push(r),i.maps.push(e)):i=n[t]={values:[r],maps:[e]}}),Object.keys(n).forEach(e=>{const r=n[e],{values:i,maps:o}=r;if(i.length>1)t=t.concat(o);else{const e=o[0];o.length>1&&(e.option_id="all"),t.push(e)}}),t}(t),n.concat(t)}return[]}function l(e,t){const{renderList:n}=e,o=[];return n.forEach(e=>{if(!Object(i.e)(e.checkMode,t))return;const{nodeUuid:n,loop:a}=e;let{embedVarMaps:c,referVarMaps:s,casVarMaps:l}=e;c=u(c),s=s||[],l=l||[];const f=c.concat(s,l);if(f.length>0){let e;f.forEach(e=>{e.value=Object(r.k)(e.value)}),a&&(e=a.replacements.map(e=>e.index)),o.push({node_id:n.toLowerCase(),loop_idxs:e,var_maps:f})}}),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=Object.keys({field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""})},function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return b})),n.d(t,"a",(function(){return h}));var r=n(39),i=n(13),o=n(16),a=n(24),c=n(6),s=n(1),u=n(41);function l(e){if(!e)return[];const t=[];return e.forEach(e=>{const n=e.reformed?e:Object(o.d)(e.id);n&&t.push(n)}),t}function f(e){const t=Object(o.d)(e.uuid);if(t)return Object(a.b)({width:t.originWidth,height:t.originHeight,name:t.serverFileName,id:t.id,originName:t.fileName})}async function d(e,t){let n=[];if(!t)return n;const r=Object(o.d)(t.uuid);if(r)return[r];if(!t)return n;if(t.value){const r=Object(i.i)(t.value);for(const t of r){const r=await d(e,Object(i.f)(e,t));n=n.concat(r)}}else{const{question:r,option:o,optionPart:a}=t;if(!r)return[];if(a){const r=(await Object(i.b)({state:e,varInfo:t,specifiedOpt:o})).map(e=>Object(c.p)(e,"image"));n=n.concat(l(r))}else n=n.concat(l(r.images))}return n}function p(e=""){return e&&"string"==typeof e?e.replace(/##(?:http|data:image).+?#(.*?)##/g,"$1"):e}function b(e=""){return e&&"string"==typeof e?e.replace(/##((?:http|data:image).+?)##/g,"$1"):e}function h(e){async function t(t,n,o){if(!t||!t.id)return[Object(a.c)(t)];if(t.reformed)return[t];if(n&&r.f(t.id))return e.LOOP_IMG.getImages(o);if("media"===t.type)return[Object(a.c)(t)];const c=o.state,s=(await d(c,Object(i.h)(c,{uuid:t.id})))[0];if(!s)return[];if(s.reformed)return[s];const{serverFileName:u,originWidth:l,originHeight:f,id:p,fileName:b}=s;return t={name:u,width:l,height:f,id:p,originName:b},[Object(a.c)(t)]}function n(e,n,r){const{varInfo:{loopNodeId:i}}=r,o=e&&e[n]||"";return"string"==typeof o?Object(s.n)([]):t(o,i,r)}e.QUES_IMAGE.getImages=async t=>{const{varInfo:{question:n,loopNodeId:o},state:c}=t,{images:s}=n;if(!s)return[];let u=[];for(const n of s)if(n.reformed)u.push(n);else if(o&&r.f(n.id)){const n=await e.LOOP_IMG.getImages(t);u=[...u,...n]}else if("media"===n.type)u.push(n);else{const e=await d(c,Object(i.h)(c,{uuid:n.id}));u=u.concat(e)}return u.map(e=>e.reformed?e:Object(a.b)({width:e.originWidth||e.width,height:e.originHeight||e.height,name:e.serverFileName||e.name,id:e.id,originName:e.originName||e.fileName}))},e.OPT_IMAGE.getImages=e=>{const{varInfo:{option:n,loopNodeId:r},specifiedOpt:i}=e,o=i||n;return t(Object(c.p)(o,"image"),r,e)},e.LOOP.getImages=e.LOOP_IMG.getImages=e=>{const{state:t,varInfo:{loopNodeId:n}}=e,i=r.d(t);if(!i)return Object(s.n)([]);const o=r.e(n,i.replacements);return o&&o.image?Object(s.n)([o.image]):Object(s.n)([])},e.OPT_ICON.getIcon=e=>e.specifiedOpt.icon,u.a.forEach(t=>{!function(t){const r=t.split("_")[1];e["OPT_MAP_"+r].getImages=e=>{const{specifiedOpt:r}=e,{mapping:i}=r;return n(i,t,e)}}(t),function(t){const r=t.split("_")[1];e["C_OPT_MAP_"+r].getImages=e=>{const{state:{context:{option:r}}}=e;if(!r)return Object(s.n)([]);const{mapping:i}=r;return n(i,t,e)}}(t),function(t){const i=t.split("_")[1],o="C_IL_MAP_"+i;function a(e,i){return r.a(e,i,r=>{if(!r)return[];const{mapping:i}=r;return n(i,t,e)})}e["C_OL_MAP_"+i].getImages=e=>a(e,0),e[o].getImages=e=>a(e,1)}(t),function(t){const i=t.split("_")[1];e["LOOP_MAP_"+i].getImages=e=>r.g(e,r=>n(r.mapping,t,e))}(t)})}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return s}));var r=n(9);let i;function o(e){if(i)return i;e.sort((e,t)=>e.Value-t.Value>0?1:-1);const t=[];let n,r;return e.forEach(e=>{const i=e.Value;i%1e4==0?(n={...e,id:i/1e4,cities:[]},t.push(n)):i%100==0?(r={...e,id:i/100,counties:[]},n.cities.push(r)):r.counties.push({...e,id:i})}),i=t,t}async function a(){if(i)return i;return o((await Object(r.p)("https://media.choiceform.com/dict/region.json")).provinces)}function c(e){if(!e)return"";const t=e.split("-"),n=t[0],r=i.find(e=>n.indexOf(e.Meaning)>-1);if(!r)return"";const o=r?r.Value+"":"",a=t[1];if(!a)return o;const c=r.cities.find(e=>a.indexOf(e.Meaning)>-1);if(!c)return o;const s=c?c.Value+"":"",u=t[2];if(!u)return s;const l=c.counties.find(e=>u.indexOf(e.Meaning)>-1);return(l?l.Value+"":"")||s||o||""}function s(e){const t=e.split(" ").map(e=>Number(e)),n=t.length,r=i[t[0]];let o,a,c=r.Meaning;return n>1&&(o=r.cities[t[1]],c+="-"+o.Meaning,n>2&&(a=o.counties[t[2]],c+="-"+a.Meaning)),c}},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(3),i=n(0),o=n(2),a=n(38),c=n(22);function s(e){const t=":"+Object(c.a)().LOOP_IMG.uuid;return e.indexOf("-0000-0000-0000-000000000000")&&(e=e.replace("-0000-0000-0000-000000000000",t)),e}function u(e){l(e),f(e)}function l(e){const{image:t,options:n}=e;t&&(t.id=s(t.id),e.images=[e.image],n&&n.forEach(e=>{e.image&&(e.image.id=s(e.image.id))}))}function f(e){const t=e;t.layout&&("cascade"===t.type?t.layout.optMarkOld="normal "+t.layout.optMark:t.layout.optMarkOld=t.layout.optMark)}function d(e,t){return e.filter(e=>e.used).map(e=>(l(e),e.destList=e.destList.filter(e=>!e.designOnly),function(e){const t=e;t.questionText=Object(a.a)(t.questionText),t.describe=Object(a.a)(t.describe);let n=[];t.options&&(n=n.concat(t.options)),t.otherOptions&&(n=n.concat(t.otherOptions)),t.optionsX&&(n=n.concat(t.optionsX)),t.optionsY&&(n=n.concat(t.optionsY)),n.forEach(e=>{e.text=Object(a.a)(e.text)})}(e),function(e,t){if(e.groupId){const n=t.find(t=>t.id===e.groupId);e.groupSingle=n&&n.singlePage}}(e,t),f(e),function(e){const t=(e,t,n)=>(n=n||e.length,e.forEach((e,r)=>{e.index=r+t,e.realIndex=e.index-n}),t+e.length),n=e;if("matrix"===n.type){const e=n.optionsX.length+n.refOptionsX.length,r=t(n.optionsX,0,e);t(n.refOptionsX,r,e);const i=n.optionsY.length+n.refOptionsY.length,o=t(n.optionsY,0,i);t(n.refOptionsY,o,i),t(n.otherOptions,0)}else if(n.options){let e=n.options.length;n.refOptions&&(e+=n.refOptions.length);const r=t(n.options,0,e);n.refOptions&&t(n.refOptions,r,e)}}(e),e))}function p(e){return e.forEach(e=>{e.value=Object(a.a)(e.value)}),e}function b(e){e.version||(Object(i.b)().error(Object(o.f)(r.a.global.upgrade)),Object(i.b)().customAbort()),e.version<2&&e.nodes.forEach(e=>{let t=[];e.options&&(t=t.concat(e.options)),e.otherOptions&&(t=t.concat(e.otherOptions)),t.forEach(e=>{10===e.mutexNumber&&(e.mutexNumber=-1)})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return p}));var r=n(1),i=n(41);const o=[{id:"ar_sa",value:"العربية"},{id:"bg_bg",value:"български"},{id:"cs_cz",value:"Česky"},{id:"da_dk",value:"Dansk"},{id:"de_de",value:"Deutsch"},{id:"el_gr",value:"Ελληνικά"},{id:"en_us",value:"English"},{id:"es_es",value:"Espanol"},{id:"et_ee",value:"Eesti"},{id:"fi_fi",value:"Suomi"},{id:"fr_fr",value:"français"},{id:"hu_hu",value:"Magyar"},{id:"it_it",value:"Italiano"},{id:"ja_jp",value:"日本語"},{id:"ko_kr",value:"한국어"},{id:"nl_nl",value:"Nederlands"},{id:"pl_pl",value:"Polski"},{id:"pt_pt",value:"Português"},{id:"ro_ro",value:"Română"},{id:"ru_ru",value:"Pусский"},{id:"sl_sl",value:"Slovenščina"},{id:"sv_se",value:"Svenska"},{id:"th_th",value:"ไทย"},{id:"zh_cn",value:"简体中文"},{id:"zh_tw",value:"繁體中文"},{id:"vi_vn",value:"Tiếng Việt Nam"}];function a(e,t){e.questionText=t.questionText||"",e.describe=t.describe||""}function c(e,t){e.mapping&&t.mapping&&i.a.forEach(n=>{const r=e.mapping[n];r&&"object"==typeof r||(e.mapping[n]=t.mapping[n]||"")})}function s(e,t){let n=[];e.options&&(n=[...n,...e.options]),e.refOptions&&(n=[...n,...e.refOptions]),e.otherOptions&&(n=[...n,...e.otherOptions]),t.options&&Object.keys(t.options).forEach(i=>{const o=n.find(e=>Object(r.s)(e.uuid)===i);o&&function(e,t,n){(function(e,t){return!e.isRef&&(!!e.isOtherOpt||!["cascade","region","area","location"].includes(t.type))})(e,n)&&(e.text=t.text||""),e.optComment=t.optComment||"",c(e,t),e.selectText=t.selectText,e.autoInputConfig&&t.autoInputConfig&&(e.autoInputConfig.defaultValue=t.autoInputConfig.defaultValue||"")}(o,t.options[i],e)})}function u(e,t){e&&t&&e.logic&&t.logic&&(e.logic.message=t.logic.message||"")}function l(e,t){a(e,t),s(e,t),u(e.validation,t.validation)}const f={};function d(e,t={}){const{nodes:n,variables:i,groups:o}=t,{nodes:a,variables:c,groups:s}=e;a&&n&&Object.keys(n).forEach(e=>{const t=n[e],i=a.find(t=>t.nodeUuid&&Object(r.s)(t.nodeUuid)===e);i&&function(e,t){const n=f[e.type];n?n(e,t):l(e,t)}(i,t)}),c&&i&&Object.keys(i).forEach(e=>{const t=i[e],n=c.find(t=>Object(r.s)(t.uuid)===e);n&&function(e,t){e.value=t.value||""}(n,t)}),s&&o&&Object.keys(o).forEach(e=>{const t=o[e],n=s.find(t=>Object(r.s)(t.id)===e);n&&function(e,t){e.prevText=t.prevText||"",e.nextText=t.nextText||""}(n,t)})}function p(e,t){e&&e.forEach(e=>{e.data.forEach(e=>{const n=e[t];n&&(e.name=n)})})}f.end=(e,t)=>{a(e,t),e.endBtnText=t.endBtnText||""},f.gift=(e,t)=>{a(e,t),e.activityName=t.activityName||"",e.endBtnText=t.endBtnText||"",e.blessings=t.questionText||""},f.loop=(e,t)=>{(t.options||e.options)&&Object.keys(t.options).forEach(n=>{const i=e.options.find(e=>Object(r.s)(e.uuid)===n);i&&(i.text=t.options[n].text)})},f.lottery=(e,t)=>{(t.options||e.options)&&Object.keys(t.options).forEach(n=>{const i=e.options.find(e=>Object(r.s)(e.uuid)===n);i&&(i.rewardName=t.options[n].rewardName)}),t.success&&(e.success.title=t.success.title||"",e.success.summary=t.success.summary||""),t.fail&&(e.fail.title=t.fail.title||"",e.fail.summary=t.fail.summary||"")},f.value_mark=(e,t)=>{l(e,t),e.minText&&(e.minText=t.minText||"",e.maxText=t.maxText||"")},f.menu=(e,t)=>{l(e,t),e.placeholder=t.placeholder||""},f.start=(e,t)=>{e.questionText=t.questionText||"",e.startName=t.startName||"",e.logoText=t.logoText||"",e.startBtnText=t.startBtnText||"",e.nextBtnText=t.nextBtnText||"",e.prevBtnText=t.prevBtnText||"",e.timeoutText=t.timeoutText||"",e.timeLessText=t.timeLessText||"",u(e.validation,t.validation)},f.slide_rate=(e,t)=>{l(e,t),(t.options||e.rateOptions)&&Object.keys(t.options).forEach(n=>{const i=e.rateOptions.find(e=>Object(r.s)(e.uuid)===n);i&&(i.text=t.options[n].text)})},f.matrix=(e,t)=>{if(a(e,t),u(e.validation,t.validation),t.options){let n=[];e.optionsX&&(n=[...n,...e.optionsX]),e.optionsY&&(n=[...n,...e.optionsY]),e.otherOptions&&(n=[...n,...e.otherOptions]);const i=e.options||[];Object.keys(t.options).forEach(e=>{const o=t.options[e],a=i.find(t=>Object(r.s)(t.uuid)===e);if(a)c(a,o);else{const t=n.find(t=>Object(r.s)(t.uuid)===e);t&&(t.text=o.text||"")}})}},f.data=(e,t)=>{s(e,t),e.options&&e.options.forEach(e=>{delete e.optComment,delete e.value})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(68),i=n(5),o=n(8),a=n(0),c=n(63),s=n(50),u=n(9),l=n(1);let f={},d=!1;const p={valid:!0,message:"",result:""};async function b(e,t,n,o,l){const{method:b,embedId:h}=t,m="embed"===b,g="fake"===b;if(Object(a.b)().realTimePreview&&!m&&!g||!function(e){const t=e.params instanceof Array;return"embed"===e.method?!(!t||!e.embedId):!(!t||!e.url)}(t))return{...p};const O=await Object(i.h)(t.url,{state:e}),j=await Object(r.b)(e,t);n&&Object.keys(n).forEach(e=>{n[e]&&(j[e]=n[e])});let v=null;if(m)v=await Object(c.a)(h,j,e);else if("fake"===b)v=await Object(s.a)(O,j,e,o,l);else{let e="GET";"post"===b&&(e="POST");const t=O+e+JSON.stringify(j);let n=l?f[t]:null;if(!n){try{const r=await Object(u.b)(Object(a.c)().dev.parseRealUrl(O),{type:e,data:j,contentType:"application/json"});n=f[t]=r}catch(t){const n=`REAL ERROR:${e} ${O} ${JSON.stringify(t)}`;throw o||Object(a.b)().error(n),n}d&&console.info({...j,url:O},n)}v=n}return v}async function h(e,t,n,r,i){const o=await b(e,t,n,r,i);return void 0===o.valid&&(o.valid=!!o.result),o.valid||o.message||(o.message="^_^"),o}async function m(e,t){try{const{request:n}=t;n&&(await b(e,n,null,!0,!1),e.endRequested=!0,o.a.trigger("END_REQ"))}catch(e){Object(l.c)(e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),i=n(1);const o={findNext(e,t){const{destList:n,output:o}=t;return Object(i.n)({node:Object(r.c)(e,n,o&&o.uuid)})}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return d}));var r=n(4),i=n(6),o=n(17),a=n(0);const c=["logic","loop","random","break_point","check","data","lottery","gift"];function s(e){return e&&"end"!==e.type}function u(e,t){let n;t=function e(t,n){if(!t)return t;const i=t.parentRandomId||t.circleNode1Id;return i&&(t=e(t=Object(r.a)(n,i),n)),t}(t,e);const{output:o,destList:a}=t,{outputN:c}=t,u=Object(i.c)(t);if(o&&(n=Object(r.c)(e,a,o.uuid)),!s(n))if(c)n=Object(r.c)(e,a,c.uuid);else if(u)for(const t of u)if(n=Object(r.c)(e,a,t.uuid),s(n))break;return n}function l(e){return!c.includes(e.type)&&!e.autoSkip}function f(e){const t=function(e){const t=e.renderList.filter(e=>l(e));return Object(o.b)(t,e.current)}(e),n=function(e,t){const{nodeList:n,current:r}=t;let i=e,o=u(n,r);for(;o;)l(o)&&(i+=1),o=u(n,o);return"end"!==r.type&&(i+=1),i}(t,e);if(-1===t)return{index:-1,fullLength:n,percent:0};return{percent:Math.round(t/n*100),fullLength:n,index:t}}function d(e){if(Object(a.c)().dev.infer)return;const{percent:t,index:n}=f(e);n>-1&&Object(a.g)(e,{progress:t})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(54),i=n(21),o=n(5),a=n(7);const c={"-1":6,"-2":8,"-3":5,"-4":7};function s(e){const{varInfo:{limit:t,limitSrc:n}}=e;return!(0===n||!t||"1:0:0"===t)}async function u(e){if(!s(e))return!0;const{varInfo:{limitSrc:t,option:n}}=e,u=e.varInfo.question,l=e.specifiedOpt||n,f=function(e,t){if(0!==t.indexOf("-"))return t;const n=t.split(":"),r=c[n[0]];n[0]=Object(a.a)(r);const i=e.options.filter(e=>e.selected).map(e=>e.number).sort();n[1]=5===r||7===r?Object(a.a)(i[i.length-1]||0):Object(a.a)(i[0]||0);return n.join(":")}(u,e.varInfo.limit),d=Object(r.a)(l,t,e),p=f.split(":"),b=Number(p[0]),h=Object(i.a)(b)?await Object(o.f)(p[1],{...e,joinBy:","}):await Object(o.g)(p[1],e),m=await Object(o.g)(p[2],e);return i.d.input(d,{markId:b,markStart:h,markEnd:m})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return f}));var r=n(0),i=n(1);let o,a={},c=!1;async function s(e,t,n,i,s){const u=e+JSON.stringify(t);if(s){const e=a[u];if(e)return e}const l=o[e];if(!l){const t="FAKE NOT FOUND:"+e;throw Object(r.b)().error(t),t}let f=null;try{if(f=await l(t,Object(r.b)()),f.exception)throw f.exception}catch(e){if(!Object(r.b)().realTimePreview){const t=`FAKE ERROR:${u} ${e.stack&&e.stack.split("\n")[0]}`;throw i||Object(r.b)().error(t),t}f={result:""}}return c&&console.info(t,f),a[u]=f,c&&console.info(JSON.stringify(t),JSON.stringify(f)),f}const u=[/^https:\/\/[^.]+\.choiceform\.com\//,/^http:\/\/localhost/];const l=[];function f(e){let t=e.fakedServers.concat(function(e){if(Object(r.b)().preview)return[];const{parsedPayload:{basicConfig:{collector:{sampler_config:t}}}}=e;return t?["committed_url","examine_failed_url","examine_skipped_url","invalid_url"].reduce((e,n)=>{const r=t[n];if(r&&0===r.indexOf("FAKE:")){const t=r.substring("FAKE:".length,r.lastIndexOf("/"));-1===e.indexOf(t)&&e.push(t)}return e},[]):[]}(e));return t=t.filter(e=>!l.includes(e)),t&&0!==t.length?new Promise((e,n)=>{const i=Object(r.c)().network.getFakeHost(),a=async c=>{i.currentSpace="",function(e){return u.some(t=>!!e.match(t))}(c)||n(new Error("can not load plugin files from untrusted site: "+c)),i.currentSpace=c;try{await Object(r.c)().network.loadFakeFile(c+".js",{crossorigin:"anonymous"})}catch(e){n(e)}return l.push(c),t.length?a(t.pop()):(o=i.fakedServers,i.currentSpace="",void e())};return a(t.pop())}):Object(i.n)()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(15),i=n(16),o=n(2),a=n(0),c=n(6),s=n(1),u=n(7),l=n(10),f=n(41),d=n(33);function p(e,t,n){const r=e&&e[t]||"";if("string"==typeof r)return r;{const{pureText:e,varInfo:{imgSize:t},specifiedOpt:o}=n;return e?o?o.text:"":Object(i.b)(r.url,t,r.originName)}}function b(e){function t(t){e["URL_KEY_"+t].getText=()=>{const e="key"+t,n=Object(l.c)()[e];return Object(s.n)(n)}}e.URL_KEY.getText=()=>{const e=Object(l.c)(),t=e.key1||e.key;return Object(s.n)(t)};for(let e=2;e<=20;e++)t(e);function n(e){const{varInfo:t,state:n}=e;let r;const i=t.question;return i&&(r=i.position&&i.position.address),r||(r=n.address),r}e.YEAR.getText=()=>Object(s.n)((new Date).getFullYear().toString()),e.MONTH.getText=()=>{const e=(new Date).getMonth()+1;return Object(s.n)(Object(d.a)(e))},e.DATE.getText=()=>{const e=(new Date).getDate();return Object(s.n)(Object(d.a)(e))},e.DAY.getText=e=>{const t=(new Date).getDay(),n="zh_cn"===e.state.language?["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][t]:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t];return Object(s.n)(n)},e.QUES_ID.getText=e=>Object(s.n)(e.state.surveyId),e.WX_ID.getText=e=>{const{state:{userInfo:t}}=e,n=t&&t.openid;return Object(s.n)(n)},e.WX_SRC.getText=()=>Object(s.n)(Object(a.c)().name),e.WX_NAME.getText=e=>{const{state:{userInfo:t}}=e,n=t&&t.nickname;return Object(s.n)(n)},e.WX_UN_ID.getText=e=>{const{state:{userInfo:t}}=e,n=t&&t.unionid;return Object(s.n)(n)},e.RES_ID.getText=e=>{const{state:t}=e;return Object(s.n)(t.transactionID)},e.CLTR_ID.getText=()=>Object(s.n)(""),e.CLTR_CODE.getText=()=>Object(a.b)().preview?Object(s.n)(""):Object(s.n)(Object(a.b)().sid),e.CLTR_NAME.getText=e=>{if(Object(a.b)().preview)return Object(s.n)("");const{state:{parsedPayload:t}}=e;if(t){const{basicConfig:{collector:{name:e}}}=t;return Object(s.n)(e)}return Object(s.n)("")},e.START_TIME.getText=e=>{const t=e.state.startTime;return Object(s.n)(Object(u.a)(t))},e.COST_TIME.getText=e=>{const t=(new Date).getTime()-e.state.startTime;return Object(s.n)(Object(u.a)(t))},e.RESULT.getText=async e=>{const{state:t}=e,n=await Object(r.b)(t,"all");return JSON.stringify(n)},e.CURR.getText=e=>{const{state:t}=e;return Object(a.b)().realTimePreview?Object(s.n)(t.language):Object(s.n)(Object(o.c)())},e.LKTP.getText=()=>{const e=Object(a.d)();return Object(s.n)(e)},e.C_OPT_TEXT.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=Object(c.p)(t,"text");return Object(s.n)(n)},e.C_OPT_NUM.getText=e=>{const{state:{context:{option:t}}}=e,n=t&&t.number;return Object(s.n)(Object(u.a)(n))},e.C_OPT_VAL.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=Object(c.p)(t,"value");return Object(s.n)(n)},e.C_OPT_LBL.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=t.label||"";return Object(s.n)(n)},e.C_OPT_IPT.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=`<input data-iptc-holder='${t.renderId}' hidden='true' />`;return Object(s.n)(n)},e.C_OPT_ASI.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=`<input data-asic-holder='${t.renderId}' hidden='true' />`;return Object(s.n)(n)},f.a.forEach(t=>{!function(t){const n=t.split("_")[1];e["C_OPT_MAP_"+n].getText=e=>{const{state:{context:{option:n}}}=e;if(!n)return Object(s.n)("");const{mapping:r}=n,i=p(r,t,e);return Object(s.n)(i)}}(t)}),e.POSITION.getText=e=>{const{state:{point:t}}=e,n=t?t.lat+","+t.lng:"";return Object(s.n)(n)},e.COUNTRY.getText=e=>{const t=n(e),r=t&&t.country;return Object(s.n)(r)},e.PROVINCE.getText=e=>{const t=n(e),r=t&&t.province;return Object(s.n)(r)},e.CITY.getText=e=>{const t=n(e);return Object(s.n)(t&&t.city)},e.DISTRICT.getText=e=>{const t=n(e);return Object(s.n)(t&&t.district)},e.QUES_IMAGE.getText=e=>{const{varInfo:t,pureText:n}=e,r=t.question,o=t.imgSize;if(n){const e=r.images.reduce((e,t)=>e+" "+t.originName,"");return Object(s.n)(e)}{const e=r.images.reduce((e,t)=>e+Object(i.b)(t.url,o,t.originName),"");return Object(s.n)(e)}},e.QUES_DESC.getText=e=>Object(s.n)(e.varInfo.question.description),e.QUES_LABEL.getText=e=>Object(s.n)(e.varInfo.question.label||""),e.QUES_TEXT.getText=e=>Object(s.n)(e.varInfo.question.title),e.QUES_NAME.getText=e=>Object(s.n)(e.varInfo.question.nodeName),e.PHONE_NUMBER.getText=e=>{const t=e.varInfo.question;return Object(s.n)(t.phoneNumber)},e.PASSWORD.getText=e=>{const t=e.varInfo.question;return Object(s.n)(t.code)},e.QUES_TIME.getText=e=>Object(s.n)(Object(u.a)(e.varInfo.question.costTime)),e.QUES_RS.getText=e=>{const t=JSON.stringify(Object(r.a)(e.varInfo.question));return Object(s.n)(t)},e.VALIDATE_FAIL_TIMES.getText=e=>{const t=e.varInfo.question.validateFailTimes+"";return Object(s.n)(t)},e.DVC_BRSN.getText=()=>{const e=Object(a.c)().system.device.browser.name||"unknown";return Object(s.n)(e)},e.DVC_BRSV.getText=()=>{const e=Object(a.c)().system.device.browser.version||"unknown";return Object(s.n)(e)},e.DVC_OSN.getText=()=>{const e=Object(a.c)().system.device.os.name||"unknown";return Object(s.n)(e)},e.DVC_OSV.getText=()=>{const e=Object(a.c)().system.device.os.version||"unknown";return Object(s.n)(e)},e.DVC_VDR.getText=()=>{const e=Object(a.c)().system.device.device.vendor||"unknown";return Object(s.n)(e)},e.DVC_MDL.getText=()=>{const e=Object(a.c)().system.device.device.model||"unknown";return Object(s.n)(e)},e.DVC_TYPE.getText=()=>{const e=Object(a.c)().system.device.device.type||"unknown";return Object(s.n)(e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(46),i=n(21),o=n(27),a=n(11),c=n(5),s=n(2),u=n(0),l=n(3),f=n(1);const d={valid:!0,message:""};async function p(e,t=!1){if(!e.parent.nextLoading&&!t)return d;e.validateFailed=!1;const{validation:n,parent:p}=e;if(!n)return d;const{request:b,logic:h,noPreventNext:m}=n;let g=await function(e,t){if(e){const{parent:n}=t;return Object(r.c)(n,e,null,!1,!1)}return Object(f.n)(d)}(b,e);return g.valid&&(g=await async function(e,t){if(e){const{logicType:n,message:r,options:o}=e;return await Object(i.b)(t,o,n)?d:{valid:!1,message:r||Object(s.f)(l.a.verify.invalidFailed)}}return d}(h,p)),g.valid||(e.validateFailed=!0,m&&(g=d,Object(a.B)(p,e)),g.dueToNode=e,await async function(e,t){if("string"!=typeof e.message)return e;const n=await Object(c.h)(e.message,{state:t});return e.message=n,Object(o.c)(e.message)||(e.message=await Object(c.d)(e.message,{state:t})),e.message.startsWith("vital:")?(e.type="vital",e.message=e.message.substr("vital:".length)):e.message.startsWith("alert:")&&(e.type="alert",e.message=e.message.substr("alert:".length)),e}(g,p),e.validateFailTimes+=1,Object(o.c)(g.message)&&(Object(u.c)().hook.beforeForceLeave(),Object(u.c)().app.openWebLink(g.message),Object(u.b)().customAbort())),g}},function(e,t,n){"use strict";n.r(t),n.d(t,"I18n",(function(){return z})),n.d(t,"EventHub",(function(){return u.a})),n.d(t,"Core",(function(){return V}));var r=n(0),i=n(5),o=n(38),a=n(44),c=n(4),s=n(18),u=n(8),l=n(2),f=n(11),d=n(45),p=n(3),b=n(29),h=n(67),m=n(9),g=n(63),O=n(1),j=n(10),v=n(16),w=n(12);let y,_;async function x(e){const t=function(e){const{mediaLibrary:t,surveyId:n,disabledLangs:r,testCases:i}=e,o=Object(a.b)(e.nodes,e.nodeGroups),s=Object(c.d)(o),u=e.langs.filter(e=>e.locale!==s.currentLang);return{imageList:t.imageList,videoList:t.videoList,nodeList:Object(a.b)(e.nodes,e.nodeGroups),theme:e.theme||{usingTheme:Object(b.b)()},nodeGroups:e.nodeGroups||[],variables:Object(a.d)(e.variables),basicConfig:_,embedApis:e.embedApis||[],varStyles:e.varStyles,surveyId:n,langs:u,language:"",langStore:null,langTable:null,langResume:!1,testCases:i,disabledLangs:r||[]}}(e),{nodeList:n,variables:i,nodeGroups:o}=t,s=t.disabledLangs,u=Object(c.d)(n),f=u.currentLang||"zh_cn",p=[f,...t.langs.map(e=>e.locale)],g=d.a.filter(e=>p.includes(e.id)&&!s.includes(e.id)),O=Object(l.c)(g,f),j=!!Object(r.c)().storage.get("lang-resume");if(j&&Object(r.c)().storage.remove("lang-resume"),await Object(l.g)(O),Object(l.d)(O),t.langTable=g,t.language=O,t.langResume=j,Object(d.b)(u.autoCpltGroups,O),O===f)return t;{const e=t.langs.find(e=>e.locale===O),r=await Object(m.p)(e.url),a=await Object(h.a)(r);return t.langStore=a,Object(d.c)({nodes:n,variables:i,groups:o},a),t}}async function T(){if(y)return y;const e=await async function(){const e=await Object(r.c)().dev.getCustomSummary();if(e)return e;{const e=Object(r.b)().sid;return Object(f.h)(),_||Object(m.f)(e)}}();!function(e){if(Object(r.b)().preview)return void(_=e);if(_)return;_=e;const{collector:{channel_configs:t}}=e,n=Object(r.c)().name,i=t.find(e=>e.type===n);if(i){if(!i.allow_response)throw Object(r.b)().error(Object(m.e)(m.a.interviewee_invalid_error)),new Error(m.a.interviewee_invalid_error);_.channel=i,Object(r.c)().auth.authorize(_)}else _.channel={type:n}}(e),await Object(r.c)().auth.init(e);const t=await async function(e){const t=await Object(r.c)().dev.getCustomSmallPayload();if(t)return t;{let t;try{t=await Object(m.p)(e.smaller_diagram_url)}catch(e){throw Object(r.b)().error(Object(l.f)(p.a.global.downloadError)),e}const n=await Object(h.a)(t);return Object(a.a)(n),n.langs=e.langs||[],n}}(e),n=await x(t),d=await async function(e){if(y)return y;const{imageList:t,nodeList:n,theme:i,variables:a,varStyles:f,surveyId:d,langResume:h}=e;Object(b.a)(i.usingTheme.client);const m=Object(c.d)(n),{imgScale:x,imgTransType:T,imgTransTime:k,imgPosition:S,welcomeUrl:E,startAuto:N,noWxShare:I,startName:C,qsnrName:L,questionText:A,describe:P,logoImage:R,useCustomLogo:M,logoText:D,startBtnText:U,hasVar:B,layout:q,template:F}=m;Object(v.f)({imageList:t,variables:a,varStyles:f}),Object(g.b)(e.embedApis),F&&await Object(r.c)().ui.loadUiTemplates(i.usingTheme,[F.id]);const V=await Object(s.a)({},m);let z="";if(R){const e=R.name;z=Object(r.b)().hostConfig.cdnHost+"/"+e}const{interviewee:$}=_,H=$?$.raw_data:Object(r.c)().auth.userInfo||{},X={template:F,langResume:h,langTable:e.langTable,eventHub:u.a,language:e.language||"zh_cn",layout:q,startNode:m,sid:Object(r.b)().sid,noWxShare:I,preview:Object(r.b)().preview,title:Object(o.a)(C||L),summary:Object(o.a)(A),description:Object(o.a)(P),images:V,surveyId:d,useCustomLogo:M,customLogo:z,customText:D||"",nextButton:U||Object(l.f)(p.a.global.start),theme:Object(b.e)(i),imgScale:x,imgPosition:S,imgTransType:T,imgTransTime:k,welcomeUrl:E,userInfo:H,hasVar:B,parsedPayload:e,startAuto:N||h,handleEvents:{handleLangChange:e=>Object(O.n)(Object(l.a)(e.id,!1)),async handleNextClick(){Object(w.m)(X,!0),await Object(r.b)().fetchSurveyState(),Object(r.c)().app.gotoSurveyPage(Object(j.c)()),Object(w.m)(X,!1)}}};return X}(n);return await async function(e){const t=e,n={state:t};e.title=await Object(i.d)(e.title,n),e.summary=await Object(i.d)(e.summary,n),e.description=await Object(i.d)(e.description,n),e.template=await Object(r.c)().ui.initNodeTemplate(e.template,t,null),Object(b.d)(e.theme),y=e,Object(u.c)({})}(d),await Object(r.c)().hook.afterFetchStart(d),(d.startAuto||Object(r.c)().dev.autoRun||Object(r.b)().liteTemplate)&&(d.hidden=!0,setTimeout(()=>{d.handleEvents.handleNextClick()})),d}var k=n(36),S=n(59),E=n(7),N=n(70),I=n.n(N);const C=()=>Object(O.n)(null),L={name:"other",dev:{parseRealUrl:e=>e,getCustomSmallPayload:C,getCustomSummary:C,local:!1,debug:!1,autoRun:!1,realtime:!1,infer:!1},app:{reload(){},openWebLink(){},canHandleReward:()=>!1,getRewardUrl:e=>Object(j.a)("https:/q.choiceform.com/reward",e)},network:{initUploader:C,connectSocket(){},closeSocket(){}},storage:null,auth:{userInfo:{},init:C,authorize(){},authorizeGift(){},retrieveAuthMeta:()=>null},hook:{afterFetchReward:C,afterFetchStart:C,afterFetchSurvey:C,afterSetup:C,beforeSetupEnd:C,beforeForceLeave(){},onLangChange(){},onSwitchPage(){},onTitleChange(){}},system:{device:{browser:{name:"",version:""},device:{type:"",vendor:"",model:""},engine:{name:"",version:""},os:{name:"",version:""}},inflate:(e,t)=>Object(O.n)(I.a.inflate(e,t)),getReferer:()=>"",getLang:()=>"zh_cn",functionConstructor:Function,translate(e,t){if(t){let n=t?Object(l.b)(e):e;return t&&Object.keys(t).forEach(e=>{n=n.replace(new RegExp(`{${e}}`,"g"),Object(E.a)(t[e]))}),n}return e}},ui:{setGlobalStyle(){},setVarStyle(){},initNodeTemplate:C,loadUiTemplates:C,getImageSize:()=>Object(O.n)({width:100,height:100})}};function A(e){return function e(t,n){Object.keys(n).forEach(r=>{const i=n[r];"object"==typeof i?t[r]?null!==i&&e(t[r],i):t[r]=i:void 0!==i&&(t[r]=i)})}(L,e),L}var P=n(34),R=n(57);const M={clientName:"ALL",key:"",dynamic:!1,treeUrl:"",templatePath:"",useWxSdk:!1,hostConfig:{qStaticHost:"https://media.choiceform.com/q-static-assets",sentryKey:"https://c2a21df7b3794fc6a8854f0a51e0e790@sentry.choiceform.io/8",recordUrl:"https://tracking.choiceform.com/api/records",host:"https://osapi.choiceform.com",wsHost:"wss://osapi.choiceform.com",cdnHost:"https://media.choiceform.com",publicHost:"https://public.choiceform.com",dictUrl:"https://media.choiceform.io/os-editor/assets/UploadFiles/Dictionary/Dictionary.js"},setTheme(){},locateError(){},langSrcMap:null,setLocale(){},customAbort(){},switchRoute:null,setter(e,t){Object.keys(t).forEach(n=>{e[n]=t[n]})}};var D=n(17),U=n(15);function B(e,t){const n=Object(r.b)().startState,o=[{title:Object(i.k)(n.title),description:Object(i.k)(n.description)}];return t.forEach(t=>{const n=Object(D.c)(e,t);if(!Object(c.w)(n)){const e={title:Object(i.k)(n.title),description:Object(i.k)(n.description),value:t.region||"",options:t.items?t.items.map(e=>({text:e.row_content||e.col_content?e.row_content+"-"+e.col_content:e.content,value:Object(U.c)(e).toString()})):[]};o.push(e)}}),o}var q=n(14);function F(){if(!V.initialized)throw new Error("CFCore not yet initialized")}const V={eventHub:u.a,notifySuspended:!1,util:{inflate:(e,t)=>I.a.inflate(e,t),convertVarStyle:v.a,richTextToNodes:P.d,getTaskInfo:async function(){const{surveyState:e,offlineTaskId:t}=Object(r.b)();if(!t||!e)return null;const n=await Object(U.b)(e,"all");return{result:n,progress:e.progress,nodes:B(e,n.answers)}}},registerEnv(e){const t=A(e);Object(r.f)(t),V.env=t},getTheme:()=>Object(b.c)(),async setup(e){if(V.initialized)return V;if(e.dynamic&&(!e.templatePath||!e.treeUrl))throw new Error("setup error, you configed your client as dynanmic, so must provide tempaltePath and treeUrl");Object.assign(V,function(e){const t={...M.hostConfig,...e.hostConfig};return Object.assign(M,{...e,hostConfig:t}),M}(e)),Object(r.a)(V.setter);const t=Object(j.c)(),n=t.sid;if(!n&&!Object(r.c)().dev.realtime)throw new Error("setup error, must provide sid");V.sid=n,V.realTimePreview=Object(r.c)().dev.realtime,V.liteTemplate=!!t.lite_template;const i=t.type;V.preview=V.realTimePreview||V.sid.length>30||"edit_template"===i||"preview_template"===i,V.preview&&(V.needPreviewFlag="1"!==t.ban_preview_bar),Object(p.f)(V.langSrcMap);const o=V.customAbort;V.customAbort=e=>{if(o&&o(),V.notifySuspended=!0,!e)throw new Error(" _custom_abort_ over")};const a=V.error;V.error=e=>{V.startState||V.rewardState||V.setTheme(Object(b.b)()),a(e),V.crashed=!0};const c=V.notify;return V.notify=e=>{V.notifySuspended||(V.startState||V.rewardState||V.setTheme(Object(b.b)()),c(e))},Object(r.c)().dev.debug&&(V.hostConfig.host="https://osapi.choiceform.com",V.hostConfig.cdnHost="https://media.choiceform.com"),V.hostConfig.qApiHost=V.hostConfig.host+"/q/v1",await Object(r.c)().hook.beforeSetupEnd(V),Object(r.e)(V),V.initialized=!0,await Object(l.g)(Object(l.c)()),await Object(r.c)().hook.afterSetup(V),await Object(r.c)().hook.beforeSetupEnd(V),V},async fetchStartState(e=""){F(),V.offlineTaskId=V.preview?"":e;const t=await T();return t.core=V,V.startState=t,Object(r.c)().hook.onTitleChange(t.title),t},async fetchSurveyState(){F(),V.startState&&Object(w.m)(V.startState,!0);const e=await Object(k.a)();return e.core=V,V.surveyState=e,Object(w.m)(V.startState,!1),Object(r.c)().hook.onTitleChange(e.title),e},async fetchRewardState(){F();const e=await Object(S.a)();return e.core=V,V.rewardState=e,Object(r.c)().hook.onTitleChange(e.quesTitle),e},reset(){V.offlineTaskId="",V.initialized=!1,y=null,_=null,V.startState=null,Object(k.c)(),V.surveyState=null,Object(S.c)(),V.rewardState=null,Object(j.f)(),Object(v.g)(),Object(R.a)(),Object(q.f)()}},z={mergeLangSrcMap:p.f,getLangSrcMap:p.d}},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d}));var r=n(22),i=n(7),o=n(25);function a(e){return e.selected}function c(e){return!e.selected}function s(e,t){return Object(o.b)(e,t)}function u(e,t){return!Object(o.b)(e,t)}const l=(e,t,n,r=!1)=>{if(Object(i.b)(t[n]))return NaN;const o={};e.forEach(e=>{let t=(e[n]+"").replace(/(\s| )/g,"");const r=parseFloat(t);isNaN(r)||(t=r),Object(i.b)(t)||(o[t]?o[t].push(e):o[t]=[e])});const a=Object.keys(o).sort((e,t)=>{const n=Number(e),i=Number(t);return isNaN(n)||isNaN(i)?r?e>t?1:-1:e<t?1:-1:r?n>i?1:-1:n<i?1:-1});for(let e=0;e<a.length;e++){if(o[a[e]].indexOf(t)>-1)return e+1}return NaN},f={};function d(e,t,n){const i=f[t];return i?i(function(e){let t=null;const{varInfo:n}=e,i=n.question,o=n.nodePart,{selectIds:l,unselectIds:f,inputIds:d,uninputIds:p}=function(){const e=Object(r.a)(),t=[e.CHECKED_OPTS.uuid,e.RANKED_OPTS.uuid,e.MATCHED_OPTS.uuid],n=[e.UNCHECKED_OPTS.uuid,e.UNRANKED_OPTS.uuid,e.UNMATCHED_OPTS.uuid],i=[e.INPUTTED_OPTS.uuid,e.MARKED_OPTS.uuid],o=[e.UN_INPUTTED_OPTS.uuid,e.UNMARKED_OPTS.uuid];return{selectIds:t,unselectIds:n,inputIds:i,uninputIds:o}}();o&&(l.indexOf(o.uuid)>-1?t=a:f.indexOf(o.uuid)>-1?t=c:d.indexOf(o.uuid)>-1?t=s:p.indexOf(o.uuid)>-1&&(t=u));return t?i.options.filter(e=>t(e,i)):i.options}(n),e):NaN}f[1]=(e,t)=>t.number,f[14]=(e,t)=>l(e,t,"number",!0),f[15]=(e,t)=>l(e,t,"number",!1),f[2]=(e,t)=>t.text,f[12]=(e,t)=>l(e,t,"text",!0),f[13]=(e,t)=>l(e,t,"text",!1),f[3]=(e,t)=>t.value,f[4]=(e,t)=>l(e,t,"value",!0),f[5]=(e,t)=>l(e,t,"value",!1),f[6]=(e,t)=>t.sortNo,f[7]=(e,t)=>l(e,t,"sortNo",!0),f[8]=(e,t)=>l(e,t,"sortNo",!1),f[9]=(e,t)=>t.value,f[10]=(e,t)=>l(e,t,"value",!0),f[11]=(e,t)=>l(e,t,"value",!1)},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(5),i=n(10),o=n(8),a=n(27),c=n(9),s=n(50),u=n(1),l=n(7),f=n(68);function d(e){const t=Object(l.a)(e.result);e&&Object(a.c)(t)&&setTimeout(()=>{Object(i.d)(t)})}async function p(e,t){let n="";const{parsedPayload:{basicConfig:{collector:i}}}=e;if(!i)return;const{sampler_config:o}=i;o&&(n=o[t]||"");if(!n||0!==n.indexOf("BACKEND:"))return;const a=n.replace("BACKEND:",""),c={};for(const t of a){const[n,i]=t.split("=");c[n]=await Object(r.j)(i,e)}return c}function b(e,t){const{parsedPayload:{basicConfig:{collector:{sampler_config:n}}}}=t;if(!n||!n[e])return o.a.trigger("SAMPLER_TRANSFER",{method:"ABORT"}),Object(u.n)();const a=n[e];return 0===a.indexOf("BACKEND")?Object(u.n)():0===a.trim().indexOf("http")?async function(e,t,n){const a=await Object(r.j)(n,e,!0);Object(i.d)(a),o.a.trigger("SAMPLER_TRANSFER",{method:"LINK",url:a,type:t})}(t,e,a):async function(e,t,n){const a=n.indexOf(":"),l=n.substr(0,a).toUpperCase(),p=n.substr(a+1),b=p.indexOf("?");let h=-1===b?p:p.substr(0,b);h=await Object(r.j)(h,e,!0);let m={};if(-1!==b){const t=-1===b?"":p.substr(b);if(t){m=t?Object(i.e)(t):{};const n=Object.keys(m);for(const t of n){const n=m[t].match(/^{{(.+?)}}$/);n&&(m[t]=await Object(r.b)(n[1],e))}}}if("FAKE"===l){d(await Object(s.a)(h,Object(f.a)(m,e),e,!1,!1))}else if("GET"===l||"POST"===l){const e="GET"===l?"GET":"POST";try{d(await Object(c.q)(h,{type:e,data:m}))}catch(e){Object(u.c)("数据转移接口出错"+JSON.stringify(e))}}o.a.trigger("SAMPLER_TRANSFER",{url:h,data:m,method:l,type:t})}(t,e,a)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g}));var r=n(35),i=n(4),o=n(1),a=n(0),c=n(7),s=n(26),u=n(25);const l={refresh:!1,result:!0},f={refresh:!0,result:!0},d={};function p(e,t,n){const{width:r,height:i}=t,o=n.value||"data:image/gif;base64,R0lGODlhAQABAAAAACw=";o&&Object(a.g)(e,{image:{name:void 0,ratio:Math.round(i/r*1e5)/1e5,url:o,natural:o,thumbnail:o,large:o,width:r,height:i,reformed:!0,id:"faked-id-for-upload-image",originName:"uploaded image"}})}function b(e,t){return Object(c.a)(e)!==Object(c.a)(t.value)}function h(e,t,n){return b(e,t)?(Object(a.g)(t,{value:e}),Object(s.c)(t,n),f):l}async function m(e,t,n){if(t.isOtherOpt)return h(e,t,n);{const i=d[n.type],o=i?await i(e,t,n):h(e,t,n);return o.noValidate||Object(r.b)(n,t),o}}function g(e,t,n){t.atcpTrigger=e,Object(r.b)(n,t)}d.icon_mark=(e,t,n)=>(e=e===t.value?e-1:e,Object(a.g)(t,{value:e}),Object(s.c)(t,n),Object(o.n)(f)),d.weight=(e,t,n)=>{if(!b(e,t))return Object(o.n)(l);const{options:r}=n,i=n.weightTotal,c=r.reduce((e,n)=>n!==t?e+Number(n.value):e,0),u=i-c;return e>u&&(e=u),Object(a.g)(t,{value:e}),r.forEach(e=>{const t=Number(e.value);Object(a.g)(e,{percent:t/i*100+"%"})}),Object(s.c)(t,n),Object(o.n)(f)},d.upload=async(e,t,n)=>{e||(e=Object(s.a)()),Object(a.g)(t,e),await async function(e){const{max:t}=await Object(i.g)(e),n=t===e.options.filter(t=>Object(u.b)(t,e)).length;Object(a.g)(e,{fullUploaded:n})}(n);return p(t,await Object(a.c)().ui.getImageSize(e.value),e),Object(s.c)(t,n),{refresh:!0,result:!0}},d.slide_rate=(e,t,n)=>{const r=h(e,t,n);return Object(s.c)(t,n),Object(o.n)(r)},d.fill=(e,t,n)=>{const r=h(e,t,n);return Object(o.n)(r)},d.sequence=(e,t,n)=>(Object(a.g)(t,{sortNo:e,selected:-1!==e}),Object(s.c)(t,n),Object(o.n)(f))},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return _}));var r=n(8),i=n(9),o=n(15),a=n(11),c=n(46),s=n(12),u=n(19),l=n(1),f=n(55),d=n(14),p=n(0),b=n(2),h=n(3),m=n(7);const g={valid:!0,message:""},O={valid:!1,message:""};let j=!1,v=!1,w=!1;function y(){j=!1,v=!1,w=!1}function _(e,t,n,y){const _=[];let k=y.prev;for(;k!==n;)_.push({prev:k,next:y}),k=(y=k).prev;return _.push({prev:k,next:y}),async function e(t,n,y){const _=y.pop(),k=await function(e,t,n,y){const _=n.checkMode,k=y.checkMode,S=y.type;"end"===S&&(clearInterval(e.timer),Object(p.g)(e,{limitTime:void 0}));if(Object(p.b)().preview)return Object(l.n)(t);if(_){if("end"===S)return async function(e,t,n){if(w)return O;Object(p.c)().network.closeSocket(),w=!0;const u=x(e,n);Object(s.m)(e,!0);try{const t=await Object(o.b)(e,"all","examine_skipped_url"),n=await Object(i.l)(t,e.transactionID);e.responseStatus=n.status}catch(t){const n=Object(m.a)(t&&t.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("skip提交失败 "+n),Object(p.b)().notify(Object(b.f)(h.a.global.tryAgain)),w=!1,Object(s.m)(e,!1),O)}r.a.trigger("CHECK_FAIL"),Object(p.c)().network.closeSocket();try{Object(d.b)(e),u||Object(a.f)(t,n,e),await Object(c.a)(e,n),Object(s.m)(e,!1),T(e),await Object(f.b)("examine_skipped_url",e)}catch(e){Object(l.c)("skip提交后续处理失败"+JSON.stringify(e))}return g}(e,n,y);if(!k)return async function(e){if(v)return O;v=!0,Object(s.m)(e,!0);const t=await Object(o.b)(e,"check","examine_skipped_url"),n=t.answers.length;try{const o=await Object(i.k)(t,e.transactionID);return Object(a.g)(e,n),Object(s.m)(e,!1),e.responseStatus=o.status,r.a.trigger("CHECK_SUBMIT"),g}catch(t){Object(d.b)(e),Object(s.m)(e,!1);const o=Object(i.d)(t);return o===i.a.quota_not_match||o===i.a.quota_full?(Object(a.v)(e,n),T(e),await Object(f.b)("examine_failed_url",e),e.responseStatus="examine_failed",r.a.trigger("QUOTA_FAIL"),Object(p.c)().network.closeSocket()):(v=!1,Object(l.c)(t.message),Object(p.b)().notify(Object(b.f)(h.a.global.tryAgain))),O}}(e)}if("end"===S)return async function(e,t,n){if(j)return O;Object(p.c)().network.closeSocket(),j=!0;const v=x(e,n)||function(e,t){const{renderList:n,startTime:r}=e,i=Math.ceil((Date.now()-r)/1e3),o=function(e,t){const n=Object(b.f)(h.a.global.notTarget),{minTime:r,timeLessText:i}=e;if(r&&r>t)return i||n;return""}(e,i);if(o){e.fakeCommitted=!0;const r=n[n.length-1];return Object(p.g)(r,{hasReward:!1,title:o}),Object(a.y)(t,e),!0}return!1}(e,n);Object(s.m)(e,!0);const w=await Object(o.b)(e,"normal","committed_url");let y;try{y=await Object(i.m)(w,e.transactionID);const t=y.response||y;e.responseStatus=t.status}catch(t){const n=Object(m.a)(t&&t.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("正式提交失败 "+n),Object(p.b)().notify(Object(b.f)(h.a.global.tryAgain)),Object(s.m)(e,!1),j=!1,O)}e.formalResult=y;try{await Object(c.a)(e,n),v?await Object(f.b)("invalid_url",e):(Object(a.i)(n,e,w.answers.length,y),y.reward&&Object(p.g)(n,{hasReward:!0}),await function(e,t){const{formalResult:{reward:n}}=t;if(!n||"red_envelope"!==n.type||n.lottery_id||Object(p.c)().app.canHandleReward())return Object(l.n)();return Object(u.a)(t,e)}(n,e),await Object(f.b)("committed_url",e))}catch(e){Object(l.c)("正式提交后续处理错误"+JSON.stringify(e))}return Object(d.b)(e),Object(s.m)(e,!1),T(e),r.a.trigger("FULL_SUBMIT"),await e.dynamicStateProps(),g}(e,0,y);return Object(l.n)(t)}(t,n,_.prev,_.next);return 0===y.length||"vital"===k.type?k:e(t,k,y)}(e,t,_)}function x(e,t){const{oneReplyPerTerminal:n,sid:r}=e;return!!t.abandonAnswer&&(e.fakeCommitted=!0,Object(a.a)(t,e),n&&Object(p.c)().storage.set(r,"1"),!0)}function T(e){const{oneReplyPerTerminal:t,sid:n}=e;t&&Object(p.c)().storage.set(n,"1")}},function(e,t,n){"use strict";n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(43),i=n(6),o=n(62),a=n(66),c=n(35),s=n(28),u=n(0),l=n(26);function f(e,t,n,r){e&&(Object(u.g)(e,{selected:!0}),t.forEach(t=>{t!==e&&Object(u.g)(t,{selected:!1})})),Object(u.g)(r,{value:n})}const d={};function p(e,t){const n=d[t.type],r=n?n(e,t):s.a;return r.noValidate||Object(c.b)(t),r}function b(e){return e.failed=!0,e.succeed=!1,e.failedSkip&&(e.failedSkipActivated=!0,e.autoSkip=!0),s.c}d.region=(e,t)=>{t.indexes=e;const n=Object(i.c)(t),a=Object(r.c)(e);f(Object(o.b)(n,a),n,a,t);const c=a.split("-"),u={country:"",province:c[0]||"",city:c[1]||"",district:c[2]||""};return t.parent.address=u,t.position={address:u},s.c},d.location=(e,t)=>{t.succeed=!0,t.failed=!1,t.failedSkipActivated=!1;const n=Object(a.b)(e.address,"-",t.infoRange),r=Object(i.c)(t);return f(Object(o.b)(r,n),r,n,t),Object(u.g)(t.parent,{point:e.point,address:e.address}),t.position=e,s.c},d.area=(e,t)=>{t.succeed=!0,t.failed=!1,t.failedSkipActivated=!1;const n=Object(a.b)(e.address,"-","street"),r=Object(i.c)(t);return f(Object(o.a)(r,e.point),r,n,t),Object(u.g)(t.parent,{point:e.point,address:e.address}),t.position=e,s.c},d.verify=(e,t)=>(Object(u.g)(t,e),{...s.c,noValidate:!0}),d.gift=(e,t)=>(Object(u.g)(t,e),s.d),d.heat_map=(e,t)=>{const n={x:Math.round(e.x),y:Math.round(e.y)},{options:r}=t,i=r[t.clickTimes%r.length];return Object(u.g)(i,{point:n,value:JSON.stringify(n)}),t.clickTimes+=1,Object(l.c)(i,t),s.d}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return _})),n.d(t,"a",(function(){return x}));var r=n(4),i=n(24),o=n(33),a=n(18),c=n(5),s=n(10),u=n(1),l=n(0),f=n(2),d=n(28),p=n(58),b=n(8),h=n(11),m=n(3),g=n(29),O=n(9),j=n(64);let v=null;function w(){return JSON.parse(Object(l.c)().storage.get("theme")||"null")||Object(g.b)()}async function y(e,t,n=!1){let s;s=Object(l.b)().preview||!e.formalResult.reward?{}:e.formalResult.reward;const d=!!s.id||Object(l.b)().preview;let p,b,h={},g="",O={},j=1e3;if("gift"===t.type)p=t;else{const o=s.gift_id&&s.gift_id.toUpperCase();if(b=t,o)p=Object(r.a)(e.nodeList,o),g=((e,t,n)=>{if(!t)return"";const i=t.destList,o=t.options.find(t=>{const o=Object(r.c)(e,i,t.uuid);return Object(u.l)(o.nodeUuid,n)});return o?o.rewardName:""})(e.nodeList,b,p.nodeUuid);else{if(n)p={};else{const n=t.destList[0].destInputId;p=Object(r.b)(e.nodeList,n)}g=t.options[0].rewardName}O=((e,t,n=!1)=>{if(!t)return{};const r=Object(l.b)().realTimePreview?"":n?Object(f.f)(m.a.lottery.congratulation):Object(f.f)(m.a.lottery.pity),o=Object(l.b)().realTimePreview?"":n?Object(f.f)(m.a.lottery.goal):Object(f.f)(m.a.lottery.fail),a=n?t.success.imageWidth:t.fail.imageWidth,c=n?t.success.imageHeight:t.fail.imageHeight,s=n?t.success.imageName:t.fail.imageName,u={rewardTitle:(n?t.success.title:t.fail.title)||r,rewardDescribe:(n?t.success.summary:t.fail.summary)||o};return s&&(u.rewardImage=Object(i.b)({width:a,height:c,name:s,id:"",originName:""})),u})(0,b,d),j=((e,t,n,i=!1)=>{if(!t)return 1e3;const o=t.options,a=i?o[0]:o.find(i=>{const o=Object(r.c)(e.nodeList,t.destList,i.uuid);return Object(u.l)(o.nodeUuid,n.nodeUuid)});return a?a.rewardCount:1e3})(e,b,p,n)}if(d){const t=await Object(c.d)(p.activityName,{state:e}),n=await Object(c.d)(p.blessings,{state:e}),r=await Object(c.d)(p.describe,{state:e}),i=await Object(c.h)(p.linkUrl,{state:e});let u=s.code;u||!0!==p.needVerification||(u="1234567890"),h={goal:!0,goalId:s.id,origin:p,...p,...h,noWxShare:e.noWxShare,wxShareInfo:e.wxShareInfo,quesTitle:e.title,quesType:"reward",images:await Object(a.a)(e,p),rewardName:g,activityName:t,blessings:n,describe:r,linkUrl:i,endBtnText:p.endBtnText,rewardCount:p.giftCount,lotteryCount:j,sendTime:Object(o.c)(),verifyCode:u,rewardNodeId:p.nodeUuid,logoUrl:"",transactionID:e.transactionID,surveyId:e.surveyId,title:e.title,companyID:e.companyID,useCustomLogo:e.useCustomLogo,customText:e.customText,customLogo:e.customLogo,...O}}else h={goal:!1,...O};return Object(l.g)(e,{rewardInfo:h}),n||Object(l.c)().storage.set("reward_info",JSON.stringify(h)),h}function _(){v=null}async function x(){if(v)return v;let e;const t=w();Object(g.a)(t.client);const n=Object(s.c)();let r=function(e){const{rid:t,rtpl:n}=e;let r={};if(t)r={quesTitle:"",rewardType:"red_envelope",goalId:e.rid,images:[]};else{const e=Object(l.c)().storage.get("reward_info")||"null";r=JSON.parse(e),r.rewardType=r.giftType}n&&(r.template={id:n,name:"",component:null});return r}(n);const{rewardType:i,goalId:a}=r,c=n.code;if("red_envelope"===i){!n.rid||n.code||Object(l.b)().preview||(Object(l.c)().auth.authorizeGift(n.aid,n.cid,n),Object(l.b)().customAbort());const t=await Object(O.h)({code:c},a),{recipient:i}=t;n.rid&&(r=function(e,t,n){const{gift:r,amount:i,type:a}=t,{config:{gift_name:c}}=r;return{...e,surveyId:n.qid,transactionID:n.tid,nodeUuid:r.id,origin:{giftType:a},rewardCount:i/100,activityName:c,blessings:r.title,title:r.title,summary:r.description,describe:r.description,sendTime:Object(o.c)()}}(r,t,n));const s=i;c&&Object(l.c)().storage.set("gift-"+c,JSON.stringify(t)),Object(h.j)(r,{...r,userInfo:s});e={...await T(r),wechatImage:s.headimgurl,wechatID:s.nickname}}else e=await T(r);return v=e,await Object(l.c)().hook.afterFetchReward(e),e}async function T(e){const t=e.origin.giftType;let n=!1,r="",i="";"custom"===t?(n=!0===e.origin.needSendNote,r=e.verifyCode):i=e.rewardCount+" 元";const o=Object(l.c)().storage.get("language")||"zh_cn",a=w();e.template&&await Object(l.c)().ui.loadUiTemplates(a,[e.template.id]),await Object(f.g)(o),Object(f.d)(o),Object(g.d)(a);const c={...e,wechatID:"",wechatImage:"",eventHub:b.a,language:o,theme:a,rewardName:e.activityName,title:e.blessings,description:e.describe,summary:e.describe,nodeType:"reward",quesType:"reward",icon:"present-gift",rewardType:t,rewardTime:e.sendTime,rewardValue:i,rewardToMessage:n,qrCode:r,prevButton:Object(l.b)().preview&&!Object(l.b)().realTimePreview?Object(f.f)(m.a.global.backTest):"",nextButton:e.linkUrl&&(e.endBtnText||Object(f.f)(m.a.global.go)),handleEvents:{...j.a,handlePrevClick:()=>(Object(l.c)().app.gotoStartPage(Object(s.c)()),Object(u.n)()),handleOptionClick:async(e,t)=>(await Object(d.b)(e,t)).result,handleQuestionInput(e,t){const n=Object(p.b)(e,t);return Object(u.n)(n.result)},handleNextClick:()=>(e.linkUrl&&Object(s.d)(e.linkUrl),Object(u.n)())}};return c.template=await Object(l.c)().ui.initNodeTemplate(e.template,c,null),c}},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"c",(function(){return p}));var r=n(4),i=n(1),o=n(47),a=n(18),c=n(31),s=n(5),u=n(6);async function l(e,t){const n=await Object(a.e)(e,t,null,!0);return Object(c.b)(t,n)}function f(e,t,n=!1){const{loopStack:r}=t;return r.find((t,o)=>(!n||o===r.length-1)&&Object(i.l)(t.node.nodeUuid,e.nodeUuid))}async function d(e,t,n,r,i,o){const a=Object(u.i)(i),c={state:e,usage:{question:t,option:i}},l=await Object(s.f)(a.text,c,"WRAPPED_URL"),f=await Object(s.f)(i.text,c,"WRAPPED_URL"),d=await Object(s.f)(a.value+"",c,"WRAPPED_URL");return{loopNodeId:n,outerIndex:o&&o.currentIndex,outerLoopId:o&&o.node.nodeUuid,index:r,uuid:i.uuid,refOptId:i.refOptId,refText:l||void 0,text:f||"",value:d,number:a.number,image:a.image,label:i.label,mapping:i.isRef?a.mapping:i.mapping}}const p={_skip:(e,t,n)=>o.a.findNext(e,t,n),async _init(e,t,n){const{varList:o,loopStart:a,destList:c}=t;if(0===o.length)return p._skip(e,t,n);const{loopStack:s}=n,u=c.find(e=>Object(i.l)(e.selfPortId,a.uuid)).destInputId,l=Object(r.b)(e,u),f=o[0],{origin:b}=t,h=s[s.length-1],m=await d(n,t,b.nodeUuid,0,f,h),g={destInputId:u,node:b,varList:o,replacements:h?[...h.replacements,m]:[m],currentIndex:0};return s.push(g),{node:l,loop:Object(i.b)(g),loopStack:Object(i.b)(s)}},async _increase(e,t,n){const{nodeUuid:o}=t,{loopStack:a}=n,c=a[a.length-1],{varList:s,replacements:u,destInputId:l}=c,f=c.currentIndex+=1,p=s[f],b=a[a.length-2],h=await d(n,t,o,f,p,b),m=Object(r.b)(e,l);return u[u.length-1]=h,{node:m,loop:Object(i.b)(c),loopStack:Object(i.b)(a)}},async _end(e,t,n){const{loopStack:r}=n;r.pop();const a=await o.a.findNext(e,t,n);if(r.length>0){const e=Object(i.b)(r);a.loop=e[e.length-1],a.loopStack=e}return a},findNext(e,t,n){const r=f(t,n,!0);if(r){const{currentIndex:i,varList:o}=r;return i===o.length-1?p._end(e,t,n):p._increase(e,t,n)}return p._init(e,t,n)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));function r(e,t){return e.endsWith(".svg")?e:e+t}function i(e=[]){const t=[];return e.includes("video")&&t.push("video/*"),e.includes("audio")&&t.push("audio/*"),e.includes("image")&&t.push("image/*"),e.includes("doc")&&t.push("text/plain","application/json","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv",".docx",".pdf",".log"),t.join()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var r=n(66);function i(e,t){return e.find(e=>e.radius>=Object(r.a)(t,{lng:e.longitude,lat:e.latitude}))||e[e.length-1]}function o(e,t){if(0===e.length)return;const n=t.split("-");return e.find(e=>e.text.split("-").every((e,t)=>{const r=n[t];return!!(r&&r.indexOf(e)>-1)}))||e[e.length-1]}function a(e,t){const n=t.map(e=>e.Meaning).indexOf(e[0]);let r=String(n);const i=t[n];if(e[1]&&i){const t=i.cities.map(e=>e.Meaning).indexOf(e[1]);r+=" "+t;const n=i.cities[t];if(e[2]&&n){r+=""+n.counties.map(e=>e.Meaning).indexOf(e[1])}}return r}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s}));var r=n(0),i=n(65);let o=[];function a(e){let t,n=e.code.replace(/<br>/g,"");n=`(function(){ /* embedApi.${e.name} */ ${n}})()`;try{return t=Object(i.a)(n,!0),t}catch(e){return()=>({result:"",message:""})}}function c(e){e&&(e.forEach(e=>{e.fn=a(e)}),o=e)}async function s(e,t,n){const i=function(e){const t=o.find(t=>t.id===e);return t?(t.fn||(t.fn=a(t)),t.fn):null}(e);let c;try{c=await i(t,Object(r.b)())}catch(t){const n=`EMBED ERROR:${function(e){const t=o.find(t=>t.id===e);return t?t.name:e}(e)} ${t.stack&&t.stack.split("\n")[0]}`;Object(r.b)().error(n)}return c}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r={handleInputPhone(e,t){return this.handleQuestionInput({phoneNumber:e},t)},handleInputCode(e,t){return this.handleQuestionInput({code:e},t)},handleAutoLocate(e,t){return this.handleQuestionInput(e,t)},handleManualLocate(e,t){return this.handleQuestionInput(e,t)},handleGetCodeClick(e){return this.handleOptionClick(null,e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return new(0,Object(r.c)().system.functionConstructor)(`${t?"return":""} ${e}`)()}},function(e,t,n){"use strict";function r(e,t="-",n="street"){let r=e.province;return"province"!==n&&e.city&&(r+=t+e.city,"city"!==n&&e.district&&(r+=t+e.district,"county"!==n&&(e.street&&(r+=t+e.street),e.street_number&&(r+=e.street_number)))),r}function i(e){return e*(Math.PI/180)}function o(e,t){const n=i(t.lat-e.lat),r=i(t.lng-e.lng),o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(i(e.lat))*Math.cos(i(t.lat))*Math.sin(r/2)*Math.sin(r/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))*1e3}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);async function i(e){if("string"==typeof e){const t=Object(r.c)().system.decodeBase64(e),n=await Object(r.c)().system.inflate(t,{to:"string"});return JSON.parse(n)}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(5),i=n(0);function o(e,t){return{_LANG_:t.language,_LINK_TYPE_:Object(i.d)(),_IS_INFER_:Object(i.c)().dev.infer?"Y":"",...e}}async function a(e,t){const{params:n}=t,i={};for(const t of n){const{name:n,value:o}=t;n.startsWith("_url_")?i[n]=await Object(r.h)(o,{state:e}):n.startsWith("_html_")?i[n]=await Object(r.d)(o,{state:e},!0):i[n]=await Object(r.f)(o,{state:e,joinBy:","},"URL")}return o(i,e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const r={actions:[]};function i(e){r.actions.push(e)}},function(e,t,n){e.exports=function e(t,n,r){function i(a,c){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},a={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],2:[function(e,t,n){"use strict";var r=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),c=0;c<256;c++)a[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;function s(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,o,a,c=e.length,s=0;for(o=0;o<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<c&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(s),a=0,o=0;a<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<c&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},n.buf2binstring=function(e){return s(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,o,c=t||e.length,u=new Array(2*c);for(r=0,n=0;n<c;)if((i=e[n++])<128)u[r++]=i;else if((o=a[i])>4)u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<c;)i=i<<6|63&e[n++],o--;o>1?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return s(u,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],4:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var c=i;c<a;c++)e=e>>>8^o[255&(e^t[c])];return-1^e}},{}],6:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,n){"use strict";t.exports=function(e,t){var n,r,i,o,a,c,s,u,l,f,d,p,b,h,m,g,O,j,v,w,y,_,x,T,k;n=e.state,r=e.next_in,T=e.input,i=r+(e.avail_in-5),o=e.next_out,k=e.output,a=o-(t-e.avail_out),c=o+(e.avail_out-257),s=n.dmax,u=n.wsize,l=n.whave,f=n.wnext,d=n.window,p=n.hold,b=n.bits,h=n.lencode,m=n.distcode,g=(1<<n.lenbits)-1,O=(1<<n.distbits)-1;e:do{b<15&&(p+=T[r++]<<b,b+=8,p+=T[r++]<<b,b+=8),j=h[p&g];t:for(;;){if(p>>>=v=j>>>24,b-=v,0==(v=j>>>16&255))k[o++]=65535&j;else{if(!(16&v)){if(0==(64&v)){j=h[(65535&j)+(p&(1<<v)-1)];continue t}if(32&v){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&j,(v&=15)&&(b<v&&(p+=T[r++]<<b,b+=8),w+=p&(1<<v)-1,p>>>=v,b-=v),b<15&&(p+=T[r++]<<b,b+=8,p+=T[r++]<<b,b+=8),j=m[p&O];n:for(;;){if(p>>>=v=j>>>24,b-=v,!(16&(v=j>>>16&255))){if(0==(64&v)){j=m[(65535&j)+(p&(1<<v)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(y=65535&j,b<(v&=15)&&(p+=T[r++]<<b,(b+=8)<v&&(p+=T[r++]<<b,b+=8)),(y+=p&(1<<v)-1)>s){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=v,b-=v,y>(v=o-a)){if((v=y-v)>l&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(_=0,x=d,0===f){if(_+=u-v,v<w){w-=v;do{k[o++]=d[_++]}while(--v);_=o-y,x=k}}else if(f<v){if(_+=u+f-v,(v-=f)<w){w-=v;do{k[o++]=d[_++]}while(--v);if(_=0,f<w){w-=v=f;do{k[o++]=d[_++]}while(--v);_=o-y,x=k}}}else if(_+=f-v,v<w){w-=v;do{k[o++]=d[_++]}while(--v);_=o-y,x=k}for(;w>2;)k[o++]=x[_++],k[o++]=x[_++],k[o++]=x[_++],w-=3;w&&(k[o++]=x[_++],w>1&&(k[o++]=x[_++]))}else{_=o-y;do{k[o++]=k[_++],k[o++]=k[_++],k[o++]=k[_++],w-=3}while(w>2);w&&(k[o++]=k[_++],w>1&&(k[o++]=k[_++]))}break}}break}}while(r<i&&o<c);r-=w=b>>3,p&=(1<<(b-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<c?c-o+257:257-(o-c),n.hold=p,n.bits=b}},{}],8:[function(e,t,n){"use strict";var r=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),c=e("./inftrees");function s(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):-2}function d(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,f(e))):-2}function p(e,t){var n,r;return e?(r=new u,e.state=r,r.window=null,0!==(n=d(e,t))&&(e.state=null),n):-2}var b,h,m=!0;function g(e){if(m){var t;for(b=new r.Buf32(512),h=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(c(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;c(2,e.lens,0,32,h,0,e.work,{bits:5}),m=!1}e.lencode=b,e.lenbits=9,e.distcode=h,e.distbits=5}function O(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=f,n.inflateReset2=d,n.inflateResetKeep=l,n.inflateInit=function(e){return p(e,15)},n.inflateInit2=p,n.inflate=function(e,t){var n,u,l,f,d,p,b,h,m,j,v,w,y,_,x,T,k,S,E,N,I,C,L,A,P=0,R=new r.Buf8(4),M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(n=e.state).mode&&(n.mode=13),d=e.next_out,l=e.output,b=e.avail_out,f=e.next_in,u=e.input,p=e.avail_in,h=n.hold,m=n.bits,j=p,v=b,C=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(2&n.wrap&&35615===h){n.check=0,R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0),h=0,m=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&h)){e.msg="unknown compression method",n.mode=30;break}if(m-=4,I=8+(15&(h>>>=4)),0===n.wbits)n.wbits=I;else if(I>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<I,e.adler=n.check=1,n.mode=512&h?10:12,h=0,m=0;break;case 2:for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(n.flags=h,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0)),h=0,m=0,n.mode=3;case 3:for(;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.head&&(n.head.time=h),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,n.check=o(n.check,R,4,0)),h=0,m=0,n.mode=4;case 4:for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0)),h=0,m=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0)),h=0,m=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((w=n.length)>p&&(w=p),w&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,u,f,w,I)),512&n.flags&&(n.check=o(n.check,u,w,f)),p-=w,f+=w,n.length-=w),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;w=0;do{I=u[f+w++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I))}while(I&&w<p);if(512&n.flags&&(n.check=o(n.check,u,w,f)),p-=w,f+=w,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===p)break e;w=0;do{I=u[f+w++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I))}while(I&&w<p);if(512&n.flags&&(n.check=o(n.check,u,w,f)),p-=w,f+=w,I)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(h!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}h=0,m=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}e.adler=n.check=s(h),h=0,m=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=d,e.avail_out=b,e.next_in=f,e.avail_in=p,n.hold=h,n.bits=m,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){h>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}switch(n.last=1&h,m-=1,3&(h>>>=1)){case 0:n.mode=14;break;case 1:if(g(n),n.mode=20,6===t){h>>>=2,m-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}h>>>=2,m-=2;break;case 14:for(h>>>=7&m,m-=7&m;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&h,h=0,m=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(w=n.length){if(w>p&&(w=p),w>b&&(w=b),0===w)break e;r.arraySet(l,u,f,w,d),p-=w,f+=w,b-=w,d+=w,n.length-=w;break}n.mode=12;break;case 17:for(;m<14;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(n.nlen=257+(31&h),h>>>=5,m-=5,n.ndist=1+(31&h),h>>>=5,m-=5,n.ncode=4+(15&h),h>>>=4,m-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.lens[M[n.have++]]=7&h,h>>>=3,m-=3}for(;n.have<19;)n.lens[M[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},C=c(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,C){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;T=(P=n.lencode[h&(1<<n.lenbits)-1])>>>16&255,k=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(k<16)h>>>=x,m-=x,n.lens[n.have++]=k;else{if(16===k){for(A=x+2;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(h>>>=x,m-=x,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}I=n.lens[n.have-1],w=3+(3&h),h>>>=2,m-=2}else if(17===k){for(A=x+3;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}m-=x,I=0,w=3+(7&(h>>>=x)),h>>>=3,m-=3}else{for(A=x+7;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}m-=x,I=0,w=11+(127&(h>>>=x)),h>>>=7,m-=7}if(n.have+w>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;w--;)n.lens[n.have++]=I}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},C=c(1,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,C){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},C=c(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,C){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(p>=6&&b>=258){e.next_out=d,e.avail_out=b,e.next_in=f,e.avail_in=p,n.hold=h,n.bits=m,a(e,v),d=e.next_out,l=e.output,b=e.avail_out,f=e.next_in,u=e.input,p=e.avail_in,h=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;T=(P=n.lencode[h&(1<<n.lenbits)-1])>>>16&255,k=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(T&&0==(240&T)){for(S=x,E=T,N=k;T=(P=n.lencode[N+((h&(1<<S+E)-1)>>S)])>>>16&255,k=65535&P,!(S+(x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}h>>>=S,m-=S,n.back+=S}if(h>>>=x,m-=x,n.back+=x,n.length=k,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=12;break}if(64&T){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(A=n.extra;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(P=n.distcode[h&(1<<n.distbits)-1])>>>16&255,k=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(0==(240&T)){for(S=x,E=T,N=k;T=(P=n.distcode[N+((h&(1<<S+E)-1)>>S)])>>>16&255,k=65535&P,!(S+(x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}h>>>=S,m-=S,n.back+=S}if(h>>>=x,m-=x,n.back+=x,64&T){e.msg="invalid distance code",n.mode=30;break}n.offset=k,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(A=n.extra;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===b)break e;if(w=v-b,n.offset>w){if((w=n.offset-w)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}w>n.wnext?(w-=n.wnext,y=n.wsize-w):y=n.wnext-w,w>n.length&&(w=n.length),_=n.window}else _=l,y=d-n.offset,w=n.length;w>b&&(w=b),b-=w,n.length-=w;do{l[d++]=_[y++]}while(--w);0===n.length&&(n.mode=21);break;case 26:if(0===b)break e;l[d++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===p)break e;p--,h|=u[f++]<<m,m+=8}if(v-=b,e.total_out+=v,n.total+=v,v&&(e.adler=n.check=n.flags?o(n.check,l,v,d-v):i(n.check,l,v,d-v)),v=b,(n.flags?h:s(h))!==n.check){e.msg="incorrect data check",n.mode=30;break}h=0,m=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(h!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}h=0,m=0}n.mode=29;case 29:C=1;break e;case 30:C=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=d,e.avail_out=b,e.next_in=f,e.avail_in=p,n.hold=h,n.bits=m,(n.wsize||v!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&O(e,e.output,e.next_out,v-e.avail_out)?(n.mode=31,-4):(j-=e.avail_in,v-=e.avail_out,e.total_in+=j,e.total_out+=v,n.total+=v,n.wrap&&v&&(e.adler=n.check=n.flags?o(n.check,l,v,e.next_out-v):i(n.check,l,v,e.next_out-v)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===j&&0===v||4===t)&&0===C&&(C=-5),C)},n.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:(n.head=t,t.done=!1,0):-2},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,t,r,0)!==n.check?-3:O(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,n){"use strict";var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,s,u,l,f,d){var p,b,h,m,g,O,j,v,w,y=d.bits,_=0,x=0,T=0,k=0,S=0,E=0,N=0,I=0,C=0,L=0,A=null,P=0,R=new r.Buf16(16),M=new r.Buf16(16),D=null,U=0;for(_=0;_<=15;_++)R[_]=0;for(x=0;x<s;x++)R[t[n+x]]++;for(S=y,k=15;k>=1&&0===R[k];k--);if(S>k&&(S=k),0===k)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(T=1;T<k&&0===R[T];T++);for(S<T&&(S=T),I=1,_=1;_<=15;_++)if(I<<=1,(I-=R[_])<0)return-1;if(I>0&&(0===e||1!==k))return-1;for(M[1]=0,_=1;_<15;_++)M[_+1]=M[_]+R[_];for(x=0;x<s;x++)0!==t[n+x]&&(f[M[t[n+x]]++]=x);if(0===e?(A=D=f,O=19):1===e?(A=i,P-=257,D=o,U-=257,O=256):(A=a,D=c,O=-1),L=0,x=0,_=T,g=l,E=S,N=0,h=-1,m=(C=1<<S)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){j=_-N,f[x]<O?(v=0,w=f[x]):f[x]>O?(v=D[U+f[x]],w=A[P+f[x]]):(v=96,w=0),p=1<<_-N,T=b=1<<E;do{u[g+(L>>N)+(b-=p)]=j<<24|v<<16|w|0}while(0!==b);for(p=1<<_-1;L&p;)p>>=1;if(0!==p?(L&=p-1,L+=p):L=0,x++,0==--R[_]){if(_===k)break;_=t[n+f[x]]}if(_>S&&(L&m)!==h){for(0===N&&(N=S),g+=T,I=1<<(E=_-N);E+N<k&&!((I-=R[E+N])<=0);)E++,I<<=1;if(C+=1<<E,1===e&&C>852||2===e&&C>592)return 1;u[h=L&m]=S<<24|E<<16|g-l|0}}return 0!==L&&(u[g+L]=_-N<<24|64<<16|0),d.bits=S,0}},{"../utils/common":1}],10:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,n){"use strict";var r=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),c=e("./zlib/messages"),s=e("./zlib/zstream"),u=e("./zlib/gzheader"),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(c[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(c[n])}function d(e,t){var n=new f(t);if(n.push(e,!0),n.err)throw n.msg||c[n.err];return n.result}f.prototype.push=function(e,t){var n,c,s,u,f,d=this.strm,p=this.options.chunkSize,b=this.options.dictionary,h=!1;if(this.ended)return!1;c=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(n=r.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&b&&(n=r.inflateSetDictionary(this.strm,b)),n===a.Z_BUF_ERROR&&!0===h&&(n=a.Z_OK,h=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==a.Z_STREAM_END&&(0!==d.avail_in||c!==a.Z_FINISH&&c!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(s=o.utf8border(d.output,d.next_out),u=d.next_out-s,f=o.buf2string(d.output,s),d.next_out=u,d.avail_out=p-u,u&&i.arraySet(d.output,d.output,s,u,0),this.onData(f)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(h=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(c=a.Z_FINISH),c===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):c!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=f,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return _})),n.d(t,"b",(function(){return T}));var r=n(4);function i(e,t,n,i,o){return o||(o=Object(r.c)(e,t,n.uuid)),o||i.parentRandomId||t.length&&(o=Object(r.b)(e,t[t.length-1].destInputId)),o}var o=n(6),a=n(1);const c=["weight","slide_rate","upload","value_mark","icon_mark","fill","sequence"],s={findNext(e,t){const{destList:n,output:s}=t,u=c.indexOf(t.type)>-1?t.otherOptions:Object(o.c)(t),l=u&&u.find(e=>e.selected),f=l&&Object(r.c)(e,n,l.uuid);return Object(a.n)({node:i(e,n,s,t,f)})}},u={async findNext(e,t,n){const{destList:i}=t,a=Object(o.j)(t);let c=a&&Object(r.c)(e,i,a.uuid);return c||(c=(await s.findNext(e,t,n)).node),c||!i.length||t.parentRandomId||(c=Object(r.b)(e,i[0].destInputId)),{node:c}}};var l=n(47),f=n(21);const d={async findNext(e,t){const{options:n,logicType:i,output:o,outputN:a,destList:c,parent:s}=t,u=await Object(f.b)(s,n,i);t.logicResult=u;const l=u?o:a;return{node:Object(r.c)(e,c,l.uuid)}}};var p=n(14);function b(e,t){const{destList:n,randomStart:i}=t,o={};n.forEach((t,n)=>{if(Object(a.l)(t.selfPortId,i.uuid)){const i=Object(r.b)(e,t.destInputId).groupNumber||"N/A_"+n,c=o[i];if(c){const e=Object(a.f)(c.length+1);c.splice(e,0,t.destInputId)}else o[i]=[t.destInputId]}});const c=function(e,t){const{customDestCount:n}=t;if(!n||n>=e.length)return e;for(;e.length>n;)e.splice(Object(a.f)(e.length),1);return e}(Object.keys(o),t);let s=[];for(;c.length>0;){const e=Object(a.f)(c.length);s=s.concat(o[c[e]]),c.splice(e,1)}return s}const h={_init(e,t,n){const{origin:i}=t;let o=b(e,t);!function(e,t){const{customNodeCount:n,parent:{nodeList:i},origin:o}=t;o.csNcDone||n&&(e.forEach(e=>{const t=[];let o=Object(r.b)(i,e);for(;o;)t.push(o),o=Object(r.c)(i,o.destList,o.output.uuid);for(;t.length>n;){const e=Object(a.f)(t.length);t[e].randomAbandoned=!0,t.splice(e,1)}}),o.csNcDone=!0)}(o,t),o=Object(p.h)(o,t);let c=[];t.random&&(c=t.random.stack.concat(t.random));const s={stack:c,node:i,destPortIds:o,currentIndex:0};return n.push(s),Object(a.n)({node:Object(r.b)(e,o[0]),random:{...s}})},_increase(e,t){t.currentIndex+=1;const{currentIndex:n,destPortIds:i}=t;return Object(a.n)({node:Object(r.b)(e,i[n]),random:{...t}})},_end:(e,t,n)=>l.a.findNext(e,t,n),findNext(e,t,n){const{randomList:r}=n,{nodeUuid:i}=t,o=r.find(e=>Object(a.l)(e.node.nodeUuid,i));if(o){const{currentIndex:r,destPortIds:i}=o;return r===i.length-1?h._end(e,t,n):h._increase(e,o)}return h._init(e,t,r)}};var m=n(60);const g={findNext(e,t){const{destList:n,output:o,options:c,otherOptions:s}=t,u=[...c.filter(e=>e.selected).sort((e,t)=>e.cascadePath.length<t.cascadePath.length?1:-1),...s.filter(e=>e.selected)];let l;for(const t of u)if(l=Object(r.c)(e,n,t.uuid),l)break;return Object(a.n)({node:i(e,n,o,t,l)})}};var O=n(17);const j={cascade:g,logic:d,loop:m.c,sequence:u,random:h};["describe","check","end","start","verify","data","max_diff"].forEach(e=>{j[e]=l.a});function v(e){const t=j[e.type];if(!t)throw new Error("lack next rules for this type of node...");return t}["weight","slide_rate","upload","value_mark","icon_mark","fill","select_image","select","region","location","lottery","matrix","menu","area","select_icon","hot_spot","heat_map"].forEach(e=>{j[e]=s});const w=["check","break_point"];function y(e,t){return"loop"===e.type?!Object(m.a)(e,t):w.indexOf(e.type)<0}function _(e,t,n){return T(e,{origin:n,...n},t)}function x(e,t,n,i){const{node:o,loop:c,random:s}=i,u=t.random;if(o){const e=t.loop,{loopStack:n}=t;!c&&e&&Object(r.l)(o,t)&&(i.loopStack=n,i.loop=e),o.parentRandomId&&u&&!s&&(i.random=u)}else if(u){const t=Object(a.h)(u.node.nodeUuid,n.loopStack);return T(e,Object(O.a)(n.renderList,t),n)}return Object(a.n)(i)}async function T(e,t,n){let r,i,o=v(t),a=!0;for(;a&&(i=await x(e,t,n,await o.findNext(e,t,n)),r=i.node,r);)y(r,n)?a=!1:(t={origin:r,parent:n,...r,...i},o=v(r));return i}},function(e,t,n){"use strict";n.d(t,"b",(function(){return R})),n.d(t,"a",(function(){return M}));var r=n(4),i=n(1),o=n(6),a=n(32),c=n(5),s=n(0),u=n(36),l=n(23),f=n(7),d=n(62);async function p(e,t){const n={};e.sortNo&&(n.sortNo=-1),e.selected&&(n.selected=!1),e.value&&(n.value=""),await Object(l.d)(e,t),Object(s.g)(e,n)}async function b(e){const{video:t,options:n,otherOptions:r}=e;t&&Object(s.g)(t,{ended:!0});let i=[];n&&(i=[...i,...n]),r&&(i=[...i,...r]);for(const t of i)await p(t,e);const{cascade:o}=e;o&&await async function e(t,n){Object(s.g)(t,{selected:!1}),await Object(l.d)(t.option,n),t.list&&t.list.forEach(t=>e(t,n))}(o,e)}const h={doc:"os/client/o_1dn9kbm3u1f4d1tsudcg1fuh17678.txt",image:"os/client/o_1dn9kbq468tj1kq2dt3qeo1pumd.png",video:"os/client/o_1dn9kpohua8v1jv51oobq981dvv8.mp4",audio:"os/client/o_1dn9l7gbs1maj1e3nn941e6p125gj.mp3"},m={};function g(e){const{regions:t}=e,n=e.infoRange||"county",r=function(e){const t=x(Object(o.c)(e),1)[0];return!t||t.isOtherOpt?null:t.inferList.some(e=>e.active)?t:null}(e);if(r){const e=r.text.split("-");return{address:e,indexes:Object(d.c)(e,t),point:{lat:r.latitude,lng:r.longitude}}}{const e=Object(i.f)(t.length);let r=Object(f.a)(e);const o=t[e],a=[o.Meaning,"",""];if("province"!==n){const e=Object(i.f)(o.cities.length),t=o.cities[e];if(a[1]=t.Meaning,r=r+" "+e,"city"!==n){const e=Object(i.f)(t.counties.length),n=t.counties[e];n&&(a[2]=n.Meaning,r=r+" "+e)}}return{address:a,indexes:r,point:{lng:0,lat:0}}}}async function O(e,t){const{value:n}=await Object(a.b)(e,t);if(n)return"__FORCE_EMPTY__"===n?"":n;const{fileLimits:r}=e,o=Object(i.p)(r,1)[0];return h[o]}async function j(e,t){const n=[],r=[];e.forEach(e=>{Object(o.n)(e)?n.push(e):r.push(e)}),await T(r,t,1);const a=Object(i.g)(1,n.length);y(n,t,a)}async function v(e,t){const{parent:n,inputInferLimit:r}=t;let o=await Object(c.e)(t.fillMin,{state:n});o=o||0;let a=e.length;o&&r>o&&r<a&&(a=r);const s=o?Object(i.g)(o,a):a;return Object(i.p)(e,s)}async function w(e,t){e.parent.context.option=t;const n=await Object(a.a)(t,e);return e.parent.context.option=null,await e.parent.handleEvents.handleOptionInput(n,t,e)}function y(e,t,n){Object(i.p)(e,n).forEach(e=>w(t,e))}async function _(e,t){if(await e.parent.handleEvents.handleOptionClick(t,e),t.useComment)return w(e,t)}function x(e,t){const n=Object(l.b)(e,"select"),r=[],o=[];if(n.forEach(e=>{e.inferList.every(e=>0===Number(e.weight))||e.disabled?r.push(e):o.push(e)}),o.length>0)return Object(l.h)(o,t);{let n=e.filter(e=>!e.disabled);return r.length>0&&(n=e.filter(e=>!r.includes(e))),Object(i.p)(n,t)}}async function T(e,t,n){const r=x(e,n).sort((e,t)=>-1===e.mutexNumber||(e.mutexNumber||0)>(t.mutexNumber||0)?1:-1);for(const e of r)await _(t,e)}async function k(e,t){const{multiple:n,min:r,max:o,list:a}=e;if(!a)return;const c=function(e,t){const n=Object(l.a)(e);return n.length>0?Object(l.g)(n,t):Object(i.p)(e,t)}(a,n?Object(i.g)(r||1,o||1):1);for(const n of c){const r=a.indexOf(n);await t.parent.handleEvents.handleCascadeClick(r,e,t),await k(n,t)}}async function S(e){const t=Object(o.c)(e);let n=1;if(Object(r.s)(e)){const t=await Object(r.e)(e),{min:o}=t;let{max:a}=t;const{selectInferLimit:c}=e;c>o&&c<a&&(a=c),n=Object(i.g)(o||1,a)}const a=[],c=[];t.forEach(e=>{Object(o.n)(e)?c.push(e):a.push(e)}),await T(a,e,n);const s=Object(i.g)(1,c.length);y(c,e,s)}function E(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}async function N(e,t,n){const r=[...n].sort(),{value:o,antis:c}=await Object(a.b)(e,t,1);if(o){if("__FORCE_EMPTY__"===o)return"0";{const e=r[0],t=r[r.length-1];return o<e?e:o>t?t:o}}{const e=()=>Object(i.p)(n,1)[0];return Object(a.f)(e,c)}}function I(e){let[t,n]=e.split("~").map(e=>Number(e));return t>n&&([n,t]=[t,n]),[t,n]}function C(e,t,n){const[r,o]=e.split("_");let a,c;if(r.includes("~")){const[e,t]=I(r);a=Object(i.g)(e,t)}else a=Math.min(Math.max(Number(r),0),t);if(o.includes("~")){const[e,t]=I(o);c=Object(i.g)(e,t)}else c=Math.min(Math.max(Number(o),0),n);return{x:a,y:c}}function L(e,t){const[n,r]=e.split("_").map(e=>Number(e)),[i,o]=t.split("_");let a=!1,c=!1;if(i.includes("~")){const[e,t]=I(i);a=e<=n&&n<=t}else a=Number(i)===n;if(o.includes("~")){const[e,t]=I(o);c=e<=r&&r<=t}else c=Number(o)===r;return a&&c}async function A(e,t){const{value:n,antis:r}=await Object(a.b)(e,t,1),{mapImgHeight:o,mapImgWidth:c}=t;if(n)return"__FORCE_EMPTY__"===n?null:C(n,c,o);{const e=()=>Object(i.f)(c)+"_"+Object(i.f)(o);return C(await Object(a.f)(e,r,L),c,o)}}function P(e,t){let n=t.filter(t=>!(-1!==t.sortNo||!t.inferList)&&t.inferList.some(t=>{if(!t.active)return!1;const n=Object(l.c)(t.candidates),r=Object(l.f)(n,1);return r.length>0&&Number(r[0].text)<=e}));0===n.length&&(n=t.filter(e=>-1===e.sortNo));const r=Object(i.p)(n,1)[0];r&&Object(s.g)(r,{sortNo:e,selected:!0})}async function R(e){return await Object(a.g)(),M(e)}async function M(e,t){const{type:n,readonly:r}=e;if(r)return Object(u.d)();await b(e),t&&t.beforeInfer&&await t.beforeInfer(e);const i=m[n]||S;await i(e),t&&t.afterInfer&&await t.afterInfer(e)}m.select=S,m.value_mark=async e=>{const{options:t,otherOptions:n}=e,r=await v(t,e);for(const t of r){const n=t.minValue||1,r=t.maxValue||5,i=await N(t,e,E(n,r).map(e=>Object(f.a)(e)));await e.parent.handleEvents.handleOptionInput(i,t,e)}await j(n,e)},m.heat_map=async e=>{const{options:t,otherOptions:n}=e;for(const n of t){const t=await A(n,e);t&&await e.parent.handleEvents.handleQuestionInput(t,e)}await j(n,e)},m.icon_mark=async e=>{const{options:t,otherOptions:n}=e,r=await v(t,e);for(const t of r){const n=1,r=t.count||5,i=await N(t,e,E(n,r).map(e=>Object(f.a)(e)));await e.parent.handleEvents.handleOptionInput(i,t,e)}await j(n,e)},m.slide_rate=async e=>{const{options:t,rateOptions:n,otherOptions:r}=e,i=await v(t,e),o=n.map(e=>e.value);for(const t of i){const n=await N(t,e,o);await e.parent.handleEvents.handleOptionInput(n,t,e)}await j(r,e)},m.weight=async e=>{let{weightTotal:t}=e;const{options:n,otherOptions:r}=e;t<=0&&(t=100);const o=[],a=[];n.forEach(e=>{const{inferList:t}=e;if(t){t.some(e=>e.active)?o.push(e):a.push(e)}else a.push(e)});const c=[];for(const n of o){const r=n.inferList.filter(e=>e.active),i=await Object(l.e)(r,e),o=Object(l.c)(i),a=Object(l.f)(o,1),s=Number(a[0].text);c.push(s),t-=s}const s=Object(i.o)(t,a.length),u=c.concat(s),f=o.concat(a);for(const[t,n]of f.entries()){const r=u[t];await e.parent.handleEvents.handleOptionInput(r.toString(),n,e)}await j(r,e)},m.fill=async e=>{const{options:t,otherOptions:n}=e,r=await v(t,e);for(const t of r)await w(e,t);await j(n,e)},m.sequence=async e=>{const{options:t,otherOptions:n}=e,r=t.length;let i=1;for(;i<=r;)P(i,t),i+=1;t.sort((e,t)=>e.sortNo>t.sortNo?1:-1),await j(n,e),Object(u.d)()},m.cascade=async e=>{const{cascade:t,otherOptions:n}=e;return await k(t,e),j(n,e)},m.describe=()=>(Object(u.d)(),Object(i.n)()),m.max_diff=async e=>{const t=function(e){const t=[],{options:n,itemCountPerTask:r,taskCount:i}=e,o=Math.ceil(i*r/n.length);return e.options.forEach(e=>{if(!e.inferList)return;let n=e.inferList.reduce((e,t)=>{if(t.active){e+=t.candidates.split(",").map(e=>Number(e)||0).reduce((e,t)=>e+t,0)}return e},0);n>o?n=o:n<-o&&(n=-o),n&&t.push({needValue:n,option:e})}),t}(e),{tasks:n,parent:{handleEvents:r}}=e;for(const o of n){let n=o.items.find(e=>t.find(t=>{const n=t.option===e.option&&t.needValue>0;return n&&(t.needValue-=1),n})),a=o.items.find(e=>t.find(t=>{const n=t.option===e.option&&t.needValue<0;return n&&(t.needValue+=1),n}));if(!n){const e=o.items.filter(e=>t.every(t=>t.option!==e.option));n=Object(i.p)(e,1)[0]}if(!a||a===n){const e=o.items.filter(e=>t.every(t=>t.option!==e.option)&&e!==n);a=Object(i.p)(e,1)[0]}await r.handleMaxDiffInput(1,n,o,e),await r.handleMaxDiffInput(-1,a,o,e)}},m.upload=async e=>{const{options:t,otherOptions:n}=e,{min:o,max:a}=await Object(r.g)(e),c=Object(i.g)(o||1,a),s=Object(i.p)(t,c);for(const t of s)await e.parent.handleEvents.handleOptionInput({name:await O(t,e)},t,e);await j(n,e)},m.region=e=>{const{indexes:t}=g(e);return e.parent.handleEvents.handleQuestionInput(t,e)},m.location=e=>{const{address:t,point:n}=g(e),r={address:{province:t[0],city:t[1],district:t[2],country:""},point:{lat:n.lat||Number(Object(a.c)(0,90)),lng:n.lng||Number(Object(a.c)(0,180))}};return e.parent.handleEvents.handleQuestionInput(r,e)},m.area=m.location,m.matrix=async e=>{const{options:t,flatten:n,otherOptions:o}=e,{min:a,max:c}=await Object(r.e)(e);if(Object(r.v)(e))await T(t,e,1);else if(Object(r.q)(e)){const t=[];for(const r of n){if(r.list.filter((e,n)=>!t.includes(n)).length>0){const n=x(r.list,1)[0];n&&(await _(e,n),t.push(r.list.indexOf(n)))}}}else if(Object(r.r)(e)||Object(r.p)(e))for(const t of n)await T(t.list,e,1);else if(Object(r.o)(e)||Object(r.n)(e))for(const t of n){const n=Object(i.g)(a||1,c);await T(t.list,e,n)}else if(Object(r.m)(e)){const n=Object(i.g)(a||1,c);await T(t,e,n)}await j(o,e)},m.end=()=>Object(i.n)(),m.verify=e=>e.parent.handleEvents.handleQuestionInput({phoneNumber:Object(a.d)(),code:Object(a.e)("number")},e)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i=n(2);function o(){return{headimgurl:"https://media.choiceform.com/fresh_little_girl.jpg",nickname:Object(i.f)(r.a.reward.weChatName)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(35),i=n(0),o=n(26);function a(e,t,n){if(void 0===e||void 0===t)return{refresh:!1,result:[]};const{options:a}=n,c=a.length;t>c&&(t=c);const s=a.splice(e,1)[0];s&&(Object(i.g)(s,{selected:!0}),a.splice(t,0,s));const u=n.options.filter(e=>!e.selected);1===u.length&&Object(i.g)(u[0],{selected:!0});const l=[];return a.forEach((e,t)=>{e.selected&&(Object(i.g)(e,{sortNo:t+1}),l.push(t+1))}),Object(r.b)(n),Object(o.c)(s,n),{refresh:!0,result:l}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);function i(e,t){Object(r.g)(e,{value:t});const{option:n}=e;n.records.find(t=>t.round===e.round).value=t,Object(r.g)(n,{value:n.records.reduce((e,t)=>e+t.value,0)})}function o(e,t,n,o){if(t.value===e)return{result:!0};i(t,e),n.items.forEach(e=>{e!==t&&e.value===t.value&&i(e,0)});const a=n.items.some(e=>1===e.value),c=n.items.some(e=>-1===e.value);return Object(r.g)(n,{done:a&&c}),{result:!0}}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){var r,i;void 0===(i="function"==typeof(r={af:function(e,t){return t?"other":1==e?"one":"other"},ak:function(e,t){return t?"other":0==e||1==e?"one":"other"},am:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},ar:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ars:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:function(e,t){return t?"other":1==e?"one":"other"},ast:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},az:function(e,t){var n=String(e).split(".")[0],r=n.slice(-1),i=n.slice(-2),o=n.slice(-3);return t?1==r||2==r||5==r||7==r||8==r||20==i||50==i||70==i||80==i?"one":3==r||4==r||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==n||6==r||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},be:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?2!=i&&3!=i||12==o||13==o?"other":"few":1==i&&11!=o?"one":i>=2&&i<=4&&(o<12||o>14)?"few":r&&0==i||i>=5&&i<=9||o>=11&&o<=14?"many":"other"},bem:function(e,t){return t?"other":1==e?"one":"other"},bez:function(e,t){return t?"other":1==e?"one":"other"},bg:function(e,t){return t?"other":1==e?"one":"other"},bh:function(e,t){return t?"other":0==e||1==e?"one":"other"},bm:function(e,t){return"other"},bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:function(e,t){return"other"},br:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2),a=r&&n[0].slice(-6);return t?"other":1==i&&11!=o&&71!=o&&91!=o?"one":2==i&&12!=o&&72!=o&&92!=o?"two":(3==i||4==i||9==i)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=e&&r&&0==a?"many":"other"},brx:function(e,t){return t?"other":1==e?"one":"other"},bs:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},ca:function(e,t){var n=!String(e).split(".")[1];return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&n?"one":"other"},ce:function(e,t){return t?"other":1==e?"one":"other"},cgg:function(e,t){return t?"other":1==e?"one":"other"},chr:function(e,t){return t?"other":1==e?"one":"other"},ckb:function(e,t){return t?"other":1==e?"one":"other"},cs:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e;return t||1!=e&&(i||0!=r&&1!=r)?"other":"one"},de:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},dsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),c=i.slice(-2);return t?"other":o&&1==a||1==c?"one":o&&2==a||2==c?"two":o&&(3==a||4==a)||3==c||4==c?"few":"other"},dv:function(e,t){return t?"other":1==e?"one":"other"},dz:function(e,t){return"other"},ee:function(e,t){return t?"other":1==e?"one":"other"},el:function(e,t){return t?"other":1==e?"one":"other"},en:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==e&&r?"one":"other"},eo:function(e,t){return t?"other":1==e?"one":"other"},es:function(e,t){return t?"other":1==e?"one":"other"},et:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},eu:function(e,t){return t?"other":1==e?"one":"other"},fa:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},fil:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=c&&6!=c&&9!=c?"one":"other"},fo:function(e,t){return t?"other":1==e?"one":"other"},fr:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},fur:function(e,t){return t?"other":1==e?"one":"other"},fy:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},ga:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},gl:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},gsw:function(e,t){return t?"other":1==e?"one":"other"},gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:function(e,t){return t?"other":0==e||1==e?"one":"other"},gv:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:function(e,t){return t?"other":1==e?"one":"other"},haw:function(e,t){return t?"other":1==e?"one":"other"},he:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1);return t?"other":1==e&&i?"one":2==r&&i?"two":i&&(e<0||e>10)&&o&&0==a?"many":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},hsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),c=i.slice(-2);return t?"other":o&&1==a||1==c?"one":o&&2==a||2==c?"two":o&&(3==a||4==a)||3==c||4==c?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},id:function(e,t){return"other"},ig:function(e,t){return"other"},ii:function(e,t){return"other"},in:function(e,t){return"other"},io:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},is:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e,o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o&&11!=a||!i?"one":"other"},it:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},iu:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},iw:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1);return t?"other":1==e&&i?"one":2==r&&i?"two":i&&(e<0||e>10)&&o&&0==a?"many":"other"},ja:function(e,t){return"other"},jbo:function(e,t){return"other"},jgo:function(e,t){return t?"other":1==e?"one":"other"},ji:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},jmc:function(e,t){return t?"other":1==e?"one":"other"},jv:function(e,t){return"other"},jw:function(e,t){return"other"},ka:function(e,t){var n=String(e).split(".")[0],r=n.slice(-2);return t?1==n?"one":0==n||r>=2&&r<=20||40==r||60==r||80==r?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:function(e,t){return t?"other":1==e?"one":"other"},kcg:function(e,t){return t?"other":1==e?"one":"other"},kde:function(e,t){return"other"},kea:function(e,t){return"other"},kk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1);return t?6==i||9==i||r&&0==i&&0!=e?"many":"other":1==e?"one":"other"},kkj:function(e,t){return t?"other":1==e?"one":"other"},kl:function(e,t){return t?"other":1==e?"one":"other"},km:function(e,t){return"other"},kn:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},ko:function(e,t){return"other"},ks:function(e,t){return t?"other":1==e?"one":"other"},ksb:function(e,t){return t?"other":1==e?"one":"other"},ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:function(e,t){return t?"other":1==e?"one":"other"},kw:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},ky:function(e,t){return t?"other":1==e?"one":"other"},lag:function(e,t){var n=String(e).split(".")[0];return t?"other":0==e?"zero":0!=n&&1!=n||0==e?"other":"one"},lb:function(e,t){return t?"other":1==e?"one":"other"},lg:function(e,t){return t?"other":1==e?"one":"other"},lkt:function(e,t){return"other"},ln:function(e,t){return t?"other":0==e||1==e?"one":"other"},lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var n=String(e).split("."),r=n[1]||"",i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?"other":1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),c=o&&n[0].slice(-2),s=r.slice(-2),u=r.slice(-1);return t?"other":o&&0==a||c>=11&&c<=19||2==i&&s>=11&&s<=19?"zero":1==a&&11!=c||2==i&&1==u&&11!=s||2!=i&&1==u?"one":"other"},mas:function(e,t){return t?"other":1==e?"one":"other"},mg:function(e,t){return t?"other":0==e||1==e?"one":"other"},mgo:function(e,t){return t?"other":1==e?"one":"other"},mk:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?1==a&&11!=c?"one":2==a&&12!=c?"two":7!=a&&8!=a||17==c||18==c?"other":"many":o&&1==a&&11!=c||1==s&&11!=u?"one":"other"},ml:function(e,t){return t?"other":1==e?"one":"other"},mn:function(e,t){return t?"other":1==e?"one":"other"},mo:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":e>=0&&e<=1?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":1==e?"one":0==e||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},my:function(e,t){return"other"},nah:function(e,t){return t?"other":1==e?"one":"other"},naq:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},nb:function(e,t){return t?"other":1==e?"one":"other"},nd:function(e,t){return t?"other":1==e?"one":"other"},ne:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},nn:function(e,t){return t?"other":1==e?"one":"other"},nnh:function(e,t){return t?"other":1==e?"one":"other"},no:function(e,t){return t?"other":1==e?"one":"other"},nqo:function(e,t){return"other"},nr:function(e,t){return t?"other":1==e?"one":"other"},nso:function(e,t){return t?"other":0==e||1==e?"one":"other"},ny:function(e,t){return t?"other":1==e?"one":"other"},nyn:function(e,t){return t?"other":1==e?"one":"other"},om:function(e,t){return t?"other":1==e?"one":"other"},or:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:function(e,t){return t?"other":1==e?"one":"other"},pa:function(e,t){return t?"other":0==e||1==e?"one":"other"},pap:function(e,t){return t?"other":1==e?"one":"other"},pl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":1==e&&i?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&1!=r&&(0==o||1==o)||i&&o>=5&&o<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),c=o&&n[0].slice(-2),s=r.slice(-2),u=r.slice(-1);return t?"other":o&&0==a||c>=11&&c<=19||2==i&&s>=11&&s<=19?"zero":1==a&&11!=c||2==i&&1==u&&11!=s||2!=i&&1==u?"one":"other"},ps:function(e,t){return t?"other":1==e?"one":"other"},pt:function(e,t){var n=String(e).split(".")[0];return t?"other":0==n||1==n?"one":"other"},"pt-PT":function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},rm:function(e,t){return t?"other":1==e?"one":"other"},ro:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},rof:function(e,t){return t?"other":1==e?"one":"other"},root:function(e,t){return"other"},ru:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o&&11!=a?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&0==o||i&&o>=5&&o<=9||i&&a>=11&&a<=14?"many":"other"},rwk:function(e,t){return t?"other":1==e?"one":"other"},sah:function(e,t){return"other"},saq:function(e,t){return t?"other":1==e?"one":"other"},sc:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},scn:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},sd:function(e,t){return t?"other":1==e?"one":"other"},sdh:function(e,t){return t?"other":1==e?"one":"other"},se:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},seh:function(e,t){return t?"other":1==e?"one":"other"},ses:function(e,t){return"other"},sg:function(e,t){return"other"},sh:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},shi:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},si:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"";return t?"other":0==e||1==e||0==r&&1==i?"one":"other"},sk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},sl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":i&&(3==o||4==o)||!i?"few":"other"},sma:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},smi:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},smj:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},smn:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},sms:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},sn:function(e,t){return t?"other":1==e?"one":"other"},so:function(e,t){return t?"other":1==e?"one":"other"},sq:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?1==e?"one":4==i&&14!=o?"many":"other":1==e?"one":"other"},sr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},ss:function(e,t){return t?"other":1==e?"one":"other"},ssy:function(e,t){return t?"other":1==e?"one":"other"},st:function(e,t){return t?"other":1==e?"one":"other"},sv:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1!=o&&2!=o||11==a||12==a?"other":"one":1==e&&r?"one":"other"},sw:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},syr:function(e,t){return t?"other":1==e?"one":"other"},ta:function(e,t){return t?"other":1==e?"one":"other"},te:function(e,t){return t?"other":1==e?"one":"other"},teo:function(e,t){return t?"other":1==e?"one":"other"},th:function(e,t){return"other"},ti:function(e,t){return t?"other":0==e||1==e?"one":"other"},tig:function(e,t){return t?"other":1==e?"one":"other"},tk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-1);return t?6==r||9==r||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=c&&6!=c&&9!=c?"one":"other"},tn:function(e,t){return t?"other":1==e?"one":"other"},to:function(e,t){return"other"},tr:function(e,t){return t?"other":1==e?"one":"other"},ts:function(e,t){return t?"other":1==e?"one":"other"},tzm:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},ug:function(e,t){return t?"other":1==e?"one":"other"},uk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1),c=o&&n[0].slice(-2),s=r.slice(-1),u=r.slice(-2);return t?3==a&&13!=c?"few":"other":i&&1==s&&11!=u?"one":i&&s>=2&&s<=4&&(u<12||u>14)?"few":i&&0==s||i&&s>=5&&s<=9||i&&u>=11&&u<=14?"many":"other"},ur:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},uz:function(e,t){return t?"other":1==e?"one":"other"},ve:function(e,t){return t?"other":1==e?"one":"other"},vi:function(e,t){return t&&1==e?"one":"other"},vo:function(e,t){return t?"other":1==e?"one":"other"},vun:function(e,t){return t?"other":1==e?"one":"other"},wa:function(e,t){return t?"other":0==e||1==e?"one":"other"},wae:function(e,t){return t?"other":1==e?"one":"other"},wo:function(e,t){return"other"},xh:function(e,t){return t?"other":1==e?"one":"other"},xog:function(e,t){return t?"other":1==e?"one":"other"},yi:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},yo:function(e,t){return"other"},yue:function(e,t){return"other"},zh:function(e,t){return"other"},zu:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"}})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){e.exports={date:n(4),duration:n(5),number:n(6),time:n(7)}},function(e,t,n){"use strict";function r(e,t,n,i){this.message=e,this.expected=t,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,n="";for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}return"Expected "+function(e){var t,r,i,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(i=e[t],n[i.type](i));if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},e.exports={SyntaxError:r,parse:function(e,t){t=void 0!==t?t:{};var n,i={},o={start:ke},a=ke,c=ve("#",!1),s=function(){return Ue[0]},u=function(e){return e.join("")},l="{",f=ve("{",!1),d="}",p=ve("}",!1),b=",",h=ve(",",!1),m="select",g=ve("select",!1),O=function(e,n){return t.strict&&Ue.unshift(!1),n},j=function(e,n){return t.strict&&Ue.shift(),{type:"select",arg:e,cases:n}},v="plural",w=ve("plural",!1),y="selectordinal",_=ve("selectordinal",!1),x=function(e,n,r,i){var o=("selectordinal"===n?t.ordinal:t.cardinal)||["zero","one","two","few","many","other"];return o&&o.length&&i.forEach((function(t){if(isNaN(t.key)&&o.indexOf(t.key)<0)throw new Error("Invalid key `"+t.key+"` for argument `"+e+"`. Valid "+n+" keys for this locale are `"+o.join("`, `")+"`, and explicit keys like `=0`.")})),Ue.shift(),{type:n,arg:e,offset:r||0,cases:i}},T=ye("identifier"),k=/^[^\t-\r \x85\u200E\u200F\u2028\u2029!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,S=we([["\t","\r"]," ","
","","","\u2028","\u2029",["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←",""],["─","❵"],["➔","⯿"],["⸀",""],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!0,!1),E=function(e,t){return{key:e,tokens:t}},N=ye("plural offset"),I="offset",C=ve("offset",!1),L=ve(":",!1),A=ve("=",!1),P="number",R=ve("number",!1),M="date",D=ve("date",!1),U="time",B=ve("time",!1),q="spellout",F=ve("spellout",!1),V="ordinal",z=ve("ordinal",!1),$="duration",H=ve("duration",!1),X=function(e){if(t.strict||/^\d/.test(e))return!1;switch(e.toLowerCase()){case"select":case"plural":case"selectordinal":return!1;default:return!0}},G=function(e){return!t.strict},K=ye("a valid (strict) function parameter"),J=/^[^'{}]/,W=we(["'","{","}"],!0,!1),Y=ve("'",!1),Z=ye("doubled apostrophe"),Q=ve("''",!1),ee=/^[^']/,te=we(["'"],!0,!1),ne=ve("'{",!1),re=ve("'}",!1),ie=ye("escaped string"),oe=ve("'#",!1),ae=ye("plain char"),ce=/^[^{}#\0-\x08\x0E-\x1F\x7F]/,se=we(["{","}","#",["\0","\b"],["",""],""],!0,!1),ue=ye("integer"),le=/^[0-9]/,fe=we([["0","9"]],!1,!1),de=ye("white space"),pe=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,be=we([["\t","\r"]," ","
","","","\u2028","\u2029"],!1,!1),he=0,me=[{line:1,column:1}],ge=0,Oe=[],je=0;if("startRule"in t){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');a=o[t.startRule]}function ve(e,t){return{type:"literal",text:e,ignoreCase:t}}function we(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function ye(e){return{type:"other",description:e}}function _e(t){var n,r=me[t];if(r)return r;for(n=t-1;!me[n];)n--;for(r={line:(r=me[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return me[t]=r,r}function xe(e,t){var n=_e(e),r=_e(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function Te(e){he<ge||(he>ge&&(ge=he,Oe=[]),Oe.push(e))}function ke(){var e,t;for(e=[],t=Se();t!==i;)e.push(t),t=Se();return e}function Se(){var t,n,r;if((t=function(){var t,n,r,o;return t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i&&De()!==i&&(r=Ee())!==i&&De()!==i?(125===e.charCodeAt(he)?(o=d,he++):(o=i,0===je&&Te(p)),o!==i?t=n=function(e){return{type:"argument",arg:e}}(r):(he=t,t=i)):(he=t,t=i),t}())===i&&(t=function(){var t,n,r,o,a,c,s,u,v;if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i)if(De()!==i)if((r=Ee())!==i)if(De()!==i)if(44===e.charCodeAt(he)?(o=b,he++):(o=i,0===je&&Te(h)),o!==i)if(De()!==i)if(e.substr(he,6)===m?(a=m,he+=6):(a=i,0===je&&Te(g)),a!==i&&(a=O(0,a)),a!==i)if((a=De())!==i)if(44===e.charCodeAt(he)?(c=b,he++):(c=i,0===je&&Te(h)),c!==i)if(De()!==i){if(s=[],(u=Ne())!==i)for(;u!==i;)s.push(u),u=Ne();else s=i;s!==i&&(u=De())!==i?(125===e.charCodeAt(he)?(v=d,he++):(v=i,0===je&&Te(p)),v!==i?t=n=j(r,s):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;return t}())===i&&(t=function(){var t,n,r,o,a,c,s,u,m,g,O;if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i)if(De()!==i)if((r=Ee())!==i)if(De()!==i)if(44===e.charCodeAt(he)?(o=b,he++):(o=i,0===je&&Te(h)),o!==i)if(De()!==i)if(e.substr(he,6)===v?(c=v,he+=6):(c=i,0===je&&Te(w)),c===i&&(e.substr(he,13)===y?(c=y,he+=13):(c=i,0===je&&Te(_))),c!==i&&(c=function(e,t){return Ue.unshift(!0),t}(0,c)),(a=c)!==i)if((c=De())!==i)if(44===e.charCodeAt(he)?(s=b,he++):(s=i,0===je&&Te(h)),s!==i)if(De()!==i)if((u=function(){var t,n,r,o;return je++,t=he,De()!==i?(e.substr(he,6)===I?(n=I,he+=6):(n=i,0===je&&Te(C)),n!==i&&De()!==i?(58===e.charCodeAt(he)?(r=":",he++):(r=i,0===je&&Te(L)),r!==i&&De()!==i&&(o=Me())!==i&&De()!==i?t=o:(he=t,t=i)):(he=t,t=i)):(he=t,t=i),je--,t===i&&0===je&&Te(N),t}())===i&&(u=null),u!==i){if(m=[],(g=Ie())!==i)for(;g!==i;)m.push(g),g=Ie();else m=i;m!==i&&(g=De())!==i?(125===e.charCodeAt(he)?(O=d,he++):(O=i,0===je&&Te(p)),O!==i?t=n=x(r,a,u,m):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;return t}())===i&&(t=function(){var t,n,r,o,a,c,s;return t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i&&De()!==i&&(r=Ee())!==i&&De()!==i?(44===e.charCodeAt(he)?(o=b,he++):(o=i,0===je&&Te(h)),o!==i&&De()!==i&&(a=function(){var t,n,r,o,a;return e.substr(he,6)===P?(t=P,he+=6):(t=i,0===je&&Te(R)),t===i&&(e.substr(he,4)===M?(t=M,he+=4):(t=i,0===je&&Te(D)),t===i&&(e.substr(he,4)===U?(t=U,he+=4):(t=i,0===je&&Te(B)),t===i&&(e.substr(he,8)===q?(t=q,he+=8):(t=i,0===je&&Te(F)),t===i&&(e.substr(he,7)===V?(t=V,he+=7):(t=i,0===je&&Te(z)),t===i&&(e.substr(he,8)===$?(t=$,he+=8):(t=i,0===je&&Te(H)),t===i&&(t=he,n=he,je++,e.substr(he,6)===m?(r=m,he+=6):(r=i,0===je&&Te(g)),je--,r===i?n=void 0:(he=n,n=i),n!==i?(r=he,je++,e.substr(he,6)===v?(o=v,he+=6):(o=i,0===je&&Te(w)),je--,o===i?r=void 0:(he=r,r=i),r!==i?(o=he,je++,e.substr(he,13)===y?(a=y,he+=13):(a=i,0===je&&Te(_)),je--,a===i?o=void 0:(he=o,o=i),o!==i&&(a=Ee())!==i&&(X(a)?void 0:i)!==i?t=n=a:(he=t,t=i)):(he=t,t=i)):(he=t,t=i))))))),t}())!==i&&De()!==i?((c=function(){var t,n,r,o;if(t=he,De()!==i)if(44===e.charCodeAt(he)?(n=b,he++):(n=i,0===je&&Te(h)),n!==i){for(r=[],o=Se();o!==i;)r.push(o),o=Se();r!==i&&(o=(o=G())?void 0:i)!==i?t=function(e){return{tokens:e}}(r):(he=t,t=i)}else he=t,t=i;else he=t,t=i;if(t===i)if(t=he,De()!==i)if(44===e.charCodeAt(he)?(n=b,he++):(n=i,0===je&&Te(h)),n!==i){for(r=[],o=Le();o!==i;)r.push(o),o=Le();r!==i?t=function(e){return{tokens:[e.join("")]}}(r):(he=t,t=i)}else he=t,t=i;else he=t,t=i;return t}())===i&&(c=null),c!==i?(125===e.charCodeAt(he)?(s=d,he++):(s=i,0===je&&Te(p)),s!==i?t=n=function(e,t,n){return{type:"function",arg:e,key:t,param:n}}(r,a,c):(he=t,t=i)):(he=t,t=i)):(he=t,t=i)):(he=t,t=i),t}())===i&&(t=he,35===e.charCodeAt(he)?(n="#",he++):(n=i,0===je&&Te(c)),n!==i&&(r=(r=s())?void 0:i)!==i?t=n={type:"octothorpe"}:(he=t,t=i),t===i)){if(t=he,n=[],(r=Re())!==i)for(;r!==i;)n.push(r),r=Re();else n=i;n!==i&&(n=u(n)),t=n}return t}function Ee(){var t,n,r;if(je++,t=he,n=[],k.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(S)),r!==i)for(;r!==i;)n.push(r),k.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(S));else n=i;return t=n!==i?e.substring(t,he):n,je--,t===i&&(n=i,0===je&&Te(T)),t}function Ne(){var e,t,n;return e=he,De()!==i&&(t=Ee())!==i&&De()!==i&&(n=Ce())!==i?e=E(t,n):(he=e,e=i),e}function Ie(){var t,n,r;return t=he,De()!==i&&(n=function(){var t,n,r;return(t=Ee())===i&&(t=he,61===e.charCodeAt(he)?(n="=",he++):(n=i,0===je&&Te(A)),n!==i&&(r=Me())!==i?t=n=r:(he=t,t=i)),t}())!==i&&De()!==i&&(r=Ce())!==i?t=E(n,r):(he=t,t=i),t}function Ce(){var t,n,r,o,a,c;if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i)if(r=he,(o=De())!==i?(a=he,je++,123===e.charCodeAt(he)?(c=l,he++):(c=i,0===je&&Te(f)),je--,c!==i?(he=a,a=void 0):a=i,a!==i?r=o=[o,a]:(he=r,r=i)):(he=r,r=i),r===i&&(r=null),r!==i){for(o=[],a=Se();a!==i;)o.push(a),a=Se();o!==i&&(a=De())!==i?(125===e.charCodeAt(he)?(c=d,he++):(c=i,0===je&&Te(p)),c!==i?t=n=o:(he=t,t=i)):(he=t,t=i)}else he=t,t=i;else he=t,t=i;return t}function Le(){var t,n,r,o;if(je++,t=he,n=[],J.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(W)),r!==i)for(;r!==i;)n.push(r),J.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(W));else n=i;if(n!==i&&(n=function(e){return e.join("")}(n)),(t=n)===i&&(t=Ae())===i&&(t=he,39===e.charCodeAt(he)?(n="'",he++):(n=i,0===je&&Te(Y)),n!==i&&(r=Pe())!==i?(39===e.charCodeAt(he)?(o="'",he++):(o=i,0===je&&Te(Y)),o!==i?t=n=r:(he=t,t=i)):(he=t,t=i),t===i))if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i){for(r=[],o=Le();o!==i;)r.push(o),o=Le();r!==i?(125===e.charCodeAt(he)?(o=d,he++):(o=i,0===je&&Te(p)),o!==i?t=n=function(e){return"{"+e.join("")+"}"}(r):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;return je--,t===i&&(n=i,0===je&&Te(K)),t}function Ae(){var t,n;return je++,"''"===e.substr(he,2)?(n="''",he+=2):(n=i,0===je&&Te(Q)),n!==i&&(n="'"),je--,(t=n)===i&&(n=i,0===je&&Te(Z)),t}function Pe(){var t,n,r;if((t=Ae())===i){if(t=he,n=[],ee.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(te)),r!==i)for(;r!==i;)n.push(r),ee.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(te));else n=i;n!==i&&(n=u(n)),t=n}return t}function Re(){var t,n;return(t=Ae())===i&&(t=function(){var t,n,r,o,a,c;if(je++,(t=function(){var t,n,r,o;if(t=he,"'{"===e.substr(he,2)?(n="'{",he+=2):(n=i,0===je&&Te(ne)),n!==i){for(r=[],o=Pe();o!==i;)r.push(o),o=Pe();r!==i?(39===e.charCodeAt(he)?(o="'",he++):(o=i,0===je&&Te(Y)),o!==i?t=n=function(e){return"{"+e.join("")}(r):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;if(t===i)if(t=he,"'}"===e.substr(he,2)?(n="'}",he+=2):(n=i,0===je&&Te(re)),n!==i){for(r=[],o=Pe();o!==i;)r.push(o),o=Pe();r!==i?(39===e.charCodeAt(he)?(o="'",he++):(o=i,0===je&&Te(Y)),o!==i?t=n=function(e){return"}"+e.join("")}(r):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;return t}())===i){if(t=he,n=he,r=he,"'#"===e.substr(he,2)?(o="'#",he+=2):(o=i,0===je&&Te(oe)),o!==i){for(a=[],c=Pe();c!==i;)a.push(c),c=Pe();a!==i?(39===e.charCodeAt(he)?(c="'",he++):(c=i,0===je&&Te(Y)),c!==i?r=o=function(e){return"#"+e.join("")}(a):(he=r,r=i)):(he=r,r=i)}else he=r,r=i;r!==i&&(o=(o=s())?void 0:i)!==i?n=r=[r,o]:(he=n,n=i),n!==i&&(n=function(e){return e[0]}(n)),(t=n)===i&&(39===e.charCodeAt(he)?(t="'",he++):(t=i,0===je&&Te(Y)))}return je--,t===i&&(n=i,0===je&&Te(ie)),t}())===i&&(t=he,35===e.charCodeAt(he)?(n="#",he++):(n=i,0===je&&Te(c)),n!==i&&(Ue[0]?i:void 0)!==i?t=n=n:(he=t,t=i),t===i&&(t=function(){var t;return je++,ce.test(e.charAt(he))?(t=e.charAt(he),he++):(t=i,0===je&&Te(se)),je--,t===i&&0===je&&Te(ae),t}())),t}function Me(){var t,n,r;if(je++,t=he,n=[],le.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(fe)),r!==i)for(;r!==i;)n.push(r),le.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(fe));else n=i;return t=n!==i?e.substring(t,he):n,je--,t===i&&(n=i,0===je&&Te(ue)),t}function De(){var t,n,r;for(je++,t=he,n=[],pe.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(be));r!==i;)n.push(r),pe.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(be));return t=n!==i?e.substring(t,he):n,je--,t===i&&(n=i,0===je&&Te(de)),t}var Ue=[!1];if((n=a())!==i&&he===e.length)return n;throw n!==i&&he<e.length&&Te({type:"end"}),function(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}(Oe,ge<e.length?e.charAt(ge):null,ge<e.length?xe(ge,ge+1):xe(ge,ge))}}},function(e,t,n){var r,i,o=[{cardinal:["other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["one","other"]},{cardinal:["one","two","other"],ordinal:["other"]}];void 0===(i="function"==typeof(r={af:o[1],ak:o[1],am:o[1],ar:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},ars:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},as:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},asa:o[1],ast:o[1],az:{cardinal:["one","other"],ordinal:["one","few","many","other"]},be:{cardinal:["one","few","many","other"],ordinal:["few","other"]},bem:o[1],bez:o[1],bg:o[1],bh:o[1],bm:o[0],bn:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},bo:o[0],br:{cardinal:["one","two","few","many","other"],ordinal:["other"]},brx:o[1],bs:{cardinal:["one","few","other"],ordinal:["other"]},ca:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ce:o[1],cgg:o[1],chr:o[1],ckb:o[1],cs:{cardinal:["one","few","many","other"],ordinal:["other"]},cy:{cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]},da:o[1],de:o[1],dsb:{cardinal:["one","two","few","other"],ordinal:["other"]},dv:o[1],dz:o[0],ee:o[1],el:o[1],en:{cardinal:["one","other"],ordinal:["one","two","few","other"]},eo:o[1],es:o[1],et:o[1],eu:o[1],fa:o[1],ff:o[1],fi:o[1],fil:o[2],fo:o[1],fr:o[2],fur:o[1],fy:o[1],ga:{cardinal:["one","two","few","many","other"],ordinal:["one","other"]},gd:{cardinal:["one","two","few","other"],ordinal:["one","two","few","other"]},gl:o[1],gsw:o[1],gu:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},guw:o[1],gv:{cardinal:["one","two","few","many","other"],ordinal:["other"]},ha:o[1],haw:o[1],he:{cardinal:["one","two","many","other"],ordinal:["other"]},hi:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},hr:{cardinal:["one","few","other"],ordinal:["other"]},hsb:{cardinal:["one","two","few","other"],ordinal:["other"]},hu:o[2],hy:o[2],ia:o[1],id:o[0],ig:o[0],ii:o[0],in:o[0],io:o[1],is:o[1],it:{cardinal:["one","other"],ordinal:["many","other"]},iu:o[3],iw:{cardinal:["one","two","many","other"],ordinal:["other"]},ja:o[0],jbo:o[0],jgo:o[1],ji:o[1],jmc:o[1],jv:o[0],jw:o[0],ka:{cardinal:["one","other"],ordinal:["one","many","other"]},kab:o[1],kaj:o[1],kcg:o[1],kde:o[0],kea:o[0],kk:{cardinal:["one","other"],ordinal:["many","other"]},kkj:o[1],kl:o[1],km:o[0],kn:o[1],ko:o[0],ks:o[1],ksb:o[1],ksh:{cardinal:["zero","one","other"],ordinal:["other"]},ku:o[1],kw:o[3],ky:o[1],lag:{cardinal:["zero","one","other"],ordinal:["other"]},lb:o[1],lg:o[1],lkt:o[0],ln:o[1],lo:{cardinal:["other"],ordinal:["one","other"]},lt:{cardinal:["one","few","many","other"],ordinal:["other"]},lv:{cardinal:["zero","one","other"],ordinal:["other"]},mas:o[1],mg:o[1],mgo:o[1],mk:{cardinal:["one","other"],ordinal:["one","two","many","other"]},ml:o[1],mn:o[1],mo:{cardinal:["one","few","other"],ordinal:["one","other"]},mr:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ms:{cardinal:["other"],ordinal:["one","other"]},mt:{cardinal:["one","few","many","other"],ordinal:["other"]},my:o[0],nah:o[1],naq:o[3],nb:o[1],nd:o[1],ne:o[2],nl:o[1],nn:o[1],nnh:o[1],no:o[1],nqo:o[0],nr:o[1],nso:o[1],ny:o[1],nyn:o[1],om:o[1],or:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},os:o[1],pa:o[1],pap:o[1],pl:{cardinal:["one","few","many","other"],ordinal:["other"]},prg:{cardinal:["zero","one","other"],ordinal:["other"]},ps:o[1],pt:o[1],"pt-PT":o[1],rm:o[1],ro:{cardinal:["one","few","other"],ordinal:["one","other"]},rof:o[1],root:o[0],ru:{cardinal:["one","few","many","other"],ordinal:["other"]},rwk:o[1],sah:o[0],saq:o[1],sc:{cardinal:["one","other"],ordinal:["many","other"]},scn:{cardinal:["one","other"],ordinal:["many","other"]},sd:o[1],sdh:o[1],se:o[3],seh:o[1],ses:o[0],sg:o[0],sh:{cardinal:["one","few","other"],ordinal:["other"]},shi:{cardinal:["one","few","other"],ordinal:["other"]},si:o[1],sk:{cardinal:["one","few","many","other"],ordinal:["other"]},sl:{cardinal:["one","two","few","other"],ordinal:["other"]},sma:o[3],smi:o[3],smj:o[3],smn:o[3],sms:o[3],sn:o[1],so:o[1],sq:{cardinal:["one","other"],ordinal:["one","many","other"]},sr:{cardinal:["one","few","other"],ordinal:["other"]},ss:o[1],ssy:o[1],st:o[1],sv:o[2],sw:o[1],syr:o[1],ta:o[1],te:o[1],teo:o[1],th:o[0],ti:o[1],tig:o[1],tk:{cardinal:["one","other"],ordinal:["few","other"]},tl:o[2],tn:o[1],to:o[0],tr:o[1],ts:o[1],tzm:o[1],ug:o[1],uk:{cardinal:["one","few","many","other"],ordinal:["few","other"]},ur:o[1],uz:o[1],ve:o[1],vi:{cardinal:["other"],ordinal:["one","other"]},vo:o[1],vun:o[1],wa:o[1],wae:o[1],wo:o[0],xh:o[1],xog:o[1],yi:o[1],yo:o[0],yue:o[0],zh:o[0],zu:o[1]})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t){function n(e,t,n){var r={day:"numeric",month:"short",year:"numeric"};switch(n){case"full":r.weekday="long";case"long":r.month="long";break;case"short":r.month="numeric"}return new Date(e).toLocaleDateString(t,r)}e.exports=function(){return n}},function(e,t){function n(e){if(!isFinite(e))return String(e);var t="";e<0?(t="-",e=Math.abs(e)):e=Number(e);var n=e%60,r=[Math.round(n)===n?n:n.toFixed(3)];return e<60?r.unshift(0):(e=Math.round((e-r[0])/60),r.unshift(e%60),e>=60&&(e=Math.round((e-r[0])/60),r.unshift(e))),t+r.shift()+":"+r.map((function(e){return e<10?"0"+String(e):String(e)})).join(":")}e.exports=function(){return n}},function(e,t){e.exports=function(e){var t=function(e,t,n){var r=n&&n.split(":")||[],i={integer:{maximumFractionDigits:0},percent:{style:"percent"},currency:{style:"currency",currency:r[1]&&r[1].trim()||CURRENCY,minimumFractionDigits:2,maximumFractionDigits:2}};return new Intl.NumberFormat(t,i[r[0]]||{}).format(e)}.toString().replace("CURRENCY",JSON.stringify(e.currency||"USD")).match(/\(([^)]*)\)[^{]*{([\s\S]*)}/);return new Function(t[1],t[2])}},function(e,t){function n(e,t,n){var r={second:"numeric",minute:"numeric",hour:"numeric"};switch(n){case"full":case"long":r.timeZoneName="short";break;case"short":delete r.second}return new Date(e).toLocaleTimeString(t,r)}e.exports=function(){return n}},function(e,t,n){"use strict";n.r(t);var r=n(1),i=n.n(r),o=n(2),a={break:!0,continue:!0,delete:!0,else:!0,for:!0,function:!0,if:!0,in:!0,new:!0,return:!0,this:!0,typeof:!0,var:!0,void:!0,while:!0,with:!0,case:!0,catch:!0,default:!0,do:!0,finally:!0,instanceof:!0,switch:!0,throw:!0,try:!0},c={debugger:!0,class:!0,enum:!0,extends:!0,super:!0,const:!0,export:!0,import:!0,null:!0,true:!0,false:!0,implements:!0,let:!0,private:!0,public:!0,yield:!0,interface:!0,package:!0,protected:!0,static:!0};function s(e,t){if(/^[A-Z_$][0-9A-Z_$]*$/i.test(e)&&!a[e])return t?"".concat(t,".").concat(e):e;var n=JSON.stringify(e);return t?t+"[".concat(n,"]"):n}function u(e){var t=e.trim().replace(/\W+/g,"_");return a[t]||c[t]||/^\d/.test(t)?"_"+t:t}var l=new RegExp("^"+["ar","ckb","fa","he","ks($|[^bfh])","lrc","mzn","pa-Arab","ps","ug","ur","uz-Arab","yi"].join("|^"));function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mf=t,this.lc=null,this.locales={},this.runtime={},this.formatters={}}var t,n;return t=e,(n=[{key:"compile",value:function(e,t,n){var r=this;if("object"!=f(e)){this.lc=t;var i=n[t]||{cardinal:[],ordinal:[]};i.strict=!!this.mf.options.strictNumberSign;var a=Object(o.parse)(e,i).map((function(e){return r.token(e)}));return"function(d) { return ".concat(a.join(" + ")||'""',"; }")}var c={};for(var s in e){var u=n.hasOwnProperty(s)?s:t;c[s]=this.compile(e[s],u,n)}return c}},{key:"cases",value:function(e,t){var n=this,r="select"===e.type||!this.mf.hasCustomPluralFuncs,i=e.cases.map((function(e){var i=e.key,o=e.tokens;"other"===i&&(r=!1);var a=o.map((function(e){return n.token(e,t)}));return s(i)+": "+(a.join(" + ")||'""')}));if(r)throw new Error("No 'other' form found in "+JSON.stringify(e));return"{ ".concat(i.join(", ")," }")}},{key:"token",value:function(e,t){var n,r=this;if("string"==typeof e)return JSON.stringify(e);var i,o,a,c,f=[s(e.arg,"d")];switch(e.type){case"argument":return this.mf.options.biDiSupport?(i=f[0],o=this.lc,a=l.test(o),c=JSON.stringify(a?"":""),"".concat(c," + ").concat(i," + ").concat(c)):f[0];case"select":n="select",t&&this.mf.options.strictNumberSign&&(t=null),f.push(this.cases(e,t)),this.runtime.select=!0;break;case"selectordinal":n="plural",f.push(0,u(this.lc),this.cases(e,e),1),this.locales[this.lc]=!0,this.runtime.plural=!0;break;case"plural":n="plural",f.push(e.offset||0,u(this.lc),this.cases(e,e)),this.locales[this.lc]=!0,this.runtime.plural=!0;break;case"function":if(!(e.key in this.mf.fmt)&&e.key in this.mf.constructor.formatters){var d=this.mf.constructor.formatters[e.key];this.mf.fmt[e.key]=d(this.mf)}if(!this.mf.fmt[e.key])throw new Error("Formatting function ".concat(JSON.stringify(e.key)," not found!"));if(f.push(JSON.stringify(this.lc)),e.param){t&&this.mf.options.strictNumberSign&&(t=null);var p=e.param.tokens.map((function(e){return r.token(e,t)}));f.push("("+(p.join(" + ")||'""')+").trim()")}n=s(e.key,"fmt"),this.formatters[e.key]=!0;break;case"octothorpe":if(!t)return'"#"';n="number",f=[s(t.arg,"d"),JSON.stringify(t.arg)],t.offset&&f.push(t.offset),this.runtime.number=!0}if(!n)throw new Error("Parser error for token "+JSON.stringify(e));return"".concat(n,"(").concat(f.join(", "),")")}}])&&d(t.prototype,n),e}(),b=n(3),h=n.n(b),m=n(0),g=n.n(m);function O(e,t,n){var r=function(){return t.apply(this,arguments)};if(r.toString=function(){return t.toString()},n){var i=h.a[e]||{};r.cardinal=i.cardinal,r.ordinal=i.ordinal}else r.cardinal=[],r.ordinal=[];return r}function j(e,t){for(var n=t.pluralKeyChecks,r=String(e);r;r=r.replace(/[-_]?[^-_]*$/,"")){var i=g.a[r];if(i)return O(r,i,n)}throw new Error("Localisation function not found for locale "+JSON.stringify(e))}function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.plural=function(e,t,n,r,i){if({}.hasOwnProperty.call(r,e))return r[e];t&&(e-=t);var o=n(e,i);return o in r?r[o]:r.other},this.select=function(e,t){return{}.hasOwnProperty.call(t,e)?t[e]:t.other},this.mf=t,this.setStrictNumber(t.options.strictNumberSign)}var t,n;return t=e,(n=[{key:"setStrictNumber",value:function(t){this.number=t?e.strictNumber:e.defaultNumber}},{key:"toString",value:function(e,t){for(var n={},r=Object.keys(t.locales),i=0;i<r.length;++i){var o=r[i];n[u(o)]=e[o]}for(var a=Object.keys(t.runtime),c=0;c<a.length;++c){var l=a[c];n[l]=this[l]}var f=Object.keys(t.formatters);if(f.length>0){n.fmt={};for(var d=0;d<f.length;++d){var p=f[d];n.fmt[p]=this.mf.fmt[p]}}return function e(t,n){if("object"!=v(t)){var r=t.toString().replace(/^(function )\w*/,"$1"),i=/([ \t]*)\S.*$/.exec(r);return i?r.replace(new RegExp("^"+i[1],"mg"),""):r}var o=[];for(var a in t){var c=e(t[a],n+1);o.push(0===n?"var ".concat(a," = ").concat(c,";\n"):"".concat(s(a),": ").concat(c))}if(0===n)return o.join("");if(0===o.length)return"{}";for(var u=" ";--n;)u+=" ";var l=o.join(",\n").replace(/^/gm,u);return"{\n".concat(l,"\n}")}(n,0)}}])&&w(t.prototype,n),e}();function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),e}y.defaultNumber=function(e,t,n){if(!n)return e;if(isNaN(e))throw new Error("Can't apply offset:"+n+" to argument `"+t+"` with non-numerical value "+JSON.stringify(e)+".");return e-n},y.strictNumber=function(e,t,n){if(isNaN(e))throw new Error("Argument `"+t+"` has non-numerical value "+JSON.stringify(e)+".");return e-(n||0)},n.d(t,"default",(function(){return k}));var k=function(){function e(t,n){var r=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=Object.assign({biDiSupport:!1,customFormatters:null,pluralKeyChecks:!0,strictNumberSign:!1},n),this.pluralFuncs={},"string"==typeof t)this.pluralFuncs[t]=j(t,this.options),this.defaultLocale=t;else if(Array.isArray(t))t.forEach((function(e){r.pluralFuncs[e]=j(e,r.options)})),this.defaultLocale=t[0];else{if(t)for(var i=Object.keys(t),o=0;o<i.length;++o){var a=i[o];if("function"!=typeof t[a]){var c="Expected function value for locale "+String(a);throw new Error(c)}this.pluralFuncs[a]=t[a],this.defaultLocale||(this.defaultLocale=a)}this.defaultLocale?this.hasCustomPluralFuncs=!0:(this.defaultLocale=e.defaultLocale,this.hasCustomPluralFuncs=!1)}this.fmt=Object.assign({},this.options.customFormatters),this.runtime=new y(this)}return T(e,null,[{key:"escape",value:function(e,t){var n=t?/[#{}]/g:/[{}]/g;return String(e).replace(n,"'$&'")}}]),T(e,[{key:"addFormatters",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];this.fmt[r]=e[r]}return this}},{key:"disablePluralKeyChecks",value:function(){for(var e in this.options.pluralKeyChecks=!1,this.pluralFuncs){var t=this.pluralFuncs[e];t&&(t.cardinal=[],t.ordinal=[])}return this}},{key:"setBiDiSupport",value:function(e){return this.options.biDiSupport=!!e||void 0===e,this}},{key:"setStrictNumberSign",value:function(e){return this.options.strictNumberSign=!!e||void 0===e,this.runtime.setStrictNumber(this.options.strictNumberSign),this}},{key:"compile",value:function(e,t){var n={};if(0===Object.keys(this.pluralFuncs).length)if(t){var r=j(t,this.options);if(!r){var i=JSON.stringify(t);throw new Error("Locale ".concat(i," not found!"))}n[t]=r}else t=this.defaultLocale,n=function(e){for(var t=e.pluralKeyChecks,n={},r=Object.keys(g.a),i=0;i<r.length;++i){var o=r[i];n[o]=O(o,g.a[o],t)}return n}(this.options);else if(t){var o=this.pluralFuncs[t];if(!o){var a=JSON.stringify(t),c=JSON.stringify(this.pluralFuncs);throw new Error("Locale ".concat(a," not found in ").concat(c,"!"))}n[t]=o}else t=this.defaultLocale,n=this.pluralFuncs;var l=new p(this),f=l.compile(e,t,n);if("object"!=_(e)){var d=new Function("number, plural, select, fmt",u(t),"return "+f),b=this.runtime;return d(b.number,b.plural,b.select,this.fmt,n[t])}var h=this.runtime.toString(n,l)+"\n",m=function e(t,n){if(n||(n=0),"object"!=_(t))return t;for(var r="",i=0;i<n;++i)r+=" ";var o=[];for(var a in t){var c=e(t[a],n+1);o.push("\n".concat(r," ").concat(s(a),": ").concat(c))}return"{".concat(o.join(","),"\n").concat(r,"}")}(f),v=new Function(h+"return "+m)();if(v.hasOwnProperty("toString"))throw new Error("The top-level message key `toString` is reserved");return v.toString=function(e){return e&&"export default"!==e?e.indexOf(".")>-1?h+e+" = "+m:h+["(function (root, G) {",' if (typeof define === "function" && define.amd) { define(G); }',' else if (typeof exports === "object") { module.exports = G; }'," else { "+s(e,"root")+" = G; }","})(this, "+m+");"].join("\n"):h+"export default "+m},v}}]),e}();k.defaultLocale="en",k.formatters=i.a}]).default},function(e,t,n){var r;
|
|
1
|
+
!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=82)}([function(e,t,n){"use strict";n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return h}));var r=n(8),i=n(1);let o,a=null,c=null,s=Object(i.a)(()=>r.a.trigger("SET_PROPS"),150);function u(e){c=e}function l(){if(!c)throw new Error("Env not yet initialized");return c}function f(e){a=e,a.silentSetter&&(s=null)}function d(){if(!a)throw new Error("Client not yet initialized");return a}function p(){return d().realTimePreview?"realtime_preview":d().preview?"preview":"formal"}function b(e,t){e&&t&&(o(e,t),s&&s())}function h(e){o=e}r.a.on("ERROR_ABORT",(e,t)=>{d().error(t)})},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"t",(function(){return a})),n.d(t,"k",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return l})),n.d(t,"s",(function(){return f})),n.d(t,"l",(function(){return d})),n.d(t,"g",(function(){return p})),n.d(t,"f",(function(){return b})),n.d(t,"p",(function(){return h})),n.d(t,"m",(function(){return m})),n.d(t,"o",(function(){return g})),n.d(t,"b",(function(){return O})),n.d(t,"c",(function(){return j})),n.d(t,"a",(function(){return v})),n.d(t,"q",(function(){return w})),n.d(t,"r",(function(){return y})),n.d(t,"n",(function(){return _})),n.d(t,"j",(function(){return x}));var r=n(7);const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");function o(e){return e.replace(/</g,"_-v-w^l-t-_").replace(/>/g,"^-v-w_g-t-^")}function a(e){return e.replace(/_-v-w\^l-t-_/g,"<").replace(/\^-v-w_g-t-\^/g,">")}function c(e,t){return t}function s(e=1,t=5){const n=p(e,t),r=i.length;let o="";for(let e=0;e<n;e++){const e=p(0,r);o+=i[e]}return o}function u(e,t){return t&&t.forEach(t=>{e+="-"+f(t.varList[t.currentIndex].uuid)}),e}function l(){const e=new Array(36);let t,n=0;for(let r=0;r<36;r++)8==r||13==r||18==r||23==r?e[r]="-":14==r?e[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),t=15&n,n>>=4,e[r]=i[19==r?3&t|8:t]);return e.join("").toLowerCase()}function f(e){return e.substr(e.length-8)}function d(e="",t=""){return e=e.toLowerCase(),t=t.toLowerCase(),8===e.length&&t.length>8?e===f(t):e.length>8&&8===t.length?f(e)===t:e===t}function p(e,t){return e>t&&([e,t]=[t,e]),e+b(t-e+1)}function b(e){return Math.floor(Math.random()*e)}function h(e,t){const n=[...e];if(Object(r.b)(t))return n;if(0===(t=Number(t)))return[];if(t<0||isNaN(t))return n;if(1===t)return n.splice(b(n.length),1);const i=[];for(n.length<t&&(t=n.length);i.length<t;){const e=b(n.length);i.push(n.splice(e,1)[0])}return i}function m(e,t){e&&"object"==typeof e&&Object.keys(e).forEach(n=>{const r=e[n];Array.isArray(r)&&r.forEach(e=>{m(e,t)}),"object"==typeof r&&m(r,t),t(e,n)})}function g(e,t){if(e<t)throw new Error("can not random distribute");const n=function(e,t){const n=[];for(;n.length<t;){const t=p(1,e-1);n.includes(t)||n.push(t)}return n.sort((e,t)=>e>t?1:-1),n}(e,t-1),r=n.map((e,t)=>e-(n[t-1]||0));return r.push(e-n[n.length-1]),r}function O(e){const t=new WeakMap;return function e(n){if(!n||"object"!=typeof n)return n;if(n instanceof Array)return n.map(t=>e(t));const r=t.get(n);if(r)return r;const i={};return t.set(n,i),Object.keys(n).forEach(t=>{i[t]=e(n[t])}),i}(e)}function j(e){setTimeout(()=>{throw"string"==typeof e?new Error(e):e})}function v(e,t=0){let n=-1;return function(){const r=arguments,i=this;clearTimeout(n),n=setTimeout(()=>{e.apply(i,r)},t)}}async function w(e,t,n){const r=[];e.replace(t,(e,...t)=>(r.push(n(e,...t)),e));const i=await Promise.all(r);return e.replace(t,()=>i.shift())}function y(e=0){return new Promise(t=>setTimeout(t,e))}function _(e){return Promise.resolve(e)}function x(e){return e instanceof Promise?e:_(e)}},function(e,t,n){"use strict";n.d(t,"g",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"f",(function(){return h}));var r=n(8),i=n(3),o=n(0),a=n(9);let c=!1;const s=["zh_cn","en_us"];async function u(e){const t=i.d();let n=t[e=e.toLowerCase()];n||(n=t[e="en_us"]);if(!i.c()[e]){let t;try{t=await Object(a.b)(n,{type:"GET"})}catch(e){t=await Object(a.b)(n.replace(".com/",".io/"),{type:"GET"})}i.g(e,t)}}function l(e,t){let n=Object(o.c)().storage.get("language")||function(){const e=Object(o.c)().system.getLang();return e?e.replace(/-/g,"_").toLowerCase():"en_us"}();if(e&&t){e.some(e=>e.id===n)||(n=t)}return n}function f(e,t){e!==Object(o.c)().storage.get("language")&&(p(e,!0),t&&Object(o.c)().storage.set("lang-resume","true"),Object(o.c)().hook.beforeForceLeave(),Object(o.c)().app.reload())}function d(e){let t="en_us";s.includes(e)&&(t=e),i.h(t),Object(o.b)().setLocale(t),r.a.trigger("LANG_CHANGE"),Object(o.c)().hook.onLangChange(t)}function p(e="en_us",t=!1){return Object(o.c)().storage.set("language",e),t||d(e),c=!0,e}function b(e){return e.replace(/\{(\w+),.+?(\w+)\}\s?\}/g,(e,t,n)=>`{${t}} ${n}`)}function h(e,t){c||c||p(l());const n=i.e(e);return n?t?Object(o.c)().system.translate(n,t):n:`missing translation for ${e} ${i.b()}`}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"f",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"e",(function(){return h}));const r={en_us:"https://media.choiceform.com/os-client-core/assets/en_us-8617c82e.json",zh_cn:"https://media.choiceform.com/os-client-core/assets/zh_cn-477e771a.json"};let i=!1,o=new Proxy({},{get(){throw new Error("Cannot access LANG before initializing")}}),a="zh_cn";const c={},s=(e,t,n)=>{const r=n||{};return Object.keys(e).forEach(i=>{const o=e[i],a=t?t+"."+i:i;r[i]="string"==typeof o?a:s(e[i],a,n&&n[i])}),r};function u(e){e&&Object.keys(e).forEach(t=>{r[t.toLowerCase()]=e[t]})}function l(){return{...r}}function f(){return{...c}}function d(e,t){i||(o=s(t,"",{}),i=!0),c[e]=t}function p(e){a=e.toLowerCase()}function b(){return a}function h(e){const t=c[a];if(!t)throw new Error("cannot translate before lang loading");try{const n=e.split(".");let r=n.shift(),i=t[r];for(;"object"==typeof i;)r=n.shift(),i=i[r];return i}catch(e){console.error(e)}return""}},function(e,t,n){"use strict";n.d(t,"i",(function(){return f})),n.d(t,"u",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"d",(function(){return b})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"s",(function(){return g})),n.d(t,"v",(function(){return O})),n.d(t,"r",(function(){return j})),n.d(t,"p",(function(){return v})),n.d(t,"q",(function(){return w})),n.d(t,"m",(function(){return y})),n.d(t,"o",(function(){return _})),n.d(t,"n",(function(){return x})),n.d(t,"g",(function(){return T})),n.d(t,"e",(function(){return k})),n.d(t,"j",(function(){return E})),n.d(t,"k",(function(){return N})),n.d(t,"a",(function(){return I})),n.d(t,"y",(function(){return C})),n.d(t,"z",(function(){return A})),n.d(t,"w",(function(){return P})),n.d(t,"l",(function(){return R})),n.d(t,"h",(function(){return M})),n.d(t,"x",(function(){return D})),n.d(t,"t",(function(){return U}));var r=n(6),i=n(1),o=n(5),a=n(2),c=n(0),s=n(3);const u={valid:!0,message:""},l=["region","location","area","describe","end","logic","loop","lottery","verify"];function f(e){return!0===e.answerRequired}function d(e){return"matrix"===e.type?function(e){const{randomType:t}=e;return"col"===t||"row_col"===t||"row"===t}(e):!0===e.randomOptionY}function p(e){const t=e.loopStack,n=e.nodeUuid;return Object(i.h)(n,t)}function b(e){return e.find(e=>"start"===e.type)}function h(e,t){if(t)return e.find(e=>e.input&&Object(i.l)(e.input.uuid,t)||e.loopEnd&&Object(i.l)(e.loopEnd.uuid,t))}function m(e,t,n){const r=t.find(e=>Object(i.l)(e.selfPortId,n));if(r&&r.destInputId)return h(e,r.destInputId)}function g(e){return"matrix"===e.type?"multi"===e.matrixSelect:!0===e.multiSelect}function O(e){return"matrix"===e.type?"single"===e.matrixSelect:!0!==e.multiSelect}function j(e){return"single_row"===e.matrixSelect}function v(e){return"single_col"===e.matrixSelect}function w(e){return"single_row_col"===e.matrixSelect}function y(e){return g(e)&&"all"===e.multiType}function _(e){return g(e)&&"row"===e.multiType}function x(e){return g(e)&&"col"===e.multiType}async function T(e){const t=!0===e.limitEnabled,{parent:n}=e;let r=t?await Object(o.e)(e.maxUploadCount,{state:n}):e.options.length,i=t?await Object(o.e)(e.minUploadCount,{state:n}):1;const a=e.options.length;return i||(i=1),r||(r=a),i>a&&(i=a),i>r&&(i=r),{max:r,min:i}}async function k(e){if(!g(e))return{min:1,max:1};const t="matrix"===e.type,{multiMin:n,multiMax:i}=e,{parent:a}=e;let c=await Object(o.e)(n,{state:a}),s=await Object(o.e)(i,{state:a});const u=Object(r.c)(e).length;return t||(c=function(e,t){const n={};Object(r.c)(e).forEach(e=>{Object(r.n)(e)||(n[e.mutexNumber]?n[e.mutexNumber]+=1:n[e.mutexNumber]=1)});const i=Object.keys(n).reduce((e,t)=>("0"===t||"undefined"===t?e+=n[t]:Number(t)<10&&(e+=1),e),0);return t>i&&(t=i),t}(e,c)),c||(c=1),s||(s=u),c>u&&(c=u),c>s&&(c=s),{min:c,max:s}}const S=(e,t,n,r)=>{let i=0;i=r?e.filter(e=>e[r]===t[r]&&e.selected).length:e.filter(e=>e.selected).length;const o=i<n;let c="";return o||(c=r?"xid"===r?Object(a.f)(s.a.matrix.colLimitMax,{max:n}):Object(a.f)(s.a.matrix.rowLimitMax,{max:n}):Object(a.f)(s.a.select.limitMax,{max:n})),{valid:o,message:c}};async function E(e,t){if(!g(e)||-1===t.mutexNumber||-1===t.xMutexNumber||-1===t.yMutexNumber)return u;const n=y(e);if(!n&&!Object(r.o)(t))return u;const i=Object(r.c)(e),{max:o}=await k(e);return n?S(i,t,o):x(e)?S(i,t,o,"xid"):_(e)?S(i,t,o,"yid"):u}async function N(e,t){if(!g(e))return u;const{max:n}=await k(e),i=Object(r.c)(e).filter(e=>e.selected).length===n,{mutexNumber:o}=t,c=!i||-1===o||Object(r.m)(e,o);return{valid:c,message:c?"":Object(a.f)(s.a.select.limitMax,{max:n})}}function I(e,t){return e.find(e=>Object(i.l)(e.nodeUuid,t))}const C=["logic","random","loop"],L=[...C,"data"];function A(e){Object(c.b)().preview&&e.autoSkip&&e.parent.previewShadowNodes&&!L.includes(e.type)&&(e.shadowNodes=!0,e.readonly=!0)}function P(e){if(e.forceSkipReason)return e.forceSkipReason;if("data"===e.type)return"data_hidden";if(e.autoSkip)return function(e){return Object(c.b)().preview&&e.parent.previewShadowNodes&&!L.includes(e.type)}(e)?"":"setting";if(e.randomAbandoned)return"random_group";const t=Object(r.c)(e);return!(l.indexOf(e.type)>-1)&&t&&0===t.length?"no_options":""}function R(e,t){return!(!e.circleNode1Id&&!e.circleNode2Id)&&(Object(i.l)(e.circleNode1Id,t.circleNode1Id)&&Object(i.l)(e.circleNode2Id,t.circleNode2Id))}async function M(e){const{parent:t,options:n}=e;let r=await Object(o.e)(e.total,{state:t})||100,i=0;for(const e of n){const n=await Object(o.e)(e.maxMark,{state:t});if(void 0===n){i=-1;break}i+=n}return i>0&&i<r&&(r=i),r}const D=["end","lottery","gift"];function U(e,t){return!(!e||!t)&&(!D.includes(e.type)&&!D.includes(t.type)&&(e.groupSingle&&t.groupSingle&&function(e,t){return!(!e.groupId||!t.groupId||t.groupId!==e.groupId)&&(!t.loop&&!e.loop||!(t.loop&&!e.loop||!t.loop&&e.loop||t.loop.destInputId!==e.loop.destInputId||t.loop.currentIndex!==e.loop.currentIndex))}(e,t)))}},function(e,t,n){"use strict";n.d(t,"i",(function(){return v})),n.d(t,"d",(function(){return T})),n.d(t,"f",(function(){return S})),n.d(t,"k",(function(){return E})),n.d(t,"h",(function(){return I})),n.d(t,"c",(function(){return C})),n.d(t,"g",(function(){return L})),n.d(t,"e",(function(){return A})),n.d(t,"b",(function(){return P})),n.d(t,"j",(function(){return R})),n.d(t,"a",(function(){return M}));var r=n(65);function i(e){let t=!0;try{t=!!Object(r.a)(e,!0)}catch(t){console.info("error bool: ",e)}return t}function o(e,t,n){return function(e,t,n){return!!(t.length&&""!==n&&e&&e[e.length-1].match(/[\d)]/))}(e,t,n)&&(e+=t[t.length-1]),e+n}function a(e){return"("===e[e.length-1]&&(e+="0"),e+")"}var c=n(1),s=n(46),u=n(38),l=n(40),f=n(13),d=n(42),p=n(16),b=n(22),h=n(0),m=n(34),g=n(7),O=n(10);function j(e){return e&&("var-html"===e.type||"var-request"===e.type||"var-loop"===e.type)}function v(e="",t=!1){if(e=(e=y(e,t)).replace(/</g,"<").replace(/>/g,">"),t)for(;e.indexOf("<")>-1||e.indexOf(">")>-1;)e=e.replace(/</g,"<").replace(/>/g,">");return e}function w(e=""){return e.replace(/</g,"<").replace(/>/g,">")}function y(e="",t=!1){if(e=e.replace(/&/g,"&"),t)for(;e.indexOf("&")>-1;)e.replace(/&/g,"&");return e}function _(e="",t,n,r,i){let o='<span var-name="'+n+'" class="var-light '+t+('"'+(r?'in-edist="1">':">"))+e+"</span>";return i&&(o=Object(c.d)(o)),o}function x(e=""){e.match(/<(\w+).+?<\/\1>/)||(e=`<span>${e}</span>`);return Object(m.c)(e).children}async function T(e="",t,n=!1){e+="";const{state:r,innerJoinBy:i,varInfo:o,usage:a}=t,s=t.spaceRep||"";e=y(e.replace(/ /g,s));const u=t.joinBy||" ";if(Object(f.j)(e)){const s=Object(f.l)(e),d=Object(f.i)(e,s);for(const e of d){const t=Object(f.f)(r,e);let c="";if(t?c=await C({state:r,varInfo:t,joinBy:i||u}):Object(h.b)().realTimePreview&&(c=_(e.getInnerHtml(),"var-empty",e.getText(),!1,!0)),c=Object(g.b)(c)?"":Object(g.a)(c).trim(),a){const n=t||{mapId:Object(f.c)(Object(f.g)(e))};Object(l.d)(a,n,c)}const s=!o&&t&&c&&!n;let d=[];j(t)?(s&&(c=_(c,t.type,t.name,t.inEdist,!1)),d=c?x(c):[""]):(s&&(c=_(c,t.type,t.name,t.inEdist,!0)),e.setText(c),d=[new m.b(e.getInnerHtml())]),k(e,d)}return N(function(e,t,n=""){if(j(t))return v(e.getInnerHtml());let r="";if(n){const i=[];for(const n of e.children){let e="";if(Object(c.k)(n,"node"===n.type)){if("span"===n.name&&!n.getText()&&0===n.children.length)continue;e=n.getOuterHtml()}else e=n.getText().trim(),t||(e=w(e));e&&i.push(y(e))}r=i.join(n)}else r=y(e.getInnerHtml());return r=r.replace(/([\r\n]|^\s*|\s*$)/g,"").replace(/<br>/g,""),r=y(Object(c.t)(r)),r}(s,o,u),t)}return e+""}function k(e,t){const n=e.parent;t.forEach(t=>{if("string"==typeof t){if(""!==t){const r=new m.b(t);n.insertBefore(r,e)}}else n.insertBefore(t,e)}),n.removeChild(e)}async function S(e="",t,n="NAME"){return N(E(await T(e,t,!0),n),t)}function E(e="",t="NAME"){if(!e||"string"!=typeof e)return e;e=e.replace(/<style>.*?<\/style>/g,"");let n=Object(f.l)(e).getText();return n=Object(f.l)(n).getText(),"NAME"===t?n=Object(d.c)(n):"URL"===t&&(n=Object(d.d)(n)),n.trim()}function N(e,t){return","===t.joinBy?(e+"").trim().replace(/(?:^\s*,|\s*,\s*,\s*|\s*,$)/,""):e}async function I(e="",t){let n=await T(e,{...t,innerJoinBy:","},!0);return n=E(v(n,!0)),n=n.replace(/####/g,"|").replace(/##/g,"").replace(/\s+/g,""),n=N(n,t),n}function C(e){const{varInfo:t}=e;return t.getText?t.getText(e):t.nodePart||t.question?Object(f.e)(e):"var-string"===t.type?function(e){const{varInfo:t}=e;if(t.getText)return t.getText(e);return T(t.value,e)}(e):"var-expression"===t.type?async function(e){const t=Object(b.a)(),{varInfo:n,state:i}=e;let c="";const s=Object(f.l)(n.value).children,u=[];let l="";for(const e of s)if(Object(f.k)(e)){if(l){const e=parseFloat(l);if(isNaN(e))return e;c=o(c,u,e),l=""}const n=Object(f.f)(i,e);if(n){const e=n.split;if(n.uuid===t.EXP_OP.uuid)c+="(";else if(n.uuid===t.EXP_CP.uuid)c=a(c);else if(e)c=o(c,u,n.expOpr),u.push(e);else if(n.expOpr)u.length&&(c=a(c),u.pop()),c=o(c,u,n.expOpr);else{const e=u[u.length-1],t=await C({state:i,varInfo:n,joinBy:e||"+"})||0;c=o(c,u,t)}}else l+="0"}else l+=e.getText().replace(/\s/g,"");l&&(c=o(c,u,parseFloat(l)));for(;u.length;)c=a(c),u.pop();return function(e){let t=0;try{t=Object(r.a)(e,!0)}catch(n){t=NaN,console.info("error exp: ",e)}return t}(c)}(e):"var-media"===t.type?async function(e){const{varInfo:t,state:n}=e,{imgSize:r}=t,i=e.joinBy||" ",o=Object(f.i)(t.value),a=[];for(const e of o){const t=Object(f.f)(n,e);if(!t)continue;r&&(t.imgSize=r);const o=await C({state:n,varInfo:t,joinBy:i});Object(g.b)(o)||a.push(o)}return a.join(i)}(e):"var-bool"===t.type?async function(e){const{varInfo:t,state:n}=e;if(t.getBool)return t.getBool(e);const{nodePart:r,question:o}=t;if(r||o)return Object(f.d)(e);const a=Object(f.i)(t.value);let c="";for(const t of a){const r=Object(f.f)(n,t);if(r)if(r.blOpr)c+=r.blOpr;else if(r.getBool)c+=i(await r.getBool(e))?"1":"0";else{const e=await C({state:n,varInfo:r});c+="string"==typeof e?"0"===e?e:e?"1":"0":i(e)?"1":"0"}}return i(c)}(e):"var-request"===t.type?async function(e){const{varInfo:{request:t,paramConfig:n},state:r}=e;if(t){let e=null;if(n){e=JSON.parse(n);for(const t of Object.keys(e))e[t]=await S(e[t],{state:r,joinBy:","},"URL")}const{result:i}=await Object(s.c)(r,t,e,!1,!1);return"string"!=typeof i?i:Object(u.a)(i)}return""}(e):"var-html"===t.type?async function(e){const{varInfo:t,state:n}=e,r=t.getText?await t.getText(e):await T(t.value,e),i=Object(u.a)(v(r));return await function(e,t,n){const r=e?JSON.parse(e):{};return Object(c.q)(t,/{{{?(.+?)}}}?/g,async(e,t)=>{const i=t.indexOf("=");let o=t,a="";i>-1&&(o=t.substr(0,i),a=t.substr(i+1));const c=r[o]||"";let s="";return c&&(s=e.startsWith("{{{")?await T(c,{state:n}):await S(c,{state:n},"URL")),s||a})}(t.paramConfig,i,n)}(e):Object(c.n)("")}async function L(e="",t,n=!1){if("number"==typeof e)return e;if(Object(g.b)(e))return n?NaN:"";const r=Number(e);if(isNaN(r)){const r=await S(e,t);if(Object(g.b)(r))return n?NaN:"";const i=Number(r);return isNaN(i)?n?NaN:r:i}return r}async function A(e="",t){if("number"==typeof e)return e;const n=await L(e,t,!0);return Number(n)}async function P(e,t){if(e.match(/key(?:\d+)?/))return Object(O.c)()[e];{const n=Object(p.c)(e);if(n){return E(await C({varInfo:n,state:t,joinBy:","}))}return""}}function R(e="",t,n=!1){if(Object(g.b)(e))return Object(c.n)("");return Object(c.q)(Object(g.a)(e),/{{(.+?)}}/g,async(e,r)=>{let i=await P(r,t);return i&&n&&(i=encodeURIComponent(i)),""+(i||"")})}function M(e=""){return e.replace(/(?:^<div>|<\/div>$)/g,"")}},function(e,t,n){"use strict";n.d(t,"h",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"m",(function(){return s})),n.d(t,"n",(function(){return u})),n.d(t,"l",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"o",(function(){return g})),n.d(t,"g",(function(){return O})),n.d(t,"i",(function(){return j})),n.d(t,"p",(function(){return v})),n.d(t,"e",(function(){return w}));var r=n(1),i=n(5),o=n(25);function a(e,t){const n=e.loopStack,i=t.uuid;return Object(r.h)(i,n)}function c(e,t){return e.find(e=>Object(r.l)(e.uuid,t))}function s(e,t){if(!t)return!1;return p(e).some(e=>e.selected&&e.mutexNumber===t)}function u(e){return"comment"===e.optionType}function l(e){return p(e).some(e=>e.selected)}function f(e){return p(e).filter(t=>Object(o.b)(t,e)).length}function d(e){return p(e).some(t=>Object(o.b)(t,e))}function p(e){let t=[];const{options:n,otherOptions:r}=e;return n&&(t=[...t,...n]),r&&(t=[...t,...r]),t}function b(e){let t=p(e);const{hiddenOptions:n}=e;return n&&(t=[...t,...n]),t}function h(e){const{renderOptionsX:t,renderOptionsY:n,otherOptions:r}=e;return t.concat(n,r)}function m(e){const{options:t}=e,n=t.find(e=>!0===e.seqTarget);return n&&n.selected?e.origin.options[n.sortNo-1]:e.output}function g(e){return!!e.yid&&!!e.xid}async function O(e,t){const{parent:n}=t;return{itemsMax:await Object(i.e)(e.itemsMax,{state:n}),itemsMin:await Object(i.e)(e.itemsMin,{state:n})}}function j(e){return e.passRef||{}}function v(e,t){const n=j(e);return e[t]||n[t]}function w(e){if(!e.assistValue)return"";return Object.keys(e.assistValue).reduce((t,n)=>(e.assistValue[n]&&(t+=e.assistValue[n])&&(t+=" "),t),"")}},function(e,t,n){"use strict";function r(e){return o(e)?"":String(e)}function i(e){if(o(e))return"";const t=Number(e);return isNaN(t)?e:t}function o(e){return e instanceof Array?0===e.length:"boolean"!=typeof e&&0!==e&&!e}n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u}));var r=n(0),i=n(1);let o,a={};const c={on(e,t){a[e]||(a[e]=[]),a[e].push(t)},off(e,t){e||(a={}),a[e]&&(a[e]=t?a[e].filter(e=>e!==t):[])},one(e,t){const n=r=>{t(r),c.off(e,n)};c.on(e,n)},trigger(e,t={}){if(a[e])try{a[e].forEach(n=>n({type:e,...t,data:t},t))}catch(e){Object(i.c)(e)}}};function s(e){"gift"!==e.type&&(c.trigger("ANSWER_CHANGE",e),e.dynamicNodeProps())}function u(e,t=!1){c.trigger("SWITCH_NODE",e),e!==o&&(o=e,t&&Object(r.c)().hook.onSwitchPage())}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"r",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"q",(function(){return O})),n.d(t,"f",(function(){return j})),n.d(t,"g",(function(){return v})),n.d(t,"k",(function(){return w})),n.d(t,"l",(function(){return y})),n.d(t,"m",(function(){return _})),n.d(t,"j",(function(){return x})),n.d(t,"o",(function(){return T})),n.d(t,"h",(function(){return k})),n.d(t,"n",(function(){return S})),n.d(t,"i",(function(){return E})),n.d(t,"e",(function(){return N}));var r=n(10),i=n(2),o=n(0),a=n(3),c=n(1),s=n(69),u=n(73);let l="";const f={diagram_has_errors:"diagram_has_errors",survey_not_exist:"survey_not_exist",survey_offline:"survey_offline",oauth_error:"oauth_error",interviewee_missing_error:"interviewee_missing_error",interviewee_invalid_error:"interviewee_invalid_error",multi_responses_error:"multi_responses_error",quota_full:"quota_full",quota_not_match:"quota_not_match",red_envelope_duplicated:"red_envelope_duplicated",red_envelope_expired:"red_envelope_expired",red_envelope_received_by_yourself:"red_envelope_received_by_yourself",red_envelope_received_by_others:"red_envelope_received_by_others",red_envelope_intercepted:"red_envelope_intercepted",red_envelope_send_error:"red_envelope_send_error"},d=[400,401,402,403,404,405,422,500];async function p(e,t){try{const r=await Object(o.c)().network.request(e,t);if((n=r).status>=200&&n.status<300)return function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}(r.response);throw r}catch(e){throw e}var n}function b(e){e&&d.includes(e.status)||Object(o.b)().error(Object(i.f)(a.a.global.downloadError))}function h(e){const t=JSON.parse(e&&e.response||"{}");return t&&d.includes(t.status)?t.code+"":""}function m(e){const t=h(e);t!==l&&t&&(f[t]?Object(o.b)().error(N(t)):Object(o.b)().notify(N(t)))}async function g(e,t={type:"GET"}){try{return await p(e,t)}catch(n){throw m(n),Object(c.c)(`api error: ${t.type}:${e} ${JSON.stringify(n)}`),n}}function O(e,t={type:"GET"}){return g(e,t={...t,contentType:"application/json"})}function j(e){if(Object(o.b)().preview)return async function(e){if("00000000-0000-0000-0000-000000000000"===e)return{smaller_diagram_url:"http://localhost:12345/unit_test_payload.json"};const t=Object(r.c)(),n=t.type;let i=Object(o.b)().hostConfig.qApiHost+"/surveys/"+e+"/preview";"preview_template"===n?i=Object(o.b)().hostConfig.host+"/v1/public_templates/"+e:"edit_template"===n&&(i=Object(o.b)().hostConfig.host+"/v1/templates/"+e);const a=await O(i,{type:"GET",jwt:t.jwt}),{diagram:c}=a;return{smaller_diagram_url:a.diagram_url||c.diagram_url,langs:a.langs}}(e);const t=Object(o.c)().auth.retrieveAuthMeta();if(t)return Object(c.n)(t);return O(Object(o.b)().hostConfig.qApiHost+"/surveys/"+e,{type:"GET"}).catch(e=>{throw b(e),e})}function v(e){const t=Object(o.b)().hostConfig.qApiHost+"/responses";return l=f.multi_responses_error,O(t,{type:"POST",data:e}).then(e=>(l="",e)).catch(()=>{l=""})}function w(e,t){return O(Object(o.b)().hostConfig.qApiHost+"/responses/"+t+"/examine",{type:"PUT",data:e})}function y(e,t){return O(Object(o.b)().hostConfig.qApiHost+"/responses/"+t+"/skip",{type:"PUT",data:e})}function _(e,t){return O(Object(o.b)().hostConfig.qApiHost+"/responses/"+t,{type:"PUT",data:e})}async function x(e){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(a.a.preview.noMessage)),{};const t=Object(o.b)().hostConfig.qApiHost+"/validations";e.question_id=e.question_id.toLowerCase();const n=await O(t,{type:"POST",data:e});return e.phone_num&&Object(o.b)().notify(Object(i.f)(a.a.verify.sendSuccess)),n}function T(e,t){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(a.a.preview.noMessage)),Object(c.n)({});return O(Object(o.b)().hostConfig.qApiHost+"/validations/"+t,{type:"PUT",data:e})}function k(e,t){if(Object(o.b)().preview)return Object(c.n)({recipient:Object(u.a)()});const n=Object(o.c)().storage.get("gift-"+e.code);if(n)return Object(c.n)(JSON.parse(n));return g(Object(o.b)().hostConfig.qApiHost+"/rewards/"+t+"/red_envelope",{type:"POST",data:e})}async function S(e,t){if(Object(o.b)().preview)return{};const n=Object(o.b)().hostConfig.qApiHost+"/rewards/"+t+"/custom";try{const t=await g(n,{type:"PUT",data:e});return Object(o.b)().notify(Object(i.f)(a.a.verify.sendSuccess)),t}catch(e){throw Object(o.b)().notify(Object(i.f)(a.a.verify.sendFailed)),e}}function E(e){Object(s.a)(e);const{preview:t}=Object(o.b)(),{dev:{autoRun:n,infer:r}}=Object(o.c)();if(t||n||r)return Object(c.n)(null);return g(Object(o.b)().hostConfig.qApiHost+"/webhooks",{type:"POST",data:e})}function N(e){return Object(i.f)("backEnd."+e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"d",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p}));var r=n(3),i=n(0),o=n(2),a=n(34);let c;function s(){return c||(c=Object(i.c)().app.getParams()),c}function u(){c=null}function l(e){const t=new a.a("div");t.setInnerHtml(e),e=t.getText();const n=Object.create(null);return"string"!=typeof e?n:(e=e.trim().replace(/^([?#&])/,""))?(e.split("&").forEach(e=>{const t=e.replace(/\+/g," ").split("=");let r=t.shift(),i=t.length>0?t.join("="):void 0;r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),void 0===n[r]?n[r]=i:Array.isArray(n[r])?n[r].push(i):n[r]=[n[r],i]}),{...n}):n}function f(e){Object(i.b)().preview||Object(i.c)().dev.autoRun?Object(i.b)().notify(Object(o.f)(r.a.preview.noLink)):(Object(i.c)().hook.beforeForceLeave(),Object(i.c)().app.openWebLink(e),Object(i.b)().customAbort())}function d(e,t){if("string"==typeof t)try{t=JSON.parse(t)}catch(e){}const n=function(e){const t=[];return Object.keys(e).forEach(n=>{if(void 0!==e[n]){const r=`${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`;t.push(r)}}),t.join("&")}(t),r=e.match(/\?/)?"&":"?";return e+r+n}function p(e,t){const n=Object.keys(t),r=["key","dev","rid","aid","cid","qid","tid","rtpl","infer_id","sid","type","jwt","ban_preview_bar","fake_port","real_port","auto_path","lite_template"];for(const i of n){const n=e.includes("?")?"&":"?";(r.includes(i)||i.match(/^key\d\d?$/))&&(e+=`${n}${i}=${t[i]}`)}return e}},function(e,t,n){"use strict";n.d(t,"A",(function(){return j})),n.d(t,"B",(function(){return v})),n.d(t,"q",(function(){return w})),n.d(t,"b",(function(){return y})),n.d(t,"p",(function(){return _})),n.d(t,"r",(function(){return x})),n.d(t,"k",(function(){return T})),n.d(t,"u",(function(){return k})),n.d(t,"t",(function(){return S})),n.d(t,"s",(function(){return E})),n.d(t,"n",(function(){return N})),n.d(t,"m",(function(){return I})),n.d(t,"f",(function(){return C})),n.d(t,"v",(function(){return L})),n.d(t,"g",(function(){return A})),n.d(t,"y",(function(){return P})),n.d(t,"a",(function(){return R})),n.d(t,"z",(function(){return M})),n.d(t,"i",(function(){return D})),n.d(t,"l",(function(){return U})),n.d(t,"j",(function(){return B})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return F})),n.d(t,"e",(function(){return V})),n.d(t,"o",(function(){return z})),n.d(t,"h",(function(){return H})),n.d(t,"x",(function(){return X})),n.d(t,"w",(function(){return G}));var r=n(33),i=n(40),o=n(1),a=n(5),c=n(20),s=n(9),u=n(6),l=n(0),f=n(10);let d=[];let p=-1;function b(){const{dev:{local:e}}=Object(l.c)(),{preview:t,realTimePreview:n,hostConfig:{recordUrl:r}}=Object(l.b)();return!(e||t||n||!r)}function h(e,t=!1){if(Object(c.b)()&&(!t||"start"===e.type))return;e.description=Object(a.k)(e.description);const n=e.description;if(b()){const r=d[d.length-1];r&&(n.indexOf(r.description)>-1||r.description.indexOf(n)>-1)&&d.pop(),d.push(e),t&&m()}}function m(){if(b()){if(clearTimeout(p),d.length>0){const e=d;d=[];const t=Object(l.b)().hostConfig.recordUrl;Object(s.q)(t,{type:"POST",data:{records:e}}).catch(()=>{Object(o.c)("failed to send record")})}p=setTimeout(m,1e4)}}function g(e,t,n,r,i){const{surveyId:o,transactionID:a,userInfo:c}=n;let s,u,d,p,b,h,m;("gift"===r||"start"===r&&c)&&(s=c.nickname,u=c.openid,s&&(p=Object(l.c)().name)),"start"===r&&(d=JSON.stringify(Object(f.c)())),t&&("matrix"===t.type?(h=e?e.yid:void 0,m=e?e.xid:void 0):b=e?e.uuid.toLowerCase():void 0);return{survey_id:o,collector_id:n.parsedPayload&&n.parsedPayload.basicConfig&&n.parsedPayload.basicConfig.collector&&n.parsedPayload.basicConfig.collector.id,response_id:a,node_id:t?t.nodeUuid.toLowerCase():void 0,option_id:b,row_option_id:h,col_option_id:m,description:i,type:r,recorded_at:new Date,provider:p,user_name:s,user_id:u,query_params:d}}function O(e){const t=e.loop?`[${e.nodeName}:${e.title||""}]`:`[${e.nodeName}]`;return Object(a.k)(t)}function j(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e,"used_phone",`在题目:${O(t)}中检测到重复使用的手机号:${e.phoneNumber}`))}function v(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e,"verify_fail",`在题目:${O(t)}高级验证失败`))}function w(e,t){if(Object(l.c)().dev.infer)return;const{type:n,parent:r}=t;if("upload"===n||"verify"===n||"gift"===n)return;let o,c="",s="";if("menu"===n||"cascade"===n)s=Object(u.c)(t).reduce((t,n)=>(n.selected&&(t+=`[${n.text}]`),e=n,t),""),o=s?"select":"deselect",c=s?"选中":"清除所有选中";else{const r=e.selected;o=r?"select":"deselect",c=r?"选中":"取消选中",s="select_icon"===n||"select_image"===n?`[${Object(i.b)(e)}]`:"matrix"===t.type?`[${Object(a.k)(e.xText)} ${Object(a.k)(e.yText)}]`:`[${Object(a.k)(e.text)}]`}const f=`在题目:${O(t)}中${c}选项:${s}`;h(g(e,t,r,o,f))}function y(e,t,n){if(Object(l.c)().dev.infer)return;const r=`在题目:${O(n)}的选项:[${Object(a.k)(t.text)}]中输入自动填充触发文字:${e}`;h(g(t,n,n.parent,"auto_complete",r))}function _(e,t,n){if(Object(l.c)().dev.infer)return;const r=n.parent;let i,o;"value_mark"===n.type||"icon_mark"===n.type||"slide_rate"===n.type||"weight"===n.type?(i="打分:"+t.value,o="rate"):"upload"===n.type?(i=e?"上传图片":"清除图片",o="upload"):(i="输入:"+t.value,o="input");h(g(t,n,r,o,`在题目:${O(n)}的选项:[${Object(a.k)(t.text)}]中${i}`))}function x(e,t){if(Object(l.c)().dev.infer)return;const n=t.parent,r=t.options[e];if(!r)return;h(g(r,t,n,"sort",`在题目:${O(t)}中将选项:[${Object(a.k)(r.text)}]排序到第${e+1}位`))}function T(e){if(Object(l.c)().dev.infer)return;const t=`在题目:${O(e)}中 定位失败`;h(g(null,e,e.parent,"locate_failed",t))}function k(e,t){if(Object(l.c)().dev.infer)return;const n=t.parent,r=t.type,i=t.value;let o="input",a="输入";if("region"===r)a="输入:"+i;else if("location"===r||"area"===r)o="locate",a="定位到:"+i;else if("verify"===r){const t=typeof e;if("string"===t)a="输入:"+e;else if("object"===t){const{code:t,phoneNumber:n}=e;void 0!==n?(o="input_phone",a="的手机号码中输入:"+n):(o="input_code",a="的密码/验证码中输入:"+t)}}h(g(null,t,n,o,`在题目:${O(t)}中${a}`))}function S(e){if(Object(l.c)().dev.infer)return;h(g(null,e,e.parent,"prev",`在题目:${O(e)}中点击上一题`))}function E(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e.parent,"prev",`返回到题目: ${O(t)},由题目:${O(e)}后退而来`))}function N(e){if(Object(l.c)().dev.infer)return;h(g(null,e,e.parent,"next",`在题目:${O(e)}中点击下一题`))}function I(e,t){if(Object(l.c)().dev.infer)return;h(g(null,t,e.parent,"next","end"===t.type?`到达结束节点: ${O(t)},由题目:${O(e)}前进而来`:`进入题目: ${O(t)},由题目:${O(e)}前进而来`))}function C(e,t,n){if(Object(l.c)().dev.infer)return;h(g(null,t,n,"check_fail",`从${O(e)}走向甄别失败`),!0)}function L(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e.current,e,"quota_fail","配额失败,答案数:"+t),!0)}function A(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e.current,e,"check_submit","甄别提交,答案数:"+t))}function P(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"time_less","答题时间太少被排除"),!0)}function R(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"abandon_answer","按结束节点要求抛弃答案"),!0)}function M(e){if(Object(l.c)().dev.infer)return;h(g(null,e.current,e,"time_over","答题超时未完成"),!0)}function D(e,t,n,r){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"full_submit",`正式提交,答案数:${n}个答案 \n 提交回应:${JSON.stringify(r)}`),!0)}function U(e,t,n=!1){if(Object(l.c)().dev.infer)return;h(g(null,e,t,n?"lottery_goal":"lottery_fail",n?"抽奖:中奖":"抽奖:未中奖"),!0)}function B(e,t){if(Object(l.c)().dev.infer)return;h(g(null,e,t,"gift","领奖"),!0)}function q(e,t,n,r,i){if(Object(l.c)().dev.infer)return;h(g(t,n,e,"auto_input",`在题目:${O(n)}中自动填充选项:[${r}],期待值:[${i}]`))}function F(e,t,n,r="成功"){if(Object(l.c)().dev.infer)return;h(g(null,n,e,"auto_skip",`在题目:${O(n)}中尝试自动选中选项:[${Object(a.k)(t.text)}]${r}`))}function V(e,t,n){if(Object(l.c)().dev.infer)return;let r=`自动跳过题目:${O(t)} by ${n}`;"logic"===t.type&&(r+=" logicResult:"+t.logicResult);h(g(null,t,e,"auto_skip",r))}function z(e,t,n){if(Object(l.c)().dev.infer)return;h(g(null,n,e,"opt_display",`在题目:${O(n)}中显示选项:[${Object(a.k)(t.text)}]`))}function $(){let e=Object(l.c)().storage.get("browser_uuid");return e||(e=Object(o.i)(),Object(l.c)().storage.set("browser_uuid",e)),e}function H(){if(Object(l.c)().dev.infer)return;const e=Object(f.c)();if(e.code&&e.state)return;h({type:"enter",collector_code:Object(l.b)().sid,browser_uuid:$(),recorded_at:Object(r.c)(),description:"来自"+Object(l.c)().system.getReferer()},!0)}function X(e,t){if(Object(l.c)().dev.infer)return;let n=`开始答题,进入到题目: ${O(t)} `;const{browser:r,device:i,engine:o,os:a}=Object(l.c)().system.device;r&&(n+=`browser:${r.name||""} ${r.version||""}, `),i&&(n+=`device:${i.type||""} ${i.vendor||""} ${i.model||""}, `),o&&(n+=`engine:${o.name||""} ${o.version}, `),a&&(n+=`os:${a.name||""} ${a.version||""}`);const c=g(null,t,e,"start",n);c.browser_uuid=$(),c.collector_code=Object(l.b)().sid,h(c,!0)}function G(e,t){if(Object(l.c)().dev.infer)return;h(g(null,null,e,"resume","开始断点续答:"+t),!0)}},function(e,t,n){"use strict";n.d(t,"l",(function(){return N})),n.d(t,"e",(function(){return L})),n.d(t,"h",(function(){return A})),n.d(t,"f",(function(){return P})),n.d(t,"g",(function(){return R})),n.d(t,"n",(function(){return M})),n.d(t,"m",(function(){return D})),n.d(t,"d",(function(){return U})),n.d(t,"b",(function(){return B})),n.d(t,"k",(function(){return F})),n.d(t,"j",(function(){return V})),n.d(t,"i",(function(){return z})),n.d(t,"c",(function(){return $})),n.d(t,"a",(function(){return H}));var r=n(8),i=n(10),o=n(4),a=n(11),c=n(17),s=n(35),u=n(59),l=n(19),f=n(57),d=n(71),p=n(0),b=n(2),h=n(47),m=n(48),g=n(3),O=n(20),j=n(9),v=n(46),w=n(5),y=n(21),_=n(69);const x={},T={};async function k(e,t,n){const{actions:r}=t;if(r&&!Object(O.b)()&&!Object(p.b)().realTimePreview){if("forward_enter"===e){if(x[t.renderId])return;x[t.renderId]=!0}if("backward_leave"===e&&delete x[t.renderId],"forward_leave"===e){if(T[t.renderId])return;T[t.renderId]=!0}"backward_leave"===e&&delete T[t.renderId];for(const i of r){if(i.disabled||i.event!==e)continue;const{activeConfig:r}=i;if(!r||await Object(y.b)(n,r.options,r.logicType))if("http_request"===i.type)Object(_.a)(i),await Object(v.b)(n,i.request,null,!0,!1);else{const r={state:n},o={question_id:t.nodeUuid,response_id:n.transactionID,locale:n.language,event:e,type:i.type};if("email"===i.type){const{email:e}=i,t={...o,email:(await Object(w.f)(e.address,r)).replace(/\s/g,""),content:await Object(w.d)(e.content,r),title:(await Object(w.f)(e.title,r)).trim()};await Object(j.i)(t)}else{const{sms:e}=i,t={};for(const n of e.params)t[n.name]=(await Object(w.f)(n.value,r)).trim();const n={...o,url:(await Object(w.f)(e.url,r)).replace(/\s/g,""),content:t};await Object(j.i)(n)}}}}}var S=n(14);let E;function N(){return!!E}const I=["end","gift","lottery"];function C(e){let{prev:t}=e;const n=[];let r=t&&Object(o.w)(t);for(;r;)n.push({question:t,reason:r}),t=t.prev,r=t&&Object(o.w)(t);return{prev:t,skipList:n,current:e}}function L(e){const{parent:t}=e,{renderList:n}=t,r=n.indexOf(e);return R(t,n,r)}function A(e){if(Object(p.b)().realTimePreview)return"";const{prevEnabled:t,themeMode:n}=e,r=e.first(),{prev:i}=C(r),o=r.type;if(t&&n&&"end"!==o&&"lottery"!==o)return e.prevBtnText;if(Object(p.b)().preview&&"end"===o)return Object(b.f)(g.a.global.backTest);return t&&i&&(r.checkMode===i.checkMode||Object(p.b)().preview)&&I.indexOf(o)<0?e.inSingleGroup?e.inSingleGroup.prevText||Object(b.f)(g.a.global.previous):e.prevBtnText:""}async function P(e){const{formalResult:t}=e,n=e.current,{type:r,linkUrl:i,goal:o,qrCode:a}=n;if("end"===r){const r=n.endBtnText||Object(b.f)(g.a.global.go);if(i)return r;if(t&&t.reward||Object(p.b)().preview&&n.useReward)return a||e.fakeCommitted?"":r;{const{node:t}=await h.a.findNext(e.nodeList,n,e);return t&&"lottery"===t.type?r:""}}if("lottery"===r){const e=Object(b.f)(g.a.reward.get);return i?n.endBtnText||e:o?a?"":e:""}return e.inSingleGroup?e.inSingleGroup.nextText||Object(b.f)(g.a.global.next):e.nextBtnText}function R(e,t,n){const r=[];let i=1;const a=t[n];let c=t[n+i],s=c&&Object(o.w)(c);for(;c&&s;)r.push({question:c,reason:s}),i+=1,c=t[n+i],s=c&&Object(o.w)(c);return{next:c,skipList:r,current:a}}async function M(e){const t=await Object(s.c)(e.nodes,!0);if(t.valid){if(Object(l.c)(e)){Object(p.g)(e,{current:e.nodes[e.nodes.length-1]});for(const t of e.nodes)await k("forward_leave",t,e)}else await k("forward_leave",e.current,e);return await Object(c.f)(e,e.current,{type:"page_next",delay:200}),!0}return function(e,t){const{valid:n,message:i,dueToNode:o,dueToOption:a}=t,c={valid:n,message:i};a&&(c.optId=a.uuid,c.optText=a.text,a.label&&(c.message=a.label+":"+c.message));o&&(c.nodeId=o.nodeUuid,c.nodeName=o.nodeName,c.nodeType=o.type,c.message=o.nodeName+":"+c.message);if(r.a.trigger("NEXT_FAIL",c),"vital"===t.type)throw Object(p.b)().error(t.message),new Error("next vital error: "+t.message);"alert"===t.type?Object(p.b)().alert(t.message):(e.inSingleGroup||Object(p.b)().notify(t.message),Object(s.a)(t,e))}(e,t),!1}function D(e,t){Object(p.g)(e,{nextLoading:t}),Object(O.c)()}function U(e){D(e,!0),E={state:e}}async function B(e){D(e,!1),E&&(await V(E.state),E=void 0)}function q(e,t){if(Object(r.c)(t,!0),"red_envelope"!==t.giftType||Object(p.b)().preview)Object(p.c)().hook.beforeForceLeave(),Object(p.c)().app.openWebLink(Object(p.c)().app.getRewardUrl(Object(i.c)())),Object(p.b)().customAbort();else{const n={...Object(i.c)(),tid:e.transactionID,qid:e.surveyId,rid:e.rewardInfo.goalId};t.template&&(n.rtpl=t.template.id);const{formalResult:{authorizer:{app_id:r,component_appid:o}}}=e;Object(p.c)().auth.authorizeGift(r,o,n),Object(p.b)().customAbort()}}function F(e,t){t.linkUrl?(Object(p.c)().hook.beforeForceLeave(),Object(p.c)().app.openWebLink(t.linkUrl),Object(p.b)().customAbort()):q(e,Object(o.a)(e.nodeList,t.rewardNodeId))}async function V(e){const t=function(e){const{renderList:t}=e,n=e.nodes[e.nodes.length-1];return R(0,t,Object(c.b)(t,n))}(e),{current:n,next:s}=t;if("end"===n.type)return async function(e,t){Object(p.c)().storage.remove("reward_info");const n=t.linkUrl;if(n)return void Object(i.d)(n);const c=Object(o.c)(e.nodeList,t.destList,t.output&&t.output.uuid);if(!c)return;const s=await Object(u.b)(e,c);if("lottery"===c.type){const t=await Object(l.e)(c,s,e);Object(a.l)(c,e,s.goal),Object(p.g)(e,{current:t}),Object(r.c)(c,!0)}else q(e,c);return e.dynamicStateProps()}(e,n);return(await Object(f.b)(e,{valid:!0,message:""},n,s)).valid?async function(e,t){const{next:n,current:i}=t;Object(p.g)(e,{current:n}),n.reached=!0,Object(a.m)(i,n),Object(r.c)(n,!0),Object(m.a)(e),Object(S.k)(e),await e.dynamicStateProps(),D(e,!1),i.dynamicNodeProps(),Object(c.e)(e,e.current),r.a.trigger("NEXT_OK")}(e,t):D(e,!1)}async function z(e){const t=e.first(),{prev:n,skipList:i}=C(t);if(n){if(t.groupSingle){const t=[...e.nodes].reverse();for(const n of t)await k("backward_leave",n,e)}else await k("backward_leave",t,e);for(const t of i)await k("backward_enter",t.question,e),await k("backward_leave",t.question,e);if(Object(p.g)(e,{current:n,currentStartTime:(new Date).getTime()}),Object(r.c)(n,!0),Object(m.a)(e),Object(S.k)(e),await e.dynamicStateProps(),Object(a.s)(t,n),Object(c.e)(e,e.current),r.a.trigger("PREV_OK"),n.groupSingle){const t=[...e.nodes].reverse();for(const n of t)await k("backward_enter",n,e)}else await k("backward_enter",n,e)}}async function $(e,t){const{nodeList:n,current:r}=e,i=await Object(d.b)(n,r,e),{node:o}=i;return o?H(e,i,t):null}async function H(e,t,n){const r=e.current,{node:i,loop:c,random:s,loopStack:u}=t,f={prev:r,origin:i,...i,loop:c,random:s,loopStack:u};if(n&&n(f))return null;const d=await Object(l.f)(f,e);await k("forward_enter",d,e),Object(p.g)(e,{current:d});const b=Object(o.w)(d);return b&&(Object(a.e)(e,d,b),await k("forward_leave",d,e)),d}},function(e,t,n){"use strict";n.d(t,"l",(function(){return b})),n.d(t,"i",(function(){return h})),n.d(t,"j",(function(){return m})),n.d(t,"k",(function(){return g})),n.d(t,"g",(function(){return O})),n.d(t,"f",(function(){return j})),n.d(t,"c",(function(){return v})),n.d(t,"h",(function(){return w})),n.d(t,"b",(function(){return y})),n.d(t,"d",(function(){return _})),n.d(t,"e",(function(){return x})),n.d(t,"a",(function(){return T}));var r=n(5),i=n(49),o=n(1),a=n(31),c=n(6),s=n(39),u=n(17),l=n(16),f=n(22),d=n(34),p=n(7);function b(e){return Object(d.c)(e)}function h(e="",t){return t||(t=b(e)),t.queryByClass("var-tag")}function m(e=""){return!!(e&&e.indexOf("var-tag")>-1)}function g(e){return Object(o.k)(e,"node"===e.type)&&e.hasClass("var-tag")}function O(e){return{name:e.getText(),uuid:(t=e,t.attributes["data-id"]),limit:e.attributes["data-limit"],limitSrc:Number(e.attributes["data-limit-src"]||void 0),imgSize:e.attributes["data-img-size"],limitRnd:Number(e.attributes["data-limit-rnd"]||void 0),paramConfig:e.attributes["data-ph-cfg"],disorder:"1"===e.attributes["data-disorder"],inEdist:e.parent&&!!e.parent.attributes.edist};var t}function j(e,t){return w(e,O(t))}function v(e){const{uuid:t,limitSrc:n,limit:r,limitRnd:i,paramConfig:o}=e;let a=t;return Object(p.b)(n)||(a+="_"+n),Object(p.b)(r)||(a+="_"+r),Object(p.b)(i)||(a+="_"+i),Object(p.b)(o)||(a+="_"+o),a}function w(e,t){const n=v(t),{uuid:r,limitSrc:i,paramConfig:a,name:d,disorder:b,inEdist:h}=t;let{imgSize:m,limitRnd:g,limit:O}=t;O=O||"1:0:0",m=m||"0:0",g=Object(p.b)(g)?-1:g;const j=r.split(":");let w="";s.f(r)&&(w=r.substr(0,8));const y=j.length;if(0===y)return;if(1===y){const e=j[0],t=Object(l.e)(e);return t&&{...t,name:d,uuid:r,limit:O,limitSrc:i,limitRnd:g,imgSize:m,loopNodeId:w,mapId:n,paramConfig:a,inEdist:h}}let _;if(!w&&(_=function(e,t=""){const{loopStack:n,context:r}=e;let{renderList:i}=e;const a=Object(o.h)("",n);return r.question&&(i=[...i,r.question]),i.find(e=>{const n=e.nodeUuid+a;return Object(o.l)(e.nodeUuid,t)&&Object(u.d)(e.renderId,n)})}(e,j[0]),!_))return;const x=Object(f.b)(j[1]);if(2===y)return x&&{name:d,question:_,nodePart:x,limit:O,limitSrc:i,limitRnd:g,uuid:r,imgSize:m,loopNodeId:w,isMedia:"var-media"===x.type,type:x.type,mapId:n,paramConfig:a,inEdist:h};const T=Object(f.b)(j[2],_),k=T&&"var-media"===T.type;if(3===y&&!j[1].match(/^[a-z0-9]{8}$/))return T&&{inEdist:h,name:d,question:_,nodePart:x,optionPart:T,limit:O,limitSrc:i,limitRnd:g,disorder:b,uuid:r,imgSize:m,loopNodeId:w,isMedia:k,type:T.type,mapId:n,paramConfig:a};const S=Object(c.a)(Object(c.b)(_),j[1]);return S?T&&{inEdist:h,name:d,question:_,option:S,optionPart:T,limit:O,limitSrc:i,limitRnd:g,disorder:b,uuid:r,imgSize:m,loopNodeId:w,isMedia:k,type:T.type,mapId:n,paramConfig:a}:void 0}async function y(e,t){let n=[];const{varInfo:{nodePart:c,option:s,disorder:u}}=e,l=await Object(r.e)(e.varInfo.limitRnd,e);if(0===l&&!t)return[];const f=e.specifiedOpt||s;n=f&&await Object(i.b)(e)?[f]:c&&c.filter?await c.filter(e):[];const d=t?t(n,l):Object(o.p)(n,l);return u?Object(a.c)(d):Object(a.d)(d)}async function _(e){const{varInfo:{nodePart:t,optionPart:n,option:r}}=e,o=e.specifiedOpt||r;if(t&&t.getBool)return t.getBool(e);if(o){return await Object(i.b)(e)&&await n.getBool({...e,specifiedOpt:o})}if(n.inBunch)return n.getBool(e);{const t=await y(e),r=[];for(const i of t){const t=await n.getText({...e,specifiedOpt:i});t&&r.push(t)}return r.length>0}}async function x(e){const{varInfo:{nodePart:t,optionPart:n,option:r}}=e,o=e.specifiedOpt||r,a=e.joinBy||" ";if(t&&t.getText)return t.getText(e);if(o){return await Object(i.b)(e)?n.getText({...e,specifiedOpt:o}):""}if(n.inBunch)return n.getText(e);{const t=await y(e),r=[];for(const i of t){const t=await n.getText({...e,specifiedOpt:i});Object(p.b)(t)||r.push(t)}return r.join(a)}}async function T(e){const t={};t.text=await x(e);const n=await async function(e){const{varInfo:{nodePart:t,optionPart:n,option:r,isMedia:o}}=e;if(!o)return[];const a=e.specifiedOpt||r;if(t&&t.getImages)return t.getImages(e);if(a){return await Object(i.b)(e)&&n.getImages?n.getImages({...e,specifiedOpt:a}):[]}{const t=await y(e),r=[];if(n.getImages)for(const i of t){const t=await n.getImages({...e,specifiedOpt:i});r.push(t[0])}return r}}(e);t.image=n[0];const r=await async function(e){const{varInfo:{optionPart:t,option:n}}=e;if(!t)return[];const r=e.specifiedOpt||n;if(r){return await Object(i.b)(e)&&t.getIcon?[t.getIcon({...e,specifiedOpt:r})]:[]}{const n=await y(e);return t.getIcon?n.map(n=>t.getIcon({...e,specifiedOpt:n})):[]}}(e);return t.icon=r[0],t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return N})),n.d(t,"e",(function(){return C})),n.d(t,"i",(function(){return A})),n.d(t,"c",(function(){return P})),n.d(t,"g",(function(){return R})),n.d(t,"h",(function(){return M})),n.d(t,"f",(function(){return D})),n.d(t,"b",(function(){return U})),n.d(t,"j",(function(){return B})),n.d(t,"k",(function(){return q})),n.d(t,"d",(function(){return F}));var r=n(6),i=n(4),o=n(15),a=n(8),c=n(36),s=n(0),u=n(1),l=n(3);const f={};function d(e,t){t.startTime=e.startTime,t.costTime=e.costTime,t.validateFailTimes=e.validateFailTimes,t.validateFailed=e.validateFailed,t.type=e.type}f.max_diff={cache(e,t){t.tasks=e.tasks.map(e=>({items:e.items.map(e=>({uuid:e.option.uuid,value:e.value,round:e.round})),done:e.done}))},use(e,t){e.tasks&&(t.tasks=e.tasks.map(e=>({items:e.items.map(e=>({option:Object(r.a)(t.options,e.uuid),value:e.value,round:e.round})),done:e.done})))}},f.cascade={use(e,t){!function e(t,n){n&&t&&(n.selected=t.selected,n.list&&t.list&&n.list.forEach(n=>{const r=t.list.find(e=>e.resultId===n.resultId);r&&e(r,n)}))}(e.cascade,t.cascade)},cache(e,t){t.cascade=function e(t){return t?{selected:t.selected,resultId:t.resultId,list:t.list&&t.list.map(t=>e(t))}:null}(e.cascade)}},f.verify={borrow(e,t){t.code=e.code,t.phoneNumber=e.phoneNumber}},f.region={borrow(e,t){t.indexes=e.indexes,t.position=e.position,t.value=e.value}},f.location=f.area={borrow(e,t){f.region.borrow(e,t),t.succeed=e.succeed,t.failed=e.failed,t.failedSkipActivated=e.failedSkipActivated}},f.sequence={use(e,t){t.options.sort((e,t)=>e.sortNo>t.sortNo?1:-1)}};const p=["select","select_icon","select_image","menu","hot_spot"];var b=n(56),h=n(7);const m={};function g(e,t,n){t.value=e.value,t.selected=e.selected,e.assistValue&&(t.assistValue=t.assistValue||{},Object.keys(e.assistValue).forEach(n=>{Object(h.b)(e.assistValue[n])||(t.assistValue[n]=e.assistValue[n])}),"cache"===n&&0===Object.keys(t.assistValue).length&&delete t.assistValue)}function O(e,t,n){if(g(e,t,"use"),!t.isOtherOpt){const r=m[n];r&&(r.use?r.use(e,t):r.borrow&&r.borrow(e,t))}}m.max_diff={borrow(e,t){e.records&&(t.records=e.records.map(e=>({...e})))}},m.sequence={borrow(e,t){t.sortNo=e.sortNo}},m.heat_map={borrow(e,t){e.point&&(t.point={...e.point})}},m.upload={borrow(e,t){t.fileName=e.fileName,t.fileType=e.fileType,t.name=e.name,t.isImage=e.isImage},cache(e,t){m.upload.borrow(e,t),t.value=e.miniValue||e.value},use(e,t){m.upload.borrow(e,t),t.fileName&&Object(b.c)(t,{width:64,height:64},e)}};let j=!1,v="";const w=["data","describe","logic","random","loop"];let y,_;let x,T,k={responseId:"",data:{},point:"",count:0,randomList:[],lang:""};function S(e){const{offlineTaskId:t}=Object(s.b)(),n="response_cache_"+Object(u.s)(e);return t?n+"_with_"+t:n}function E(e,t){const n={};return function(e,t,n){if(t.uuid=e.uuid,g(e,t,"cache"),!e.isOtherOpt){const r=m[n];r&&(r.cache?r.cache(e,t):r.borrow&&r.borrow(e,t))}}(e,n,t),n}function N(e){if(Object(s.c)().dev.infer||j)return;if(Object(i.w)(e)||w.includes(e.type)||e.readonly)return;const t={};!function(e,t){d(e,t);const n=f[t.type];n&&(n.cache?n.cache(e,t):n.borrow&&n.borrow(e,t))}(e,t);const n=Object(o.a)(e);if(n&&n.items){const r=n.items.map(e=>e.option_id.toLowerCase()),i=e=>!!n.items&&r.includes(e.uuid.toLowerCase()),{options:o,otherOptions:a}=e;o&&(t.options=o.filter(i).map(t=>E(t,e.type))),a&&(t.otherOptions=a.filter(i).map(t=>E(t,e.type)))}k.responseId=e.parent.transactionID,k.data[e.renderId]=t;const r=e.parent.randomList;r&&(k.randomList=r.map(e=>({nodeId:e.node.nodeUuid,destPortIds:e.destPortIds}))),I(e.parent)}function I(e){const{sid:t,renderList:n}=e,r=S(t);k.lang=Object(l.b)();const i=Object.keys(k.data);k.count=0;for(const e of n)if(i.includes(e.renderId)&&(k.count+=1),e.renderId===k.point)break;Object(s.b)().preview||Object(s.c)().storage.set(r,JSON.stringify(L(k)))}function C(e){const t=S(e),n=Object(s.c)().storage.get(t);if(n){const e=JSON.parse(n);return v||(v=e.lang),e}return null}function L(e){const t=e.data,n={};return Object.keys(t).forEach(e=>{const r={...t[e]};"upload"===r.type&&(r.options=r.options.map(e=>((e={...e}).miniValue&&(e.value=e.miniValue,delete e.miniValue),e))),n[e]=r}),{...e,data:n}}function A(e){if(Object(s.c)().dev.infer)return e;if(Object(i.w)(e)||w.includes(e.type)||e.readonly)return e;const t=k.data[e.renderId];return t?(function(e,t,n){const i=Object(r.c)(e);let o=[];t.options&&(o=[...o,...t.options]),t.otherOptions&&(o=[...o,...t.otherOptions]);for(const e of i){const t=Object(r.a)(o,e.uuid);t&&O(t,e,n)}}(e,t,e.type),function(e,t){d(e,t);const n=f[t.type];n&&(n.use?n.use(e,t):n.borrow&&n.borrow(e,t))}(t,e),function(e){if(Object(i.s)(e))return;const{options:t,otherOptions:n,type:r}=e;let o=n||[];p.includes(r)&&(o=[...o,...t]);const a=o.filter(e=>e.selected);if(a.length<=1)return;const c=[];a.forEach(e=>{e.autoSelectMarked?Object(s.g)(e,{selected:!1,autoSelectMarked:!1}):c.push(e)}),c.length>1&&c.forEach((e,t)=>{t<c.length-1&&Object(s.g)(e,{selected:!1})})}(e),y&&y(e),e):(y&&y(e),e)}function P(e=!1){return e?L(k):k}async function R(e,t,n){k=e,x=[...e.randomList||[]],T=e.point;const r=k.count;let i=0;j=!0,y=()=>{i>=r?_({failed:!1,error:""}):(n.onProgress(`${i}/${r}`),i++)},_=e=>{o(),y=null,_=null,a.a.trigger("END_MEMORY",t.current),setTimeout(()=>{n.onEnd(e)},250)};const o=()=>{a.a.off("NEXT_OK",u),a.a.off("STRETCH_OK",u),a.a.off("NEXT_OK",s),j=!1},s=(e,t)=>{"NEXT_FAIL"===e.type&&t?n.onSuspend():_({failed:!0,error:t})},u=()=>t.current.renderId===T?_({failed:!1,error:""}):t.handleEvents.handleNextClick();a.a.one("STRETCH_OK",u),a.a.on("NEXT_FAIL",s),a.a.on("NEXT_OK",u),a.a.trigger("START_MEMORY"),await Object(c.b)()}function M(e,t){if(!x)return e;const n=x.find(e=>e.nodeId===t.nodeUuid);if(!n)return e;const r=n.destPortIds,i=[],o=[];return e.forEach(e=>{r.includes(e)?i.push(e):o.push(e)}),i.sort((e,t)=>r.indexOf(e)>r.indexOf(t)?1:-1),[...i,...o]}function D(){k={responseId:"",data:{},point:"",count:0,randomList:[],lang:""}}function U(e){D();const t=S(e.sid);Object(s.c)().storage.remove(t)}function B(e){j||(k.point=e.current.renderId)}function q(e){B(e),I(e)}function F(e){return e?(v||C(e),v):""}},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"c",(function(){return _})),n.d(t,"e",(function(){return x})),n.d(t,"b",(function(){return k})),n.d(t,"d",(function(){return S}));var r=n(6),i=n(37),o=n(40),a=n(43),c=n(1),s=n(5),u=n(4),l=n(55),f=n(10),d=n(7),p=n(25);const b=["select","icon_mark","value_mark","upload","menu","slide_rate"],h=["fill","verify"];function m(e){const{type:t}=e;return"region"===t?"predef":t}function g(e,t){let n;if(t.isOtherOpt)n=t.optionType;else if(!0===t.useComment)n="option_comment";else{const{type:t}=e;n="region"===t?"predef_region":b.includes(t)?"option":h.includes(t)?"comment":t}return n}function O(e,t){const n=function(e){const{loop:t}=e;let n;return t&&(n=t.replacements.map(e=>({node_id:e.loopNodeId.toLowerCase(),index:e.index,option_id:e.uuid.toLowerCase()}))),n}(e),{nodeUuid:r}=e,i=t&&t(e);return{type:m(e),node_id:r.toLowerCase(),items:i,start_time:e.startTime,cost_time:Math.round(e.costTime||0),loop_ctxs:n}}function j(e,t){const n=t,i=Object(r.e)(n),o=Object(p.a)(n,e),a={value:Object(d.b)(o)?"":o,other:!!n.isOtherOpt,type:g(e,n)};return a.option_id=n.uuid.toLowerCase(),"matrix"===e.type&&n.yid?(a.row_option_id=n.yid.toLowerCase(),a.col_option_id=n.xid.toLowerCase(),a.row_content=Object(s.k)(n.yText),a.col_content=Object(s.k)(n.xText),a.content=a.col_content+"-"+a.row_content):a.content=i||Object(s.k)(n.text),n.visible||(a.hidden=!0),a}function v(e){return Object(r.b)(e).reduce((t,n)=>((n.selected||Object(p.b)(n,e))&&t.push(j(e,n)),t),[])}const w={};function y(e){const t=w[e.type];return t&&t(e)}function _(e){return"object"==typeof e.value?JSON.stringify(e.value):e.value}function x(e,t){return"all"===t||(e?"check"===t:"normal"===t)}function T(){return function(e){const t={};return Object.keys(e).forEach(n=>{n.match(/key\d{0,2}/)&&(t[n]=e[n])}),t}(Object(f.c)())}async function k(e,t="all",n="committed_url"){const{costTime:r,answers:a}=function(e,t,n=!1){const r=[];let i=0;return e.renderList.forEach(e=>{if(!x(e.checkMode,t))return;if("data"===e.type)return;const o=y(e);o&&(n&&(o.content=e.title,o.name=e.number),r.push(o),i+=o.cost_time)}),{answers:r,costTime:i}}(e,t),s={webhook_params:await Object(l.a)(e,n),answers:a,var_map_info:Object(o.a)(e,t),options_display_info:Object(i.a)(e,t),query_params:T(),cost_time:r,status:e.responseStatus};return Object(c.m)(s.answers,(e,t)=>{"string"==typeof e[t]&&(e[t]=e[t].replace(/,/g,",").replace(/[\r\n]/g," "))}),s}function S(e){switch(e.type){case"verify":return!!e.code;case"location":case"region":case"area":return!!e.value;case"describe":case"lottery":case"end":return!1;default:return Object(r.k)(e)||Object(r.l)(e)}}w.select=w.select_image=w.menu=w.select_icon=w.hot_spot=e=>{const t=O(e,v);if(Object(u.v)(e)&&t.items){let e=!1,n=!1;t.items.forEach(t=>{"comment"!==t.type&&(t.hidden?e=!0:n=!0),delete t.hidden}),e&&n&&(t.items=t.items.filter(e=>!e.hidden))}return t},w.cascade=w.icon_mark=w.value_mark=w.matrix=w.weight=w.slide_rate=w.sequence=w.upload=w.heat_map=w.fill=w.max_diff=e=>{const t=O(e,v);return t.items&&t.items.forEach(e=>{delete e.hidden}),t},w.location=e=>{const t=O(e,t=>{const n=Object(r.b)(e).find(e=>e.selected);if(!n)return[];return[j(t,n)]}),{position:n,indexes:i}=e;return n&&(n.indexes=i,t.location=n),t},w.region=e=>{const t=w.location(e);return t.region=Object(a.b)(e.value),t},w.area=e=>w.location(e),w.data=e=>O(e,e=>Object(r.b)(e).reduce((t,n)=>(n.selected&&t.push(j(e,n)),t),[])),w.verify=e=>{const t=O(e),{phoneNumber:n,validateType:r,code:i}=e;return"sms"===r&&(t.phone_num=n),t.code=i,t},w.end=e=>({type:m(e),node_id:e.nodeUuid.toLowerCase(),start_time:e.startTime,cost_time:0}),w.logic=e=>{const t=O(e);return t.logic_result=e.logicResult,t}},function(e,t,n){"use strict";n.d(t,"g",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return g}));var r=n(5),i=n(24),o=n(1),a=n(22),c=n(0);let s=[],u=[];function l(){s=[],u=[]}function f(e){s=e.imageList,u=e.variables,function(e){const t=function(e){const{varInfo:{imgSize:t},pureText:n}=e;if(n)return Object(o.n)(this.fileName);const r=g(Object(i.a)(this.serverFileName),t,this.fileName);return Object(o.n)(r)};e.forEach(e=>{e.getText=t,e.isMedia=!0,e.type="var-media"})}(s),function(){let e="";u.forEach(t=>{t.name.indexOf("TO_GLOBAL")>-1&&"var-html"===t.type&&(e+=Object(r.i)(t.value).replace(/<style>/g,"").replace(/<\/style>/g,""))}),Object(c.c)().ui.setGlobalStyle(e)}(),function(e){if(e){const t=p(e.allJson,null)+p(e.strJson,"var-string")+p(e.expJson,"var-expression")+p(e.reqJson,"var-request")+p(e.loopJson,"var-loop");Object(c.c)().ui.setVarStyle(t,e)}}(e.varStyles)}function d(e){let t="";return e.bold&&(t+="font-weight: bold;"),e.italic&&(t+="font-style: italic;"),e.underline?t+="text-decoration: underline;":e.lineThrough&&(t+="text-decoration: line-through;"),e.color&&(t+=`color: ${e.color};`),e.backgroundColor&&(t+=`background-color: ${e.backgroundColor};`),e.fontSize&&(t+=`font-size: ${e.fontSize};`,t+="line-height: 1.4;"),t}function p(e,t){if(!e)return"";let n=t?`.var-light.${t}:not([in-edist]) {`:".var-light:not([in-edist]) {";return n+=d(e),n+="}",n}function b(e=""){return u.find(t=>t.name===e)}function h(e=""){return s.find(t=>Object(o.l)(t.id,e))}function m(e=""){return Object(a.b)(e)||u.find(t=>Object(o.l)(t.uuid,e))||h(e)}function g(e="",t="0:0",n="Image",r=!1){let i="##"+e;if(!r){const e=t.split(":");i+=`?w=${e[0]||0}&h=${e[1]||0}`,n&&(i+="#"+n)}return i+"##"}},function(e,t,n){"use strict";n.d(t,"d",(function(){return p})),n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return g})),n.d(t,"e",(function(){return O})),n.d(t,"c",(function(){return j}));var r=n(12),i=n(4),o=n(52),a=n(1),c=n(19),s=n(0),u=n(36),l=n(48),f=n(8);let d=-1;function p(e,t){return t===e||t.indexOf(e)>-1&&t.substr(e.length).indexOf("-")>-1}function b(e,t){return t=t.toLowerCase(),e.find(e=>p(e.renderId.toLowerCase(),t))}function h(e,t){for(let i=0;i<e.length;i++){const o=e[i];if(n=o,r=t,Object(a.l)(n.renderId,r.renderId))return i}var n,r;return-1}function m(e,t){Object(s.g)(e,{refreshing:t})}function g(e,t,n){if(m(e,!0),clearTimeout(d),n.initial&&Object(f.c)(e.current,!0),n.delay){const r=Object(s.c)().dev.autoRun||Object(s.c)().dev.infer?0:n.delay;return new Promise((i,o)=>{d=setTimeout(async()=>{try{await v(e,t,n)}catch(e){o(e)}i()},r)})}return v(e,t,n)}function O(e,t){const{circleNode1Id:n}=t;n?Object(s.g)(e,{loopStack:Object(a.b)(t.loopStack)}):Object(s.g)(e,{loopStack:[]});const r=e.randomList,i=t.random;r.forEach(e=>{if(i)if(Object(a.l)(e.node.nodeUuid,i.node.nodeUuid))e.currentIndex=i.currentIndex;else{i.stack.some(t=>Object(a.l)(e.node.nodeUuid,t.node.nodeUuid))||(e.currentIndex=-1)}else e.currentIndex=-1})}function j(e,t){const n=function(e,t){let n=e;if(!t)return n;for(const e of t)n+="-"+Object(a.s)(e.option_id);return n}(t.node_id,t.loop_ctxs);return b(e.renderList,n)}async function v(e,t,n){m(e,!0);const a=e.renderList;O(e,t=t||e.current);const f=h(a,t),d=await async function(e,t,n){const a=n.type;let u=[...e.renderList];u=u.length>0?u:[t];const l=h(u,t);if(l<0)return u;u.length=l,u.push(t),Object(s.g)(e,{renderList:u}),Object(c.c)(e)&&await Object(o.a)(t);let f=null;const d=e=>!Object(i.t)(e,f);let p=null;for("page_inner"===a&&(f=t,p=d);;){const t=await Object(r.c)(e,p);if(!t)break;if(u.push(t),i.x.includes(t.type))break;if(!Object(i.w)(t)){f||(f=t,f.groupSingle&&(p=d));if(!Object(i.t)(f,t))break;await Object(o.a)(t)}}return u}(e,t,n),p=n.initial?Object(r.g)(e,d,f).next:t;Object(s.g)(e,{current:p}),m(e,!1),O(e,t),await e.dynamicStateProps(),n.initial||(await Object(r.b)(e),e.inSingleGroup&&Object(l.a)(e)),Object(u.d)()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return O})),n.d(t,"d",(function(){return j})),n.d(t,"e",(function(){return v}));var r=n(6),i=n(5),o=n(1),a=n(40),c=n(31),s=n(13),u=n(42),l=n(22),f=n(0),d=n(24);function p(e,t){const{loop:n}=t,r=n&&n.node.nodeUuid;return Object(l.a)().QUES_IMAGE.getImages({state:e,varInfo:{question:t,loopNodeId:r}})}async function b(e,t){const{parent:n,loop:r}=e,i=r&&r.node.nodeUuid,{image:o,text:c}=t,s=Object(l.a)(),u=(await s.OPT_IMAGE.getImages({state:n,varInfo:{option:t,loopNodeId:i}}))[0];return!c&&u&&o&&"variable"===o.type&&Object(a.d)({question:e,option:t},{mapId:o.id},u.originName),u}function h(e){return!!Object(f.b)().realTimePreview||e&&!!(e.text||e.image||e.icon)}async function m(e,t,n){const{optionPart:i,nodePart:o}=t,{option:a}=t;if(!i||i.inBunch)return{valid:!0};if(a)return{valid:!0,option:a};{const i=await o.filter({state:e,varInfo:t}),a=Object(r.a)(i,n.refOptId);return{valid:!!a,option:a}}}function g(e,t){return e?e.find(e=>e.uuid===t):null}async function O(e,t,n){const r={...e};if(t.context.option=r,r.mapping){const e={...r.mapping};for(const n of Object.keys(e)){const r=n,o=e[r];if("string"==typeof o)e[r]=await Object(i.d)(o,{state:t});else{const t=o;e[r]=Object(d.c)(t)}}r.mapping=e,"data"===n&&(r.value=e.field_1,r.number=e.field_2,r.optComment=e.field_3,r.image=e.field_4)}return r.assistValue={field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""},t.context.option=null,r}async function j(e,t,n){const r=[];for(const i of e)r.push(await O(i,t,n));return r}async function v(e,t,n,u=!1){let l=[];const f=t;let{refOptions:d,options:p,optionRefers:b}=f;if("xid"===n?(d=f.refOptionsX,p=f.optionsX,b=f.optionXRefers):"yid"===n&&(d=f.refOptionsY,p=f.optionsY,b=f.optionYRefers),p&&d&&0!==d.length){l=[...p];const t={};for(const n of d){const o=g(b,n.referId),a=await Object(i.e)(n.limitRnd,{state:e});if(0===a)continue;let c=null;const l=Object(s.h)(e,{uuid:n.varId,limit:n.limit,limitSrc:n.limitSrc,limitRnd:n.limitRnd});if(!l)continue;const{valid:f,option:d}=await m(e,l,n);if(!f)continue;d&&(n.refIndex=d.index,n.refRealIndex=d.realIndex);const p={state:e,varInfo:l,specifiedOpt:d,pureText:!u,keepWrap:!0};if(l.question?(c=await Object(s.a)(p),d&&(c.passRef={value:d.value,optComment:d.optComment,image:Object(r.p)(d,"image"),number:d.number,text:d.text,label:d.label,mapping:d.mapping&&{...d.mapping}})):c=await w(p),h(c)){const e={...n,...c},r=n.referId+n.varId;t[r]?t[r].list.push(e):t[r]={list:[e],limitRnd:a,varInfo:l,disorder:o&&o.disorder}}}Object.keys(t).forEach(e=>{const{limitRnd:n,list:r,varInfo:i,disorder:s}=t[e];let u=Object(o.p)(r,n);u=s?Object(c.c)(u):Object(c.e)(u),Object(a.e)(f,i,u),l=l.concat(u)})}else l=p;return j(l,e,f.type)}async function w(e){return{text:await Object(i.c)(e),image:Object(u.b)(e.varInfo)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return ae})),n.d(t,"c",(function(){return ce})),n.d(t,"d",(function(){return le})),n.d(t,"f",(function(){return fe})),n.d(t,"e",(function(){return de})),n.d(t,"a",(function(){return pe}));var r=n(31),i=n(6),o=n(4),a=n(18),c=n(37),s=n(5);var u=n(0);const l=["select","sequence","menu"];function f(e,t){return t.options?t=function(e,t){if(Object(u.b)().realTimePreview)return t;let n;return l.indexOf(e.type)>-1?n=e=>!!e.text:"select_image"===e.type?n=e=>!!e.image:"slide_rate"===e.type&&(n=e=>!!e.text||!!e.image),n&&(t.options=t.options.filter(n)),t}(e,t):t}var d=n(61),p=n(11),b=n(7);const h={done:!1,expectedValue:"",actualValue:""};function m(e){const{autoInputConfig:t}=e;if(!t)return"";const{defaultValue:n}=t;return n&&Object(b.a)(n).trim()?n:""}const g={};async function O(e,t,n,r,i){if(!m(e))return h;const{parent:o}=t,a=await Object(s.e)(m(e),{state:o});let c=a;return a>=n&&a<=r||(c=i),Object(u.g)(e,{value:c}),{done:!0,actualValue:c,expectedValue:a}}async function j(e,t){const n=g[t.type];if(n){t.parent.context.option=e;const r=await n(e,t);return!!r.done&&(Object(p.c)(t.parent,e,t,r.actualValue,r.expectedValue),!0)}return!1}g.fill=async(e,t)=>{if(!m(e))return h;const{parent:n}=t,r=await Object(s.f)(m(e),{state:n});return Object(u.g)(e,{value:r}),{done:!0,actualValue:r,expectedValue:r}},g.value_mark=(e,t)=>O(e,t,e.minValue,e.maxValue,""),g.icon_mark=(e,t)=>O(e,t,0,e.count,""),g.slide_rate=(e,t)=>{const{rateOptions:n}=t;return O(e,t,0,n.length,"")},g.weight=(e,t)=>O(e,t,0,e.maxValue||t.weightTotal,""),g.sequence=async(e,t)=>{if(!m(e))return h;const n=t.options.length,{parent:r}=t,i=await Object(s.e)(m(e),{state:r});let o=i;return i>=1&&i<=n||(o=-1),Object(u.g)(e,{sortNo:o,selected:o>=1}),{done:!0,actualValue:o,expectedValue:i}};var v=n(21),w=n(1);async function y(e,t){const n=t.parent;n.context.option=e;const r=await function(e,t){return t?Object(v.b)(e,t.options,t.logicType):Object(w.n)(!1)}(n,e.selectConfig);e.autoSelectMarked=!!r}const _=["select","select_icon","select_image","menu","hot_spot","data"];var x=n(42),T=n(14),k=n(8);async function S(e,t,n,r,i=!1){const o=(n.options||[]).find(n=>n.xid===e.uuid&&n.yid===t.uuid),s={...o,index:o.number,realIndex:o.number,label:o.label||"",xid:e.uuid,yid:t.uuid,xText:e.text,yText:t.text,text:i?e.text:t.text,xNumber:e.number,xMutexNumber:e.mutexNumber,yMutexNumber:t.mutexNumber,yNumber:t.number,renderId:Object(w.h)(o.uuid,n.loopStack),headLength:r,selected:!1},u=await Object(a.c)(s,n.parent,n.type),l=await Object(c.b)(n.parent,u,n);return u.disabled=!l,u}async function E(e,t,n){const{parent:r}=e;return t={...t,customData:{},isOther:!!t.isOtherOpt,_selected:!1,inputType:n||N(t),value:t.value||"",renderId:Object(i.h)(e,t)},r.context.option=t,t.text=await Object(s.d)(t.text,{state:r,usage:{question:e,option:t}}),Object.defineProperty(t,"selected",{get(){return this._selected},set(e){"select-input"===this.inputType&&(e?Object(u.g)(this,{value:this.cachedValue||this.value}):Object(u.g)(this,{cachedValue:this.value,value:""})),Object(u.g)(this,{_selected:e}),e&&-1===this.mutexNumber&&setTimeout(()=>{k.a.trigger("OPT_EXCLUDE",this)}),k.a.trigger("OPT_SELECT",this)}}),t.isOtherOpt&&(await function(e,t){return Object(u.g)(e,{inputType:N(e)}),C(e,t)}(t,e),Object(i.n)(t)||await y(t,e)),function(e){!0===e.useComment?Object(u.g)(e,{placeholder:e.optComment}):"input"===e.inputType&&Object(u.g)(e,{placeholder:e.text})}(t),t}function N(e){let t="select";return Object(i.n)(e)?t="input":!0===e.useComment&&(t="select-input"),t}const I={chars:"count",date:"date",date_range:"dateRange",email:"email",float:"float",integer:"int",phone_number:"mobile",postcode:"postCode",time:"time",time_range:"timeRange",time_duration:"timeSpan",url:"link",auto_complete:"autoComplete",list_select:"dropdown",none:"noValidation"};async function C(e,t){const n=e.fillType;if(!n)return;const{parent:r}=t;let i,o,a,c=await Object(s.e)(e.fillStart,{state:r}),l=await Object(s.e)(e.fillEnd,{state:r});if(isNaN(c)&&(c=void 0),isNaN(l)&&(l=void 0),"date"===n){const e=(new Date).getFullYear(),t=c,n=l;void 0!==c&&(c=new Date(c,0,1),e<t&&(i=c)),void 0!==l&&(l=new Date(l,11,31),e>n&&(i=l))}"auto_complete"===n&&(o=function(e,t=[]){const{autoCpltGroups:n}=e;return t.reduce((e,t)=>{const r=n.find(e=>e.id===t);return r&&(e=e.concat(r.data)),e},[])}(r,e.autoCpltIds),a=Object(T.d)(t.parent.sid));let f=[];if("list_select"===n){f=M((await Object(s.f)(e.selectText,{state:r,joinBy:","})).split(","))}Object(u.g)(e,{inputRule:I[e.fillType]||"noValidation",validateMin:c,validateMax:l,defaultValue:i,completeGroups:o,selectList:f,prevCpltLang:a})}async function L(e,t,n=!1){const{options:i,otherOptions:o,hiddenOptions:a}=e,c={options:[],otherOptions:[],hiddenOptions:[]};if(i)for(const n of Object(r.b)(e,i))c.options.push(await t(n));if(o)for(const t of o)c.otherOptions.push(await E(e,t));if(a)for(const e of a)c.hiddenOptions.push(await t(e));return n&&D([...c.options,...c.otherOptions]),c}const A={};async function P(e,t){if(!e.image||!e.image.reformed){return await Object(a.b)(t,e)}return e.image}function R(e){return e.replace("/outline/","/glyph/")}function M(e){const t={};return e.map(e=>{const n=t[e];if(n){const r=n+1;return t[e]=r,`${e}(${n})`}return t[e]=2,e})}function D(e){M(e.map(e=>e.text)).forEach((t,n)=>{e[n].text=t})}function U(e){return e?"string"==typeof e?e:e.path?Object(u.b)().hostConfig.cdnHost+e.path:"":""}function B(e){const{icon:t}=e,n=U(t);Object(u.g)(e,{icon:n,iconActive:R(n)})}async function q(e,t){const n=await async function(e,t){const n=e;if("matrix"===n.type){const e=await Object(a.e)(t,n,"xid");n.optionsX=await Object(c.c)(t,e,n);const r=await Object(a.e)(t,n,"yid");n.optionsY=await Object(c.c)(t,r,n);const i=await Object(a.d)(n.otherOptions,t,n.type),o=await Object(c.d)(t,i,n);return n.otherOptions=o.visibleList,n}if(n.options){let e=await Object(a.e)(t,n);if(n.otherOptions){const r=await Object(a.d)(n.otherOptions,t,n.type);e=e.concat(r)}const r=await Object(c.d)(t,e,n);return n.options=[],n.otherOptions=[],r.visibleList.forEach(e=>{e.isOtherOpt?n.otherOptions.push(e):n.options.push(e)}),n.hiddenOptions=r.hiddenList,n}return n}(e,t),r=A[n.type],i=r?await r(n):void 0,s=i&&f(n,i);return Object(u.g)(n,s),function(e){const{options:t,otherOptions:n,type:r,parent:i}=e;let a=n||[];_.includes(r)&&(a=[...a,...t]);const c=a.filter(e=>e.autoSelectMarked).reverse();if(Object(o.s)(e))c.forEach(t=>{Object(u.g)(t,{selected:!0}),Object(p.d)(i,t,e)});else{const[t,...n]=c;n.forEach(t=>{t.autoSelectMarked=!1,Object(p.d)(i,t,e,"因冲突被终止")}),t&&(Object(u.g)(t,{selected:!0}),Object(p.d)(i,t,e))}}(n),t.context.option=null,s}A.select=e=>L(e,(async function(t){const n=await E(e,t);return await C(n,e),await y(n,e),n})),A.fill=e=>L(e,(async function(t){const n=await E(e,t,"input");return await C(n,e),n.placeholder=Object(s.k)(n.text),await j(n,e),n})),A.value_mark=e=>L(e,(async function(t){const{parent:n}=e,r=await E(e,t,"input");r.value="";const i=await Object(s.e)(e.markMin,{state:n}),o=await Object(s.e)(e.markMax,{state:n});return Object(u.g)(r,{minValue:i,step:e.markStep,maxValue:o,minValueText:e.minText,maxValueText:e.maxText}),await j(r,e),r})),A.icon_mark=e=>L(e,(async function(t){const n=await E(e,t,"input");return n.value="",Object(u.g)(n,{count:e.markImgCount||5,icon:e.markImgName||"rating-number"}),await j(n,e),n})),A.sequence=async e=>{let t=!1;const n=await L(e,async n=>{const r=await E(e,n,"input");Object(u.g)(r,{icon:"ranking",sortNo:-1});return await j(r,e)&&(t=!0),r});return t&&n.options.sort((e,t)=>e.sortNo>t.sortNo?1:-1),n},A.matrix=async e=>{const t=Object(r.a)(e),{optionsX:n,optionsY:i}=t,{parent:a}=e,c=[];for(const t of n)c.push({...t,text:await Object(s.d)(t.text,{state:a,usage:{question:e,option:t}})});const u=[];for(const t of i)u.push({...t,text:await Object(s.d)(t.text,{state:a,usage:{question:e,option:t}})});const l=[];for(const n of t.otherOptions)l.push(await E(e,n));const f={otherOptions:l,renderOptionsX:c.filter(e=>e.visible),renderOptionsY:u.filter(e=>e.visible)},d=Object(o.r)(e)||Object(o.o)(e),p=await async function(e,t,n,r=!1){const i=[],o=[];let a=e,c=t;r&&(a=t,c=e);for(const[e,t]of a.entries())if(t.visible){const a=t.text.length,s={length:a,text:t.text,list:[]};let u=0;for(const e of c)if(e.visible){let i=t,c=e;r&&(c=t,i=e);const l=await S(i,c,n,a,r);u=Math.max(u,l.text.length),o.push(l),s.list.push(l)}0===e&&s.list.forEach(e=>{e.length=u}),i.push(s)}return{flatten:i,options:o,fullOptions:o}}(c,u,e,d),b=function(e,t,n){const r=[];return t.forEach(t=>{if(t.visible){const i=[];e.forEach(e=>{if(e.visible){const r=n.find(n=>n.xid===e.uuid&&n.yid===t.uuid);if(!r)throw new Error("matrix item not found");i.push(r)}}),r.push(i)}}),{matrix:r}}(c,u,p.options);return{...f,...p,...b}},A.select_image=e=>L(e,async t=>{const n=await E(e,t);return n.text=Object(s.k)(n.text),n.image=await P(n,e),await y(n,e),n}),A.upload=e=>L(e,async t=>{const n=await E(e,t,"input");return n.text=Object(s.k)(n.text),n.icon="camera",n.name="",n.value="",n.fileName="",n.fileType="",n.progress=0,n.isImage=!1,n.fileLimits=[...n.fileLimits||["image"]],n.accept=Object(d.a)(n.fileLimits),n}),A.menu=e=>L(e,async t=>{const n=await E(e,t);return await C(n,e),n.text=Object(s.k)(n.text).trim(),await y(n,e),n},!0),A.select_icon=e=>L(e,async t=>{const n=await E(e,t);return B(n),await y(n,e),n}),A.weight=e=>{const{parent:t}=e;return L(e,async n=>{const r=await E(e,n,"input");let i=await Object(s.e)(r.maxMark,{state:t});const a=await Object(o.h)(e);return(!i||i>a)&&(i=a),Object(u.g)(r,{percent:"0%",color:r.color,maxValue:i,value:""}),await j(r,e),r})},A.cascade=e=>L(e,t=>(t.text="",E(e,t))),A.data=async e=>{const t={state:e.parent,loop:e.loop},n=[];for(const r of e.options){const i=await E(e,r);B(i),Object(u.g)(i,{value:await Object(s.g)(i.value,t),number:await Object(s.g)(i.number,t),optComment:await Object(s.d)(i.optComment,t),image:await Object(a.b)(e,i)}),await y(i,e),n.push(i)}return{options:n}},A.hot_spot=async e=>{const t=await L(e,async t=>{const n=await E(e,t);await C(n,e),await y(n,e);const{area:r,pathD:i}=n.points.reduce((e,t,r)=>{e.pathD?e.pathD+=" L":e.pathD+="M",e.pathD+=t.x+" "+t.y;const i=n.points[r+1];return i?e.area+=t.y+i.y*(i.x-t.x)/2:e.pathD+=" Z",e},{area:0,pathD:""});return Object(u.g)(n,{area:r,pathD:i,transform:`translate(${n.x},${n.y})`}),n});return t.options.sort((e,t)=>e.area<t.area?1:-1),t},A.heat_map=e=>L(e,(async function(t){return await E(e,t,"input")})),A.max_diff=e=>L(e,(async function(t){const n=await E(e,t,"input");return n.value=0,n.image=await P(n,e),n.records=[],n})),A.slide_rate=async e=>{const{rateOptions:t}=e,n=await L(e,async t=>{const n=await E(e,t,"input");return Object(u.g)(n,{image:await P(n,e),text:Object(x.c)(n.text),value:""}),await j(n,e),n}),r=[];for(const n of t){await Object(c.b)(e.parent,n,e)&&r.push(n)}return{...n,rateOptions:r.map(e=>{const{icon:t}=e,n=U(t);return{url:U(t),urlActive:R(n),text:Object(s.a)(e.text),value:e.value,uuid:e.uuid,customData:{}}})}};var F=n(43),V=n(2),z=n(3);const $={typeName:"",typeDescription:""},H={};H.select=async e=>{const t=Object(o.s)(e);let n=Object(V.f)(z.a.select.single);if(t){n=Object(V.f)(z.a.select.multi);const{min:t,max:r}=await Object(o.e)(e);return{typeName:n,typeDescription:Object(V.f)(z.a.select.limitBetween,{min:t,max:r})}}return{typeName:n,typeDescription:""}},H.value_mark=()=>Object(w.n)({typeName:Object(V.f)(z.a.mark.value)}),H.icon_mark=()=>Object(w.n)({typeName:Object(V.f)(z.a.mark.graph)}),H.weight=e=>{const t=e.weightTotal;let n=Object(V.f)(z.a.weight.total,{total:t});return n+=!0===e.relax?Object(V.f)(z.a.weight.relax):Object(V.f)(z.a.weight.strict),Object(w.n)({typeName:Object(V.f)(z.a.weight.name),typeDescription:n})},H.fill=()=>Object(w.n)({typeName:Object(V.f)(z.a.fill.name)}),H.slide_rate=()=>Object(w.n)({typeName:Object(V.f)(z.a.slideRate.name)}),H.sequence=e=>{const t=e.rankCount,n=Number(t)?Object(V.f)(z.a.rank.limitMin,{min:t}):Object(V.f)(z.a.rank.limitAll);return Object(w.n)({typeName:Object(V.f)(z.a.rank.name),typeDescription:n})},H.menu=async e=>({...await H.select(e),typeName:Object(V.f)(z.a.menu.name)}),H.select_icon=e=>H.select(e),H.select_image=e=>H.select(e),H.upload=async e=>{const t=Object(V.f)(z.a.upload.name);if(!0===e.limitEnabled){const{min:n,max:r}=await Object(o.g)(e);return{typeName:t,typeDescription:Object(V.f)(z.a.upload.amountLimit,{min:n,max:r})}}return{typeName:t,typeDescription:""}},H.location=()=>Object(w.n)({typeName:Object(V.f)(z.a.locate.name)}),H.area=()=>Object(w.n)({typeName:Object(V.f)(z.a.site.name)}),H.region=()=>Object(w.n)({typeName:Object(V.f)(z.a.region.name)}),H.verify=()=>Object(w.n)({typeName:Object(V.f)(z.a.verify.name)}),H.cascade=()=>Object(w.n)({typeName:Object(V.f)(z.a.cascade.name)}),H.matrix=async e=>{if(Object(o.v)(e))return{typeName:Object(V.f)(z.a.matrix.single)};if(Object(o.s)(e)){const{min:t,max:n}=await Object(o.e)(e);let r=Object(V.f)(z.a.matrix.multi),i=Object(V.f)(z.a.select.limitBetween,{min:t,max:n});return Object(o.n)(e)?(r=Object(V.f)(z.a.matrix.multiCol),i=Object(V.f)(z.a.matrix.colLimitBetween,{min:t,max:n})):Object(o.o)(e)&&(r=Object(V.f)(z.a.matrix.multiRow),i=Object(V.f)(z.a.matrix.rowLimitBetween,{min:t,max:n})),{typeName:r,typeDescription:i}}return Object(o.r)(e)?{typeName:Object(V.f)(z.a.matrix.singleRow),typeDescription:Object(V.f)(z.a.matrix.eachRowOne)}:Object(o.p)(e)?{typeName:Object(V.f)(z.a.matrix.singleCol),typeDescription:Object(V.f)(z.a.matrix.eachColOne)}:Object(o.q)(e)?{typeName:Object(V.f)(z.a.matrix.singleRowCol),typeDescription:Object(V.f)(z.a.matrix.eachRowColOne)}:{typeName:Object(V.f)(z.a.matrix.single)}},H.hot_spot=()=>Object(w.n)({typeName:Object(V.f)(z.a.hotSpot.name)}),H.heat_map=()=>Object(w.n)({typeName:Object(V.f)(z.a.heatMap.name)}),H.max_diff=()=>Object(w.n)({typeName:Object(V.f)(z.a.maxDiff.name)});var X=n(24);const G=["select","menu","select_image","select_icon","upload"];function K(e){return async function(e){if("sequence"===e.type){const t=Object(i.c)(e);if(1===t.length){const n=t[0];Object(u.g)(n,{selected:!0,sortNo:1}),Object(p.r)(0,e)}}else if(G.indexOf(e.type)>-1){if(!await Object(v.f)(e.showWithSingleRefOpt,e.parent)){const t=Object(i.c)(e)||[];if(1===t.length){const n=t[0];n.isRef&&(Object(u.g)(n,{selected:!0}),Object(p.d)(e.parent,n,e,"single_ref_select_opt"),e.forceSkipReason="single_ref_select_opt",e.autoSkip=!0)}}return e}return e}(e)}var J=n(40),W=n(60),Y=n(15),Z=n(12),Q=n(22),ee=n(10);function te(e){return 1===e?"bottom":2===e?"top":"center"}async function ne(e,t){const{destList:n,cascadeStart:r}=t,a=Object(o.c)(e.nodeList,n,r.uuid);if(!a)return;const c=await async function e(t,n,r,a,c){c?((c=await E(t,c)).text=Object(x.c)(Object(s.k)(c.text)),await C(c,t)):c={uuid:"",text:""};const{nodeList:u}=n,l=a?a+"=>"+Object(w.s)(c.uuid):Object(w.s)(c.uuid),f={option:c,groupId:a,resultId:l,text:c.text||c.optComment};if(!r)return f;f.placeholder=r.placeholder||Object(V.f)(z.a.menu.clickToSelect),(r={...r,options:await re(r,n,t)}).parent=n;const d=Object(o.s)(r),{min:p,max:b}=await Object(o.e)(r),{destList:h,output:m}=r,g=Object(o.i)(r),O=[],j=d?Object(V.f)(z.a.cascade.selectBetween,{min:p||1,max:b}):Object(V.f)(z.a.cascade.selectSome,{amount:1}),v={...f,list:O,multiple:d,min:p,max:b,hint:j,required:g,display:te(r.menuType),multiLine:r.lineCount},y=Object(o.c)(u,h,m.uuid),_=Object(i.c)(r);D(_);for(const r of _){const i=Object(o.c)(u,h,r.uuid)||y,a=await e(t,n,i,l,r);O.push(a)}return v}(t,e,a,"");t.cascade=c}async function re(e,t,n){let i=n.cachedCasMenuOpts;i||(i=n.cachedCasMenuOpts={});const o=i[e.nodeUuid];if(o)return o;{const o=await Object(a.e)(t,e),s=await Object(c.d)(t,o,n),u=Object(r.b)(e,s.visibleList);return i[e.nodeUuid]=u,u}}function ie(e,t,n){const r=function(e){const t=[];return e.forEach(e=>{const{pickedTimes:n}=e;t[n]?t[n].push(e):t[n]=[e]}),t}(e),i={items:[],done:!1};let o=t;for(const e of r)if(e){const t=Object(w.p)(e,o);if(t.forEach(e=>{i.items.push({option:e.option,value:0,round:n}),e.option.records.push({round:n,value:0}),e.pickedTimes+=1}),o-=t.length,0===o)break}return i}function oe(e){const{options:t,itemCountPerTask:n,taskCount:r}=e,i=t.map(e=>({option:e,pickedTimes:0})),o=[];for(let e=0;e<r;e++)o.push(ie(i,n,e+1));return o}function ae(e){const{current:t,renderList:n}=e,r=[t],i=n.indexOf(t);let a=i-1,c=t;for(;;){const e=n[a--];if(!Object(o.t)(e,c))break;Object(o.w)(e)||(r.unshift(e),c=e)}let s=i+1,l=t;for(;;){const e=n[s++];if(!Object(o.t)(e,l))break;Object(o.w)(e)||(r.push(e),l=e)}return r[0].groupSingle&&(r.forEach(e=>{Object(u.g)(e,{pageEnd:!1,pageStart:!1})}),Object(u.g)(r[0],{pageStart:!0}),Object(u.g)(r[r.length-1],{pageEnd:!0})),r}function ce(e){const t=e.first();return t&&t.groupSingle}function se(e){return["province","city","county","street"].indexOf(e)+1||1}const ue={};async function le(e){const t=e,{parent:n}=t,r=await Object(s.d)(t.describe,{state:n,usage:{question:t,exclusiveId:"description"}});Object(u.g)(t,{description:r})}async function fe(e,t){const n={...e,dynamicNodeProps(){Object(u.g)(this,{hasAnswer:Object(Y.d)(this),next:Object(Z.e)(this).next})}};if(o.y.indexOf(n.type)>-1)return async function(e,t){e.parent=t,Object(u.g)(e,{autoSkip:!0,renderId:Object(o.f)(e),number:""});const n=ue[e.type];return n&&await n(e),e}(n,t);const{qNumberRequired:r}=t;n.parent=t;const i=Object(o.f)(n);Object(u.g)(n,{customData:{},template:await Object(u.c)().ui.initNodeTemplate(n.template,t,n.loop),startTime:(new Date).toISOString(),costTime:0,realtimePreview:Object(u.b)().realTimePreview,validateFailTimes:0,renderId:i,images:await Object(a.a)(t,n),asterisks:!0===n.answerRequired&&t.asterisksRequired,selectType:Object(o.s)(n)?"checkbox":"radio",value:""}),await q(n,t);const c=ue[n.type];c&&await c(n),t.context.question=n,await async function(e){const t=e,{loop:n,parent:r}=t,i=await Object(s.d)(t.questionText,{spaceRep:" ",state:r,usage:{question:t,exclusiveId:"title"}});let o=t.nodeName.split("/")[0];if(o&&t.circleNode1Id&&!t.lockLoopCount&&!Object(u.b)().realTimePreview){const e=Object(Q.a)();let i=await e.C_OL_LBL.getText({state:r});if(i||(i=n.node.nodeName+"_"+await e.C_OL_IDX.getText({state:r})),o=i+"_"+o,t.circleNode2Id){let t=await e.C_IL_LBL.getText({state:r});t||(t=n.node.nodeName+"_"+await e.C_IL_IDX.getText({state:r})),o=t+"_"+o}}Object(u.g)(t,{title:i,realNodeName:o})}(n),await le(n),r&&function(e){"end"!==e.type&&"describe"!==e.type&&Object(u.g)(e,{number:e.realNodeName})}(n),Object(u.c)().dev.infer||Object(u.g)(n,await async function(e){if(!e.parent.nodeTypeInfoRequired)return $;const t=H[e.type],n=t?await t(e):$;return n.typeDescription="",n}(n)),Object(o.z)(n);return Object(T.i)(await K(n))}async function de(e,t,n){const r=await fe({origin:e,...e,parent:n,activityName:t.activityName,rewardName:t.rewardName,rewardTime:t.sendTime,goal:t.goal,rewardNodeId:t.rewardNodeId,rewardCount:t.lotteryCount,rewardImage:t.rewardImage,rewardTitle:t.rewardTitle,rewardDescribe:t.rewardDescribe,rewardList:e.showRewards?e.options.map(e=>({rewardName:e.rewardName,rewardNumbering:e.rewardCount})):null},n);if(!Object(u.b)().preview){const{formalResult:{reward:e}}=n;!Object(u.c)().app.canHandleReward()&&e&&"red_envelope"===e.type&&await pe(n,r)}return r}async function pe(e,t){const{formalResult:{reward:n,authorizer:r},nodeList:i}=e,{app_id:a,component_appid:c}=r,l=Object(o.a)(i,n.gift_id),f=await Object(s.h)(l.linkUrl,{state:e});t.linkUrl=f,t.endBtnText=l.endBtnText||"";const d={rid:Object(b.a)(n.id),aid:a,cid:c,qid:e.surveyId,tid:e.transactionID,sid:Object(ee.c)().sid};l.template&&(d.rtpl=l.template.id),t.qrCode=Object(u.c)().app.getRewardUrl(d)}ue.select=e=>(Object(u.g)(e,{quesType:"choice"}),Object(w.n)()),ue.region=e=>(Object(u.g)(e,{quesType:"region",indexes:"0 0 0",value:"",regions:Object(F.d)(),grade:se(e.infoRange),placeholder:Object(V.f)(z.a.menu.clickToSelect)}),Object(w.n)()),ue.describe=e=>(Object(u.g)(e,{quesType:"intro-page"}),Object(w.n)()),ue.end=async e=>{const{parent:t}=e,n=await Object(s.h)(e.linkUrl,{state:t});Object(u.g)(e,{quesType:"end-page",hasReward:!1,logoText:e.parent.customText,logoImage:e.parent.customLogo,linkUrl:n})},ue.fill=e=>(Object(u.g)(e,{quesType:"short-text"}),Object(w.n)()),ue.gift=e=>(Object(u.g)(e,{quesType:"reward"}),Object(w.n)()),ue.select_icon=e=>(Object(u.g)(e,{quesType:"icon"}),Object(w.n)()),ue.location=e=>(Object(u.g)(e,{quesType:"location",regions:Object(F.d)(),grade:se(e.infoRange),value:""}),Object(w.n)()),ue.lottery=e=>(Object(u.g)(e,{quesType:"lottery"}),Object(w.n)()),ue.value_mark=e=>(Object(u.g)(e,{quesType:"range"}),Object(w.n)()),ue.icon_mark=e=>(Object(u.g)(e,{quesType:"rating"}),Object(w.n)()),ue.matrix=e=>(Object(u.g)(e,{quesType:"matrix"}),Object(w.n)()),ue.menu=e=>(Object(u.g)(e,{quesType:"dropdown",value:"",placeholder:e.placeholder||Object(V.f)(z.a.menu.clickToSelect),icon:"arrows-small-down",...Object(o.e)(e),multiple:Object(o.s)(e),display:te(e.menuType),multiLine:e.lineCount}),Object(w.n)()),ue.select_image=e=>(Object(u.g)(e,{quesType:"picture-choice"}),Object(w.n)()),ue.sequence=e=>(Object(u.g)(e,{quesType:"ranking"}),Object(w.n)()),ue.area=e=>(Object(u.g)(e,{quesType:"location",grade:3,regions:Object(F.d)()}),Object(w.n)()),ue.upload=e=>(Object(u.g)(e,{quesType:"file-upload"}),Object(w.n)()),ue.verify=e=>(Object(u.g)(e,{quesType:"verification",value:"",phoneNumber:"",code:""}),Object(w.n)()),ue.weight=async e=>{const t=await Object(o.h)(e);Object(u.g)(e,{quesType:"weight",weightTotal:t})},ue.max_diff=e=>(Object(u.g)(e,{quesType:"max-diff",tasks:oe(e)}),Object(w.n)()),ue.cascade=async e=>{await ne(e.parent,e),function(e){const t=[],n=e=>{t.push(e),e.list&&e.list.forEach(e=>n(e))};n(e.cascade),e.options.forEach(e=>{if(e.useComment){const n=t.find(t=>t.resultId===e.cascadePath);e.inputType=N(n.option)}})}(e),function e(t,n,r,i,o=""){const{resultId:a,text:c}=n,s=a&&t.options.find(e=>e.cascadePath===a),u=o?o+"=>"+c:c;return s&&(s.text=u),r.nodeTypeInfoRequired||(n.hint=""),n.list&&n.list.forEach(n=>{n.text=e(t,n,r,i,u)}),n.text}(e,e.cascade,e.parent,e.loop,""),Object(u.g)(e,{quesType:"cascade"}),e.options=e.options.filter(e=>!!e.text),Object(J.c)(e,e.options)},ue.data=e=>(Object(u.g)(e,{quesType:"intro-page"}),Object(w.n)()),ue.hot_spot=e=>(Object(u.g)(e,{quesType:"hot-spot",mapImage:e.mapImage&&Object(X.b)(e.mapImage)}),Object(w.n)()),ue.heat_map=e=>(Object(u.g)(e,{quesType:"heat-map",clickTimes:0,mapImage:e.mapImage&&Object(X.b)(e.mapImage)}),Object(w.n)()),ue.slide_rate=e=>(Object(u.g)(e,{quesType:"slide-rate"}),Object(w.n)()),ue.loop=async e=>{const{parent:t}=e;if(!Object(W.a)(e,t)){const n=await Object(W.b)(t,e);e.varList=n}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return b}));var r=n(14),i=n(11),o=n(0),a=n(2),c=n(3),s=n(1),u=n(8);class l{constructor(e,t){if(e&&e.data&&Object.keys(e.data).length>0){const{langResume:n}=t;this.holder=e,this.state=t,this.show=!0,this.title=n?Object(a.f)(c.a.langResume.title):Object(a.f)(c.a.memory.title),this.message=n?"":Object(a.f)(c.a.memory.message),this.sureText=n?"":Object(a.f)(c.a.memory.sure),this.denyText=n?"":Object(a.f)(c.a.memory.deny)}}handleSure(){if(!this.holder||p())return Object(s.n)();const e=this;return Object(o.g)(e,{sureText:"",denyText:"",show:!0,resuming:!0}),Object(i.w)(this.state,e.holder.responseId||""),Object(r.g)(this.holder,this.state,{onEnd(){e.end()},onProgress(t){Object(o.g)(e,{show:!0}),Object(o.g)(e,{message:t})},onSuspend(){e.suspend()}})}handleDeny(){p()||(Object(r.b)(this.state),this.end())}end(){Object(o.g)(this,{show:!1,holder:null,message:"",resuming:!1}),b()}suspend(){Object(o.g)(this,{show:!1})}}let f=null;function d(e){const t=Object(r.e)(e.sid);return f=new l(t,e),f}function p(){return f&&f.resuming}function b(){p()||u.a.trigger("UPDATE_UI")}},function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"a",(function(){return h})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return O})),n.d(t,"f",(function(){return j}));var r=n(17),i=n(1),o=n(5),a=n(15),c=n(13),s=n(7);const u={1:(e,t,n)=>(t>n&&([t,n]=[n,t]),u[5](e,t,0)&&u[6](e,n,0)),2:(e,t,n)=>!u[1](e,t,n),11:(e,t)=>{const n=Object(s.a)(e).split(",").filter(e=>""!==e.trim()),r=Object(s.a)(t).split(",").filter(e=>""!==e.trim());return n.some(e=>(e=e.trim(),r.some(t=>(t=t.trim(),e.indexOf(t)>-1))))},12:(e,t)=>!u[11](e,t,0),3:(e,t)=>Object(s.a)(e)===Object(s.a)(t),4:(e,t)=>!u[3](e,t,0),5:(e,t)=>{const n=Object(s.c)(e),r=Object(s.c)(t);return"number"==typeof n&&"number"==typeof r?n>r:Object(s.a)(n)>Object(s.a)(r)},6:(e,t)=>{const n=Object(s.c)(e),r=Object(s.c)(t);return"number"==typeof n&&"number"==typeof r?n<r:Object(s.a)(n)<Object(s.a)(r)},7:(e,t)=>!u[6](e,t,0),8:(e,t)=>!u[5](e,t,0),9:(e,t)=>{const n=Object(s.a)(e).split(",").filter(e=>""!==e.trim()),r=Object(s.a)(t).split(",").filter(e=>""!==e.trim());return n.some(e=>(e=e.trim(),r.some(t=>(t=t.trim())===e)))},10:(e,t)=>!u[9](e,t,0),13:e=>Object(s.a)(e).split(",").every(e=>""===e.trim()),14:(e,t)=>!u[13](e,t),15:(e,t)=>!u[16](e,t),16:(e,t)=>Object(s.a)(e).split(",").every(e=>{const t=e.trim();return"false"===t||""===t})},l={request:e=>!!e,bool:e=>!!e,mark:(e,t)=>l.input(e,t),input:(e,t)=>{const{markId:n,markStart:r,markEnd:i}=t;return u[n](e,r,i)}};function f(e,t){"string"==typeof e&&(e=Object(o.k)(e));const n=l[t.limitType],r=n?n(e,t):!!e;return{value:r,reason:r?void 0:{type:"value_unmatch",expected:t.markStart,expectedEnd:t.markEnd,limit:t.markId,actual:e}}}async function d(e,t){const{text:n}=e.relatedEmbed,r=h(e.markId)?",":void 0;return f(await Object(o.d)(n,{state:t,joinBy:r}),e)}async function p(e,t){const{relatedVarId:n}=e,r=Object(c.h)(t,{uuid:n});if(!r)return{value:!1,reason:{type:"var_not_found"}};const i=h(e.markId)?",":void 0;return f(await Object(o.c)({state:t,varInfo:r,joinBy:i}),e)}function b(e,t){const{loopStack:n,renderList:o}=e,{relatedNodeId:c,relatedOptionId:s,limitType:u,markId:f}=t,d=Object(i.h)(c,n),p=Object(r.a)(o,d);if(!p)return-2===f?{value:!0}:{value:!1,reason:{type:"node_not_found",nodeId:c}};const b=Object(a.a)(p);if(!b||!b.items)return-2===f?{value:!0}:{value:!1,reason:{type:"answer_not_found",nodeId:c}};const h=b.items.find(e=>function(e,t){return Object(i.l)(e.option_id,t)}(e,s)),m=l[u];if(m){const e=h?Object(a.c)(h):"",n=m(e,t),r={value:n};return n||(r.reason={type:"node_unmatch",limit:f,actual:e,expected:t.markStart,expectedEnd:t.markEnd,nodeId:c,optionId:s}),r}{const e=-2===f?!h:!!h,t={value:e};return e||(t.reason={type:"node_unmatch",limit:f,nodeId:c,optionId:s,expected:-1===f,actual:2===f}),t}}function h(e){return 9===e||10===e||11===e||12===e||13===e||14===e||15===e||16===e}async function m(e,t){return{start:h(e.markId)?await Object(o.f)(e.markStart,{state:t,joinBy:","}):await Object(o.g)(e.markStart,{state:t}),end:await Object(o.g)(e.markEnd,{state:t})}}async function g(e,t,n){return(await O(e,t,n)).value}async function O(e,t,n){if(!t)return{value:!0};const r=[];for(const n of t){const t={...n},{relatedVarId:i,relatedEmbed:o,isGroup:a,groupLogicList:c,groupLogicType:s}=t,{start:u,end:l}=await m(t,e);let f;t.markEnd=l,t.markStart=u,f=a?await O(e,c,s):o?await d(t,e):i?await p(t,e):b(e,t),r.push(f)}return{value:!r["and"===n?"some":"every"](e=>!e.value),details:r}}function j(e,t){return"object"==typeof e&&null!==e?g(t,e.options,e.logicType):Object(i.n)(!!e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return g})),n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return x}));var r=n(51),i=n(16),o=n(13),a=n(6),c=n(1),s=n(7),u=n(41);function l(e){e.OPT_INPUT.getText=e=>{const t=Object(a.p)(e.specifiedOpt,"value");return Object(c.n)(t)},e.OPT_LABEL.getText=e=>{const t=e.specifiedOpt.label||"";return Object(c.n)(t)},u.a.forEach(t=>{!function(t){const n=t.split("_")[1];e["OPT_MAP_"+n].getText=e=>{const{specifiedOpt:n}=e,{mapping:i}=n,o=Object(r.b)(i,t,e);return Object(c.n)(o)}}(t),function(t){const n=t.split("_")[1];e["OPT_ASTV_"+n].getText=e=>{const n=e.specifiedOpt.assistValue,r=n&&n[t]||"";return Object(c.n)(r)}}(t)}),e.OPT_MARK.getText=e.OPT_INPUT.getText,e.OPT_TEXT.getText=e=>{const t=e.specifiedOpt,n=Object(a.e)(t);if(n)return Object(c.n)(n);const r=t.xText?t.xText+"_"+t.yText:Object(a.p)(t,"text");return Object(c.n)(r)},e.OPT_NUMBER.getText=e=>{const t=Object(s.a)(e.specifiedOpt.number);return Object(c.n)(t)},e.OPT_RANK.getText=e=>{const t=e.specifiedOpt.sortNo;return Object(c.n)(Object(s.a)(t))},e.OPT_TEXT_X.getText=e=>{const t=e.specifiedOpt.xText;return Object(c.n)(t)},e.OPT_TEXT_Y.getText=e=>{const t=e.specifiedOpt.yText;return Object(c.n)(t)},e.OPT_NUMBER_X.getText=e=>{const t=e.specifiedOpt.xNumber;return Object(c.n)(Object(s.a)(t))},e.OPT_NUMBER_Y.getText=e=>{const t=e.specifiedOpt.yNumber;return Object(c.n)(Object(s.a)(t))},e.OPT_IMAGE.getText=e=>{const{varInfo:{imgSize:t},specifiedOpt:n,pureText:r}=e,o=Object(a.p)(n,"image");if(r)return Object(c.n)(n.text);if(o){const e=Object(i.b)(o.url,t,o.originName);return Object(c.n)(e)}return Object(c.n)("")},e.OPT_ICON.getText=e=>{const t=e.specifiedOpt.text;return Object(c.n)(t)},e.OPT_COUNT.getText=async e=>{const t=await Object(o.b)(e);return Object(s.a)(t.length)}}var f=n(49),d=n(54);function p(e,t){!function(e,t){t.forEach(t=>{const n=e[t];"function"==typeof n.getText&&(n.getBool=async function(e){const t=await this.getText(e);return!Object(s.b)(t)})}),e.OPT_COUNT.getBool=async function(e){return!!await this.getText(e)}}(e,t),e.OPT_SAME_MARK.getBool=async e=>{const t=await Object(o.b)(e);return function(e,t){if(Object(s.b)(t))return!0;(t<0||t>e.length)&&(t=e.length);const n={};for(const r of e){const e=r.value;if(n[e]?n[e]+=1:n[e]=1,n[e]>=t)return!0}return!1}(t,t.length)},e.OPT_DIFF_MARK.getBool=async e=>{const t=await Object(o.b)(e);return function(e,t){if(Object(s.b)(t))return!0;(t<0||t>e.length)&&(t=e.length);const n={};for(const r of e)if(n[r.value]=!0,Object.keys(n).length>=t)return!0;return!1}(t,t.length)},e.OPT_SAME_VALUE.getBool=e.OPT_SAME_MARK.getBool,e.OPT_SAME_VALUE.getText=e.OPT_SAME_MARK.getText,e.OPT_DIFF_VALUE.getBool=e.OPT_DIFF_MARK.getBool,e.OPT_DIFF_VALUE.getText=e.OPT_DIFF_MARK.getText,e.FAIL_SKIP.getBool=e=>{const t=e.varInfo.question;return Promise.resolve(!!t.failedSkipActivated)},e.FAILED.getBool=e=>{const t=e.varInfo.question;return Object(c.n)(!!t.failed)},e.SUCCEED.getBool=e=>{const t=e.varInfo.question;return Object(c.n)(!!t.succeed)},e.USED_PHONE.getBool=e=>Object(c.n)(!!e.state.phoneUsed),e.VALIDATE_FAILED.getBool=e=>Object(c.n)(e.varInfo.question.validateFailed),e.Q_TIME_OVER.getBool=e=>{const{maxAnswerTime:t,costTime:n}=e.varInfo.question,r=1e3*t;return Object(c.n)(!!(r&&n&&r<n))},e.Q_TIME_LESS.getBool=e=>{const{minAnswerTime:t,costTime:n}=e.varInfo.question,r=1e3*t;return Object(c.n)(!!(r&&n&&r>n))},function(e,t){function n(e){return this.getBool(e)}t.forEach(t=>{const r=e[t];"function"==typeof r.getBool&&r.getText===g&&(r.getText=n)})}(e,t)}var b=n(42),h=n(45),m=n(39);const g="waiting fo extend";let O=!1;Math.avg=(...e)=>{let t=0;const n=e.length;for(let r=0;r<n;r++)t+=Number(e[r]);return t/n};const j={YEAR:{uuid:"YEAR",type:"var-string",getText:g},MONTH:{uuid:"MONTH",type:"var-string",getText:g},DATE:{uuid:"DATE",type:"var-string",getText:g},DAY:{uuid:"DAY",type:"var-string",getText:g},URL_KEY:{uuid:"URL_KEY",type:"var-string",getText:g},QUES_ID:{uuid:"QUES_ID",type:"var-string",getText:g},WX_ID:{uuid:"WX_ID",type:"var-string",getText:g},WX_SRC:{uuid:"WX_SRC",type:"var-string",getText:g},WX_NAME:{uuid:"WX_NAME",type:"var-string",getText:g},WX_UN_ID:{uuid:"WX_UN_ID",type:"var-string",getText:g},RES_ID:{uuid:"RES_ID",type:"var-string",getText:g},CLTR_ID:{uuid:"CLTR_ID",type:"var-string",getText:g},CLTR_CODE:{uuid:"CLTR_CODE",type:"var-string",getText:g},CLTR_NAME:{uuid:"CLTR_NAME",type:"var-string",getText:g},CURR:{uuid:"CLANG",type:"var-string",getText:g},LKTP:{uuid:"LKTP",type:"var-string",getText:g},START_TIME:{uuid:"S_T",type:"var-string",getText:g},COST_TIME:{uuid:"C_T",type:"var-string",getText:g},DVC_OSN:{uuid:"DVC_OSN",type:"var-string",getText:g},DVC_OSV:{uuid:"DVC_OSV",type:"var-string",getText:g},DVC_BRSN:{uuid:"DVC_BRSN",type:"var-string",getText:g},DVC_BRSV:{uuid:"DVC_BRSV",type:"var-string",getText:g},DVC_VDR:{uuid:"DVC_VDR",type:"var-string",getText:g},DVC_MDL:{uuid:"DVC_MDL",type:"var-string",getText:g},DVC_TYPE:{uuid:"DVC_TYPE",type:"var-string",category:"DEVICE",getText:g},RESULT:{uuid:"RESULT",type:"var-string",getText:g},C_OPT_TEXT:{uuid:"COTTX",type:"var-string",getText:g},C_OPT_NUM:{uuid:"CONUM",type:"var-string",getText:g},C_OPT_VAL:{uuid:"COVAL",type:"var-string",getText:g},C_OPT_LBL:{uuid:"COLBL",type:"var-string",getText:g},C_OPT_IPT:{uuid:"COIPT",type:"var-string",category:"CTPT",getText:g},C_OPT_ASI:{uuid:"COASI",type:"var-string",category:"CTPT",getText:g},C_OL_TXT:{uuid:"COLTXT",type:"var-string",getText:g},C_OL_IDX:{uuid:"COLIDX",type:"var-string",getText:g},C_OL_VAL:{uuid:"COLVAL",type:"var-string",getText:g},C_OL_NUM:{uuid:"COLNUM",type:"var-string",getText:g},C_OL_LBL:{uuid:"COLLBL",type:"var-string",getText:g},C_IL_TXT:{uuid:"CILTXT",type:"var-string",getText:g},C_IL_IDX:{uuid:"CILIDX",type:"var-string",getText:g},C_IL_VAL:{uuid:"CILVAL",type:"var-string",getText:g},C_IL_NUM:{uuid:"CILNUM",type:"var-string",getText:g},C_IL_LBL:{uuid:"CILLBL",type:"var-string",getText:g},POSITION:{uuid:"_P_OS",type:"var-string",getText:g},FAIL_SKIP:{uuid:"L_FAIL_SKIP",type:"var-bool",getText:g,getBool:g},FAILED:{uuid:"L_FAILED",type:"var-bool",getText:g,getBool:g},SUCCEED:{uuid:"L_SUCCEED",type:"var-bool",getText:g,getBool:g},COUNTRY:{uuid:"_C_NTY",type:"var-string",getText:g},PROVINCE:{uuid:"_P_ROV",type:"var-string",getText:g},CITY:{uuid:"_C_ITY",type:"var-string",getText:g},DISTRICT:{uuid:"_D_TRT",type:"var-string",getText:g},QUES_IMAGE:{uuid:"QI",type:"var-media",getText:g,getImages:g},QUES_TEXT:{uuid:"QT",type:"var-string",getText:g},QUES_LABEL:{uuid:"QL",type:"var-string",getText:g},QUES_DESC:{uuid:"QD",type:"var-string",getText:g},QUES_NAME:{uuid:"QN",type:"var-string",getText:g},PHONE_NUMBER:{uuid:"PN",type:"var-string",getText:g},PASSWORD:{uuid:"PSW",type:"var-string",getText:g},USED_PHONE:{uuid:"UPN",type:"var-bool",getText:g,getBool:g},VALIDATE_FAILED:{uuid:"VF",type:"var-bool",getText:g,getBool:g},VALIDATE_FAIL_TIMES:{uuid:"VFT",type:"var-expression",getText:g,getBool:g},QUES_TIME:{uuid:"DRTN",type:"var-string",getText:g,getBool:g},QUES_RS:{uuid:"QRS",type:"var-string",getText:g},Q_TIME_OVER:{uuid:"QTOR",type:"var-bool",getText:g,getBool:g},Q_TIME_LESS:{uuid:"QTLS",type:"var-bool",getText:g,getBool:g},MATCHED_OPTS:{uuid:"MTO",type:"var-string",filter:g},UNMATCHED_OPTS:{uuid:"UMTO",type:"var-string",filter:g},MARKED_OPTS:{uuid:"MKO",type:"var-string",filter:g},UNMARKED_OPTS:{uuid:"UMKO",type:"var-string",filter:g},RANKED_OPTS:{uuid:"RKO",type:"var-string",filter:g},UNRANKED_OPTS:{uuid:"URKO",type:"var-string",filter:g},CHECKED_OPTS:{uuid:"CKO",type:"var-string",filter:g},UNCHECKED_OPTS:{uuid:"UCKO",type:"var-string",filter:g},INPUTTED_OPTS:{uuid:"INO",type:"var-string",filter:g},UN_INPUTTED_OPTS:{uuid:"UINO",type:"var-string",filter:g},ALL_OPTS:{uuid:"ALO",type:"var-string",filter:g},SPECIFIED_OPT:{uuid:"SPO",type:"var-string"},OPT_TEXT:{uuid:"OTXX",type:"var-string",getText:g},OPT_TEXT_X:{uuid:"OTXY",type:"var-string",getText:g},OPT_TEXT_Y:{uuid:"OTX",type:"var-string",getText:g},OPT_NUMBER:{uuid:"ONM",type:"var-string",getText:g},OPT_NUMBER_X:{uuid:"ONMX",type:"var-string",getText:g},OPT_NUMBER_Y:{uuid:"ONMY",type:"var-string",getText:g},OPT_IMAGE:{uuid:"OMG",type:"var-media",getText:g,getImages:g},OPT_ICON:{uuid:"OIC",type:"var-string",getText:g,getIcon:g},OPT_MARK:{uuid:"OMA",type:"var-string",getText:g},OPT_RANK:{uuid:"ORA",type:"var-string",getText:g},OPT_INPUT:{uuid:"OIN",type:"var-string",getText:g},OPT_LABEL:{uuid:"OLB",type:"var-string",getText:g},OPT_COUNT:{uuid:"OCT",type:"var-expression",inBunch:!0,getText:g},OPT_SAME_MARK:{uuid:"OSM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_MARK:{uuid:"ODM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_SAME_VALUE:{uuid:"OSV",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_VALUE:{uuid:"ODV",type:"var-bool",inBunch:!0,getBool:g,getText:g},EXP_PLUS:{uuid:"EP",type:"var-expression",expOpr:"+"},EXP_MINUS:{uuid:"EM",type:"var-expression",expOpr:"-"},EXP_MULTIPLY:{uuid:"EPL",type:"var-expression",expOpr:"*"},EXP_DIVIDE:{uuid:"ED",type:"var-expression",expOpr:"/"},EXP_SUM:{uuid:"ES",type:"var-expression",expOpr:"(",split:"+"},EXP_MIN:{uuid:"EMN",type:"var-expression",expOpr:"Math.min(",split:","},EXP_MAX:{uuid:"EMX",type:"var-expression",expOpr:"Math.max(",split:","},EXP_AVG:{uuid:"EAG",type:"var-expression",expOpr:"Math.avg(",split:","},EXP_RD:{uuid:"ERD",type:"var-expression",expOpr:"Math.round(",split:"+"},EXP_FLR:{uuid:"EFLR",type:"var-expression",expOpr:"Math.floor(",split:"+"},EXP_CL:{uuid:"ECL",type:"var-expression",expOpr:"Math.ceil(",split:"+"},EXP_OP:{uuid:"EOP",type:"var-expression"},EXP_CP:{uuid:"ECP",type:"var-expression"},BOOL_AND:{uuid:"BAND",type:"var-bool",blOpr:"&&"},BOOL_OR:{uuid:"BOR",type:"var-bool",blOpr:"||"},BOOL_NOT:{uuid:"BNOT",type:"var-bool",blOpr:"!"},BOOL_OP:{uuid:"BOP",type:"var-bool",blOpr:"("},BOOL_CP:{uuid:"BCP",type:"var-bool",blOpr:")"},LOOP:{uuid:"LP",type:"var-loop",getText:g,getImages:g},LOOP_IMG:{uuid:"LPIMG",type:"var-loop",getText:g,getImages:g},LOOP_INDEX:{uuid:"LPIDX",type:"var-loop",getText:g},LOOP_VAL:{uuid:"LPVAL",type:"var-loop",getText:g},LOOP_NUM:{uuid:"LPNUM",type:"var-loop",getText:g},LOOP_LBL:{uuid:"LPLBL",type:"var-loop",getText:g}};for(const e of h.a){const t="LANG_"+e.id.toUpperCase(),n=t;j[t]={uuid:n,type:"var-string",getText:()=>Object(c.n)(e.id)}}for(let e=2;e<21;e++){const t="URL_KEY_"+e;j[t]={uuid:t,type:"var-string",getText:g}}function v(e,t){const n=t.optionMappingHeads;if(n){const t=n.find(t=>t.field==="field_"+e);if(t)return{type:"image"===t.type?"var-media":"var-string"}}return null}for(let e=1;e<7;e++)j["OPT_ASTV_"+e]={uuid:"OASTV_"+e,type:"var-string",getText:g},j["OPT_MAP_"+e]={uuid:"OM_"+e,type:"var-string",getText:g,getDynamicProps:t=>v(e,t)},j["C_OPT_MAP_"+e]={uuid:"COMAP"+e,type:"var-string",getText:g},j["C_OL_MAP_"+e]={uuid:"COLMAP"+e,type:"var-string",getText:g},j["C_IL_MAP_"+e]={uuid:"CILMAP"+e,type:"var-string",getText:g},j["LOOP_MAP_"+e]={uuid:"LPMAP"+e,type:"var-loop",getText:g};const w=Object.keys(j);function y(e,t){for(const n of w)if(j[n].uuid===e){let e=j[n];if(e.getDynamicProps&&t){const n=e.getDynamicProps(t);n&&(e={...e,...n})}return e}}function _(){O||(!function(){const e=[];w.forEach(t=>{if(!(j[t]instanceof Function)){if(e.indexOf(j[t].uuid)>0)throw new Error("error duplicated uuid in implicit var config: "+j[t].uuid);e.push(j[t].uuid)}})}(),Object(r.a)(j),Object(m.c)(j),Object(m.b)(j),l(j),function(e){async function t(e,t){const{varInfo:n,needOtherOpt:r}=e,i=n.question,o=Object(a.b)(i),c=[];for(const n of o)!r&&n.isOtherOpt||t&&!t(n,i)||!await Object(f.b)({...e,specifiedOpt:n})||c.push(n);return c}e.MATCHED_OPTS.filter=e=>t(e,d.c),e.RANKED_OPTS.filter=e.MATCHED_OPTS.filter,e.CHECKED_OPTS.filter=e.MATCHED_OPTS.filter,e.UNMATCHED_OPTS.filter=e=>t(e,d.e),e.UNRANKED_OPTS.filter=e.UNMATCHED_OPTS.filter,e.UNCHECKED_OPTS.filter=e.UNMATCHED_OPTS.filter,e.MARKED_OPTS.filter=e=>t(e,d.b),e.INPUTTED_OPTS.filter=e.MARKED_OPTS.filter,e.UNMARKED_OPTS.filter=e=>t(e,d.d),e.UN_INPUTTED_OPTS.filter=e.UNMARKED_OPTS.filter,e.ALL_OPTS.filter=e=>{if(!Object(f.a)(e)){const t=e.varInfo.question.options;return Object(c.n)(t)}return t(e)}}(j),p(j,w),Object(b.a)(j),function(){let e="";if(w.forEach(t=>{const n=j[t];if(["filter","getText","getImages","getIcon","getBool"].forEach(r=>{n[r]===g&&(e+=t+"=>"+r+"\n")}),n.getText){const e=n.getText;n.getText=async function(t){const{keepWrap:n}=t,r=e.apply(this,arguments),i=await r;if("string"==typeof i&&!n){const e=/<span var-name=".+?" class="var-light var-(\w+?)">(.+?)<\/span>/g;return Object(s.a)(i).replace(e,(e,t,n)=>"media"===t?e:n)}return Object(s.b)(i)?"":i}}}),e)throw new Error("lack var implement for:\n"+e)}(),O=!0)}function x(){return O||_(),j}_()},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"c",(function(){return p}));var r=n(7),i=n(21),o=n(5);function a(e,t){if(Object(r.b)(t)||e.length<=t)return[...e];return c(e.map(e=>({...e.option,cascade:e})),t).map(e=>e.cascade)}function c(e,t){if(Object(r.b)(t)||e.length<=t)return[...e];return f(e.map(e=>{const t=e.inferList.reduce((e,t)=>(t.active&&"select"===t.type&&(e+=t.weight),e),0);return{option:e,weight:t}}),t).map(e=>e.option)}function s(e){return e.filter(e=>{const{option:t}=e;return!(!t||!t.inferList)&&t.inferList.some(e=>e.active)})}function u(e,t){return e.filter(e=>e.inferList.some(e=>e.active&&e.type===t))}async function l(e,t){if(!e)return;const n=t.parent;e.inferList=e.inferList||[];for(const t of e.inferList){const{activeConfig:r}=t;if(r){const{options:o,logicType:a}=r;n.context.option=e,t.active=await Object(i.b)(n,o,a),n.context.option=null}else t.active=!0}}function f(e,t){if(e=[...e],Object(r.b)(t)||e.length<=t)return e;const n=e.reduce((e,t)=>e+=t.weight,0);let i=0,o=0,a=e.map(e=>{const t=e.weight/n;o=i+t;const r={item:e,floor:i,ceil:o};return i=o,r});const c=[];for(;c.length<t;){const e=Math.random()*o,t=a.find(t=>t.floor<=e&&t.ceil>e);t&&(c.push(t.item),a=a.filter(e=>e!==t))}return c}async function d(e,t){const{parent:n}=t,r=[];for(const t of e)r.push(await Object(o.f)(t.candidates,{state:n,joinBy:","}));return r.join(",")}function p(e){const t={},n=[];return e.split(",").forEach(e=>{let r=e,i=1;const o=e.match(/\(([\d\.]+)\)$/);o&&(r=e.replace(/\([\d\.]+\)$/,""),i=parseFloat(o[1]));const a=t[r];if(a)a.weight+=i;else{const e={text:r,weight:i};n.push(e),t[r]=e}}),n.filter(e=>0!==e.weight)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c}));var r=n(61),i=n(0);function o(e){return Object(i.b)().hostConfig.cdnHost+"/"+e}function a(e){const{width:t,height:n,name:i,id:a,originName:c}=e,s=o(i);return{ratio:Math.round(n/t*1e5)/1e5,url:s,natural:Object(r.b)(s,"@m720"),thumbnail:Object(r.b)(s,"@avatar"),large:Object(r.b)(s,"@m1080"),width:t,height:n,reformed:!0,id:a,originName:c,name:i}}function c(e){if(!e)return;if(e&&e.reformed)return e;const{name:t,width:n,height:r,id:i,originName:o}=e;return t?a({width:n,height:r,name:t,id:i,originName:o}):void 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return u}));var r=n(7),i=n(5);const o={};function a(e,t){let n="";const r=o[t.type];return n=e.isOtherOpt||!r?e.value:r(e),"string"==typeof n&&(n=Object(i.k)(n)),n}function c(e,t){let n=a(e,t);return"string"==typeof n&&(n=n.trim()),!Object(r.b)(n)}o.upload=e=>e.name,o.sequence=e=>e.sortNo,o.heat_map=e=>e.point,o.max_diff=e=>e.records;const s={};function u(e,t){return(s[t.type]||c)(e,t)}s.sequence=(e,t)=>-1!==e.sortNo&&c(e,t)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u}));var r=n(0),i=n(30);function o(){return{value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""}}const a={};function c(e,t,n){t.options.forEach(t=>{t!==e&&(t.mutexNumber!==e.mutexNumber&&-1!==e.mutexNumber||n(t))})}function s(e,t){if(e.isOtherOpt&&e.mutexNumber){const n=a[t.type];n?n(e,t):c(e,t,e=>{Object(r.g)(e,{value:"",selected:!1})})}}function u(e,t){t.otherOptions.filter(t=>!(!t.mutexNumber||t===e)&&(t.mutexNumber===e.mutexNumber||-1===t.mutexNumber)).forEach(e=>{Object(r.g)(e,{selected:!1})})}a.heat_map=(e,t)=>{c(e,t,e=>{Object(r.g)(e,{point:null,value:""})})},a.cascade=(e,t)=>{t.options.forEach(e=>{Object(r.g)(e,{selected:!1})}),Object(i.b)(t.cascade)},a.upload=(e,t)=>{c(e,t,e=>{const t={value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""};Object(r.g)(e,{...t,image:null})}),t.fullUploaded=!1},a.weight=(e,t)=>{c(e,t,e=>{Object(r.g)(e,{value:""})}),t.options.forEach(e=>{Object(r.g)(e,{percent:""})})},a.sequence=(e,t)=>{c(e,t,e=>{Object(r.g)(e,{selected:!1,sortNo:-1})}),t.options.sort((e,t)=>e.number>t.number?1:-1)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"d",(function(){return m}));var r=n(1),i=n(5),o=n(2),a=n(6),c=n(3),s=n(7);function u(e){return/^1[0-9][0-9]\d{8}$/i.test(e)}function l(e){return/[-a-zA-Z0-9@:%_+.~#?&/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_+.~#?&/=]*)?/gi.test(e)}async function f(e,t){const{parent:n}=t;let r=await Object(i.e)(e.fillStart,{state:n}),o=await Object(i.e)(e.fillEnd,{state:n});return Object(s.b)(r)&&(r=-1/0),Object(s.b)(o)&&(o=1/0),{start:r,end:o}}function d(e,t,n){return t<=e&&n>=e}function p(e,t,n){return d(e,t,n)?"":Object(o.f)(c.a.fill.valueLimit,{min:t,max:n})}const b={};async function h(e,t,n){const{itemsMax:r,itemsMin:i}=await Object(a.g)(t,n),s=e.split(/[,,]/).reduce((e,t)=>t.trim()?e+1:e,0);let u="";return(s<i||s>r)&&(u=Object(o.f)(c.a.fill.itemsLimit,{min:i,max:r})),{valid:!u,message:u}}async function m(e,t){const n=Object(s.a)(e.value),r=e.fillType,i=b[r];if(!i||Object(s.b)(n)&&"auto_complete"!==r)return{valid:!0,message:""};const{parent:o}=t;o.context.option=e;const a=await i(n,e,t);return o.context.option=null,a.valid||(a.dueToOption=e,a.dueToNode=t),a}b.chars=async(e,t,n)=>{const{start:r,end:i}=await f(t,n);let{tolerance:a}=t;a=a||[];const s=function(e,t=[]){if(0===t.length)return"";e=e.replace(/[\s,,]/g,"");let n="";const r=[];t.includes("number")&&(n+="0-9",r.push(Object(o.f)(c.a.fill.number))),t.includes("alphabet")&&(n+="a-zA-Z",r.push(Object(o.f)(c.a.fill.alphabet))),t.includes("chinese")&&(n+="一-龥",r.push(Object(o.f)(c.a.fill.chinese)));const i=r.join(" "),a=new RegExp("^["+n+"]+$");return e.match(a)?"":Object(o.f)(c.a.fill.onlyAllow,{text:i})}(e,a)||function(e,t,n){return d(e.length,t,n)?"":Object(o.f)(c.a.fill.charsLimit,{min:t,max:n})}(e,r,i);return{valid:!s,message:s}},b.email=e=>{const t=function(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]+$/i.test(e)}(e),n=t?"":Object(o.f)(c.a.fill.needEmail);return Object(r.n)({valid:t,message:n})},b.float=async(e,t,n)=>{if(!function(e){return/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)}(e))return{valid:!1,message:Object(o.f)(c.a.fill.inputNumber)};const{start:r,end:i}=await f(t,n),a=p(1*Number(e),r,i);return{valid:!a,message:a}},b.integer=async(e,t,n)=>{if(!function(e){return/^[-]?\d+$/.test(e)}(e=e.replace(/\s/g,"")))return{valid:!1,message:Object(o.f)(c.a.fill.inputInteger)};const r=Number(e),{start:i,end:a}=await f(t,n),s=p(1*r,i,a);return{valid:!s,message:s}},b.none=()=>Object(r.n)({valid:!0,message:""}),b.phone_number=e=>{const t=u(e),n=t?"":Object(o.f)(c.a.fill.needPhoneNumber);return Object(r.n)({valid:t,message:n})},b.postcode=e=>{const t=function(e){return/^[0-9][0-9]{5}$/.test(e)}(e),n=t?"":Object(o.f)(c.a.fill.needZipCode);return Object(r.n)({valid:t,message:n})},b.url=e=>{const t=l(e),n=t?"":Object(o.f)(c.a.fill.needUrl);return Object(r.n)({valid:t,message:n})},b.auto_complete=(e,t,n)=>{if(!e&&t.atcpTrigger){const e={valid:!1,message:Object(o.f)(c.a.fill.atcpLabelOnly),dueToNode:n,dueToOption:t};return Object(r.n)(e)}return h(e,t,n)},b.list_select=(e,t,n)=>h(e,t,n)},function(e,t,n){"use strict";n.d(t,"a",(function(){return O})),n.d(t,"c",(function(){return j})),n.d(t,"d",(function(){return v})),n.d(t,"b",(function(){return T}));var r=n(6),i=n(27),o=n(35),a=n(4),c=n(11),s=n(5),u=n(1),l=n(0),f=n(2),d=n(30),p=n(3),b=n(9),h=n(20),m=n(26);const g={},O={refresh:!1,result:!1},j={refresh:!0,result:!0},v={refresh:!1,result:!0};function w(e,t,n){t.forEach(t=>{Object(u.l)(t.uuid,e.uuid)||t[n]!==e[n]||Object(l.g)(t,{selected:!1})})}function y(e,t){t.forEach(t=>{t.uuid!==e.uuid&&Object(l.g)(t,{selected:!1})})}function _(e,t,n="mutexNumber"){const i=e[n],o=function(e,t,n="mutexNumber"){const i=Object(r.c)(t);return"xMutexNumber"===n?i.filter(t=>t.yid===e.yid):"yMutexNumber"===n?i.filter(t=>t.xid===e.xid):i}(e,t,n);i?function(e,t,n="mutexNumber"){const r=e[n];t.forEach(t=>{r&&-1!==r&&t[n]!==r&&-1!==t[n]||t.uuid!==e.uuid&&Object(l.g)(t,{selected:!1})})}(e,o,n):function(e,t){e.forEach(e=>{-1===e[t]&&Object(l.g)(e,{selected:!1})})}(o,n)}function x(e,t,n=!1){return e.selected?Object(l.g)(e,{selected:!1}):(Object(l.g)(e,{selected:!0}),y(e,n?t.otherOptions:Object(r.c)(t)),Object(m.b)(e,t)),j}async function T(e,t){const n=g[t.type];if(n){const r=await n(e,t);return r.noValidate||Object(o.b)(t),r}return O}g.select=async(e,t)=>{if(e.selected)return Object(l.g)(e,{selected:!1}),j;const n=await Object(a.k)(t,e);return n.valid?(Object(l.g)(e,{selected:!0}),Object(a.s)(t)?_(e,t):y(e,Object(r.c)(t)),j):(Object(l.b)().notify(n.message),O)},g.select_icon=g.select,g.select_image=g.select,g.matrix=async(e,t)=>{if(e.selected)return Object(l.g)(e,{selected:!1}),j;const n=await Object(a.j)(t,e);return n.valid?(Object(l.g)(e,{selected:!0}),Object(a.v)(t)?y(e,Object(r.c)(t)):Object(a.q)(t)?(w(e,t.options,"yid"),w(e,t.options,"xid")):Object(a.r)(t)?w(e,t.options,"yid"):Object(a.p)(t)?w(e,t.options,"xid"):Object(a.s)(t)&&(_(e,t),e.isOtherOpt||(_(e,t,"xMutexNumber"),_(e,t,"yMutexNumber"))),j):(Object(l.b)().notify(n.message),O)},g.upload=async(e,t)=>{if(e.isOtherOpt)return x(e,t,!0);{const{parent:n,fullUploaded:r}=t;let i=await Object(s.e)(t.maxUploadCount,{state:n});i=i||t.options.length;const o=e.value;if(r&&!o)return Object(l.b)().notify(Object(f.f)(p.a.upload.amountLimitMax,{max:i})),O;const a={onprogress(t){Object(l.g)(e,{progress:t}),Object(h.c)()},accept:e.accept},c=await Object(l.c)().network.upload(a);return await n.handleEvents.handleOptionInput(c,e,t),v}},g.verify=async(e,t)=>{const{parent:n,nodeUuid:r,phoneNumber:o,validateType:a}=t,{transactionID:s}=n;let u=!1,d={response_id:s,question_id:r};if("sms"===a){if(Object(l.b)().preview)return Object(l.b)().notify(Object(f.f)(p.a.preview.noMessage)),{...O,noValidate:!0};if(!o||!Object(i.b)(o))return Object(l.b)().notify(Object(f.f)(p.a.fill.needPhoneNumber)),{...O,noValidate:!0};d={...d,phone_num:o},t.messageGetFailed=!1;try{const e=await Object(b.j)(d);t.serverValidations=e,n.phoneNumber=o,n.phoneUsed=e.phone_num_used,n.phoneUsed&&Object(c.A)(n,t),u=!0}catch(e){t.messageGetFailed=!0}}else if("image"===a){const e=await Object(b.j)(d);t.serverValidations=e,Object(l.g)(t,{captcha:e.image}),u=!0}return{...v,noValidate:!0,result:u}},g.gift=async(e,t)=>{if(Object(l.b)().preview)return Object(l.b)().notify(Object(f.f)(p.a.preview.noMessage)),O;const{phoneNumber:n,goalId:r}=t;if(!Object(i.b)(n))return Object(l.b)().notify(Object(f.f)(p.a.fill.needPhoneNumber)),O;t.messageGetFailed=!1;try{await Object(b.n)({phone_num:n},r)}catch(e){t.messageGetFailed=!0}return j},g.menu=g.select,g.cascade=(e,t)=>{if(e.isOtherOpt)x(e,t,!0);else{let{resultList:n}=e;const{list:r}=e;if(!r||!n)return Object(u.n)(v);n=n instanceof Array?n:n?[n]:[];const{addList:i,cancelList:o}=Object(d.d)(r,n);o.forEach(e=>{Object(d.a)(e,t)}),i.forEach(e=>{Object(d.h)(e,t)}),Object(d.c)(t);const a=i[i.length-1];a&&Object(m.c)(a.option,t)}return Object(u.n)(j)},g.hot_spot=g.select,g.icon_mark=g.value_mark=g.slide_rate=g.fill=g.weight=g.heat_map=(e,t)=>e.isOtherOpt?Object(u.n)(x(e,t,!0)):Object(u.n)(v),g.sequence=(e,t)=>{if(e.isOtherOpt)return Object(u.n)(x(e,t,!0));{const{options:n,operationType:r}=t;if(-1===e.sortNo){const t=n.map(e=>e.sortNo).filter(e=>e>0);let r=-1;for(let e=1;e<=n.length;e++)if(!t.includes(e)){r=e;break}r>0&&Object(l.g)(e,{sortNo:r,selected:!0})}else{const t=e.sortNo;Object(l.g)(e,{sortNo:-1,selected:!1}),"collapse-pick"===r&&n.forEach(e=>{e.sortNo>t&&Object(l.g)(e,{sortNo:e.sortNo-1})})}return Object(u.n)(v)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return f}));var r=n(2),i=n(0),o=n(3);let a=null;function c(){return{default:"minimal",primary:"rgba(128,128,128,1)",secondary:"rgba(255,255,255,1)",contrast:"rgba(202,32,39,1)",background:"#FFFFFF",error:"rgba(202,32,39,1)",button:"rgba(202,32,39,1)",fontSize:"24px",fontWeight:"normal",descFontSize:"16px",descFontWeight:"normal",optFontSize:"16px",optFontWeight:"normal",btnFontSize:"16px",btnFontWeight:"normal",name:"minimal",fontFamily:"SimSun",titleFontSize:"25px",titleFontWeight:"normal",boxWidth:"auto",bgOpacity:100,bgImageUrl:"",effect:"normal",dynamic:Object(i.b)().dynamic,client:Object(i.b)().clientName}}function s(e){if(!e)return c();const t="string"==typeof e?JSON.parse(e):e;let n=t.usingTheme;return n.background||(n={...c()},n.primary=t.usingTheme.primary,n.secondary=t.usingTheme.secondary,n.contrast=t.usingTheme.contrast),{...n,default:"minimal"}}function u(e=c()){e.error=e.error||e.contrast,e.button=e.button||e.contrast,a=e,Object(i.b)().setTheme(e),Object(i.c)().storage.set("theme",JSON.stringify(e))}function l(){return a||c()}function f(e="Legacy"){const t=Object(i.b)().clientName;if("ALL"!==t&&e!==t)throw Object(i.b)().error(Object(r.f)(o.a.global.clientError)),Object(i.b)().customAbort(),new Error("client not matched")}},function(e,t,n){"use strict";n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p})),n.d(t,"c",(function(){return b})),n.d(t,"h",(function(){return h})),n.d(t,"d",(function(){return m}));var r=n(6),i=n(2),o=n(0),a=n(3),c=n(7);function s(e){return"tabs"===e.layout.optMark}function u(e){return e.selected&&!Object(r.n)(e.option)}function l(e,t,n,i){const a=n.list.filter(e=>e.option.useComment)[t];Object(o.g)(a.option,{value:e});const c=i.options.find(e=>e.cascadePath===a.resultId);return Object(r.n)(a.option)&&(e?h(a,i):p(a,i),b(i)),c}function f(e,t,n){let l,f;const d=s(n),p=t.list.filter(e=>!Object(r.n)(e.option))[e];let b=t.list.filter(e=>u(e));const h=-1===b.indexOf(p),m=n.cascade;if(h&&d&&m.multiple&&!t.selected){let e=null;if(m.list.reduce((t,n)=>(u(n)&&(t+=1),n.list&&n.list.includes(p)&&(e=n),t),0)===m.max&&!Object(r.n)(e.option))return Object(o.b)().notify(Object(i.f)(a.a.menu.limitMax,{text:Object(i.f)(a.a.menu.topList),max:Object(c.a)(m.max)})),null}if(t.multiple){if(h){const{mutexNumber:e}=p.option;-1===e?b=[p]:(b=b.filter(t=>(!e||t.option.mutexNumber!==e)&&-1!==t.option.mutexNumber),b.push(p))}else b=b.filter(e=>e!==p);if(b.length>t.max)return Object(o.b)().notify(Object(i.f)(a.a.menu.limitMax,{text:t.text?Object(i.f)(a.a.menu.listItem)+t.text:Object(i.f)(a.a.menu.topList),max:Object(c.a)(t.max)})),null;l=b.map(e=>e.text)}else l=h?[p.text]:[];return f=l.map(e=>e),{resultList:l,list:t.list,group:t,result:f}}function d(e){Object(o.g)(e,{selected:!1}),Object(o.g)(e.option,{selected:!1});const t=e.list;t&&0!==t.length&&t.forEach(e=>{d(e)})}function p(e,t){d(e),t.options.forEach(t=>{t.cascadePath.includes(e.resultId)&&Object(o.g)(t,{selected:!1})})}function b(e){s(e)&&e.cascade.list.forEach(e=>{e.selected=e.list&&e.list.some(e=>e.selected)})}function h(e,t){Object(o.g)(e,{selected:!0}),Object(o.g)(e.option,{selected:!0}),t.options.forEach(t=>{e.resultId.includes(t.cascadePath)&&Object(o.g)(t,{selected:!0})})}function m(e,t){const n=[],r=[];return e.forEach(e=>{const i=t.some(t=>t.trim()===e.text.trim()),o=u(e);i&&!o?n.push(e):!i&&o&&r.push(e)}),{addList:n,cancelList:r}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return p}));var r=n(1),i=n(4);function o(e){const t=[];return e.forEach((e,n)=>{const i=Object(r.f)(n+1);t.splice(i,0,e)}),t}function a(e,t){return e.forEach((e,t)=>e.realIndex=t),t&&t.forEach((t,n)=>t.realIndex=n+e.length),e}const c={};function s(e,t){let n=[];return n=e.circulation?u(t):e.followRandom||e.groupRandom||e.groupInnerRandom?function(e,t){const{followRandom:n,groupRandom:i,groupInnerRandom:o}=e,a=[],c={},s={};t.forEach((e,t)=>{if(e.refOptId){let r="";if(n?r=e.refNodeId:i&&e.refGroupNumber&&(r=e.refNodeId+"_"+e.refGroupNumber),r){e.groupName=r;const n=s[r];n?h(e,n.list,o):s[r]={headIndex:t,list:[e]}}else a.push(e)}else if(e.groupNumber){const n=e.groupNumber;e.groupName=n;const r=c[n];r?h(e,r.list,o):c[n]={headIndex:t,list:[e]}}else a.push(e)});let u=[];return a.forEach(e=>{const t=Object(r.f)(u.length+1);u.splice(t,0,e)}),[c,s].forEach((e,t)=>{Object.keys(e).forEach(o=>{const{list:a,headIndex:c}=e[o];1===t&&n&&d(a);let s=c;i&&(s=Object(r.f)(u.length+1)),u=function(e,t,n){if(0===n)return e.concat(t);{for(;n<t.length-1&&b(t[n],t[n-1]);)n++;if(n>=t.length-1)return t.concat(e);const r=t.slice(0,n),i=t.slice(n);return r.concat(e,i)}}(a,u,s)})}),u}(e,t):function(e){const t=[];return e.forEach(e=>{const n=Object(r.f)(t.length+1);t.splice(n,0,e)}),t}(t),a(n,e.otherOptions)}function u(e,t){return t=(t||Math.round(10*Math.random()))%e.length,e.slice(t).concat(e.slice(0,t))}function l(e,t){if(!Object(i.u)(e))return a(t,e.otherOptions);if(e.groupSingle){let n=c[e.nodeUuid];if(n)return t.sort((e,t)=>n[e.uuid]>n[t.uuid]?1:-1);{const r=s(e,t);return c[e.nodeUuid]=n={},r.forEach((e,t)=>{n[e.uuid]=t}),r}}return s(e,t)}function f(e){let{optionsX:t,optionsY:n}=e;const{otherOptions:r}=e,{randomType:i}=e;return"col"!==i&&"row_col"!==i||(t=l(e,t)),"row"!==i&&"row_col"!==i||(n=l(e,n)),"col_loop"===i&&(t=u(t)),"row_loop"===i&&(n=u(n)),{optionsX:a(t,null),optionsY:a(n,null),otherOptions:a(r,null)}}function d(e){return e.sort((e,t)=>e.refRealIndex>t.refRealIndex?1:-1),e}function p(e){return e.sort((e,t)=>e.realIndex>t.realIndex?1:-1),e}function b(e,t){return!(!e.groupName&&!t.groupName)&&e.groupName===t.groupName}function h(e,t,n=!1){if(n){const n=Object(r.f)(t.length+1);t.splice(n,0,e)}else t.push(e)}},function(e,t,n){"use strict";n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"e",(function(){return g})),n.d(t,"a",(function(){return v}));var r=n(6),i=n(1),o=n(27),a=n(23),c=n(9);let s=null;async function u(e,t){let{start:n,end:r}=await Object(o.a)(e,t);return n===-1/0&&(n=-9999,n>r&&(n=r-9999)),r===1/0&&(r=9999,r<n&&(r=n+9999)),{start:n,end:r}}function l(e,t,n){return!!t&&t.some(t=>{if(t.startsWith("/")&&t.endsWith("/")){const n=t.substr(1,t.length-2),r=new RegExp(n);return!!e.match(r)}return n?n(e,t):e===t})}async function f(e,t,n){let r=0,i=await e();for(;l(i,t,n);)if(i=await e(),r++,r>10)throw new Error("Hard to infer, rejected 10 times");return i}async function d(e,t,n=1){if(!e.inferList)return{value:"",antis:null};const r=e.inferList.filter(e=>e.active&&"input"===e.type);if(0===r.length)return{value:"",antis:null};const i=await Object(a.e)(r,t);if(""===i.replace(/,/g,""))return{value:"__FORCE_EMPTY__",antis:null};const o=[];if(i.split(",").forEach(e=>{e.startsWith("!")?o.push(e.substr(1)):e.match(/\(0\)$/)&&o.push(e.replace(/\(0\)$/,""))}),o.length)return{value:"",antis:o};const c=Object(a.c)(i);return{value:Object(a.f)(c,n).map(e=>e.text).join(","),antis:null}}function p(){return"1"+m(1e9,9999999999)}function b(e){return s[e]||Math.random().toString().replace("0.","")}async function h(){if(s)return s;const e=await Object(c.p)("https://media.choiceform.com/infer/infer.json",{type:"GET",contentType:"application/json"});return s=e,s}function m(e=0,t=10,n=0){const r=Math.pow(10,n);e*=r,t*=r;return(Object(i.g)(e,t)/r).toString()}function g(e,t=1,n=10){let r=b(e);for(;r.length<n;)r+=b(e);const o=r.length,a=Object(i.g)(n,o),c=a-Object(i.g)(t,n),s=r.substring(c,a);return""===s.trim()?g(e,t,n):s}function O(e=0,t=5e3,n=3){e=Math.max(e,0),t=Math.min(t,5e3);let r=Object(i.g)(e,t).toString();if(n>1){r=r+" "+Object(i.g)(1,12)}if(n>2){r=r+" "+Object(i.g)(1,28)}return r}const j={};async function v(e,t){const n=j[e.fillType]||j.none,r=await n(e,t);return"__FORCE_EMPTY__"===r?"":r}j.auto_complete=async(e,t)=>{let{completeGroups:n}=e;const{itemsMax:o,itemsMin:a}=await Object(r.g)(e,t),c=Object(i.g)(a,o)||1,{value:s,antis:u}=await d(e,t,c);if(s)return s;u&&(n=n.filter(e=>!l(e.name,u)));return Object(i.p)(n,c).map(e=>e.name).join(",")},j.chars=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{tolerance:i}=e,{start:o,end:a}=await u(e,t);return f(()=>!i||0===i.length||i.includes("chinese")?g("chinese",o,a):i.includes("alphabet")?g("alphabet",o,a):g("number",o,a),r)},j.date=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{grade:i}=e,{start:o,end:a}=await u(e,t);return f(()=>O(o,a,i),r)},j.date_range=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const i=O(1960,2050,3),o=Number(i.split(" ")[0]);return f(()=>{const e=O(o,2060);return i+" - "+e},r)},j.email=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return f(()=>(Object(i.e)(1,6)+"@"+Object(i.e)(1,6)+"."+Object(i.e)(1,4)).toLowerCase(),r)},j.float=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{scale:i}=e;return f(async()=>{const{start:n,end:r}=await u(e,t);return m(n,r,i)},r)},j.integer=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{start:i,end:o}=await u(e,t);return f(()=>m(i,o),r)},j.list_select=async(e,t)=>{let{selectList:n}=e;const{itemsMax:o,itemsMin:a}=await Object(r.g)(e,t),c=Object(i.g)(a||1,o||1)||1,{value:s,antis:u}=await d(e,t,c);if(s)return s;u&&(n=n.filter(e=>!l(e,u)));return Object(i.p)(n,c).join(",")},j.none=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return f(()=>g("chinese",1,10),r)},j.phone_number=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return f(()=>p(),r)},j.postcode=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>m(1e5,999999),r)},j.time=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>m(1,25)+":"+m(1,60),r)},j.time_range=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>{const e=m(1,20);return e+":"+m(1,60)+" - "+(m(Number(e)+1,24)+":"+m(1,60))},r)},j.time_duration=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;const{grade:i}=e;return await f(()=>{if(i<=3){let e=m(1,20)+"d";return i>1&&(e+=" "+m(1,24)+"h"),i>2&&(e+=" "+m(1,60)+"m"),e}{let e=m(1,60)+"h";return i>4&&(e+=m(1,60)+"m"),i>5&&(e+=m(1,60)),e}},r)},j.url=async(e,t)=>{const{value:n,antis:r}=await d(e,t);if(n)return n;return await f(()=>("https://"+Object(i.e)(1,3)+"."+Object(i.e)(1,6)+"."+Object(i.e)(1,3)).toLowerCase(),r)}},function(e,t,n){"use strict";function r(e){if(!e)return"00:00";const t=e%60;return i((e-t)/60)+":"+i(t)}function i(e){let t=e+"";return 1===t.length&&(t="0"+t),t}function o(){const e=new Date;return e.getFullYear()+"-"+i(e.getMonth()+1)+"-"+i(e.getDate())+" "+i(e.getHours())+":"+i(e.getMinutes())+":"+i(e.getSeconds())}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return p}));var r=n(1);const i=String.fromCharCode(160),o=new RegExp(i,"g");function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g,i)}class c{constructor(e){this.type="node",this.name=e,this.children=[],this.attributes={}}hasClass(e){const{attributes:t}=this,n=t&&t.class;return n&&n.split(" ").includes(e)}insertBefore(e,t){const n=this.children.indexOf(t);e.parent=this,this.children.splice(n,0,e)}getOuterHtml(){let e=Object.keys(this.attributes).map(e=>{let t=this.attributes[e]||"";return t&&(t=t.replace(/&/g,"&").replace(o," ").replace(/"/g,""")),`${e}="${t}"`}).join(" ");e&&(e=" "+e);let t=`<${this.name}${e}>`;return l(this.name)||(t+=this.getInnerHtml(),t+=`</${this.name}>`),t}getInnerHtml(){return this.children.map(e=>Object(r.k)(e,"node"===e.type)?e.getOuterHtml():e.getText().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(o," ")).join("")}setInnerHtml(e){this.empty(),d(e,this)}setText(e){this.empty(),this.children.push(new s(e))}getText(){return this.children.map(e=>e.getText()).join("")}empty(){this.children.forEach(e=>e.parent=null),this.children=[]}removeChild(e){this.children=this.children.filter(t=>t!==e)}appendChild(e){this.children.includes(e)||(e.parent=this,this.children.push(e))}queryByClass(e){let t=[];return this.children.forEach(n=>{const{children:i,type:o}=n;if(Object(r.k)(n,"node"===o)&&(n.hasClass(e)&&t.push(n),i&&i.length>0)){const r=n.queryByClass(e);r.length>0&&(t=[...t,...r])}}),t}}class s{constructor(e){this.type="text",this.setText(e)}getText(){return this._text}setText(e){this._text=e}}const u=["area","base","br","col","command","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function l(e){return u.includes(e)}function f(e){e=Object(r.t)(e);const t={},n=/(\S+?)=(["'])(.*?)\2[\/\s>]/g;let o=n.exec(e);for(;o;)t[o[1]]=o[3].replace(/&/g,"&").replace(/ /g,i).replace(/"/g,'"'),o=n.exec(e);return t}function d(e,t){e=function(e){return e.replace(/\S+?=(["']).*?\1/g,e=>Object(r.d)(e))}(e).replace(/\n/g," ");const n=/<(\w+).*?>/g,i=[];let o=n.exec(e);const u=t||new c("div");for(;o;){const t=o[1],r=o.index+o[0].length;i.push({type:"open",name:t,value:o[0],start:o.index,end:r}),n.lastIndex=r,o=n.exec(e)}if(0===i.length)return u.appendChild(new s(a(e))),u;const d=/<\/(\w+)>/g;let p=d.exec(e);for(;p;){const t=p[1],n=p.index+p[0].length;i.push({type:"close",name:t,value:p[0],start:p.index,end:n}),p=d.exec(e)}i.sort((e,t)=>e.start>t.start?1:-1);const b=[...i];let h=u,m=0,g=b.shift();const O=[];for(;g;){const{start:t,end:n,name:r,type:i,value:o}=g;if(m<t&&h.children.push(new s(a(e.substring(m,t)))),"open"===i){const e=new c(r);e.attributes=f(o),h.appendChild(e),l(r)||(h=e,O.push(g))}else if(!l(r)){const e=O[O.length-1];e&&e.name===g.name&&(h=h.parent,O.pop())}m=n,g=b.shift()}return m<e.length&&u.appendChild(new s(a(e.substring(m)))),u}function p(e){const t=d(e),n=e=>{const t={type:e.type};return Object(r.k)(e,"node"===e.type)?(t.name=e.name,t.attrs=e.attributes,t.children=e.children.map(n)):t.text=e.getText(),t};return t.children.map(n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return k})),n.d(t,"b",(function(){return E})),n.d(t,"c",(function(){return N}));var r=n(6),i=n(27),o=n(4),a=n(52),c=n(5),s=n(1),u=n(0),l=n(2),f=n(30),d=n(3),p=n(9),b=n(25);const h={valid:!0,message:""};function m(e){if(!Object(o.i)(e))return h;const t=Object(r.l)(e)||Object(r.k)(e);return{valid:t,message:t?"":Object(l.f)(d.a.global.answerRequired),dueToNode:e}}function g(e,t){const{otherOptions:n}=e;return n.some(e=>e.selected)?0:t}async function O(e){if(!Object(o.i)(e)&&!Object(r.k)(e))return h;const{options:t}=e,{parent:n}=e;let i=await Object(c.e)(e.fillMin,{state:n});i=i||t.length,i>t.length&&(i=t.length),i=g(e,i);let a=0;for(const n of t)if(Object(b.b)(n,e))a+=1;else if(!0===n.fillRequired)return{valid:!1,message:Object(l.f)(d.a.fill.required,{text:n.text||""}),dueToNode:e};const s=i<=a;return s?h:{valid:s,message:Object(l.f)(d.a.fill.inputLimitMin,{min:i}),dueToNode:e}}function j(e,t=!1){const n=t?e.otherOptions:Object(r.c)(e),i=Object(o.i)(e);let a;const c=!n.some(t=>(a=t,function(e,t){const n=!0===e.fillRequired,i=e.selected;return n&&(i||Object(r.n)(e)&&t)}(t,i)&&!Object(b.b)(t,e)));return c?h:{valid:c,message:Object(l.f)(d.a.fill.required,{text:a.text}),dueToNode:e,dueToOption:a}}async function v(e,t=!1){const n=t?e.options:Object(r.c)(e);for(const t of n){if(!Object(b.b)(t,e))continue;const n=await Object(i.d)(t,e);if(!n.valid)return n}return h}function w(e){return Object(o.s)(e)&&Object(r.l)(e)?y(e):Object(s.n)(h)}async function y(e){if(function(e){if("matrix"===e.type)return!1;const t=Object(r.c)(e).find(e=>e.selected);return!(!t||-1!==t.mutexNumber)}(e))return h;const{min:t}=await Object(o.e)(e);return Object(r.c)(e).filter(e=>!Object(r.n)(e)).filter(e=>e.selected).length>=t?h:{valid:!1,message:Object(l.f)(d.a.select.limitMin,{min:t}),dueToNode:e}}function _(e){return Object(o.v)(e)?Object(s.n)(h):Object(o.i)(e)||Object(r.l)(e)?Object(o.m)(e)?y(e):Object(o.r)(e)||Object(o.p)(e)||Object(o.q)(e)?Object(s.n)(function(e){let t,n,r;Object(o.r)(e)?(t="yid",n=e.renderOptionsY,r=!1):Object(o.p)(e)?(t="xid",n=e.renderOptionsX,r=!0):Object(o.q)(e)&&(e.renderOptionsX.length>e.renderOptionsY.length?(t="yid",n=e.renderOptionsY,r=!1):(t="xid",n=e.renderOptionsX,r=!0));const i=e.options;for(const o of n){const n=o.uuid;if(!i.some(e=>e.selected&&Object(s.l)(e[t],n))){return{valid:!1,message:r?Object(l.f)(d.a.matrix.colLimitMin,{min:1}):Object(l.f)(d.a.matrix.rowLimitMin,{min:1}),dueToNode:e}}}return h}(e)):async function(e){const t=Object(o.n)(e);let{min:n}=await Object(o.e)(e);const r=t?"xid":"yid",i=e[t?"renderOptionsX":"renderOptionsY"],a=e[t?"renderOptionsY":"renderOptionsX"];n>a.length&&(n=a.length);const c=e.options;for(const o of i){const i=o.uuid;if(c.filter(e=>e.selected&&Object(s.l)(e[r],i)).length<n){return{valid:!1,message:t?Object(l.f)(d.a.matrix.colLimitMin,{min:n}):Object(l.f)(d.a.matrix.rowLimitMin,{min:n}),dueToNode:e}}}return h}(e):Object(s.n)(h)}const x={};function T(e,t){Object(u.g)(e,{errorMessage:t.message||""})}function k(e,t){Object(u.b)().locateError(e,t)}async function S(e,t){if(Object(o.w)(e)||e.readonly)return h;const n=function(e){const{canSkipVideo:t,video:n}=e;return t||!n||n.ended?h:{valid:!1,message:Object(l.f)(d.a.video.watchAll),dueToNode:e}}(e);if(!n.valid)return n;const r=x[e.type];let i=r?await r(e):h;return i.valid&&t&&(i=await Object(a.a)(e)),i.valid&&T(e,i),i}x.select=async e=>{const t=m(e);if(!t.valid)return t;let n=await w(e);return n.valid?(n=j(e,!1),n.valid?v(e,!1):n):n},x.select_image=e=>x.select(e),x.fill=async e=>{const t=m(e);if(!t.valid)return t;let n=await O(e);return n.valid?(n=j(e,!0),n.valid?v(e,!1):n):n},x.value_mark=async e=>{const t=m(e);if(!t.valid)return t;let n=await O(e);return n.valid?(n=j(e,!0),n.valid?v(e,!0):n):n},x.icon_mark=async e=>{const t=await x.value_mark(e);if(!t.valid)return t;if(Object(o.i)(e)){if(e.options.some(e=>0===e.value))return{valid:!1,message:Object(l.f)(d.a.global.answerRequired),dueToNode:e}}return h},x.sequence=e=>{let t=m(e);if(!t.valid)return Object(s.n)(t);const{options:n}=e;let r=Object(o.i)(e)?e.rankCount||n.length:0;const i=n.length;r>i&&(r=i),r=g(e,r);let a=0;const c=n.filter(e=>e.sortNo>0).sort((e,t)=>e.sortNo>t.sortNo?1:-1);for(let e=0;e<c.length&&c[e].sortNo===e+1;e++)a++;return r>a?Object(s.n)({valid:!1,message:Object(l.f)(d.a.rank.limitMin,{min:r}),dueToNode:e}):(t=j(e,!0),t.valid?v(e,!0):Object(s.n)(t))},x.matrix=async e=>{const t=m(e);if(!t.valid)return t;let n=await _(e);return n.valid?(n=j(e,!0),n.valid?v(e,!0):n):n},x.region=e=>{const t=!Object(o.i)(e)||e.value?h:{valid:!1,message:Object(l.f)(d.a.global.answerRequired),dueToNode:e};return Object(s.n)(t)},x.location=async e=>{const t=await x.region(e);return t.valid||(t.message=Object(l.f)(d.a.locate.required)),t},x.upload=async e=>{const t=m(e);if(!t.valid)return t;let n=!0,i="";const a=Object(r.f)(e);if(!Object(o.i)(e)&&0===a)return h;const c=await Object(o.g)(e),{max:s}=c,u=g(e,c.min);return a<u?(n=!1,i=Object(l.f)(d.a.upload.amountLimitMin,{min:u})):a>s&&(n=!1,i=Object(l.f)(d.a.upload.amountLimitMax,{max:s})),{valid:n,message:i,dueToNode:e}},x.verify=async e=>{if(Object(u.b)().preview||Object(u.c)().dev.infer){if(!e.code)return{valid:!1,message:Object(l.f)(d.a.global.answerRequired),dueToNode:e}}else{const t={valid:!1,message:Object(l.f)(d.a.verify.invalidFailed),dueToNode:e},{validateType:n}=e,{code:r,parent:i,nodeUuid:o}=e,a=()=>(e.validateFailTimes+=1,t);if("image"===n){const{serverValidations:n}=e;if(!n)return t;{const{id:e}=n;try{return await Object(p.o)({code:r},e),h}catch(e){return a()}}}else if("password"===n){const{transactionID:e}=i,t={response_id:e,question_id:o,code:r};try{return await Object(p.j)(t),h}catch(e){return a()}}else if("sms"===n){const{serverValidations:n}=e;if(!n)return t;{const{id:e}=n;try{return await Object(p.o)({code:r},e),h}catch(e){return a()}}}}return h},x.menu=x.select,x.area=e=>Object(s.n)(m(e)),x.select_icon=e=>{const t=m(e);return t.valid?w(e):Object(s.n)(t)},x.weight=e=>{if(!Object(o.i)(e)&&!Object(r.k)(e))return Object(s.n)(h);const t=m(e);if(!t.valid)return Object(s.n)(t);let{weightTotal:n}=e;n=g(e,n);const{options:i}=e;return n>i.reduce((e,t)=>e+Number(t.value),0)&&!0!==e.relax?Object(s.n)({valid:!1,message:Object(l.f)(d.a.weight.totalLimitMin,{min:n}),dueToNode:e}):Object(s.n)(h)},x.cascade=e=>{if(!Object(o.i)(e)&&!Object(r.l)(e))return Object(s.n)(h);const{cascade:t}=e,n=m(e);return n.valid?async function e(t,n,r=0){if(!n.list)return h;const o=Object(f.e)(t),{multiple:a,min:c,max:s,required:u}=n,p=n.text?Object(l.f)(d.a.menu.listItem)+n.text:Object(l.f)(d.a.menu.topList),b=n.list.filter(e=>{let t=e.selected;return o&&e.list&&(t=t&&e.list.some(e=>e.selected)),t});for(const e of b){const{option:n}=e;if(n.fillRequired&&!(n.value||"").toString().trim())return{valid:!1,dueToNode:t,message:Object(l.f)(d.a.menu.inputReq,{text:n.text})};const r=await Object(i.d)(n,t);if(!r.valid)return{...r,message:Object(l.f)(d.a.menu.inputRule,{text:n.text,rule:r.message})}}const m=b.length;if(u&&0===m&&(!o||0===r))return{valid:!1,dueToNode:t,message:Object(l.f)(d.a.menu.required,{text:p})};if(a&&m<c&&(!o||m>0))return{valid:!1,dueToNode:t,message:Object(l.f)(d.a.menu.requiredBetween,{text:p,min:c,max:s})};for(const r of n.list){if(!r.selected)continue;const n=await e(t,r,m);if(!n.valid)return n}return h}(e,t):Object(s.n)(n)},x.hot_spot=x.select,x.heat_map=e=>Object(s.n)(m(e)),x.slide_rate=x.value_mark,x.max_diff=e=>{const t=e.tasks.every(e=>e.done),n={valid:t,dueToNode:t?null:e,message:t?"":Object(l.f)(d.a.maxDiff.all)};return Object(s.n)(n)};const E=Object(s.a)(async(e,t)=>{if(t){const n=await Object(i.d)(t,e);t.errorMessage!==n.message&&T(t,n)}if(e){const t=await N([e]);t.message||T(e,t)}},250);async function N(e,t=!1){const n=[],r=e.length>1;for(const r of e){const e=await S(r,t);n.push(e)}let i=null;return n.forEach(e=>{e.valid||(r&&T(e.dueToNode,e),i||(i=e))}),i||h}},function(e,t,n){"use strict";n.d(t,"d",(function(){return R})),n.d(t,"b",(function(){return H})),n.d(t,"c",(function(){return K})),n.d(t,"a",(function(){return J}));var r=n(4),i=n(71),o=n(12),a=n(33),c=n(56),s=n(28),u=n(74),l=n(58),f=n(19),d=n(43),p=n(11),b=n(52),h=n(17),m=n(9),g=n(44),O=n(57),j=(n(15),n(30)),v=n(8),w=n(14),y=n(20),_=n(0),x=n(2),T=n(45),k=(n(6),n(64)),S=n(1),E=n(48),N=n(3),I=n(67),C=n(72),L=n(50),A=n(10),P=n(75);const R=Object(S.a)(()=>{Object(_.b)().realTimePreview||F(null)||v.a.trigger("STRETCH_OK")});let M;function D(){return M}function U(e){const t=["region","location","area"];return e.some(e=>e.used&&t.indexOf(e.type)>-1)}function B(e){const{parsedPayload:t,userInfo:n,theme:r,hasVar:i,sid:d,langTable:b,startNode:m,surveyId:g,summary:O,language:T,images:E,langResume:N,title:I,transactionID:L,status:A,platform:R,digest:M,channel:D,customLogo:B,customText:z,useCustomLogo:$}=e,{nodeList:H,basicConfig:X,testCases:G}=t;let K=!1;Object(_.b)().offlineTaskId||X.collector&&(K=!1===X.collector.multiple_response);const{fakedServers:J,autoCpltGroups:W,noWxShare:Y,previewShadowNodes:Z,qNumberRequired:Q,asterisksRequired:ee,progressBarRequired:te,nodeTypeInfoRequired:ne,limitTime:re,minTime:ie,timeoutText:oe,timeLessText:ae,resumeEnabled:ce}=m,se={previewShadowNodes:Z&&!Object(_.c)().dev.autoRun,langResume:N,langTable:b,testCases:G,progress:0,resumeEnabled:ce||!!Object(_.b)().offlineTaskId,images:E,eventHub:v.a,language:T,sid:d,parsedPayload:t,digest:M,channel:D,transactionID:L,status:A,platform:R,fakedServers:J,autoCpltGroups:W,noWxShare:Y,needRegions:U(H),theme:r,userInfo:n,responseStatus:"created",context:{question:void 0,option:void 0},completeUrl:"",quotaFullUrl:"",screenOutUrl:"",title:I,summary:O,useCustomLogo:$,customText:z,customLogo:B,bonusLimitTime:"",nodeList:H,companyID:"",oneReplyPerTerminal:K,surveyId:g,qNumberRequired:Q,asterisksRequired:ee,progressBarRequired:te,nodeTypeInfoRequired:ne,preview:Object(_.b)().preview,nextBtnText:"",prevBtnText:"",prevEnabled:!1,randomList:[],loopStack:[],startTime:0,currentStartTime:0,renderList:[],current:void 0,limitTime:re||void 0,minTime:ie,timeoutText:oe||"",timeLessText:ae||"",timer:-1,restTime:Object(a.b)(re),hasVar:i,nextLoading:!1,refreshing:!1,phoneUsed:!1,phoneNumber:"",startNode:m,nodes:[],prevButton:"",nextButton:"",inSingleGroup:null,needProgressBar:!1,first(){return Object(f.b)(this)[0]||this.current},last(){const e=Object(f.b)(this);return e[e.length-1]||this.current},async dynamicStateProps(){const e=Object(f.b)(this);Object(_.g)(this,{nodes:e});let t=null;if(Object(f.c)(this)){const e=this.first();t=e&&this.parsedPayload.nodeGroups.find(t=>t.id===e.groupId)}Object(_.g)(this,{inSingleGroup:t});const n=await Object(o.f)(this);Object(_.g)(this,{prevButton:Object(o.h)(this),nextButton:n,needProgressBar:this.progressBarRequired&&"lottery"!==this.current.type}),e.forEach((t,n)=>{t.next=e[n+1]})},handleEvents:{...k.a,handleQuickAnswer:e=>Object(C.b)(e),handleLangChange:e=>Object(S.n)(Object(x.a)(e.id,!0)),handleCascadeInput(e,t,n,r){if(F(r))return Object(S.n)();const i=Object(j.g)(e,t,n,r);return this.handleOptionInput(e,i,r).then(e=>(Object(y.c)(),e))},handleOptionAssistInput:(e,t,n,r)=>(Object(_.g)(n.assistValue,{[t]:e}),V({result:!0},r)),async handleCascadeClick(e,t,n){const r=()=>t.list.filter(e=>e.selected).map(e=>e.text);if(F(n))return r();const i=Object(j.f)(e,t,n);return i?(await this.handleOptionClick(i,n),Object(y.c)(),i.result):r()},async handleMenuClick(e,t){const n=()=>t.options.filter(e=>e.selected).map(e=>e.text);if(F(t))return n();await this.handleOptionClick(t.options[e],t);const r=n();return Object(y.c)(),r},async handleOptionClick(e,t){if(F(t))return;const n=await Object(s.b)(e,t);return n.result&&Object(p.q)(e,t),V(n,t).then(e=>(Object(y.c)(),e))},async handleOptionInput(e,t,n){if(F(n))return;const r=await Object(c.b)(e,t,n);return r.result&&Object(p.p)(e,t,n),V(r,n).then(e=>(Object(y.c)(),e))},handleAutoCpltInput:(e,t,n)=>(Object(c.a)(e,t,n),Object(S.n)(Object(p.b)(e,t,n))),handleOptionDrop(e,t,n){if(F(n))return Object(S.n)([]);const r=Object(u.a)(e,t,n);return r.result&&Object(p.r)(t,n),V(r,n).then(e=>(Object(y.c)(),e))},handleQuestionInput(e,t){if(F(t))return Object(S.n)();const n=Object(l.b)(e,t);return n.result&&Object(p.u)(e,t),V(n,t).then(e=>(Object(y.c)(),e))},handleLocateFailed(e){const t=Object(l.a)(e);return t.result&&Object(p.k)(e),V(t,e).then(e=>(Object(y.c)(),e))},handlePrevClick:()=>Object(_.b)().realTimePreview||q()||!se.prevButton||F(null)?Object(S.n)():(Object(p.t)(se.current),Object(o.i)(se).then(e=>(Object(y.c)(),e))),handleMaxDiffInput:(e,t,n,r)=>V(Object(P.a)(e,t,n,r),r).then(e=>(Object(y.c)(),e)),async handleNextClick(){if(Object(_.b)().realTimePreview||F(se.current)||q()&&Object(o.l)())return;Object(o.m)(se,!0),function(e){const{current:t,currentStartTime:n,nodes:r}=e,i=t.costTime||0,o=(new Date).getTime(),a=o-n;if(t.groupSingle&&r.length>1){const e=Math.abs(a/r.length);r.forEach(t=>{Object(_.g)(t,{costTime:e,endTime:o}),Object(w.a)(t)})}else Object(_.g)(e.current,{costTime:Math.abs(i+a),endTime:o}),Object(w.a)(e.current);Object(_.g)(e,{currentStartTime:o})}(se);const{current:e}=se;if(Object(p.n)(e),"lottery"===e.type)Object(o.k)(se,e),Object(o.m)(se,!1);else{if(await Object(o.n)(se)){if(!q())return Object(o.j)(se);Object(o.d)(se)}else Object(o.m)(se,!1)}}}};return Object.keys(se.handleEvents).forEach(e=>{const t=se.handleEvents[e];se.handleEvents[e]=async(...e)=>{Object(h.e)(se,se.current);const n=await t.apply(se.handleEvents,e);return Object(h.e)(se,se.current),n}}),se}function q(){return M.refreshing}function F(e){let t=M.nextLoading||q();return e&&(t=t&&e!==e.parent.current),t}async function V(e,t){if(await Object(f.d)(t),Object(_.b)().liteTemplate)return!1;Object(v.c)(t),Object(w.a)(t);const n=t.parent;return Object(_.b)().realTimePreview||(n.inSingleGroup?(Object(_.g)(n,{current:t}),await Object(h.f)(n,t,{type:"page_inner",delay:60})):R()),Object(v.b)(t),e.result}function z(e){const t=e;return{nodeName:t.nodeName,nodeUuid:t.nodeUuid,type:"describe",image:t.image,images:t.image?[t.image]:void 0,imgPosition:"before",imgTransTime:2e3,imgTransType:"slide",layout:t.layout}}async function $(e){if(M=e,Object(_.b)().liteTemplate)await async function(e){const{nodeList:t}=e,n=t.find(e=>"start"===e.type),r=t.find(e=>"end"===e.type),i={...z(n),questionText:n.startName,describe:n.questionText},o={...z(r),questionText:r.questionText,describe:r.describe},a=[i,...t.filter(e=>"start"!==e.type&&"end"!==e.type).sort((e,t)=>e.x>t.x?1:-1),o];let c;const s=[];for(const t of a){const n={prev:c,origin:t,...t},r=await Object(f.f)(n,e);c&&(c.next=r),c=r,s.push(r)}Object(_.g)(e,{renderList:s,nodes:s,nextButton:"",prevButton:""})}(e);else if(await X(e),function(e){let t=e.limitTime;t&&(e.timer=setInterval(()=>{t--,t||(Object(p.z)(e),clearInterval(e.timer),Object(_.b)().error(e.timeoutText||Object(x.f)(N.a.global.timeOver))),Object(_.g)(e,{restTime:Object(a.b)(t)})},1e3))}(e),e.langResume||e.resumeEnabled&&!Object(_.b)().preview){const t=Object(y.a)(e);Object(_.g)(e,{memoryTool:t,answerResumer:t}),e.langResume&&setTimeout(()=>e.answerResumer.handleSure(),1e3)}}function H(e,t={}){return e=e||D(),Object(_.g)(e,{renderList:[],current:null,loopStack:[],randomList:[],...t}),X(e)}async function X(e){Object(o.m)(e,!0);const t=e.nodeList,n=Object(r.d)(t),a=await Object(i.a)(t,e,n);!function(e,t){const n=(new Date).getTime();Object(_.g)(e,{nextBtnText:t.nextBtnText||Object(x.f)(N.a.global.next),prevBtnText:t.prevBtnText||Object(x.f)(N.a.global.previous),prevEnabled:!0===t.goBackEnabled,startTime:n,currentStartTime:n})}(e,n),await Object(o.a)(e,a,null);const{current:c}=e,s=Object(r.w)(c),u=Object(f.c)(e);if(s||u){const t=u?"page_inner":"page_next";await Object(h.f)(e,c,{type:t,initial:!0})}else Object(_.g)(e,{renderList:[c]}),await e.dynamicStateProps(),R();Object(E.a)(e);const l=e.current;return l.reached=!0,Object(p.x)(e,l),Object(w.j)(e),c!==l&&await Object(O.b)(e,{valid:!0,message:""},c,l),Object(v.c)(e.current,!0),Object(o.m)(e,!1),e}async function G(){const e=Object(_.b)().sid,t=Object(_.b)().startState;if(t||(Object(_.c)().app.gotoStartPage(Object(A.c)()),Object(_.b)().customAbort()),Object(_.b)().preview)return t;const{parsedPayload:{basicConfig:n}}=t,{payload_digest:r,channel:i,interviewee:o}=n;!function(e,t){if(!Object(_.c)().dev.autoRun&&Object(_.c)().storage.get(e)&&t&&!Object(_.b)().preview)throw Object(_.b)().error(Object(x.f)(N.a.global.antiAgain)),new Error(" _custom_abort_ _multi_reply")}(e,!1===n.collector.multiple_response);const a={code:e,payload_digest:r,platform:i.type,interviewee_id:o&&o.id};try{const e=await Object(m.g)(a);return t.transactionID=e.id,t.status=e.status,t.platform=e.platform,t.digest=r,t.channel=i,Object(_.c)().network.connectSocket(e.id,n.collector.id),t}catch(e){throw Object(m.c)(e),e}}function K(){M=null}async function J(){const e=Object(_.c)();if(M)return M;const t=await G();await async function(e){if(Object(_.b)().preview)return;const{parsedPayload:t}=e,{basicConfig:{diagram_url:n}}=t;let r;try{r=await Object(m.p)(n)}catch(e){throw Object(_.b)().error(Object(x.f)(N.a.global.downloadError)),e}const i=await Object(I.a)(r);t.nodeList=Object(g.b)(i.nodes,t.nodeGroups);const{nodeList:o,langStore:a}=t;a&&Object(T.c)({nodes:o},a)}(t);const n=B(t);Object(_.b)().surveyState=n,await e.network.initUploader(n),await Object(L.b)(n),await async function(e){e.needRegions&&await Object(d.a)()}(n);const{startNode:{templates:r},theme:i}=n;return await e.ui.loadUiTemplates(i,r),await async function(e){const{startNode:t}=e,n=await Object(b.a)({...t,parent:e},!0);n.valid?t.passed=!0:(Object(_.b)().error(n.message||Object(x.f)(N.a.verify.failed)),Object(_.b)().customAbort())}(n),await $(n),await e.hook.afterFetchSurvey(n),n}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return l}));var r=n(21),i=n(6),o=n(11),a=n(15);async function c(e,t,n){const i=t.displayConfig;if(i){n.hasOptShowHide=!0,e.context.option=t;const a=await Object(r.b)(e,i.options,i.logicType);return a&&Object(o.o)(e,t,n),e.context.option=null,a}return!0}async function s(e,t,n){const r=[],i=[];for(const o of t){await c(e,o,n)?(o.visible=!0,r.push(o)):(o.visible=!1,i.push(o))}return{visibleList:r,hiddenList:i}}async function u(e,t,n){for(const r of t)r.visible=await c(e,r,n);return t}function l(e,t){const{renderList:n}=e,r=[];return n.forEach(e=>{if(!Object(a.e)(e.checkMode,t))return;const{hasOptShowHide:n,nodeUuid:o,loop:c}=e;if(n){const t="matrix"===e.type?Object(i.d)(e):Object(i.c)(e);let n;c&&(n=c.replacements.map(e=>e.index)),r.push({node_id:o.toLowerCase(),loop_idxs:n,option_ids:t.map(e=>e.uuid.toLowerCase())})}}),r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(34);const i=["beforecopy","beforepaste","beforecut","copy","paste","cut","animationstart","animationend","animationiteration","transitionend","scroll","wheel","blur","click","dblclick","focus","focusin","focusout","input","keypress","keyup","keydown","select","change","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","touchcancel","touchend","touchmove","touchstart","unload","cancel","close","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","loadedmetadata","loadeddata","durationchange","timeupdate","play","pause","ratechange","volumechange","suspend","emptied","stalled","invalid","reset","submit","invalid","reset","submit","show","contextmenu","drag","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop","webglcontextcreationerror","webglcontextlost","webglcontextrestored","error","load","loadend","loadstart","progress"];function o(e){if(!e||e.includes("data-safe-html="))return e;const t=new r.a("div");return t.setInnerHtml(e),function e(t){if("script"===t.name)t.parent&&t.parent.removeChild(t);else{i.forEach(e=>{delete t.attributes["on"+e]});for(let n=t.children.length-1;n>=0;n--){const r=t.children[n];"node"===r.type&&e(r)}}}(t),t.getInnerHtml()}},function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"e",(function(){return b})),n.d(t,"b",(function(){return w})),n.d(t,"c",(function(){return y}));var r=n(1),i=n(16),o=n(22),a=n(51),c=n(7),s=n(41);let u;function l(e){const{loopStack:t}=e;return t?t[t.length-1]:null}function f(e,t,n){const{state:{loopStack:i}}=e,o=i[t];if(o){const e=o.replacements[t];if(e)return Object(r.j)(n(e))}return Object(r.j)(n())}function d(e,t){const{varInfo:{loopNodeId:n,imgSize:i},state:o}=e,a=l(o);if(!a)return Object(r.n)("");const c=b(n,a.replacements);return Object(r.j)(t(c,i))}function p(e){const t=e.split(":")[1];return function(){if(!u){const e=Object(o.a)();u=[],Object.keys(e).forEach(t=>{const{uuid:n,type:r}=e[t];"var-loop"===r&&u.push(n)})}return u}().indexOf(t)>-1}function b(e,t){return t.find(t=>Object(r.l)(t.loopNodeId,e))}function h(e,t="0:0"){if(e){let n=void 0===e.refText?e.text:e.refText;if(n.match(/^##.+##$/)&&"0:0"!==t){const e=t.split(":");n=n.replace(/\?w=0&h=0/,`?w=${e[0]||0}&h=${e[1]||0}`)}return n}return""}function m(e,t="0:0"){if(e&&e.image){const{image:n}=e;return Object(i.b)(n.url,t)}return""}function g(e){return e&&Object(c.a)(e.index+1)}function O(e){return e&&e.value}function j(e){return e&&Object(c.a)(e.number)}function v(e){return e&&e.label}function w(e){e.C_OL_TXT.getText=e=>f(e,0,h),e.C_OL_IDX.getText=e=>f(e,0,g),e.C_OL_NUM.getText=e=>f(e,0,j),e.C_OL_VAL.getText=e=>f(e,0,O),e.C_OL_LBL.getText=e=>f(e,0,v),e.C_IL_TXT.getText=e=>f(e,1,h),e.C_IL_IDX.getText=e=>f(e,1,g),e.C_IL_NUM.getText=e=>f(e,1,j),e.C_IL_VAL.getText=e=>f(e,1,O),e.C_IL_LBL.getText=e=>f(e,1,v),s.a.forEach(t=>{!function(t){const n=t.split("_")[1],r="C_IL_MAP_"+n,i=(e,n)=>f(e,n,n=>{if(!n)return"";const{mapping:r}=n;return Object(a.b)(r,t,e)});e["C_OL_MAP_"+n].getText=e=>i(e,0),e[r].getText=e=>i(e,1)}(t)})}function y(e){e.LOOP.getText=e=>d(e,h),e.LOOP_IMG.getText=e=>d(e,m),e.LOOP_INDEX.getText=e=>d(e,g),e.LOOP_NUM.getText=e=>d(e,j),e.LOOP_VAL.getText=e=>d(e,O),e.LOOP_LBL.getText=e=>d(e,v),s.a.forEach(t=>{!function(t){const n=t.split("_")[1];e["LOOP_MAP_"+n].getText=e=>d(e,n=>Object(a.b)(n.mapping,t,e))}(t)})}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return l}));var r=n(5),i=n(15);function o(e,t,n){const{question:r,option:i,exclusiveId:o}=e;let a=r.embedVarMaps;if(a||(a=r.embedVarMaps=[]),o){const e=a.find(e=>e.exclusiveId===o&&e.var_id===t.mapId);if(e)return void(e.value=n)}a.push({type:"embed",var_id:t.mapId,value:n,option_id:i&&i.uuid.toLowerCase(),exclusiveId:o})}function a(e){const{text:t,image:n,icon:r}=e;if(t)return t;if(n)return n.originName;if(r){const e=r.match(/#[^#]+$/);return e&&e[0]||""}return""}function c(e,t,n){e.referVarMaps||(e.referVarMaps=[]);const r=n.map(e=>({option_id:e.uuid.toLowerCase(),value:a(e),type:"ref",var_id:t.uuid}));e.referVarMaps=e.referVarMaps.concat(r)}function s(e,t){const n=e.casVarMaps=[];t.forEach(e=>{e.text&&n.push({type:"cascade",option_id:e.uuid.toLowerCase(),value:e.text})})}function u(e){if(e){let t=[];const n=[];return e.forEach(e=>{delete e.exclusiveId,e.option_id?t.push(e):n.push(e)}),t=function(e){let t=[];const n={};return e.forEach(e=>{const{var_id:t,value:r}=e;let i=n[t];i?(i.values.indexOf(r)<0&&i.values.push(r),i.maps.push(e)):i=n[t]={values:[r],maps:[e]}}),Object.keys(n).forEach(e=>{const r=n[e],{values:i,maps:o}=r;if(i.length>1)t=t.concat(o);else{const e=o[0];o.length>1&&(e.option_id="all"),t.push(e)}}),t}(t),n.concat(t)}return[]}function l(e,t){const{renderList:n}=e,o=[];return n.forEach(e=>{if(!Object(i.e)(e.checkMode,t))return;const{nodeUuid:n,loop:a}=e;let{embedVarMaps:c,referVarMaps:s,casVarMaps:l}=e;c=u(c),s=s||[],l=l||[];const f=c.concat(s,l);if(f.length>0){let e;f.forEach(e=>{e.value=Object(r.k)(e.value)}),a&&(e=a.replacements.map(e=>e.index)),o.push({node_id:n.toLowerCase(),loop_idxs:e,var_maps:f})}}),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=Object.keys({field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""})},function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return b})),n.d(t,"a",(function(){return h}));var r=n(39),i=n(13),o=n(16),a=n(24),c=n(6),s=n(1),u=n(41);function l(e){if(!e)return[];const t=[];return e.forEach(e=>{const n=e.reformed?e:Object(o.d)(e.id);n&&t.push(n)}),t}function f(e){const t=Object(o.d)(e.uuid);if(t)return Object(a.b)({width:t.originWidth,height:t.originHeight,name:t.serverFileName,id:t.id,originName:t.fileName})}async function d(e,t){let n=[];if(!t)return n;const r=Object(o.d)(t.uuid);if(r)return[r];if(!t)return n;if(t.value){const r=Object(i.i)(t.value);for(const t of r){const r=await d(e,Object(i.f)(e,t));n=n.concat(r)}}else{const{question:r,option:o,optionPart:a}=t;if(!r)return[];if(a){const r=(await Object(i.b)({state:e,varInfo:t,specifiedOpt:o})).map(e=>Object(c.p)(e,"image"));n=n.concat(l(r))}else n=n.concat(l(r.images))}return n}function p(e=""){return e&&"string"==typeof e?e.replace(/##(?:http|data:image).+?#(.*?)##/g,"$1"):e}function b(e=""){return e&&"string"==typeof e?e.replace(/##((?:http|data:image).+?)##/g,"$1"):e}function h(e){async function t(t,n,o){if(!t||!t.id)return[Object(a.c)(t)];if(t.reformed)return[t];if(n&&r.f(t.id))return e.LOOP_IMG.getImages(o);if("media"===t.type)return[Object(a.c)(t)];const c=o.state,s=(await d(c,Object(i.h)(c,{uuid:t.id})))[0];if(!s)return[];if(s.reformed)return[s];const{serverFileName:u,originWidth:l,originHeight:f,id:p,fileName:b}=s;return t={name:u,width:l,height:f,id:p,originName:b},[Object(a.c)(t)]}function n(e,n,r){const{varInfo:{loopNodeId:i}}=r,o=e&&e[n]||"";return"string"==typeof o?Object(s.n)([]):t(o,i,r)}e.QUES_IMAGE.getImages=async t=>{const{varInfo:{question:n,loopNodeId:o},state:c}=t,{images:s}=n;if(!s)return[];let u=[];for(const n of s)if(n.reformed)u.push(n);else if(o&&r.f(n.id)){const n=await e.LOOP_IMG.getImages(t);u=[...u,...n]}else if("media"===n.type)u.push(n);else{const e=await d(c,Object(i.h)(c,{uuid:n.id}));u=u.concat(e)}return u.map(e=>e.reformed?e:Object(a.b)({width:e.originWidth||e.width,height:e.originHeight||e.height,name:e.serverFileName||e.name,id:e.id,originName:e.originName||e.fileName}))},e.OPT_IMAGE.getImages=e=>{const{varInfo:{option:n,loopNodeId:r},specifiedOpt:i}=e,o=i||n;return t(Object(c.p)(o,"image"),r,e)},e.LOOP.getImages=e.LOOP_IMG.getImages=e=>{const{state:t,varInfo:{loopNodeId:n}}=e,i=r.d(t);if(!i)return Object(s.n)([]);const o=r.e(n,i.replacements);return o&&o.image?Object(s.n)([o.image]):Object(s.n)([])},e.OPT_ICON.getIcon=e=>e.specifiedOpt.icon,u.a.forEach(t=>{!function(t){const r=t.split("_")[1];e["OPT_MAP_"+r].getImages=e=>{const{specifiedOpt:r}=e,{mapping:i}=r;return n(i,t,e)}}(t),function(t){const r=t.split("_")[1];e["C_OPT_MAP_"+r].getImages=e=>{const{state:{context:{option:r}}}=e;if(!r)return Object(s.n)([]);const{mapping:i}=r;return n(i,t,e)}}(t),function(t){const i=t.split("_")[1],o="C_IL_MAP_"+i;function a(e,i){return r.a(e,i,r=>{if(!r)return[];const{mapping:i}=r;return n(i,t,e)})}e["C_OL_MAP_"+i].getImages=e=>a(e,0),e[o].getImages=e=>a(e,1)}(t),function(t){const i=t.split("_")[1];e["LOOP_MAP_"+i].getImages=e=>r.g(e,r=>n(r.mapping,t,e))}(t)})}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return s}));var r=n(9);let i;function o(e){if(i)return i;e.sort((e,t)=>e.Value-t.Value>0?1:-1);const t=[];let n,r;return e.forEach(e=>{const i=e.Value;i%1e4==0?(n={...e,id:i/1e4,cities:[]},t.push(n)):i%100==0?(r={...e,id:i/100,counties:[]},n.cities.push(r)):r.counties.push({...e,id:i})}),i=t,t}async function a(){if(i)return i;return o((await Object(r.p)("https://media.choiceform.com/dict/region.json")).provinces)}function c(e){if(!e)return"";const t=e.split("-"),n=t[0],r=i.find(e=>n.indexOf(e.Meaning)>-1);if(!r)return"";const o=r?r.Value+"":"",a=t[1];if(!a)return o;const c=r.cities.find(e=>a.indexOf(e.Meaning)>-1);if(!c)return o;const s=c?c.Value+"":"",u=t[2];if(!u)return s;const l=c.counties.find(e=>u.indexOf(e.Meaning)>-1);return(l?l.Value+"":"")||s||o||""}function s(e){const t=e.split(" ").map(e=>Number(e)),n=t.length,r=i[t[0]];let o,a,c=r.Meaning;return n>1&&(o=r.cities[t[1]],c+="-"+o.Meaning,n>2&&(a=o.counties[t[2]],c+="-"+a.Meaning)),c}},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(3),i=n(0),o=n(2),a=n(38),c=n(22);function s(e){const t=":"+Object(c.a)().LOOP_IMG.uuid;return e.indexOf("-0000-0000-0000-000000000000")&&(e=e.replace("-0000-0000-0000-000000000000",t)),e}function u(e){l(e),f(e)}function l(e){const{image:t,options:n}=e;t&&(t.id=s(t.id),e.images=[e.image],n&&n.forEach(e=>{e.image&&(e.image.id=s(e.image.id))}))}function f(e){const t=e;t.layout&&("cascade"===t.type?t.layout.optMarkOld="normal "+t.layout.optMark:t.layout.optMarkOld=t.layout.optMark)}function d(e,t){return e.filter(e=>e.used).map(e=>(l(e),e.destList=e.destList.filter(e=>!e.designOnly),function(e){const t=e;t.questionText=Object(a.a)(t.questionText),t.describe=Object(a.a)(t.describe);let n=[];t.options&&(n=n.concat(t.options)),t.otherOptions&&(n=n.concat(t.otherOptions)),t.optionsX&&(n=n.concat(t.optionsX)),t.optionsY&&(n=n.concat(t.optionsY)),n.forEach(e=>{e.text=Object(a.a)(e.text)})}(e),function(e,t){if(e.groupId){const n=t.find(t=>t.id===e.groupId);e.groupSingle=n&&n.singlePage}}(e,t),f(e),function(e){const t=(e,t,n)=>(n=n||e.length,e.forEach((e,r)=>{e.index=r+t,e.realIndex=e.index-n}),t+e.length),n=e;if("matrix"===n.type){const e=n.optionsX.length+n.refOptionsX.length,r=t(n.optionsX,0,e);t(n.refOptionsX,r,e);const i=n.optionsY.length+n.refOptionsY.length,o=t(n.optionsY,0,i);t(n.refOptionsY,o,i),t(n.otherOptions,0)}else if(n.options){let e=n.options.length;n.refOptions&&(e+=n.refOptions.length);const r=t(n.options,0,e);n.refOptions&&t(n.refOptions,r,e)}}(e),e))}function p(e){return e.forEach(e=>{e.value=Object(a.a)(e.value)}),e}function b(e){e.version||(Object(i.b)().error(Object(o.f)(r.a.global.upgrade)),Object(i.b)().customAbort()),e.version<2&&e.nodes.forEach(e=>{let t=[];e.options&&(t=t.concat(e.options)),e.otherOptions&&(t=t.concat(e.otherOptions)),t.forEach(e=>{10===e.mutexNumber&&(e.mutexNumber=-1)})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return p}));var r=n(1),i=n(41);const o=[{id:"ar_sa",value:"العربية"},{id:"bg_bg",value:"български"},{id:"cs_cz",value:"Česky"},{id:"da_dk",value:"Dansk"},{id:"de_de",value:"Deutsch"},{id:"el_gr",value:"Ελληνικά"},{id:"en_us",value:"English"},{id:"es_es",value:"Espanol"},{id:"et_ee",value:"Eesti"},{id:"fi_fi",value:"Suomi"},{id:"fr_fr",value:"français"},{id:"hu_hu",value:"Magyar"},{id:"it_it",value:"Italiano"},{id:"ja_jp",value:"日本語"},{id:"ko_kr",value:"한국어"},{id:"nl_nl",value:"Nederlands"},{id:"pl_pl",value:"Polski"},{id:"pt_pt",value:"Português"},{id:"ro_ro",value:"Română"},{id:"ru_ru",value:"Pусский"},{id:"sl_sl",value:"Slovenščina"},{id:"sv_se",value:"Svenska"},{id:"th_th",value:"ไทย"},{id:"zh_cn",value:"简体中文"},{id:"zh_tw",value:"繁體中文"},{id:"vi_vn",value:"Tiếng Việt Nam"}];function a(e,t){e.questionText=t.questionText||"",e.describe=t.describe||""}function c(e,t){e.mapping&&t.mapping&&i.a.forEach(n=>{const r=e.mapping[n];r&&"object"==typeof r||(e.mapping[n]=t.mapping[n]||"")})}function s(e,t){let n=[];e.options&&(n=[...n,...e.options]),e.refOptions&&(n=[...n,...e.refOptions]),e.otherOptions&&(n=[...n,...e.otherOptions]),t.options&&Object.keys(t.options).forEach(i=>{const o=n.find(e=>Object(r.s)(e.uuid)===i);o&&function(e,t,n){(function(e,t){return!e.isRef&&(!!e.isOtherOpt||!["cascade","region","area","location"].includes(t.type))})(e,n)&&(e.text=t.text||""),e.optComment=t.optComment||"",c(e,t),e.selectText=t.selectText,e.autoInputConfig&&t.autoInputConfig&&(e.autoInputConfig.defaultValue=t.autoInputConfig.defaultValue||"")}(o,t.options[i],e)})}function u(e,t){e&&t&&e.logic&&t.logic&&(e.logic.message=t.logic.message||"")}function l(e,t){a(e,t),s(e,t),u(e.validation,t.validation)}const f={};function d(e,t={}){const{nodes:n,variables:i,groups:o}=t,{nodes:a,variables:c,groups:s}=e;a&&n&&Object.keys(n).forEach(e=>{const t=n[e],i=a.find(t=>t.nodeUuid&&Object(r.s)(t.nodeUuid)===e);i&&function(e,t){const n=f[e.type];n?n(e,t):l(e,t)}(i,t)}),c&&i&&Object.keys(i).forEach(e=>{const t=i[e],n=c.find(t=>Object(r.s)(t.uuid)===e);n&&function(e,t){e.value=t.value||""}(n,t)}),s&&o&&Object.keys(o).forEach(e=>{const t=o[e],n=s.find(t=>Object(r.s)(t.id)===e);n&&function(e,t){e.prevText=t.prevText||"",e.nextText=t.nextText||""}(n,t)})}function p(e,t){e&&e.forEach(e=>{e.data.forEach(e=>{const n=e[t];n&&(e.name=n)})})}f.end=(e,t)=>{a(e,t),e.endBtnText=t.endBtnText||""},f.gift=(e,t)=>{a(e,t),e.activityName=t.activityName||"",e.endBtnText=t.endBtnText||"",e.blessings=t.questionText||""},f.loop=(e,t)=>{(t.options||e.options)&&Object.keys(t.options).forEach(n=>{const i=e.options.find(e=>Object(r.s)(e.uuid)===n);i&&(i.text=t.options[n].text)})},f.lottery=(e,t)=>{(t.options||e.options)&&Object.keys(t.options).forEach(n=>{const i=e.options.find(e=>Object(r.s)(e.uuid)===n);i&&(i.rewardName=t.options[n].rewardName)}),t.success&&(e.success.title=t.success.title||"",e.success.summary=t.success.summary||""),t.fail&&(e.fail.title=t.fail.title||"",e.fail.summary=t.fail.summary||"")},f.value_mark=(e,t)=>{l(e,t),e.minText&&(e.minText=t.minText||"",e.maxText=t.maxText||"")},f.menu=(e,t)=>{l(e,t),e.placeholder=t.placeholder||""},f.start=(e,t)=>{e.questionText=t.questionText||"",e.startName=t.startName||"",e.logoText=t.logoText||"",e.startBtnText=t.startBtnText||"",e.nextBtnText=t.nextBtnText||"",e.prevBtnText=t.prevBtnText||"",e.timeoutText=t.timeoutText||"",e.timeLessText=t.timeLessText||"",u(e.validation,t.validation)},f.slide_rate=(e,t)=>{l(e,t),(t.options||e.rateOptions)&&Object.keys(t.options).forEach(n=>{const i=e.rateOptions.find(e=>Object(r.s)(e.uuid)===n);i&&(i.text=t.options[n].text)})},f.matrix=(e,t)=>{if(a(e,t),u(e.validation,t.validation),t.options){let n=[];e.optionsX&&(n=[...n,...e.optionsX]),e.optionsY&&(n=[...n,...e.optionsY]),e.otherOptions&&(n=[...n,...e.otherOptions]);const i=e.options||[];Object.keys(t.options).forEach(e=>{const o=t.options[e],a=i.find(t=>Object(r.s)(t.uuid)===e);if(a)c(a,o);else{const t=n.find(t=>Object(r.s)(t.uuid)===e);t&&(t.text=o.text||"")}})}},f.data=(e,t)=>{s(e,t),e.options&&e.options.forEach(e=>{delete e.optComment,delete e.value})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(68),i=n(5),o=n(8),a=n(0),c=n(63),s=n(50),u=n(9),l=n(1);let f={},d=!1;const p={valid:!0,message:"",result:""};async function b(e,t,n,o,l){const{method:b,embedId:h}=t,m="embed"===b,g="fake"===b;if(Object(a.b)().realTimePreview&&!m&&!g||!function(e){const t=e.params instanceof Array;return"embed"===e.method?!(!t||!e.embedId):!(!t||!e.url)}(t))return{...p};const O=await Object(i.h)(t.url,{state:e}),j=await Object(r.b)(e,t);n&&Object.keys(n).forEach(e=>{n[e]&&(j[e]=n[e])});let v=null;if(m)v=await Object(c.a)(h,j,e);else if("fake"===b)v=await Object(s.a)(O,j,e,o,l);else{let e="GET";"post"===b&&(e="POST");const t=O+e+JSON.stringify(j);let n=l?f[t]:null;if(!n){try{const r=await Object(u.b)(Object(a.c)().dev.parseRealUrl(O),{type:e,data:j,contentType:"application/json"});n=f[t]=r}catch(t){const n=`REAL ERROR:${e} ${O} ${JSON.stringify(t)}`;throw o||Object(a.b)().error(n),n}d&&console.info({...j,url:O},n)}v=n}return v}async function h(e,t,n,r,i){const o=await b(e,t,n,r,i);return void 0===o.valid&&(o.valid=!!o.result),o.valid||o.message||(o.message="^_^"),o}async function m(e,t){try{const{request:n}=t;n&&(await b(e,n,null,!0,!1),e.endRequested=!0,o.a.trigger("END_REQ"))}catch(e){Object(l.c)(e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),i=n(1);const o={findNext(e,t){const{destList:n,output:o}=t;return Object(i.n)({node:Object(r.c)(e,n,o&&o.uuid)})}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return d}));var r=n(4),i=n(6),o=n(17),a=n(0);const c=["logic","loop","random","break_point","check","data","lottery","gift"];function s(e){return e&&"end"!==e.type}function u(e,t){let n;t=function e(t,n){if(!t)return t;const i=t.parentRandomId||t.circleNode1Id;return i&&(t=e(t=Object(r.a)(n,i),n)),t}(t,e);const{output:o,destList:a}=t,{outputN:c}=t,u=Object(i.c)(t);if(o&&(n=Object(r.c)(e,a,o.uuid)),!s(n))if(c)n=Object(r.c)(e,a,c.uuid);else if(u)for(const t of u)if(n=Object(r.c)(e,a,t.uuid),s(n))break;return n}function l(e){return!c.includes(e.type)&&!e.autoSkip}function f(e){const t=function(e){const t=e.renderList.filter(e=>l(e));return Object(o.b)(t,e.current)}(e),n=function(e,t){const{nodeList:n,current:r}=t;let i=e,o=u(n,r);for(;o;)l(o)&&(i+=1),o=u(n,o);return"end"!==r.type&&(i+=1),i}(t,e);if(-1===t)return{index:-1,fullLength:n,percent:0};return{percent:Math.round(t/n*100),fullLength:n,index:t}}function d(e){if(Object(a.c)().dev.infer)return;const{percent:t,index:n}=f(e);n>-1&&Object(a.g)(e,{progress:t})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(54),i=n(21),o=n(5),a=n(7);const c={"-1":6,"-2":8,"-3":5,"-4":7};function s(e){const{varInfo:{limit:t,limitSrc:n}}=e;return!(0===n||!t||"1:0:0"===t)}async function u(e){if(!s(e))return!0;const{varInfo:{limitSrc:t,option:n}}=e,u=e.varInfo.question,l=e.specifiedOpt||n,f=function(e,t){if(0!==t.indexOf("-"))return t;const n=t.split(":"),r=c[n[0]];n[0]=Object(a.a)(r);const i=e.options.filter(e=>e.selected).map(e=>e.number).sort();n[1]=5===r||7===r?Object(a.a)(i[i.length-1]||0):Object(a.a)(i[0]||0);return n.join(":")}(u,e.varInfo.limit),d=Object(r.a)(l,t,e),p=f.split(":"),b=Number(p[0]),h=Object(i.a)(b)?await Object(o.f)(p[1],{...e,joinBy:","}):await Object(o.g)(p[1],e),m=await Object(o.g)(p[2],e);return i.d.input(d,{markId:b,markStart:h,markEnd:m})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return f}));var r=n(0),i=n(1);let o,a={},c=!1;async function s(e,t,n,i,s){const u=e+JSON.stringify(t);if(s){const e=a[u];if(e)return e}const l=o[e];if(!l){const t="FAKE NOT FOUND:"+e;throw Object(r.b)().error(t),t}let f=null;try{if(f=await l(t,Object(r.b)()),f.exception)throw f.exception}catch(e){if(!Object(r.b)().realTimePreview){const t=`FAKE ERROR:${u} ${e.stack&&e.stack.split("\n")[0]}`;throw i||Object(r.b)().error(t),t}f={result:""}}return c&&console.info(t,f),a[u]=f,c&&console.info(JSON.stringify(t),JSON.stringify(f)),f}const u=[/^https:\/\/[^.]+\.choiceform\.com\//,/^http:\/\/localhost/];const l=[];function f(e){let t=e.fakedServers.concat(function(e){if(Object(r.b)().preview)return[];const{parsedPayload:{basicConfig:{collector:{sampler_config:t}}}}=e;return t?["committed_url","examine_failed_url","examine_skipped_url","invalid_url"].reduce((e,n)=>{const r=t[n];if(r&&0===r.indexOf("FAKE:")){const t=r.substring("FAKE:".length,r.lastIndexOf("/"));-1===e.indexOf(t)&&e.push(t)}return e},[]):[]}(e));return t=t.filter(e=>!l.includes(e)),t&&0!==t.length?new Promise((e,n)=>{const i=Object(r.c)().network.getFakeHost(),a=async c=>{i.currentSpace="",function(e){return u.some(t=>!!e.match(t))}(c)||n(new Error("can not load plugin files from untrusted site: "+c)),i.currentSpace=c;try{await Object(r.c)().network.loadFakeFile(c+".js",{crossorigin:"anonymous"})}catch(e){n(e)}return l.push(c),t.length?a(t.pop()):(o=i.fakedServers,i.currentSpace="",void e())};return a(t.pop())}):Object(i.n)()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(15),i=n(16),o=n(2),a=n(0),c=n(6),s=n(1),u=n(7),l=n(10),f=n(41),d=n(33);function p(e,t,n){const r=e&&e[t]||"";if("string"==typeof r)return r;{const{pureText:e,varInfo:{imgSize:t},specifiedOpt:o}=n;return e?o?o.text:"":Object(i.b)(r.url,t,r.originName)}}function b(e){function t(t){e["URL_KEY_"+t].getText=()=>{const e="key"+t,n=Object(l.c)()[e];return Object(s.n)(n)}}e.URL_KEY.getText=()=>{const e=Object(l.c)(),t=e.key1||e.key;return Object(s.n)(t)};for(let e=2;e<=20;e++)t(e);function n(e){const{varInfo:t,state:n}=e;let r;const i=t.question;return i&&(r=i.position&&i.position.address),r||(r=n.address),r}e.YEAR.getText=()=>Object(s.n)((new Date).getFullYear().toString()),e.MONTH.getText=()=>{const e=(new Date).getMonth()+1;return Object(s.n)(Object(d.a)(e))},e.DATE.getText=()=>{const e=(new Date).getDate();return Object(s.n)(Object(d.a)(e))},e.DAY.getText=e=>{const t=(new Date).getDay(),n="zh_cn"===e.state.language?["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][t]:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t];return Object(s.n)(n)},e.QUES_ID.getText=e=>Object(s.n)(e.state.surveyId),e.WX_ID.getText=e=>{const{state:{userInfo:t}}=e,n=t&&t.openid;return Object(s.n)(n)},e.WX_SRC.getText=()=>Object(s.n)(Object(a.c)().name),e.WX_NAME.getText=e=>{const{state:{userInfo:t}}=e,n=t&&t.nickname;return Object(s.n)(n)},e.WX_UN_ID.getText=e=>{const{state:{userInfo:t}}=e,n=t&&t.unionid;return Object(s.n)(n)},e.RES_ID.getText=e=>{const{state:t}=e;return Object(s.n)(t.transactionID)},e.CLTR_ID.getText=()=>Object(s.n)(""),e.CLTR_CODE.getText=()=>Object(a.b)().preview?Object(s.n)(""):Object(s.n)(Object(a.b)().sid),e.CLTR_NAME.getText=e=>{if(Object(a.b)().preview)return Object(s.n)("");const{state:{parsedPayload:t}}=e;if(t){const{basicConfig:{collector:{name:e}}}=t;return Object(s.n)(e)}return Object(s.n)("")},e.START_TIME.getText=e=>{const t=e.state.startTime;return Object(s.n)(Object(u.a)(t))},e.COST_TIME.getText=e=>{const t=(new Date).getTime()-e.state.startTime;return Object(s.n)(Object(u.a)(t))},e.RESULT.getText=async e=>{const{state:t}=e,n=await Object(r.b)(t,"all");return JSON.stringify(n)},e.CURR.getText=e=>{const{state:t}=e;return Object(a.b)().realTimePreview?Object(s.n)(t.language):Object(s.n)(Object(o.c)())},e.LKTP.getText=()=>{const e=Object(a.d)();return Object(s.n)(e)},e.C_OPT_TEXT.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=Object(c.p)(t,"text");return Object(s.n)(n)},e.C_OPT_NUM.getText=e=>{const{state:{context:{option:t}}}=e,n=t&&t.number;return Object(s.n)(Object(u.a)(n))},e.C_OPT_VAL.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=Object(c.p)(t,"value");return Object(s.n)(n)},e.C_OPT_LBL.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=t.label||"";return Object(s.n)(n)},e.C_OPT_IPT.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=`<input data-iptc-holder='${t.renderId}' hidden='true' />`;return Object(s.n)(n)},e.C_OPT_ASI.getText=e=>{const{state:{context:{option:t}}}=e;if(!t)return Object(s.n)("");const n=`<input data-asic-holder='${t.renderId}' hidden='true' />`;return Object(s.n)(n)},f.a.forEach(t=>{!function(t){const n=t.split("_")[1];e["C_OPT_MAP_"+n].getText=e=>{const{state:{context:{option:n}}}=e;if(!n)return Object(s.n)("");const{mapping:r}=n,i=p(r,t,e);return Object(s.n)(i)}}(t)}),e.POSITION.getText=e=>{const{state:{point:t}}=e,n=t?t.lat+","+t.lng:"";return Object(s.n)(n)},e.COUNTRY.getText=e=>{const t=n(e),r=t&&t.country;return Object(s.n)(r)},e.PROVINCE.getText=e=>{const t=n(e),r=t&&t.province;return Object(s.n)(r)},e.CITY.getText=e=>{const t=n(e);return Object(s.n)(t&&t.city)},e.DISTRICT.getText=e=>{const t=n(e);return Object(s.n)(t&&t.district)},e.QUES_IMAGE.getText=e=>{const{varInfo:t,pureText:n}=e,r=t.question,o=t.imgSize;if(n){const e=r.images.reduce((e,t)=>e+" "+t.originName,"");return Object(s.n)(e)}{const e=r.images.reduce((e,t)=>e+Object(i.b)(t.url,o,t.originName),"");return Object(s.n)(e)}},e.QUES_DESC.getText=e=>Object(s.n)(e.varInfo.question.description),e.QUES_LABEL.getText=e=>Object(s.n)(e.varInfo.question.label||""),e.QUES_TEXT.getText=e=>Object(s.n)(e.varInfo.question.title),e.QUES_NAME.getText=e=>Object(s.n)(e.varInfo.question.nodeName),e.PHONE_NUMBER.getText=e=>{const t=e.varInfo.question;return Object(s.n)(t.phoneNumber)},e.PASSWORD.getText=e=>{const t=e.varInfo.question;return Object(s.n)(t.code)},e.QUES_TIME.getText=e=>Object(s.n)(Object(u.a)(e.varInfo.question.costTime)),e.QUES_RS.getText=e=>{const t=JSON.stringify(Object(r.a)(e.varInfo.question));return Object(s.n)(t)},e.VALIDATE_FAIL_TIMES.getText=e=>{const t=e.varInfo.question.validateFailTimes+"";return Object(s.n)(t)},e.DVC_BRSN.getText=()=>{const e=Object(a.c)().system.device.browser.name||"unknown";return Object(s.n)(e)},e.DVC_BRSV.getText=()=>{const e=Object(a.c)().system.device.browser.version||"unknown";return Object(s.n)(e)},e.DVC_OSN.getText=()=>{const e=Object(a.c)().system.device.os.name||"unknown";return Object(s.n)(e)},e.DVC_OSV.getText=()=>{const e=Object(a.c)().system.device.os.version||"unknown";return Object(s.n)(e)},e.DVC_VDR.getText=()=>{const e=Object(a.c)().system.device.device.vendor||"unknown";return Object(s.n)(e)},e.DVC_MDL.getText=()=>{const e=Object(a.c)().system.device.device.model||"unknown";return Object(s.n)(e)},e.DVC_TYPE.getText=()=>{const e=Object(a.c)().system.device.device.type||"unknown";return Object(s.n)(e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(46),i=n(21),o=n(27),a=n(11),c=n(5),s=n(2),u=n(0),l=n(3),f=n(1);const d={valid:!0,message:""};async function p(e,t=!1){if(!e.parent.nextLoading&&!t)return d;e.validateFailed=!1;const{validation:n,parent:p}=e;if(!n)return d;const{request:b,logic:h,noPreventNext:m}=n;let g=await function(e,t){if(e){const{parent:n}=t;return Object(r.c)(n,e,null,!1,!1)}return Object(f.n)(d)}(b,e);return g.valid&&(g=await async function(e,t){if(e){const{logicType:n,message:r,options:o}=e;return await Object(i.b)(t,o,n)?d:{valid:!1,message:r||Object(s.f)(l.a.verify.invalidFailed)}}return d}(h,p)),g.valid||(e.validateFailed=!0,m&&(g=d,Object(a.B)(p,e)),g.dueToNode=e,await async function(e,t){if("string"!=typeof e.message)return e;const n=await Object(c.h)(e.message,{state:t});return e.message=n,Object(o.c)(e.message)||(e.message=await Object(c.d)(e.message,{state:t})),e.message.startsWith("vital:")?(e.type="vital",e.message=e.message.substr("vital:".length)):e.message.startsWith("alert:")&&(e.type="alert",e.message=e.message.substr("alert:".length)),e}(g,p),e.validateFailTimes+=1,Object(o.c)(g.message)&&(Object(u.c)().hook.beforeForceLeave(),Object(u.c)().app.openWebLink(g.message),Object(u.b)().customAbort())),g}},function(e,t,n){"use strict";n.r(t),n.d(t,"I18n",(function(){return z})),n.d(t,"EventHub",(function(){return u.a})),n.d(t,"Core",(function(){return V}));var r=n(0),i=n(5),o=n(38),a=n(44),c=n(4),s=n(18),u=n(8),l=n(2),f=n(11),d=n(45),p=n(3),b=n(29),h=n(67),m=n(9),g=n(63),O=n(1),j=n(10),v=n(16),w=n(12);let y,_;async function x(e){const t=function(e){const{mediaLibrary:t,surveyId:n,disabledLangs:r,testCases:i}=e,o=Object(a.b)(e.nodes,e.nodeGroups),s=Object(c.d)(o),u=e.langs.filter(e=>e.locale!==s.currentLang);return{imageList:t.imageList,videoList:t.videoList,nodeList:Object(a.b)(e.nodes,e.nodeGroups),theme:e.theme||{usingTheme:Object(b.b)()},nodeGroups:e.nodeGroups||[],variables:Object(a.d)(e.variables),basicConfig:_,embedApis:e.embedApis||[],varStyles:e.varStyles,surveyId:n,langs:u,language:"",langStore:null,langTable:null,langResume:!1,testCases:i,disabledLangs:r||[]}}(e),{nodeList:n,variables:i,nodeGroups:o}=t,s=t.disabledLangs,u=Object(c.d)(n),f=u.currentLang||"en_us",p=[f,...t.langs.map(e=>e.locale)],g=d.a.filter(e=>p.includes(e.id)&&!s.includes(e.id)),O=Object(l.c)(g,f),j=!!Object(r.c)().storage.get("lang-resume");if(j&&Object(r.c)().storage.remove("lang-resume"),await Object(l.g)(O),Object(l.d)(O),t.langTable=g,t.language=O,t.langResume=j,Object(d.b)(u.autoCpltGroups,O),O===f)return t;{const e=t.langs.find(e=>e.locale===O),r=await Object(m.p)(e.url),a=await Object(h.a)(r);return t.langStore=a,Object(d.c)({nodes:n,variables:i,groups:o},a),t}}async function T(){if(y)return y;const e=await async function(){const e=await Object(r.c)().dev.getCustomSummary();if(e)return e;{const e=Object(r.b)().sid;return Object(f.h)(),_||Object(m.f)(e)}}();!function(e){if(Object(r.b)().preview)return void(_=e);if(_)return;_=e;const{collector:{channel_configs:t}}=e,n=Object(r.c)().name,i=t.find(e=>e.type===n);if(i){if(!i.allow_response)throw Object(r.b)().error(Object(m.e)(m.a.interviewee_invalid_error)),new Error(m.a.interviewee_invalid_error);_.channel=i,Object(r.c)().auth.authorize(_)}else _.channel={type:n}}(e),await Object(r.c)().auth.init(e);const t=await async function(e){const t=await Object(r.c)().dev.getCustomSmallPayload();if(t)return t;{let t;try{t=await Object(m.p)(e.smaller_diagram_url)}catch(e){throw Object(r.b)().error(Object(l.f)(p.a.global.downloadError)),e}const n=await Object(h.a)(t);return Object(a.a)(n),n.langs=e.langs||[],n}}(e),n=await x(t),d=await async function(e){if(y)return y;const{imageList:t,nodeList:n,theme:i,variables:a,varStyles:f,surveyId:d,langResume:h}=e;Object(b.a)(i.usingTheme.client);const m=Object(c.d)(n),{imgScale:x,imgTransType:T,imgTransTime:k,imgPosition:S,welcomeUrl:E,startAuto:N,noWxShare:I,startName:C,qsnrName:L,questionText:A,describe:P,logoImage:R,useCustomLogo:M,logoText:D,startBtnText:U,hasVar:B,layout:q,template:F}=m;Object(v.f)({imageList:t,variables:a,varStyles:f}),Object(g.b)(e.embedApis),F&&await Object(r.c)().ui.loadUiTemplates(i.usingTheme,[F.id]);const V=await Object(s.a)({},m);let z="";if(R){const e=R.name;z=Object(r.b)().hostConfig.cdnHost+"/"+e}const{interviewee:$}=_,H=$?$.raw_data:Object(r.c)().auth.userInfo||{},X={template:F,langResume:h,langTable:e.langTable,eventHub:u.a,language:e.language||"en_us",layout:q,startNode:m,sid:Object(r.b)().sid,noWxShare:I,preview:Object(r.b)().preview,title:Object(o.a)(C||L),summary:Object(o.a)(A),description:Object(o.a)(P),images:V,surveyId:d,useCustomLogo:M,customLogo:z,customText:D||"",nextButton:U||Object(l.f)(p.a.global.start),theme:Object(b.e)(i),imgScale:x,imgPosition:S,imgTransType:T,imgTransTime:k,welcomeUrl:E,userInfo:H,hasVar:B,parsedPayload:e,startAuto:N||h,handleEvents:{handleLangChange:e=>Object(O.n)(Object(l.a)(e.id,!1)),async handleNextClick(){Object(w.m)(X,!0),await Object(r.b)().fetchSurveyState(),Object(r.c)().app.gotoSurveyPage(Object(j.c)()),Object(w.m)(X,!1)}}};return X}(n);return await async function(e){const t=e,n={state:t};e.title=await Object(i.d)(e.title,n),e.summary=await Object(i.d)(e.summary,n),e.description=await Object(i.d)(e.description,n),e.template=await Object(r.c)().ui.initNodeTemplate(e.template,t,null),Object(b.d)(e.theme),y=e,Object(u.c)({})}(d),await Object(r.c)().hook.afterFetchStart(d),(d.startAuto||Object(r.c)().dev.autoRun||Object(r.b)().liteTemplate)&&(d.hidden=!0,setTimeout(()=>{d.handleEvents.handleNextClick()})),d}var k=n(36),S=n(59),E=n(7),N=n(70),I=n.n(N);const C=()=>Object(O.n)(null),L={name:"other",dev:{parseRealUrl:e=>e,getCustomSmallPayload:C,getCustomSummary:C,local:!1,debug:!1,autoRun:!1,realtime:!1,infer:!1},app:{reload(){},openWebLink(){},canHandleReward:()=>!1,getRewardUrl:e=>Object(j.a)("https:/q.choiceform.com/reward",e)},network:{initUploader:C,connectSocket(){},closeSocket(){}},storage:null,auth:{userInfo:{},init:C,authorize(){},authorizeGift(){},retrieveAuthMeta:()=>null},hook:{afterFetchReward:C,afterFetchStart:C,afterFetchSurvey:C,afterSetup:C,beforeSetupEnd:C,beforeForceLeave(){},onLangChange(){},onSwitchPage(){},onTitleChange(){}},system:{device:{browser:{name:"",version:""},device:{type:"",vendor:"",model:""},engine:{name:"",version:""},os:{name:"",version:""}},inflate:(e,t)=>Object(O.n)(I.a.inflate(e,t)),getReferer:()=>"",getLang:()=>"en_us",functionConstructor:Function,translate(e,t){if(t){let n=t?Object(l.b)(e):e;return t&&Object.keys(t).forEach(e=>{n=n.replace(new RegExp(`{${e}}`,"g"),Object(E.a)(t[e]))}),n}return e}},ui:{setGlobalStyle(){},setVarStyle(){},initNodeTemplate:C,loadUiTemplates:C,getImageSize:()=>Object(O.n)({width:100,height:100})}};function A(e){return function e(t,n){Object.keys(n).forEach(r=>{const i=n[r];"object"==typeof i?t[r]?null!==i&&e(t[r],i):t[r]=i:void 0!==i&&(t[r]=i)})}(L,e),L}var P=n(34),R=n(57);const M={clientName:"ALL",key:"",dynamic:!1,treeUrl:"",templatePath:"",useWxSdk:!1,hostConfig:{qStaticHost:"https://media.choiceform.com/q-static-assets",sentryKey:"https://c2a21df7b3794fc6a8854f0a51e0e790@sentry.choiceform.io/8",recordUrl:"https://tracking.choiceform.com/api/records",host:"https://osapi.choiceform.com",wsHost:"wss://osapi.choiceform.com",cdnHost:"https://media.choiceform.com",publicHost:"https://public.choiceform.com",dictUrl:"https://media.choiceform.io/os-editor/assets/UploadFiles/Dictionary/Dictionary.js"},setTheme(){},locateError(){},langSrcMap:null,setLocale(){},customAbort(){},switchRoute:null,setter(e,t){Object.keys(t).forEach(n=>{e[n]=t[n]})}};var D=n(17),U=n(15);function B(e,t){const n=Object(r.b)().startState,o=[{title:Object(i.k)(n.title),description:Object(i.k)(n.description)}];return t.forEach(t=>{const n=Object(D.c)(e,t);if(!Object(c.w)(n)){const e={title:Object(i.k)(n.title),description:Object(i.k)(n.description),value:t.region||"",options:t.items?t.items.map(e=>({text:e.row_content||e.col_content?e.row_content+"-"+e.col_content:e.content,value:Object(U.c)(e).toString()})):[]};o.push(e)}}),o}var q=n(14);function F(){if(!V.initialized)throw new Error("CFCore not yet initialized")}const V={eventHub:u.a,notifySuspended:!1,util:{inflate:(e,t)=>I.a.inflate(e,t),convertVarStyle:v.a,richTextToNodes:P.d,getTaskInfo:async function(){const{surveyState:e,offlineTaskId:t}=Object(r.b)();if(!t||!e)return null;const n=await Object(U.b)(e,"all");return{result:n,progress:e.progress,nodes:B(e,n.answers)}}},registerEnv(e){const t=A(e);Object(r.f)(t),V.env=t},getTheme:()=>Object(b.c)(),async setup(e){if(V.initialized)return V;if(e.dynamic&&(!e.templatePath||!e.treeUrl))throw new Error("setup error, you configed your client as dynanmic, so must provide tempaltePath and treeUrl");Object.assign(V,function(e){const t={...M.hostConfig,...e.hostConfig};return Object.assign(M,{...e,hostConfig:t}),M}(e)),Object(r.a)(V.setter);const t=Object(j.c)(),n=t.sid;if(!n&&!Object(r.c)().dev.realtime)throw new Error("setup error, must provide sid");V.sid=n,V.realTimePreview=Object(r.c)().dev.realtime,V.liteTemplate=!!t.lite_template;const i=t.type;V.preview=V.realTimePreview||V.sid.length>30||"edit_template"===i||"preview_template"===i,V.preview&&(V.needPreviewFlag="1"!==t.ban_preview_bar),Object(p.f)(V.langSrcMap);const o=V.customAbort;V.customAbort=e=>{if(o&&o(),V.notifySuspended=!0,!e)throw new Error(" _custom_abort_ over")};const a=V.error;V.error=e=>{V.startState||V.rewardState||V.setTheme(Object(b.b)()),a(e),V.crashed=!0};const c=V.notify;return V.notify=e=>{V.notifySuspended||(V.startState||V.rewardState||V.setTheme(Object(b.b)()),c(e))},Object(r.c)().dev.debug&&(V.hostConfig.host="https://osapi.choiceform.com",V.hostConfig.cdnHost="https://media.choiceform.com"),V.hostConfig.qApiHost=V.hostConfig.host+"/q/v1",await Object(r.c)().hook.beforeSetupEnd(V),Object(r.e)(V),V.initialized=!0,await Object(l.g)(Object(l.c)()),await Object(r.c)().hook.afterSetup(V),await Object(r.c)().hook.beforeSetupEnd(V),V},async fetchStartState(e=""){F(),V.offlineTaskId=V.preview?"":e;const t=await T();return t.core=V,V.startState=t,Object(r.c)().hook.onTitleChange(t.title),t},async fetchSurveyState(){F(),V.startState&&Object(w.m)(V.startState,!0);const e=await Object(k.a)();return e.core=V,V.surveyState=e,Object(w.m)(V.startState,!1),Object(r.c)().hook.onTitleChange(e.title),e},async fetchRewardState(){F();const e=await Object(S.a)();return e.core=V,V.rewardState=e,Object(r.c)().hook.onTitleChange(e.quesTitle),e},reset(){V.offlineTaskId="",V.initialized=!1,y=null,_=null,V.startState=null,Object(k.c)(),V.surveyState=null,Object(S.c)(),V.rewardState=null,Object(j.f)(),Object(v.g)(),Object(R.a)(),Object(q.f)()}},z={mergeLangSrcMap:p.f,getLangSrcMap:p.d}},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d}));var r=n(22),i=n(7),o=n(25);function a(e){return e.selected}function c(e){return!e.selected}function s(e,t){return Object(o.b)(e,t)}function u(e,t){return!Object(o.b)(e,t)}const l=(e,t,n,r=!1)=>{if(Object(i.b)(t[n]))return NaN;const o={};e.forEach(e=>{let t=(e[n]+"").replace(/(\s| )/g,"");const r=parseFloat(t);isNaN(r)||(t=r),Object(i.b)(t)||(o[t]?o[t].push(e):o[t]=[e])});const a=Object.keys(o).sort((e,t)=>{const n=Number(e),i=Number(t);return isNaN(n)||isNaN(i)?r?e>t?1:-1:e<t?1:-1:r?n>i?1:-1:n<i?1:-1});for(let e=0;e<a.length;e++){if(o[a[e]].indexOf(t)>-1)return e+1}return NaN},f={};function d(e,t,n){const i=f[t];return i?i(function(e){let t=null;const{varInfo:n}=e,i=n.question,o=n.nodePart,{selectIds:l,unselectIds:f,inputIds:d,uninputIds:p}=function(){const e=Object(r.a)(),t=[e.CHECKED_OPTS.uuid,e.RANKED_OPTS.uuid,e.MATCHED_OPTS.uuid],n=[e.UNCHECKED_OPTS.uuid,e.UNRANKED_OPTS.uuid,e.UNMATCHED_OPTS.uuid],i=[e.INPUTTED_OPTS.uuid,e.MARKED_OPTS.uuid],o=[e.UN_INPUTTED_OPTS.uuid,e.UNMARKED_OPTS.uuid];return{selectIds:t,unselectIds:n,inputIds:i,uninputIds:o}}();o&&(l.indexOf(o.uuid)>-1?t=a:f.indexOf(o.uuid)>-1?t=c:d.indexOf(o.uuid)>-1?t=s:p.indexOf(o.uuid)>-1&&(t=u));return t?i.options.filter(e=>t(e,i)):i.options}(n),e):NaN}f[1]=(e,t)=>t.number,f[14]=(e,t)=>l(e,t,"number",!0),f[15]=(e,t)=>l(e,t,"number",!1),f[2]=(e,t)=>t.text,f[12]=(e,t)=>l(e,t,"text",!0),f[13]=(e,t)=>l(e,t,"text",!1),f[3]=(e,t)=>t.value,f[4]=(e,t)=>l(e,t,"value",!0),f[5]=(e,t)=>l(e,t,"value",!1),f[6]=(e,t)=>t.sortNo,f[7]=(e,t)=>l(e,t,"sortNo",!0),f[8]=(e,t)=>l(e,t,"sortNo",!1),f[9]=(e,t)=>t.value,f[10]=(e,t)=>l(e,t,"value",!0),f[11]=(e,t)=>l(e,t,"value",!1)},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(5),i=n(10),o=n(8),a=n(27),c=n(9),s=n(50),u=n(1),l=n(7),f=n(68);function d(e){const t=Object(l.a)(e.result);e&&Object(a.c)(t)&&setTimeout(()=>{Object(i.d)(t)})}async function p(e,t){let n="";const{parsedPayload:{basicConfig:{collector:i}}}=e;if(!i)return;const{sampler_config:o}=i;o&&(n=o[t]||"");if(!n||0!==n.indexOf("BACKEND:"))return;const a=n.replace("BACKEND:",""),c={};for(const t of a){const[n,i]=t.split("=");c[n]=await Object(r.j)(i,e)}return c}function b(e,t){const{parsedPayload:{basicConfig:{collector:{sampler_config:n}}}}=t;if(!n||!n[e])return o.a.trigger("SAMPLER_TRANSFER",{method:"ABORT"}),Object(u.n)();const a=n[e];return 0===a.indexOf("BACKEND")?Object(u.n)():0===a.trim().indexOf("http")?async function(e,t,n){const a=await Object(r.j)(n,e,!0);Object(i.d)(a),o.a.trigger("SAMPLER_TRANSFER",{method:"LINK",url:a,type:t})}(t,e,a):async function(e,t,n){const a=n.indexOf(":"),l=n.substr(0,a).toUpperCase(),p=n.substr(a+1),b=p.indexOf("?");let h=-1===b?p:p.substr(0,b);h=await Object(r.j)(h,e,!0);let m={};if(-1!==b){const t=-1===b?"":p.substr(b);if(t){m=t?Object(i.e)(t):{};const n=Object.keys(m);for(const t of n){const n=m[t].match(/^{{(.+?)}}$/);n&&(m[t]=await Object(r.b)(n[1],e))}}}if("FAKE"===l){d(await Object(s.a)(h,Object(f.a)(m,e),e,!1,!1))}else if("GET"===l||"POST"===l){const e="GET"===l?"GET":"POST";try{d(await Object(c.q)(h,{type:e,data:m}))}catch(e){Object(u.c)("数据转移接口出错"+JSON.stringify(e))}}o.a.trigger("SAMPLER_TRANSFER",{url:h,data:m,method:l,type:t})}(t,e,a)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g}));var r=n(35),i=n(4),o=n(1),a=n(0),c=n(7),s=n(26),u=n(25);const l={refresh:!1,result:!0},f={refresh:!0,result:!0},d={};function p(e,t,n){const{width:r,height:i}=t,o=n.value||"data:image/gif;base64,R0lGODlhAQABAAAAACw=";o&&Object(a.g)(e,{image:{name:void 0,ratio:Math.round(i/r*1e5)/1e5,url:o,natural:o,thumbnail:o,large:o,width:r,height:i,reformed:!0,id:"faked-id-for-upload-image",originName:"uploaded image"}})}function b(e,t){return Object(c.a)(e)!==Object(c.a)(t.value)}function h(e,t,n){return b(e,t)?(Object(a.g)(t,{value:e}),Object(s.c)(t,n),f):l}async function m(e,t,n){if(t.isOtherOpt)return h(e,t,n);{const i=d[n.type],o=i?await i(e,t,n):h(e,t,n);return o.noValidate||Object(r.b)(n,t),o}}function g(e,t,n){t.atcpTrigger=e,Object(r.b)(n,t)}d.icon_mark=(e,t,n)=>(e=e===t.value?e-1:e,Object(a.g)(t,{value:e}),Object(s.c)(t,n),Object(o.n)(f)),d.weight=(e,t,n)=>{if(!b(e,t))return Object(o.n)(l);const{options:r}=n,i=n.weightTotal,c=r.reduce((e,n)=>n!==t?e+Number(n.value):e,0),u=i-c;return e>u&&(e=u),Object(a.g)(t,{value:e}),r.forEach(e=>{const t=Number(e.value);Object(a.g)(e,{percent:t/i*100+"%"})}),Object(s.c)(t,n),Object(o.n)(f)},d.upload=async(e,t,n)=>{e||(e=Object(s.a)()),Object(a.g)(t,e),await async function(e){const{max:t}=await Object(i.g)(e),n=t===e.options.filter(t=>Object(u.b)(t,e)).length;Object(a.g)(e,{fullUploaded:n})}(n);return p(t,await Object(a.c)().ui.getImageSize(e.value),e),Object(s.c)(t,n),{refresh:!0,result:!0}},d.slide_rate=(e,t,n)=>{const r=h(e,t,n);return Object(s.c)(t,n),Object(o.n)(r)},d.fill=(e,t,n)=>{const r=h(e,t,n);return Object(o.n)(r)},d.sequence=(e,t,n)=>(Object(a.g)(t,{sortNo:e,selected:-1!==e}),Object(s.c)(t,n),Object(o.n)(f))},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return _}));var r=n(8),i=n(9),o=n(15),a=n(11),c=n(46),s=n(12),u=n(19),l=n(1),f=n(55),d=n(14),p=n(0),b=n(2),h=n(3),m=n(7);const g={valid:!0,message:""},O={valid:!1,message:""};let j=!1,v=!1,w=!1;function y(){j=!1,v=!1,w=!1}function _(e,t,n,y){const _=[];let k=y.prev;for(;k!==n;)_.push({prev:k,next:y}),k=(y=k).prev;return _.push({prev:k,next:y}),async function e(t,n,y){const _=y.pop(),k=await function(e,t,n,y){const _=n.checkMode,k=y.checkMode,S=y.type;"end"===S&&(clearInterval(e.timer),Object(p.g)(e,{limitTime:void 0}));if(Object(p.b)().preview)return Object(l.n)(t);if(_){if("end"===S)return async function(e,t,n){if(w)return O;Object(p.c)().network.closeSocket(),w=!0;const u=x(e,n);Object(s.m)(e,!0);try{const t=await Object(o.b)(e,"all","examine_skipped_url"),n=await Object(i.l)(t,e.transactionID);e.responseStatus=n.status}catch(t){const n=Object(m.a)(t&&t.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("skip提交失败 "+n),Object(p.b)().notify(Object(b.f)(h.a.global.tryAgain)),w=!1,Object(s.m)(e,!1),O)}r.a.trigger("CHECK_FAIL"),Object(p.c)().network.closeSocket();try{Object(d.b)(e),u||Object(a.f)(t,n,e),await Object(c.a)(e,n),Object(s.m)(e,!1),T(e),await Object(f.b)("examine_skipped_url",e)}catch(e){Object(l.c)("skip提交后续处理失败"+JSON.stringify(e))}return g}(e,n,y);if(!k)return async function(e){if(v)return O;v=!0,Object(s.m)(e,!0);const t=await Object(o.b)(e,"check","examine_skipped_url"),n=t.answers.length;try{const o=await Object(i.k)(t,e.transactionID);return Object(a.g)(e,n),Object(s.m)(e,!1),e.responseStatus=o.status,r.a.trigger("CHECK_SUBMIT"),g}catch(t){Object(d.b)(e),Object(s.m)(e,!1);const o=Object(i.d)(t);return o===i.a.quota_not_match||o===i.a.quota_full?(Object(a.v)(e,n),T(e),await Object(f.b)("examine_failed_url",e),e.responseStatus="examine_failed",r.a.trigger("QUOTA_FAIL"),Object(p.c)().network.closeSocket()):(v=!1,Object(l.c)(t.message),Object(p.b)().notify(Object(b.f)(h.a.global.tryAgain))),O}}(e)}if("end"===S)return async function(e,t,n){if(j)return O;Object(p.c)().network.closeSocket(),j=!0;const v=x(e,n)||function(e,t){const{renderList:n,startTime:r}=e,i=Math.ceil((Date.now()-r)/1e3),o=function(e,t){const n=Object(b.f)(h.a.global.notTarget),{minTime:r,timeLessText:i}=e;if(r&&r>t)return i||n;return""}(e,i);if(o){e.fakeCommitted=!0;const r=n[n.length-1];return Object(p.g)(r,{hasReward:!1,title:o}),Object(a.y)(t,e),!0}return!1}(e,n);Object(s.m)(e,!0);const w=await Object(o.b)(e,"normal","committed_url");let y;try{y=await Object(i.m)(w,e.transactionID);const t=y.response||y;e.responseStatus=t.status}catch(t){const n=Object(m.a)(t&&t.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("正式提交失败 "+n),Object(p.b)().notify(Object(b.f)(h.a.global.tryAgain)),Object(s.m)(e,!1),j=!1,O)}e.formalResult=y;try{await Object(c.a)(e,n),v?await Object(f.b)("invalid_url",e):(Object(a.i)(n,e,w.answers.length,y),y.reward&&Object(p.g)(n,{hasReward:!0}),await function(e,t){const{formalResult:{reward:n}}=t;if(!n||"red_envelope"!==n.type||n.lottery_id||Object(p.c)().app.canHandleReward())return Object(l.n)();return Object(u.a)(t,e)}(n,e),await Object(f.b)("committed_url",e))}catch(e){Object(l.c)("正式提交后续处理错误"+JSON.stringify(e))}return Object(d.b)(e),Object(s.m)(e,!1),T(e),r.a.trigger("FULL_SUBMIT"),await e.dynamicStateProps(),g}(e,0,y);return Object(l.n)(t)}(t,n,_.prev,_.next);return 0===y.length||"vital"===k.type?k:e(t,k,y)}(e,t,_)}function x(e,t){const{oneReplyPerTerminal:n,sid:r}=e;return!!t.abandonAnswer&&(e.fakeCommitted=!0,Object(a.a)(t,e),n&&Object(p.c)().storage.set(r,"1"),!0)}function T(e){const{oneReplyPerTerminal:t,sid:n}=e;t&&Object(p.c)().storage.set(n,"1")}},function(e,t,n){"use strict";n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(43),i=n(6),o=n(62),a=n(66),c=n(35),s=n(28),u=n(0),l=n(26);function f(e,t,n,r){e&&(Object(u.g)(e,{selected:!0}),t.forEach(t=>{t!==e&&Object(u.g)(t,{selected:!1})})),Object(u.g)(r,{value:n})}const d={};function p(e,t){const n=d[t.type],r=n?n(e,t):s.a;return r.noValidate||Object(c.b)(t),r}function b(e){return e.failed=!0,e.succeed=!1,e.failedSkip&&(e.failedSkipActivated=!0,e.autoSkip=!0),s.c}d.region=(e,t)=>{t.indexes=e;const n=Object(i.c)(t),a=Object(r.c)(e);f(Object(o.b)(n,a),n,a,t);const c=a.split("-"),u={country:"",province:c[0]||"",city:c[1]||"",district:c[2]||""};return t.parent.address=u,t.position={address:u},s.c},d.location=(e,t)=>{t.succeed=!0,t.failed=!1,t.failedSkipActivated=!1;const n=Object(a.b)(e.address,"-",t.infoRange),r=Object(i.c)(t);return f(Object(o.b)(r,n),r,n,t),Object(u.g)(t.parent,{point:e.point,address:e.address}),t.position=e,s.c},d.area=(e,t)=>{t.succeed=!0,t.failed=!1,t.failedSkipActivated=!1;const n=Object(a.b)(e.address,"-","street"),r=Object(i.c)(t);return f(Object(o.a)(r,e.point),r,n,t),Object(u.g)(t.parent,{point:e.point,address:e.address}),t.position=e,s.c},d.verify=(e,t)=>(Object(u.g)(t,e),{...s.c,noValidate:!0}),d.gift=(e,t)=>(Object(u.g)(t,e),s.d),d.heat_map=(e,t)=>{const n={x:Math.round(e.x),y:Math.round(e.y)},{options:r}=t,i=r[t.clickTimes%r.length];return Object(u.g)(i,{point:n,value:JSON.stringify(n)}),t.clickTimes+=1,Object(l.c)(i,t),s.d}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return _})),n.d(t,"a",(function(){return x}));var r=n(4),i=n(24),o=n(33),a=n(18),c=n(5),s=n(10),u=n(1),l=n(0),f=n(2),d=n(28),p=n(58),b=n(8),h=n(11),m=n(3),g=n(29),O=n(9),j=n(64);let v=null;function w(){return JSON.parse(Object(l.c)().storage.get("theme")||"null")||Object(g.b)()}async function y(e,t,n=!1){let s;s=Object(l.b)().preview||!e.formalResult.reward?{}:e.formalResult.reward;const d=!!s.id||Object(l.b)().preview;let p,b,h={},g="",O={},j=1e3;if("gift"===t.type)p=t;else{const o=s.gift_id&&s.gift_id.toUpperCase();if(b=t,o)p=Object(r.a)(e.nodeList,o),g=((e,t,n)=>{if(!t)return"";const i=t.destList,o=t.options.find(t=>{const o=Object(r.c)(e,i,t.uuid);return Object(u.l)(o.nodeUuid,n)});return o?o.rewardName:""})(e.nodeList,b,p.nodeUuid);else{if(n)p={};else{const n=t.destList[0].destInputId;p=Object(r.b)(e.nodeList,n)}g=t.options[0].rewardName}O=((e,t,n=!1)=>{if(!t)return{};const r=Object(l.b)().realTimePreview?"":n?Object(f.f)(m.a.lottery.congratulation):Object(f.f)(m.a.lottery.pity),o=Object(l.b)().realTimePreview?"":n?Object(f.f)(m.a.lottery.goal):Object(f.f)(m.a.lottery.fail),a=n?t.success.imageWidth:t.fail.imageWidth,c=n?t.success.imageHeight:t.fail.imageHeight,s=n?t.success.imageName:t.fail.imageName,u={rewardTitle:(n?t.success.title:t.fail.title)||r,rewardDescribe:(n?t.success.summary:t.fail.summary)||o};return s&&(u.rewardImage=Object(i.b)({width:a,height:c,name:s,id:"",originName:""})),u})(0,b,d),j=((e,t,n,i=!1)=>{if(!t)return 1e3;const o=t.options,a=i?o[0]:o.find(i=>{const o=Object(r.c)(e.nodeList,t.destList,i.uuid);return Object(u.l)(o.nodeUuid,n.nodeUuid)});return a?a.rewardCount:1e3})(e,b,p,n)}if(d){const t=await Object(c.d)(p.activityName,{state:e}),n=await Object(c.d)(p.blessings,{state:e}),r=await Object(c.d)(p.describe,{state:e}),i=await Object(c.h)(p.linkUrl,{state:e});let u=s.code;u||!0!==p.needVerification||(u="1234567890"),h={goal:!0,goalId:s.id,origin:p,...p,...h,noWxShare:e.noWxShare,wxShareInfo:e.wxShareInfo,quesTitle:e.title,quesType:"reward",images:await Object(a.a)(e,p),rewardName:g,activityName:t,blessings:n,describe:r,linkUrl:i,endBtnText:p.endBtnText,rewardCount:p.giftCount,lotteryCount:j,sendTime:Object(o.c)(),verifyCode:u,rewardNodeId:p.nodeUuid,logoUrl:"",transactionID:e.transactionID,surveyId:e.surveyId,title:e.title,companyID:e.companyID,useCustomLogo:e.useCustomLogo,customText:e.customText,customLogo:e.customLogo,...O}}else h={goal:!1,...O};return Object(l.g)(e,{rewardInfo:h}),n||Object(l.c)().storage.set("reward_info",JSON.stringify(h)),h}function _(){v=null}async function x(){if(v)return v;let e;const t=w();Object(g.a)(t.client);const n=Object(s.c)();let r=function(e){const{rid:t,rtpl:n}=e;let r={};if(t)r={quesTitle:"",rewardType:"red_envelope",goalId:e.rid,images:[]};else{const e=Object(l.c)().storage.get("reward_info")||"null";r=JSON.parse(e),r.rewardType=r.giftType}n&&(r.template={id:n,name:"",component:null});return r}(n);const{rewardType:i,goalId:a}=r,c=n.code;if("red_envelope"===i){!n.rid||n.code||Object(l.b)().preview||(Object(l.c)().auth.authorizeGift(n.aid,n.cid,n),Object(l.b)().customAbort());const t=await Object(O.h)({code:c},a),{recipient:i}=t;n.rid&&(r=function(e,t,n){const{gift:r,amount:i,type:a}=t,{config:{gift_name:c}}=r;return{...e,surveyId:n.qid,transactionID:n.tid,nodeUuid:r.id,origin:{giftType:a},rewardCount:i/100,activityName:c,blessings:r.title,title:r.title,summary:r.description,describe:r.description,sendTime:Object(o.c)()}}(r,t,n));const s=i;c&&Object(l.c)().storage.set("gift-"+c,JSON.stringify(t)),Object(h.j)(r,{...r,userInfo:s});e={...await T(r),wechatImage:s.headimgurl,wechatID:s.nickname}}else e=await T(r);return v=e,await Object(l.c)().hook.afterFetchReward(e),e}async function T(e){const t=e.origin.giftType;let n=!1,r="",i="";"custom"===t?(n=!0===e.origin.needSendNote,r=e.verifyCode):i=e.rewardCount+" 元";const o=Object(l.c)().storage.get("language")||"en_us",a=w();e.template&&await Object(l.c)().ui.loadUiTemplates(a,[e.template.id]),await Object(f.g)(o),Object(f.d)(o),Object(g.d)(a);const c={...e,wechatID:"",wechatImage:"",eventHub:b.a,language:o,theme:a,rewardName:e.activityName,title:e.blessings,description:e.describe,summary:e.describe,nodeType:"reward",quesType:"reward",icon:"present-gift",rewardType:t,rewardTime:e.sendTime,rewardValue:i,rewardToMessage:n,qrCode:r,prevButton:Object(l.b)().preview&&!Object(l.b)().realTimePreview?Object(f.f)(m.a.global.backTest):"",nextButton:e.linkUrl&&(e.endBtnText||Object(f.f)(m.a.global.go)),handleEvents:{...j.a,handlePrevClick:()=>(Object(l.c)().app.gotoStartPage(Object(s.c)()),Object(u.n)()),handleOptionClick:async(e,t)=>(await Object(d.b)(e,t)).result,handleQuestionInput(e,t){const n=Object(p.b)(e,t);return Object(u.n)(n.result)},handleNextClick:()=>(e.linkUrl&&Object(s.d)(e.linkUrl),Object(u.n)())}};return c.template=await Object(l.c)().ui.initNodeTemplate(e.template,c,null),c}},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return f})),n.d(t,"c",(function(){return p}));var r=n(4),i=n(1),o=n(47),a=n(18),c=n(31),s=n(5),u=n(6);async function l(e,t){const n=await Object(a.e)(e,t,null,!0);return Object(c.b)(t,n)}function f(e,t,n=!1){const{loopStack:r}=t;return r.find((t,o)=>(!n||o===r.length-1)&&Object(i.l)(t.node.nodeUuid,e.nodeUuid))}async function d(e,t,n,r,i,o){const a=Object(u.i)(i),c={state:e,usage:{question:t,option:i}},l=await Object(s.f)(a.text,c,"WRAPPED_URL"),f=await Object(s.f)(i.text,c,"WRAPPED_URL"),d=await Object(s.f)(a.value+"",c,"WRAPPED_URL");return{loopNodeId:n,outerIndex:o&&o.currentIndex,outerLoopId:o&&o.node.nodeUuid,index:r,uuid:i.uuid,refOptId:i.refOptId,refText:l||void 0,text:f||"",value:d,number:a.number,image:a.image,label:i.label,mapping:i.isRef?a.mapping:i.mapping}}const p={_skip:(e,t,n)=>o.a.findNext(e,t,n),async _init(e,t,n){const{varList:o,loopStart:a,destList:c}=t;if(0===o.length)return p._skip(e,t,n);const{loopStack:s}=n,u=c.find(e=>Object(i.l)(e.selfPortId,a.uuid)).destInputId,l=Object(r.b)(e,u),f=o[0],{origin:b}=t,h=s[s.length-1],m=await d(n,t,b.nodeUuid,0,f,h),g={destInputId:u,node:b,varList:o,replacements:h?[...h.replacements,m]:[m],currentIndex:0};return s.push(g),{node:l,loop:Object(i.b)(g),loopStack:Object(i.b)(s)}},async _increase(e,t,n){const{nodeUuid:o}=t,{loopStack:a}=n,c=a[a.length-1],{varList:s,replacements:u,destInputId:l}=c,f=c.currentIndex+=1,p=s[f],b=a[a.length-2],h=await d(n,t,o,f,p,b),m=Object(r.b)(e,l);return u[u.length-1]=h,{node:m,loop:Object(i.b)(c),loopStack:Object(i.b)(a)}},async _end(e,t,n){const{loopStack:r}=n;r.pop();const a=await o.a.findNext(e,t,n);if(r.length>0){const e=Object(i.b)(r);a.loop=e[e.length-1],a.loopStack=e}return a},findNext(e,t,n){const r=f(t,n,!0);if(r){const{currentIndex:i,varList:o}=r;return i===o.length-1?p._end(e,t,n):p._increase(e,t,n)}return p._init(e,t,n)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));function r(e,t){return e.endsWith(".svg")?e:e+t}function i(e=[]){const t=[];return e.includes("video")&&t.push("video/*"),e.includes("audio")&&t.push("audio/*"),e.includes("image")&&t.push("image/*"),e.includes("doc")&&t.push("text/plain","application/json","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv",".docx",".pdf",".log"),t.join()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var r=n(66);function i(e,t){return e.find(e=>e.radius>=Object(r.a)(t,{lng:e.longitude,lat:e.latitude}))||e[e.length-1]}function o(e,t){if(0===e.length)return;const n=t.split("-");return e.find(e=>e.text.split("-").every((e,t)=>{const r=n[t];return!!(r&&r.indexOf(e)>-1)}))||e[e.length-1]}function a(e,t){const n=t.map(e=>e.Meaning).indexOf(e[0]);let r=String(n);const i=t[n];if(e[1]&&i){const t=i.cities.map(e=>e.Meaning).indexOf(e[1]);r+=" "+t;const n=i.cities[t];if(e[2]&&n){r+=""+n.counties.map(e=>e.Meaning).indexOf(e[1])}}return r}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s}));var r=n(0),i=n(65);let o=[];function a(e){let t,n=e.code.replace(/<br>/g,"");n=`(function(){ /* embedApi.${e.name} */ ${n}})()`;try{return t=Object(i.a)(n,!0),t}catch(e){return()=>({result:"",message:""})}}function c(e){e&&(e.forEach(e=>{e.fn=a(e)}),o=e)}async function s(e,t,n){const i=function(e){const t=o.find(t=>t.id===e);return t?(t.fn||(t.fn=a(t)),t.fn):null}(e);let c;try{c=await i(t,Object(r.b)())}catch(t){const n=`EMBED ERROR:${function(e){const t=o.find(t=>t.id===e);return t?t.name:e}(e)} ${t.stack&&t.stack.split("\n")[0]}`;Object(r.b)().error(n)}return c}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r={handleInputPhone(e,t){return this.handleQuestionInput({phoneNumber:e},t)},handleInputCode(e,t){return this.handleQuestionInput({code:e},t)},handleAutoLocate(e,t){return this.handleQuestionInput(e,t)},handleManualLocate(e,t){return this.handleQuestionInput(e,t)},handleGetCodeClick(e){return this.handleOptionClick(null,e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return new(0,Object(r.c)().system.functionConstructor)(`${t?"return":""} ${e}`)()}},function(e,t,n){"use strict";function r(e,t="-",n="street"){let r=e.province;return"province"!==n&&e.city&&(r+=t+e.city,"city"!==n&&e.district&&(r+=t+e.district,"county"!==n&&(e.street&&(r+=t+e.street),e.street_number&&(r+=e.street_number)))),r}function i(e){return e*(Math.PI/180)}function o(e,t){const n=i(t.lat-e.lat),r=i(t.lng-e.lng),o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(i(e.lat))*Math.cos(i(t.lat))*Math.sin(r/2)*Math.sin(r/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))*1e3}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);async function i(e){if("string"==typeof e){const t=Object(r.c)().system.decodeBase64(e),n=await Object(r.c)().system.inflate(t,{to:"string"});return JSON.parse(n)}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(5),i=n(0);function o(e,t){return{_LANG_:t.language,_LINK_TYPE_:Object(i.d)(),_IS_INFER_:Object(i.c)().dev.infer?"Y":"",...e}}async function a(e,t){const{params:n}=t,i={};for(const t of n){const{name:n,value:o}=t;n.startsWith("_url_")?i[n]=await Object(r.h)(o,{state:e}):n.startsWith("_html_")?i[n]=await Object(r.d)(o,{state:e},!0):i[n]=await Object(r.f)(o,{state:e,joinBy:","},"URL")}return o(i,e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const r={actions:[]};function i(e){r.actions.push(e)}},function(e,t,n){e.exports=function e(t,n,r){function i(a,c){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},a={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],2:[function(e,t,n){"use strict";var r=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),c=0;c<256;c++)a[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;function s(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,o,a,c=e.length,s=0;for(o=0;o<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<c&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(s),a=0,o=0;a<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<c&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},n.buf2binstring=function(e){return s(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,o,c=t||e.length,u=new Array(2*c);for(r=0,n=0;n<c;)if((i=e[n++])<128)u[r++]=i;else if((o=a[i])>4)u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<c;)i=i<<6|63&e[n++],o--;o>1?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return s(u,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],4:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var c=i;c<a;c++)e=e>>>8^o[255&(e^t[c])];return-1^e}},{}],6:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,n){"use strict";t.exports=function(e,t){var n,r,i,o,a,c,s,u,l,f,d,p,b,h,m,g,O,j,v,w,y,_,x,T,k;n=e.state,r=e.next_in,T=e.input,i=r+(e.avail_in-5),o=e.next_out,k=e.output,a=o-(t-e.avail_out),c=o+(e.avail_out-257),s=n.dmax,u=n.wsize,l=n.whave,f=n.wnext,d=n.window,p=n.hold,b=n.bits,h=n.lencode,m=n.distcode,g=(1<<n.lenbits)-1,O=(1<<n.distbits)-1;e:do{b<15&&(p+=T[r++]<<b,b+=8,p+=T[r++]<<b,b+=8),j=h[p&g];t:for(;;){if(p>>>=v=j>>>24,b-=v,0==(v=j>>>16&255))k[o++]=65535&j;else{if(!(16&v)){if(0==(64&v)){j=h[(65535&j)+(p&(1<<v)-1)];continue t}if(32&v){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&j,(v&=15)&&(b<v&&(p+=T[r++]<<b,b+=8),w+=p&(1<<v)-1,p>>>=v,b-=v),b<15&&(p+=T[r++]<<b,b+=8,p+=T[r++]<<b,b+=8),j=m[p&O];n:for(;;){if(p>>>=v=j>>>24,b-=v,!(16&(v=j>>>16&255))){if(0==(64&v)){j=m[(65535&j)+(p&(1<<v)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(y=65535&j,b<(v&=15)&&(p+=T[r++]<<b,(b+=8)<v&&(p+=T[r++]<<b,b+=8)),(y+=p&(1<<v)-1)>s){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=v,b-=v,y>(v=o-a)){if((v=y-v)>l&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(_=0,x=d,0===f){if(_+=u-v,v<w){w-=v;do{k[o++]=d[_++]}while(--v);_=o-y,x=k}}else if(f<v){if(_+=u+f-v,(v-=f)<w){w-=v;do{k[o++]=d[_++]}while(--v);if(_=0,f<w){w-=v=f;do{k[o++]=d[_++]}while(--v);_=o-y,x=k}}}else if(_+=f-v,v<w){w-=v;do{k[o++]=d[_++]}while(--v);_=o-y,x=k}for(;w>2;)k[o++]=x[_++],k[o++]=x[_++],k[o++]=x[_++],w-=3;w&&(k[o++]=x[_++],w>1&&(k[o++]=x[_++]))}else{_=o-y;do{k[o++]=k[_++],k[o++]=k[_++],k[o++]=k[_++],w-=3}while(w>2);w&&(k[o++]=k[_++],w>1&&(k[o++]=k[_++]))}break}}break}}while(r<i&&o<c);r-=w=b>>3,p&=(1<<(b-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<c?c-o+257:257-(o-c),n.hold=p,n.bits=b}},{}],8:[function(e,t,n){"use strict";var r=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),c=e("./inftrees");function s(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):-2}function d(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,f(e))):-2}function p(e,t){var n,r;return e?(r=new u,e.state=r,r.window=null,0!==(n=d(e,t))&&(e.state=null),n):-2}var b,h,m=!0;function g(e){if(m){var t;for(b=new r.Buf32(512),h=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(c(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;c(2,e.lens,0,32,h,0,e.work,{bits:5}),m=!1}e.lencode=b,e.lenbits=9,e.distcode=h,e.distbits=5}function O(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=f,n.inflateReset2=d,n.inflateResetKeep=l,n.inflateInit=function(e){return p(e,15)},n.inflateInit2=p,n.inflate=function(e,t){var n,u,l,f,d,p,b,h,m,j,v,w,y,_,x,T,k,S,E,N,I,C,L,A,P=0,R=new r.Buf8(4),M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(n=e.state).mode&&(n.mode=13),d=e.next_out,l=e.output,b=e.avail_out,f=e.next_in,u=e.input,p=e.avail_in,h=n.hold,m=n.bits,j=p,v=b,C=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(2&n.wrap&&35615===h){n.check=0,R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0),h=0,m=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&h)){e.msg="unknown compression method",n.mode=30;break}if(m-=4,I=8+(15&(h>>>=4)),0===n.wbits)n.wbits=I;else if(I>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<I,e.adler=n.check=1,n.mode=512&h?10:12,h=0,m=0;break;case 2:for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(n.flags=h,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0)),h=0,m=0,n.mode=3;case 3:for(;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.head&&(n.head.time=h),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,n.check=o(n.check,R,4,0)),h=0,m=0,n.mode=4;case 4:for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0)),h=0,m=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&(R[0]=255&h,R[1]=h>>>8&255,n.check=o(n.check,R,2,0)),h=0,m=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((w=n.length)>p&&(w=p),w&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,u,f,w,I)),512&n.flags&&(n.check=o(n.check,u,w,f)),p-=w,f+=w,n.length-=w),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;w=0;do{I=u[f+w++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I))}while(I&&w<p);if(512&n.flags&&(n.check=o(n.check,u,w,f)),p-=w,f+=w,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===p)break e;w=0;do{I=u[f+w++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I))}while(I&&w<p);if(512&n.flags&&(n.check=o(n.check,u,w,f)),p-=w,f+=w,I)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(h!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}h=0,m=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}e.adler=n.check=s(h),h=0,m=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=d,e.avail_out=b,e.next_in=f,e.avail_in=p,n.hold=h,n.bits=m,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){h>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}switch(n.last=1&h,m-=1,3&(h>>>=1)){case 0:n.mode=14;break;case 1:if(g(n),n.mode=20,6===t){h>>>=2,m-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}h>>>=2,m-=2;break;case 14:for(h>>>=7&m,m-=7&m;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&h,h=0,m=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(w=n.length){if(w>p&&(w=p),w>b&&(w=b),0===w)break e;r.arraySet(l,u,f,w,d),p-=w,f+=w,b-=w,d+=w,n.length-=w;break}n.mode=12;break;case 17:for(;m<14;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(n.nlen=257+(31&h),h>>>=5,m-=5,n.ndist=1+(31&h),h>>>=5,m-=5,n.ncode=4+(15&h),h>>>=4,m-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.lens[M[n.have++]]=7&h,h>>>=3,m-=3}for(;n.have<19;)n.lens[M[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},C=c(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,C){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;T=(P=n.lencode[h&(1<<n.lenbits)-1])>>>16&255,k=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(k<16)h>>>=x,m-=x,n.lens[n.have++]=k;else{if(16===k){for(A=x+2;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(h>>>=x,m-=x,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}I=n.lens[n.have-1],w=3+(3&h),h>>>=2,m-=2}else if(17===k){for(A=x+3;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}m-=x,I=0,w=3+(7&(h>>>=x)),h>>>=3,m-=3}else{for(A=x+7;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}m-=x,I=0,w=11+(127&(h>>>=x)),h>>>=7,m-=7}if(n.have+w>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;w--;)n.lens[n.have++]=I}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},C=c(1,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,C){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},C=c(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,C){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(p>=6&&b>=258){e.next_out=d,e.avail_out=b,e.next_in=f,e.avail_in=p,n.hold=h,n.bits=m,a(e,v),d=e.next_out,l=e.output,b=e.avail_out,f=e.next_in,u=e.input,p=e.avail_in,h=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;T=(P=n.lencode[h&(1<<n.lenbits)-1])>>>16&255,k=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(T&&0==(240&T)){for(S=x,E=T,N=k;T=(P=n.lencode[N+((h&(1<<S+E)-1)>>S)])>>>16&255,k=65535&P,!(S+(x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}h>>>=S,m-=S,n.back+=S}if(h>>>=x,m-=x,n.back+=x,n.length=k,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=12;break}if(64&T){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(A=n.extra;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(P=n.distcode[h&(1<<n.distbits)-1])>>>16&255,k=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(0==(240&T)){for(S=x,E=T,N=k;T=(P=n.distcode[N+((h&(1<<S+E)-1)>>S)])>>>16&255,k=65535&P,!(S+(x=P>>>24)<=m);){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}h>>>=S,m-=S,n.back+=S}if(h>>>=x,m-=x,n.back+=x,64&T){e.msg="invalid distance code",n.mode=30;break}n.offset=k,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(A=n.extra;m<A;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===b)break e;if(w=v-b,n.offset>w){if((w=n.offset-w)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}w>n.wnext?(w-=n.wnext,y=n.wsize-w):y=n.wnext-w,w>n.length&&(w=n.length),_=n.window}else _=l,y=d-n.offset,w=n.length;w>b&&(w=b),b-=w,n.length-=w;do{l[d++]=_[y++]}while(--w);0===n.length&&(n.mode=21);break;case 26:if(0===b)break e;l[d++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===p)break e;p--,h|=u[f++]<<m,m+=8}if(v-=b,e.total_out+=v,n.total+=v,v&&(e.adler=n.check=n.flags?o(n.check,l,v,d-v):i(n.check,l,v,d-v)),v=b,(n.flags?h:s(h))!==n.check){e.msg="incorrect data check",n.mode=30;break}h=0,m=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===p)break e;p--,h+=u[f++]<<m,m+=8}if(h!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}h=0,m=0}n.mode=29;case 29:C=1;break e;case 30:C=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=d,e.avail_out=b,e.next_in=f,e.avail_in=p,n.hold=h,n.bits=m,(n.wsize||v!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&O(e,e.output,e.next_out,v-e.avail_out)?(n.mode=31,-4):(j-=e.avail_in,v-=e.avail_out,e.total_in+=j,e.total_out+=v,n.total+=v,n.wrap&&v&&(e.adler=n.check=n.flags?o(n.check,l,v,e.next_out-v):i(n.check,l,v,e.next_out-v)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===j&&0===v||4===t)&&0===C&&(C=-5),C)},n.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:(n.head=t,t.done=!1,0):-2},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,t,r,0)!==n.check?-3:O(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,n){"use strict";var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,s,u,l,f,d){var p,b,h,m,g,O,j,v,w,y=d.bits,_=0,x=0,T=0,k=0,S=0,E=0,N=0,I=0,C=0,L=0,A=null,P=0,R=new r.Buf16(16),M=new r.Buf16(16),D=null,U=0;for(_=0;_<=15;_++)R[_]=0;for(x=0;x<s;x++)R[t[n+x]]++;for(S=y,k=15;k>=1&&0===R[k];k--);if(S>k&&(S=k),0===k)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(T=1;T<k&&0===R[T];T++);for(S<T&&(S=T),I=1,_=1;_<=15;_++)if(I<<=1,(I-=R[_])<0)return-1;if(I>0&&(0===e||1!==k))return-1;for(M[1]=0,_=1;_<15;_++)M[_+1]=M[_]+R[_];for(x=0;x<s;x++)0!==t[n+x]&&(f[M[t[n+x]]++]=x);if(0===e?(A=D=f,O=19):1===e?(A=i,P-=257,D=o,U-=257,O=256):(A=a,D=c,O=-1),L=0,x=0,_=T,g=l,E=S,N=0,h=-1,m=(C=1<<S)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){j=_-N,f[x]<O?(v=0,w=f[x]):f[x]>O?(v=D[U+f[x]],w=A[P+f[x]]):(v=96,w=0),p=1<<_-N,T=b=1<<E;do{u[g+(L>>N)+(b-=p)]=j<<24|v<<16|w|0}while(0!==b);for(p=1<<_-1;L&p;)p>>=1;if(0!==p?(L&=p-1,L+=p):L=0,x++,0==--R[_]){if(_===k)break;_=t[n+f[x]]}if(_>S&&(L&m)!==h){for(0===N&&(N=S),g+=T,I=1<<(E=_-N);E+N<k&&!((I-=R[E+N])<=0);)E++,I<<=1;if(C+=1<<E,1===e&&C>852||2===e&&C>592)return 1;u[h=L&m]=S<<24|E<<16|g-l|0}}return 0!==L&&(u[g+L]=_-N<<24|64<<16|0),d.bits=S,0}},{"../utils/common":1}],10:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,n){"use strict";var r=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),c=e("./zlib/messages"),s=e("./zlib/zstream"),u=e("./zlib/gzheader"),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(c[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(c[n])}function d(e,t){var n=new f(t);if(n.push(e,!0),n.err)throw n.msg||c[n.err];return n.result}f.prototype.push=function(e,t){var n,c,s,u,f,d=this.strm,p=this.options.chunkSize,b=this.options.dictionary,h=!1;if(this.ended)return!1;c=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(n=r.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&b&&(n=r.inflateSetDictionary(this.strm,b)),n===a.Z_BUF_ERROR&&!0===h&&(n=a.Z_OK,h=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==a.Z_STREAM_END&&(0!==d.avail_in||c!==a.Z_FINISH&&c!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(s=o.utf8border(d.output,d.next_out),u=d.next_out-s,f=o.buf2string(d.output,s),d.next_out=u,d.avail_out=p-u,u&&i.arraySet(d.output,d.output,s,u,0),this.onData(f)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(h=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(c=a.Z_FINISH),c===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):c!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=f,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")},function(e,t,n){"use strict";n.d(t,"a",(function(){return _})),n.d(t,"b",(function(){return T}));var r=n(4);function i(e,t,n,i,o){return o||(o=Object(r.c)(e,t,n.uuid)),o||i.parentRandomId||t.length&&(o=Object(r.b)(e,t[t.length-1].destInputId)),o}var o=n(6),a=n(1);const c=["weight","slide_rate","upload","value_mark","icon_mark","fill","sequence"],s={findNext(e,t){const{destList:n,output:s}=t,u=c.indexOf(t.type)>-1?t.otherOptions:Object(o.c)(t),l=u&&u.find(e=>e.selected),f=l&&Object(r.c)(e,n,l.uuid);return Object(a.n)({node:i(e,n,s,t,f)})}},u={async findNext(e,t,n){const{destList:i}=t,a=Object(o.j)(t);let c=a&&Object(r.c)(e,i,a.uuid);return c||(c=(await s.findNext(e,t,n)).node),c||!i.length||t.parentRandomId||(c=Object(r.b)(e,i[0].destInputId)),{node:c}}};var l=n(47),f=n(21);const d={async findNext(e,t){const{options:n,logicType:i,output:o,outputN:a,destList:c,parent:s}=t,u=await Object(f.b)(s,n,i);t.logicResult=u;const l=u?o:a;return{node:Object(r.c)(e,c,l.uuid)}}};var p=n(14);function b(e,t){const{destList:n,randomStart:i}=t,o={};n.forEach((t,n)=>{if(Object(a.l)(t.selfPortId,i.uuid)){const i=Object(r.b)(e,t.destInputId).groupNumber||"N/A_"+n,c=o[i];if(c){const e=Object(a.f)(c.length+1);c.splice(e,0,t.destInputId)}else o[i]=[t.destInputId]}});const c=function(e,t){const{customDestCount:n}=t;if(!n||n>=e.length)return e;for(;e.length>n;)e.splice(Object(a.f)(e.length),1);return e}(Object.keys(o),t);let s=[];for(;c.length>0;){const e=Object(a.f)(c.length);s=s.concat(o[c[e]]),c.splice(e,1)}return s}const h={_init(e,t,n){const{origin:i}=t;let o=b(e,t);!function(e,t){const{customNodeCount:n,parent:{nodeList:i},origin:o}=t;o.csNcDone||n&&(e.forEach(e=>{const t=[];let o=Object(r.b)(i,e);for(;o;)t.push(o),o=Object(r.c)(i,o.destList,o.output.uuid);for(;t.length>n;){const e=Object(a.f)(t.length);t[e].randomAbandoned=!0,t.splice(e,1)}}),o.csNcDone=!0)}(o,t),o=Object(p.h)(o,t);let c=[];t.random&&(c=t.random.stack.concat(t.random));const s={stack:c,node:i,destPortIds:o,currentIndex:0};return n.push(s),Object(a.n)({node:Object(r.b)(e,o[0]),random:{...s}})},_increase(e,t){t.currentIndex+=1;const{currentIndex:n,destPortIds:i}=t;return Object(a.n)({node:Object(r.b)(e,i[n]),random:{...t}})},_end:(e,t,n)=>l.a.findNext(e,t,n),findNext(e,t,n){const{randomList:r}=n,{nodeUuid:i}=t,o=r.find(e=>Object(a.l)(e.node.nodeUuid,i));if(o){const{currentIndex:r,destPortIds:i}=o;return r===i.length-1?h._end(e,t,n):h._increase(e,o)}return h._init(e,t,r)}};var m=n(60);const g={findNext(e,t){const{destList:n,output:o,options:c,otherOptions:s}=t,u=[...c.filter(e=>e.selected).sort((e,t)=>e.cascadePath.length<t.cascadePath.length?1:-1),...s.filter(e=>e.selected)];let l;for(const t of u)if(l=Object(r.c)(e,n,t.uuid),l)break;return Object(a.n)({node:i(e,n,o,t,l)})}};var O=n(17);const j={cascade:g,logic:d,loop:m.c,sequence:u,random:h};["describe","check","end","start","verify","data","max_diff"].forEach(e=>{j[e]=l.a});function v(e){const t=j[e.type];if(!t)throw new Error("lack next rules for this type of node...");return t}["weight","slide_rate","upload","value_mark","icon_mark","fill","select_image","select","region","location","lottery","matrix","menu","area","select_icon","hot_spot","heat_map"].forEach(e=>{j[e]=s});const w=["check","break_point"];function y(e,t){return"loop"===e.type?!Object(m.a)(e,t):w.indexOf(e.type)<0}function _(e,t,n){return T(e,{origin:n,...n},t)}function x(e,t,n,i){const{node:o,loop:c,random:s}=i,u=t.random;if(o){const e=t.loop,{loopStack:n}=t;!c&&e&&Object(r.l)(o,t)&&(i.loopStack=n,i.loop=e),o.parentRandomId&&u&&!s&&(i.random=u)}else if(u){const t=Object(a.h)(u.node.nodeUuid,n.loopStack);return T(e,Object(O.a)(n.renderList,t),n)}return Object(a.n)(i)}async function T(e,t,n){let r,i,o=v(t),a=!0;for(;a&&(i=await x(e,t,n,await o.findNext(e,t,n)),r=i.node,r);)y(r,n)?a=!1:(t={origin:r,parent:n,...r,...i},o=v(r));return i}},function(e,t,n){"use strict";n.d(t,"b",(function(){return R})),n.d(t,"a",(function(){return M}));var r=n(4),i=n(1),o=n(6),a=n(32),c=n(5),s=n(0),u=n(36),l=n(23),f=n(7),d=n(62);async function p(e,t){const n={};e.sortNo&&(n.sortNo=-1),e.selected&&(n.selected=!1),e.value&&(n.value=""),await Object(l.d)(e,t),Object(s.g)(e,n)}async function b(e){const{video:t,options:n,otherOptions:r}=e;t&&Object(s.g)(t,{ended:!0});let i=[];n&&(i=[...i,...n]),r&&(i=[...i,...r]);for(const t of i)await p(t,e);const{cascade:o}=e;o&&await async function e(t,n){Object(s.g)(t,{selected:!1}),await Object(l.d)(t.option,n),t.list&&t.list.forEach(t=>e(t,n))}(o,e)}const h={doc:"os/client/o_1dn9kbm3u1f4d1tsudcg1fuh17678.txt",image:"os/client/o_1dn9kbq468tj1kq2dt3qeo1pumd.png",video:"os/client/o_1dn9kpohua8v1jv51oobq981dvv8.mp4",audio:"os/client/o_1dn9l7gbs1maj1e3nn941e6p125gj.mp3"},m={};function g(e){const{regions:t}=e,n=e.infoRange||"county",r=function(e){const t=x(Object(o.c)(e),1)[0];return!t||t.isOtherOpt?null:t.inferList.some(e=>e.active)?t:null}(e);if(r){const e=r.text.split("-");return{address:e,indexes:Object(d.c)(e,t),point:{lat:r.latitude,lng:r.longitude}}}{const e=Object(i.f)(t.length);let r=Object(f.a)(e);const o=t[e],a=[o.Meaning,"",""];if("province"!==n){const e=Object(i.f)(o.cities.length),t=o.cities[e];if(a[1]=t.Meaning,r=r+" "+e,"city"!==n){const e=Object(i.f)(t.counties.length),n=t.counties[e];n&&(a[2]=n.Meaning,r=r+" "+e)}}return{address:a,indexes:r,point:{lng:0,lat:0}}}}async function O(e,t){const{value:n}=await Object(a.b)(e,t);if(n)return"__FORCE_EMPTY__"===n?"":n;const{fileLimits:r}=e,o=Object(i.p)(r,1)[0];return h[o]}async function j(e,t){const n=[],r=[];e.forEach(e=>{Object(o.n)(e)?n.push(e):r.push(e)}),await T(r,t,1);const a=Object(i.g)(1,n.length);y(n,t,a)}async function v(e,t){const{parent:n,inputInferLimit:r}=t;let o=await Object(c.e)(t.fillMin,{state:n});o=o||0;let a=e.length;o&&r>o&&r<a&&(a=r);const s=o?Object(i.g)(o,a):a;return Object(i.p)(e,s)}async function w(e,t){e.parent.context.option=t;const n=await Object(a.a)(t,e);return e.parent.context.option=null,await e.parent.handleEvents.handleOptionInput(n,t,e)}function y(e,t,n){Object(i.p)(e,n).forEach(e=>w(t,e))}async function _(e,t){if(await e.parent.handleEvents.handleOptionClick(t,e),t.useComment)return w(e,t)}function x(e,t){const n=Object(l.b)(e,"select"),r=[],o=[];if(n.forEach(e=>{e.inferList.every(e=>0===Number(e.weight))||e.disabled?r.push(e):o.push(e)}),o.length>0)return Object(l.h)(o,t);{let n=e.filter(e=>!e.disabled);return r.length>0&&(n=e.filter(e=>!r.includes(e))),Object(i.p)(n,t)}}async function T(e,t,n){const r=x(e,n).sort((e,t)=>-1===e.mutexNumber||(e.mutexNumber||0)>(t.mutexNumber||0)?1:-1);for(const e of r)await _(t,e)}async function k(e,t){const{multiple:n,min:r,max:o,list:a}=e;if(!a)return;const c=function(e,t){const n=Object(l.a)(e);return n.length>0?Object(l.g)(n,t):Object(i.p)(e,t)}(a,n?Object(i.g)(r||1,o||1):1);for(const n of c){const r=a.indexOf(n);await t.parent.handleEvents.handleCascadeClick(r,e,t),await k(n,t)}}async function S(e){const t=Object(o.c)(e);let n=1;if(Object(r.s)(e)){const t=await Object(r.e)(e),{min:o}=t;let{max:a}=t;const{selectInferLimit:c}=e;c>o&&c<a&&(a=c),n=Object(i.g)(o||1,a)}const a=[],c=[];t.forEach(e=>{Object(o.n)(e)?c.push(e):a.push(e)}),await T(a,e,n);const s=Object(i.g)(1,c.length);y(c,e,s)}function E(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}async function N(e,t,n){const r=[...n].sort(),{value:o,antis:c}=await Object(a.b)(e,t,1);if(o){if("__FORCE_EMPTY__"===o)return"0";{const e=r[0],t=r[r.length-1];return o<e?e:o>t?t:o}}{const e=()=>Object(i.p)(n,1)[0];return Object(a.f)(e,c)}}function I(e){let[t,n]=e.split("~").map(e=>Number(e));return t>n&&([n,t]=[t,n]),[t,n]}function C(e,t,n){const[r,o]=e.split("_");let a,c;if(r.includes("~")){const[e,t]=I(r);a=Object(i.g)(e,t)}else a=Math.min(Math.max(Number(r),0),t);if(o.includes("~")){const[e,t]=I(o);c=Object(i.g)(e,t)}else c=Math.min(Math.max(Number(o),0),n);return{x:a,y:c}}function L(e,t){const[n,r]=e.split("_").map(e=>Number(e)),[i,o]=t.split("_");let a=!1,c=!1;if(i.includes("~")){const[e,t]=I(i);a=e<=n&&n<=t}else a=Number(i)===n;if(o.includes("~")){const[e,t]=I(o);c=e<=r&&r<=t}else c=Number(o)===r;return a&&c}async function A(e,t){const{value:n,antis:r}=await Object(a.b)(e,t,1),{mapImgHeight:o,mapImgWidth:c}=t;if(n)return"__FORCE_EMPTY__"===n?null:C(n,c,o);{const e=()=>Object(i.f)(c)+"_"+Object(i.f)(o);return C(await Object(a.f)(e,r,L),c,o)}}function P(e,t){let n=t.filter(t=>!(-1!==t.sortNo||!t.inferList)&&t.inferList.some(t=>{if(!t.active)return!1;const n=Object(l.c)(t.candidates),r=Object(l.f)(n,1);return r.length>0&&Number(r[0].text)<=e}));0===n.length&&(n=t.filter(e=>-1===e.sortNo));const r=Object(i.p)(n,1)[0];r&&Object(s.g)(r,{sortNo:e,selected:!0})}async function R(e){return await Object(a.g)(),M(e)}async function M(e,t){const{type:n,readonly:r}=e;if(r)return Object(u.d)();await b(e),t&&t.beforeInfer&&await t.beforeInfer(e);const i=m[n]||S;await i(e),t&&t.afterInfer&&await t.afterInfer(e)}m.select=S,m.value_mark=async e=>{const{options:t,otherOptions:n}=e,r=await v(t,e);for(const t of r){const n=t.minValue||1,r=t.maxValue||5,i=await N(t,e,E(n,r).map(e=>Object(f.a)(e)));await e.parent.handleEvents.handleOptionInput(i,t,e)}await j(n,e)},m.heat_map=async e=>{const{options:t,otherOptions:n}=e;for(const n of t){const t=await A(n,e);t&&await e.parent.handleEvents.handleQuestionInput(t,e)}await j(n,e)},m.icon_mark=async e=>{const{options:t,otherOptions:n}=e,r=await v(t,e);for(const t of r){const n=1,r=t.count||5,i=await N(t,e,E(n,r).map(e=>Object(f.a)(e)));await e.parent.handleEvents.handleOptionInput(i,t,e)}await j(n,e)},m.slide_rate=async e=>{const{options:t,rateOptions:n,otherOptions:r}=e,i=await v(t,e),o=n.map(e=>e.value);for(const t of i){const n=await N(t,e,o);await e.parent.handleEvents.handleOptionInput(n,t,e)}await j(r,e)},m.weight=async e=>{let{weightTotal:t}=e;const{options:n,otherOptions:r}=e;t<=0&&(t=100);const o=[],a=[];n.forEach(e=>{const{inferList:t}=e;if(t){t.some(e=>e.active)?o.push(e):a.push(e)}else a.push(e)});const c=[];for(const n of o){const r=n.inferList.filter(e=>e.active),i=await Object(l.e)(r,e),o=Object(l.c)(i),a=Object(l.f)(o,1),s=Number(a[0].text);c.push(s),t-=s}const s=Object(i.o)(t,a.length),u=c.concat(s),f=o.concat(a);for(const[t,n]of f.entries()){const r=u[t];await e.parent.handleEvents.handleOptionInput(r.toString(),n,e)}await j(r,e)},m.fill=async e=>{const{options:t,otherOptions:n}=e,r=await v(t,e);for(const t of r)await w(e,t);await j(n,e)},m.sequence=async e=>{const{options:t,otherOptions:n}=e,r=t.length;let i=1;for(;i<=r;)P(i,t),i+=1;t.sort((e,t)=>e.sortNo>t.sortNo?1:-1),await j(n,e),Object(u.d)()},m.cascade=async e=>{const{cascade:t,otherOptions:n}=e;return await k(t,e),j(n,e)},m.describe=()=>(Object(u.d)(),Object(i.n)()),m.max_diff=async e=>{const t=function(e){const t=[],{options:n,itemCountPerTask:r,taskCount:i}=e,o=Math.ceil(i*r/n.length);return e.options.forEach(e=>{if(!e.inferList)return;let n=e.inferList.reduce((e,t)=>{if(t.active){e+=t.candidates.split(",").map(e=>Number(e)||0).reduce((e,t)=>e+t,0)}return e},0);n>o?n=o:n<-o&&(n=-o),n&&t.push({needValue:n,option:e})}),t}(e),{tasks:n,parent:{handleEvents:r}}=e;for(const o of n){let n=o.items.find(e=>t.find(t=>{const n=t.option===e.option&&t.needValue>0;return n&&(t.needValue-=1),n})),a=o.items.find(e=>t.find(t=>{const n=t.option===e.option&&t.needValue<0;return n&&(t.needValue+=1),n}));if(!n){const e=o.items.filter(e=>t.every(t=>t.option!==e.option));n=Object(i.p)(e,1)[0]}if(!a||a===n){const e=o.items.filter(e=>t.every(t=>t.option!==e.option)&&e!==n);a=Object(i.p)(e,1)[0]}await r.handleMaxDiffInput(1,n,o,e),await r.handleMaxDiffInput(-1,a,o,e)}},m.upload=async e=>{const{options:t,otherOptions:n}=e,{min:o,max:a}=await Object(r.g)(e),c=Object(i.g)(o||1,a),s=Object(i.p)(t,c);for(const t of s)await e.parent.handleEvents.handleOptionInput({name:await O(t,e)},t,e);await j(n,e)},m.region=e=>{const{indexes:t}=g(e);return e.parent.handleEvents.handleQuestionInput(t,e)},m.location=e=>{const{address:t,point:n}=g(e),r={address:{province:t[0],city:t[1],district:t[2],country:""},point:{lat:n.lat||Number(Object(a.c)(0,90)),lng:n.lng||Number(Object(a.c)(0,180))}};return e.parent.handleEvents.handleQuestionInput(r,e)},m.area=m.location,m.matrix=async e=>{const{options:t,flatten:n,otherOptions:o}=e,{min:a,max:c}=await Object(r.e)(e);if(Object(r.v)(e))await T(t,e,1);else if(Object(r.q)(e)){const t=[];for(const r of n){if(r.list.filter((e,n)=>!t.includes(n)).length>0){const n=x(r.list,1)[0];n&&(await _(e,n),t.push(r.list.indexOf(n)))}}}else if(Object(r.r)(e)||Object(r.p)(e))for(const t of n)await T(t.list,e,1);else if(Object(r.o)(e)||Object(r.n)(e))for(const t of n){const n=Object(i.g)(a||1,c);await T(t.list,e,n)}else if(Object(r.m)(e)){const n=Object(i.g)(a||1,c);await T(t,e,n)}await j(o,e)},m.end=()=>Object(i.n)(),m.verify=e=>e.parent.handleEvents.handleQuestionInput({phoneNumber:Object(a.d)(),code:Object(a.e)("number")},e)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i=n(2);function o(){return{headimgurl:"https://media.choiceform.com/fresh_little_girl.jpg",nickname:Object(i.f)(r.a.reward.weChatName)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(35),i=n(0),o=n(26);function a(e,t,n){if(void 0===e||void 0===t)return{refresh:!1,result:[]};const{options:a}=n,c=a.length;t>c&&(t=c);const s=a.splice(e,1)[0];s&&(Object(i.g)(s,{selected:!0}),a.splice(t,0,s));const u=n.options.filter(e=>!e.selected);1===u.length&&Object(i.g)(u[0],{selected:!0});const l=[];return a.forEach((e,t)=>{e.selected&&(Object(i.g)(e,{sortNo:t+1}),l.push(t+1))}),Object(r.b)(n),Object(o.c)(s,n),{refresh:!0,result:l}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);function i(e,t){Object(r.g)(e,{value:t});const{option:n}=e;n.records.find(t=>t.round===e.round).value=t,Object(r.g)(n,{value:n.records.reduce((e,t)=>e+t.value,0)})}function o(e,t,n,o){if(t.value===e)return{result:!0};i(t,e),n.items.forEach(e=>{e!==t&&e.value===t.value&&i(e,0)});const a=n.items.some(e=>1===e.value),c=n.items.some(e=>-1===e.value);return Object(r.g)(n,{done:a&&c}),{result:!0}}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){var r,i;void 0===(i="function"==typeof(r={af:function(e,t){return t?"other":1==e?"one":"other"},ak:function(e,t){return t?"other":0==e||1==e?"one":"other"},am:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},ar:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ars:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:function(e,t){return t?"other":1==e?"one":"other"},ast:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},az:function(e,t){var n=String(e).split(".")[0],r=n.slice(-1),i=n.slice(-2),o=n.slice(-3);return t?1==r||2==r||5==r||7==r||8==r||20==i||50==i||70==i||80==i?"one":3==r||4==r||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==n||6==r||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},be:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?2!=i&&3!=i||12==o||13==o?"other":"few":1==i&&11!=o?"one":i>=2&&i<=4&&(o<12||o>14)?"few":r&&0==i||i>=5&&i<=9||o>=11&&o<=14?"many":"other"},bem:function(e,t){return t?"other":1==e?"one":"other"},bez:function(e,t){return t?"other":1==e?"one":"other"},bg:function(e,t){return t?"other":1==e?"one":"other"},bh:function(e,t){return t?"other":0==e||1==e?"one":"other"},bm:function(e,t){return"other"},bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:function(e,t){return"other"},br:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2),a=r&&n[0].slice(-6);return t?"other":1==i&&11!=o&&71!=o&&91!=o?"one":2==i&&12!=o&&72!=o&&92!=o?"two":(3==i||4==i||9==i)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=e&&r&&0==a?"many":"other"},brx:function(e,t){return t?"other":1==e?"one":"other"},bs:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},ca:function(e,t){var n=!String(e).split(".")[1];return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&n?"one":"other"},ce:function(e,t){return t?"other":1==e?"one":"other"},cgg:function(e,t){return t?"other":1==e?"one":"other"},chr:function(e,t){return t?"other":1==e?"one":"other"},ckb:function(e,t){return t?"other":1==e?"one":"other"},cs:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e;return t||1!=e&&(i||0!=r&&1!=r)?"other":"one"},de:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},dsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),c=i.slice(-2);return t?"other":o&&1==a||1==c?"one":o&&2==a||2==c?"two":o&&(3==a||4==a)||3==c||4==c?"few":"other"},dv:function(e,t){return t?"other":1==e?"one":"other"},dz:function(e,t){return"other"},ee:function(e,t){return t?"other":1==e?"one":"other"},el:function(e,t){return t?"other":1==e?"one":"other"},en:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==e&&r?"one":"other"},eo:function(e,t){return t?"other":1==e?"one":"other"},es:function(e,t){return t?"other":1==e?"one":"other"},et:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},eu:function(e,t){return t?"other":1==e?"one":"other"},fa:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},fil:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=c&&6!=c&&9!=c?"one":"other"},fo:function(e,t){return t?"other":1==e?"one":"other"},fr:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},fur:function(e,t){return t?"other":1==e?"one":"other"},fy:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},ga:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},gl:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},gsw:function(e,t){return t?"other":1==e?"one":"other"},gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:function(e,t){return t?"other":0==e||1==e?"one":"other"},gv:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:function(e,t){return t?"other":1==e?"one":"other"},haw:function(e,t){return t?"other":1==e?"one":"other"},he:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1);return t?"other":1==e&&i?"one":2==r&&i?"two":i&&(e<0||e>10)&&o&&0==a?"many":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},hsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),c=i.slice(-2);return t?"other":o&&1==a||1==c?"one":o&&2==a||2==c?"two":o&&(3==a||4==a)||3==c||4==c?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},id:function(e,t){return"other"},ig:function(e,t){return"other"},ii:function(e,t){return"other"},in:function(e,t){return"other"},io:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},is:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e,o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o&&11!=a||!i?"one":"other"},it:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},iu:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},iw:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1);return t?"other":1==e&&i?"one":2==r&&i?"two":i&&(e<0||e>10)&&o&&0==a?"many":"other"},ja:function(e,t){return"other"},jbo:function(e,t){return"other"},jgo:function(e,t){return t?"other":1==e?"one":"other"},ji:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},jmc:function(e,t){return t?"other":1==e?"one":"other"},jv:function(e,t){return"other"},jw:function(e,t){return"other"},ka:function(e,t){var n=String(e).split(".")[0],r=n.slice(-2);return t?1==n?"one":0==n||r>=2&&r<=20||40==r||60==r||80==r?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:function(e,t){return t?"other":1==e?"one":"other"},kcg:function(e,t){return t?"other":1==e?"one":"other"},kde:function(e,t){return"other"},kea:function(e,t){return"other"},kk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1);return t?6==i||9==i||r&&0==i&&0!=e?"many":"other":1==e?"one":"other"},kkj:function(e,t){return t?"other":1==e?"one":"other"},kl:function(e,t){return t?"other":1==e?"one":"other"},km:function(e,t){return"other"},kn:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},ko:function(e,t){return"other"},ks:function(e,t){return t?"other":1==e?"one":"other"},ksb:function(e,t){return t?"other":1==e?"one":"other"},ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:function(e,t){return t?"other":1==e?"one":"other"},kw:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},ky:function(e,t){return t?"other":1==e?"one":"other"},lag:function(e,t){var n=String(e).split(".")[0];return t?"other":0==e?"zero":0!=n&&1!=n||0==e?"other":"one"},lb:function(e,t){return t?"other":1==e?"one":"other"},lg:function(e,t){return t?"other":1==e?"one":"other"},lkt:function(e,t){return"other"},ln:function(e,t){return t?"other":0==e||1==e?"one":"other"},lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var n=String(e).split("."),r=n[1]||"",i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?"other":1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),c=o&&n[0].slice(-2),s=r.slice(-2),u=r.slice(-1);return t?"other":o&&0==a||c>=11&&c<=19||2==i&&s>=11&&s<=19?"zero":1==a&&11!=c||2==i&&1==u&&11!=s||2!=i&&1==u?"one":"other"},mas:function(e,t){return t?"other":1==e?"one":"other"},mg:function(e,t){return t?"other":0==e||1==e?"one":"other"},mgo:function(e,t){return t?"other":1==e?"one":"other"},mk:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?1==a&&11!=c?"one":2==a&&12!=c?"two":7!=a&&8!=a||17==c||18==c?"other":"many":o&&1==a&&11!=c||1==s&&11!=u?"one":"other"},ml:function(e,t){return t?"other":1==e?"one":"other"},mn:function(e,t){return t?"other":1==e?"one":"other"},mo:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":e>=0&&e<=1?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":1==e?"one":0==e||r>=2&&r<=10?"few":r>=11&&r<=19?"many":"other"},my:function(e,t){return"other"},nah:function(e,t){return t?"other":1==e?"one":"other"},naq:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},nb:function(e,t){return t?"other":1==e?"one":"other"},nd:function(e,t){return t?"other":1==e?"one":"other"},ne:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},nn:function(e,t){return t?"other":1==e?"one":"other"},nnh:function(e,t){return t?"other":1==e?"one":"other"},no:function(e,t){return t?"other":1==e?"one":"other"},nqo:function(e,t){return"other"},nr:function(e,t){return t?"other":1==e?"one":"other"},nso:function(e,t){return t?"other":0==e||1==e?"one":"other"},ny:function(e,t){return t?"other":1==e?"one":"other"},nyn:function(e,t){return t?"other":1==e?"one":"other"},om:function(e,t){return t?"other":1==e?"one":"other"},or:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:function(e,t){return t?"other":1==e?"one":"other"},pa:function(e,t){return t?"other":0==e||1==e?"one":"other"},pap:function(e,t){return t?"other":1==e?"one":"other"},pl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":1==e&&i?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&1!=r&&(0==o||1==o)||i&&o>=5&&o<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),c=o&&n[0].slice(-2),s=r.slice(-2),u=r.slice(-1);return t?"other":o&&0==a||c>=11&&c<=19||2==i&&s>=11&&s<=19?"zero":1==a&&11!=c||2==i&&1==u&&11!=s||2!=i&&1==u?"one":"other"},ps:function(e,t){return t?"other":1==e?"one":"other"},pt:function(e,t){var n=String(e).split(".")[0];return t?"other":0==n||1==n?"one":"other"},"pt-PT":function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},rm:function(e,t){return t?"other":1==e?"one":"other"},ro:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},rof:function(e,t){return t?"other":1==e?"one":"other"},root:function(e,t){return"other"},ru:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o&&11!=a?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&0==o||i&&o>=5&&o<=9||i&&a>=11&&a<=14?"many":"other"},rwk:function(e,t){return t?"other":1==e?"one":"other"},sah:function(e,t){return"other"},saq:function(e,t){return t?"other":1==e?"one":"other"},sc:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},scn:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},sd:function(e,t){return t?"other":1==e?"one":"other"},sdh:function(e,t){return t?"other":1==e?"one":"other"},se:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},seh:function(e,t){return t?"other":1==e?"one":"other"},ses:function(e,t){return"other"},sg:function(e,t){return"other"},sh:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},shi:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},si:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"";return t?"other":0==e||1==e||0==r&&1==i?"one":"other"},sk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},sl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":i&&(3==o||4==o)||!i?"few":"other"},sma:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},smi:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},smj:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},smn:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},sms:function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},sn:function(e,t){return t?"other":1==e?"one":"other"},so:function(e,t){return t?"other":1==e?"one":"other"},sq:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?1==e?"one":4==i&&14!=o?"many":"other":1==e?"one":"other"},sr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=r.slice(-2),s=i.slice(-1),u=i.slice(-2);return t?"other":o&&1==a&&11!=c||1==s&&11!=u?"one":o&&a>=2&&a<=4&&(c<12||c>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},ss:function(e,t){return t?"other":1==e?"one":"other"},ssy:function(e,t){return t?"other":1==e?"one":"other"},st:function(e,t){return t?"other":1==e?"one":"other"},sv:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1!=o&&2!=o||11==a||12==a?"other":"one":1==e&&r?"one":"other"},sw:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},syr:function(e,t){return t?"other":1==e?"one":"other"},ta:function(e,t){return t?"other":1==e?"one":"other"},te:function(e,t){return t?"other":1==e?"one":"other"},teo:function(e,t){return t?"other":1==e?"one":"other"},th:function(e,t){return"other"},ti:function(e,t){return t?"other":0==e||1==e?"one":"other"},tig:function(e,t){return t?"other":1==e?"one":"other"},tk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-1);return t?6==r||9==r||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),c=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=c&&6!=c&&9!=c?"one":"other"},tn:function(e,t){return t?"other":1==e?"one":"other"},to:function(e,t){return"other"},tr:function(e,t){return t?"other":1==e?"one":"other"},ts:function(e,t){return t?"other":1==e?"one":"other"},tzm:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},ug:function(e,t){return t?"other":1==e?"one":"other"},uk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1),c=o&&n[0].slice(-2),s=r.slice(-1),u=r.slice(-2);return t?3==a&&13!=c?"few":"other":i&&1==s&&11!=u?"one":i&&s>=2&&s<=4&&(u<12||u>14)?"few":i&&0==s||i&&s>=5&&s<=9||i&&u>=11&&u<=14?"many":"other"},ur:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},uz:function(e,t){return t?"other":1==e?"one":"other"},ve:function(e,t){return t?"other":1==e?"one":"other"},vi:function(e,t){return t&&1==e?"one":"other"},vo:function(e,t){return t?"other":1==e?"one":"other"},vun:function(e,t){return t?"other":1==e?"one":"other"},wa:function(e,t){return t?"other":0==e||1==e?"one":"other"},wae:function(e,t){return t?"other":1==e?"one":"other"},wo:function(e,t){return"other"},xh:function(e,t){return t?"other":1==e?"one":"other"},xog:function(e,t){return t?"other":1==e?"one":"other"},yi:function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},yo:function(e,t){return"other"},yue:function(e,t){return"other"},zh:function(e,t){return"other"},zu:function(e,t){return t?"other":e>=0&&e<=1?"one":"other"}})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){e.exports={date:n(4),duration:n(5),number:n(6),time:n(7)}},function(e,t,n){"use strict";function r(e,t,n,i){this.message=e,this.expected=t,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,n="";for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}return"Expected "+function(e){var t,r,i,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(i=e[t],n[i.type](i));if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},e.exports={SyntaxError:r,parse:function(e,t){t=void 0!==t?t:{};var n,i={},o={start:ke},a=ke,c=ve("#",!1),s=function(){return Ue[0]},u=function(e){return e.join("")},l="{",f=ve("{",!1),d="}",p=ve("}",!1),b=",",h=ve(",",!1),m="select",g=ve("select",!1),O=function(e,n){return t.strict&&Ue.unshift(!1),n},j=function(e,n){return t.strict&&Ue.shift(),{type:"select",arg:e,cases:n}},v="plural",w=ve("plural",!1),y="selectordinal",_=ve("selectordinal",!1),x=function(e,n,r,i){var o=("selectordinal"===n?t.ordinal:t.cardinal)||["zero","one","two","few","many","other"];return o&&o.length&&i.forEach((function(t){if(isNaN(t.key)&&o.indexOf(t.key)<0)throw new Error("Invalid key `"+t.key+"` for argument `"+e+"`. Valid "+n+" keys for this locale are `"+o.join("`, `")+"`, and explicit keys like `=0`.")})),Ue.shift(),{type:n,arg:e,offset:r||0,cases:i}},T=ye("identifier"),k=/^[^\t-\r \x85\u200E\u200F\u2028\u2029!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,S=we([["\t","\r"]," ","
","","","\u2028","\u2029",["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←",""],["─","❵"],["➔","⯿"],["⸀",""],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!0,!1),E=function(e,t){return{key:e,tokens:t}},N=ye("plural offset"),I="offset",C=ve("offset",!1),L=ve(":",!1),A=ve("=",!1),P="number",R=ve("number",!1),M="date",D=ve("date",!1),U="time",B=ve("time",!1),q="spellout",F=ve("spellout",!1),V="ordinal",z=ve("ordinal",!1),$="duration",H=ve("duration",!1),X=function(e){if(t.strict||/^\d/.test(e))return!1;switch(e.toLowerCase()){case"select":case"plural":case"selectordinal":return!1;default:return!0}},G=function(e){return!t.strict},K=ye("a valid (strict) function parameter"),J=/^[^'{}]/,W=we(["'","{","}"],!0,!1),Y=ve("'",!1),Z=ye("doubled apostrophe"),Q=ve("''",!1),ee=/^[^']/,te=we(["'"],!0,!1),ne=ve("'{",!1),re=ve("'}",!1),ie=ye("escaped string"),oe=ve("'#",!1),ae=ye("plain char"),ce=/^[^{}#\0-\x08\x0E-\x1F\x7F]/,se=we(["{","}","#",["\0","\b"],["",""],""],!0,!1),ue=ye("integer"),le=/^[0-9]/,fe=we([["0","9"]],!1,!1),de=ye("white space"),pe=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,be=we([["\t","\r"]," ","
","","","\u2028","\u2029"],!1,!1),he=0,me=[{line:1,column:1}],ge=0,Oe=[],je=0;if("startRule"in t){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');a=o[t.startRule]}function ve(e,t){return{type:"literal",text:e,ignoreCase:t}}function we(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function ye(e){return{type:"other",description:e}}function _e(t){var n,r=me[t];if(r)return r;for(n=t-1;!me[n];)n--;for(r={line:(r=me[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return me[t]=r,r}function xe(e,t){var n=_e(e),r=_e(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function Te(e){he<ge||(he>ge&&(ge=he,Oe=[]),Oe.push(e))}function ke(){var e,t;for(e=[],t=Se();t!==i;)e.push(t),t=Se();return e}function Se(){var t,n,r;if((t=function(){var t,n,r,o;return t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i&&De()!==i&&(r=Ee())!==i&&De()!==i?(125===e.charCodeAt(he)?(o=d,he++):(o=i,0===je&&Te(p)),o!==i?t=n=function(e){return{type:"argument",arg:e}}(r):(he=t,t=i)):(he=t,t=i),t}())===i&&(t=function(){var t,n,r,o,a,c,s,u,v;if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i)if(De()!==i)if((r=Ee())!==i)if(De()!==i)if(44===e.charCodeAt(he)?(o=b,he++):(o=i,0===je&&Te(h)),o!==i)if(De()!==i)if(e.substr(he,6)===m?(a=m,he+=6):(a=i,0===je&&Te(g)),a!==i&&(a=O(0,a)),a!==i)if((a=De())!==i)if(44===e.charCodeAt(he)?(c=b,he++):(c=i,0===je&&Te(h)),c!==i)if(De()!==i){if(s=[],(u=Ne())!==i)for(;u!==i;)s.push(u),u=Ne();else s=i;s!==i&&(u=De())!==i?(125===e.charCodeAt(he)?(v=d,he++):(v=i,0===je&&Te(p)),v!==i?t=n=j(r,s):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;return t}())===i&&(t=function(){var t,n,r,o,a,c,s,u,m,g,O;if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i)if(De()!==i)if((r=Ee())!==i)if(De()!==i)if(44===e.charCodeAt(he)?(o=b,he++):(o=i,0===je&&Te(h)),o!==i)if(De()!==i)if(e.substr(he,6)===v?(c=v,he+=6):(c=i,0===je&&Te(w)),c===i&&(e.substr(he,13)===y?(c=y,he+=13):(c=i,0===je&&Te(_))),c!==i&&(c=function(e,t){return Ue.unshift(!0),t}(0,c)),(a=c)!==i)if((c=De())!==i)if(44===e.charCodeAt(he)?(s=b,he++):(s=i,0===je&&Te(h)),s!==i)if(De()!==i)if((u=function(){var t,n,r,o;return je++,t=he,De()!==i?(e.substr(he,6)===I?(n=I,he+=6):(n=i,0===je&&Te(C)),n!==i&&De()!==i?(58===e.charCodeAt(he)?(r=":",he++):(r=i,0===je&&Te(L)),r!==i&&De()!==i&&(o=Me())!==i&&De()!==i?t=o:(he=t,t=i)):(he=t,t=i)):(he=t,t=i),je--,t===i&&0===je&&Te(N),t}())===i&&(u=null),u!==i){if(m=[],(g=Ie())!==i)for(;g!==i;)m.push(g),g=Ie();else m=i;m!==i&&(g=De())!==i?(125===e.charCodeAt(he)?(O=d,he++):(O=i,0===je&&Te(p)),O!==i?t=n=x(r,a,u,m):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;else he=t,t=i;return t}())===i&&(t=function(){var t,n,r,o,a,c,s;return t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i&&De()!==i&&(r=Ee())!==i&&De()!==i?(44===e.charCodeAt(he)?(o=b,he++):(o=i,0===je&&Te(h)),o!==i&&De()!==i&&(a=function(){var t,n,r,o,a;return e.substr(he,6)===P?(t=P,he+=6):(t=i,0===je&&Te(R)),t===i&&(e.substr(he,4)===M?(t=M,he+=4):(t=i,0===je&&Te(D)),t===i&&(e.substr(he,4)===U?(t=U,he+=4):(t=i,0===je&&Te(B)),t===i&&(e.substr(he,8)===q?(t=q,he+=8):(t=i,0===je&&Te(F)),t===i&&(e.substr(he,7)===V?(t=V,he+=7):(t=i,0===je&&Te(z)),t===i&&(e.substr(he,8)===$?(t=$,he+=8):(t=i,0===je&&Te(H)),t===i&&(t=he,n=he,je++,e.substr(he,6)===m?(r=m,he+=6):(r=i,0===je&&Te(g)),je--,r===i?n=void 0:(he=n,n=i),n!==i?(r=he,je++,e.substr(he,6)===v?(o=v,he+=6):(o=i,0===je&&Te(w)),je--,o===i?r=void 0:(he=r,r=i),r!==i?(o=he,je++,e.substr(he,13)===y?(a=y,he+=13):(a=i,0===je&&Te(_)),je--,a===i?o=void 0:(he=o,o=i),o!==i&&(a=Ee())!==i&&(X(a)?void 0:i)!==i?t=n=a:(he=t,t=i)):(he=t,t=i)):(he=t,t=i))))))),t}())!==i&&De()!==i?((c=function(){var t,n,r,o;if(t=he,De()!==i)if(44===e.charCodeAt(he)?(n=b,he++):(n=i,0===je&&Te(h)),n!==i){for(r=[],o=Se();o!==i;)r.push(o),o=Se();r!==i&&(o=(o=G())?void 0:i)!==i?t=function(e){return{tokens:e}}(r):(he=t,t=i)}else he=t,t=i;else he=t,t=i;if(t===i)if(t=he,De()!==i)if(44===e.charCodeAt(he)?(n=b,he++):(n=i,0===je&&Te(h)),n!==i){for(r=[],o=Le();o!==i;)r.push(o),o=Le();r!==i?t=function(e){return{tokens:[e.join("")]}}(r):(he=t,t=i)}else he=t,t=i;else he=t,t=i;return t}())===i&&(c=null),c!==i?(125===e.charCodeAt(he)?(s=d,he++):(s=i,0===je&&Te(p)),s!==i?t=n=function(e,t,n){return{type:"function",arg:e,key:t,param:n}}(r,a,c):(he=t,t=i)):(he=t,t=i)):(he=t,t=i)):(he=t,t=i),t}())===i&&(t=he,35===e.charCodeAt(he)?(n="#",he++):(n=i,0===je&&Te(c)),n!==i&&(r=(r=s())?void 0:i)!==i?t=n={type:"octothorpe"}:(he=t,t=i),t===i)){if(t=he,n=[],(r=Re())!==i)for(;r!==i;)n.push(r),r=Re();else n=i;n!==i&&(n=u(n)),t=n}return t}function Ee(){var t,n,r;if(je++,t=he,n=[],k.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(S)),r!==i)for(;r!==i;)n.push(r),k.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(S));else n=i;return t=n!==i?e.substring(t,he):n,je--,t===i&&(n=i,0===je&&Te(T)),t}function Ne(){var e,t,n;return e=he,De()!==i&&(t=Ee())!==i&&De()!==i&&(n=Ce())!==i?e=E(t,n):(he=e,e=i),e}function Ie(){var t,n,r;return t=he,De()!==i&&(n=function(){var t,n,r;return(t=Ee())===i&&(t=he,61===e.charCodeAt(he)?(n="=",he++):(n=i,0===je&&Te(A)),n!==i&&(r=Me())!==i?t=n=r:(he=t,t=i)),t}())!==i&&De()!==i&&(r=Ce())!==i?t=E(n,r):(he=t,t=i),t}function Ce(){var t,n,r,o,a,c;if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i)if(r=he,(o=De())!==i?(a=he,je++,123===e.charCodeAt(he)?(c=l,he++):(c=i,0===je&&Te(f)),je--,c!==i?(he=a,a=void 0):a=i,a!==i?r=o=[o,a]:(he=r,r=i)):(he=r,r=i),r===i&&(r=null),r!==i){for(o=[],a=Se();a!==i;)o.push(a),a=Se();o!==i&&(a=De())!==i?(125===e.charCodeAt(he)?(c=d,he++):(c=i,0===je&&Te(p)),c!==i?t=n=o:(he=t,t=i)):(he=t,t=i)}else he=t,t=i;else he=t,t=i;return t}function Le(){var t,n,r,o;if(je++,t=he,n=[],J.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(W)),r!==i)for(;r!==i;)n.push(r),J.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(W));else n=i;if(n!==i&&(n=function(e){return e.join("")}(n)),(t=n)===i&&(t=Ae())===i&&(t=he,39===e.charCodeAt(he)?(n="'",he++):(n=i,0===je&&Te(Y)),n!==i&&(r=Pe())!==i?(39===e.charCodeAt(he)?(o="'",he++):(o=i,0===je&&Te(Y)),o!==i?t=n=r:(he=t,t=i)):(he=t,t=i),t===i))if(t=he,123===e.charCodeAt(he)?(n=l,he++):(n=i,0===je&&Te(f)),n!==i){for(r=[],o=Le();o!==i;)r.push(o),o=Le();r!==i?(125===e.charCodeAt(he)?(o=d,he++):(o=i,0===je&&Te(p)),o!==i?t=n=function(e){return"{"+e.join("")+"}"}(r):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;return je--,t===i&&(n=i,0===je&&Te(K)),t}function Ae(){var t,n;return je++,"''"===e.substr(he,2)?(n="''",he+=2):(n=i,0===je&&Te(Q)),n!==i&&(n="'"),je--,(t=n)===i&&(n=i,0===je&&Te(Z)),t}function Pe(){var t,n,r;if((t=Ae())===i){if(t=he,n=[],ee.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(te)),r!==i)for(;r!==i;)n.push(r),ee.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(te));else n=i;n!==i&&(n=u(n)),t=n}return t}function Re(){var t,n;return(t=Ae())===i&&(t=function(){var t,n,r,o,a,c;if(je++,(t=function(){var t,n,r,o;if(t=he,"'{"===e.substr(he,2)?(n="'{",he+=2):(n=i,0===je&&Te(ne)),n!==i){for(r=[],o=Pe();o!==i;)r.push(o),o=Pe();r!==i?(39===e.charCodeAt(he)?(o="'",he++):(o=i,0===je&&Te(Y)),o!==i?t=n=function(e){return"{"+e.join("")}(r):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;if(t===i)if(t=he,"'}"===e.substr(he,2)?(n="'}",he+=2):(n=i,0===je&&Te(re)),n!==i){for(r=[],o=Pe();o!==i;)r.push(o),o=Pe();r!==i?(39===e.charCodeAt(he)?(o="'",he++):(o=i,0===je&&Te(Y)),o!==i?t=n=function(e){return"}"+e.join("")}(r):(he=t,t=i)):(he=t,t=i)}else he=t,t=i;return t}())===i){if(t=he,n=he,r=he,"'#"===e.substr(he,2)?(o="'#",he+=2):(o=i,0===je&&Te(oe)),o!==i){for(a=[],c=Pe();c!==i;)a.push(c),c=Pe();a!==i?(39===e.charCodeAt(he)?(c="'",he++):(c=i,0===je&&Te(Y)),c!==i?r=o=function(e){return"#"+e.join("")}(a):(he=r,r=i)):(he=r,r=i)}else he=r,r=i;r!==i&&(o=(o=s())?void 0:i)!==i?n=r=[r,o]:(he=n,n=i),n!==i&&(n=function(e){return e[0]}(n)),(t=n)===i&&(39===e.charCodeAt(he)?(t="'",he++):(t=i,0===je&&Te(Y)))}return je--,t===i&&(n=i,0===je&&Te(ie)),t}())===i&&(t=he,35===e.charCodeAt(he)?(n="#",he++):(n=i,0===je&&Te(c)),n!==i&&(Ue[0]?i:void 0)!==i?t=n=n:(he=t,t=i),t===i&&(t=function(){var t;return je++,ce.test(e.charAt(he))?(t=e.charAt(he),he++):(t=i,0===je&&Te(se)),je--,t===i&&0===je&&Te(ae),t}())),t}function Me(){var t,n,r;if(je++,t=he,n=[],le.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(fe)),r!==i)for(;r!==i;)n.push(r),le.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(fe));else n=i;return t=n!==i?e.substring(t,he):n,je--,t===i&&(n=i,0===je&&Te(ue)),t}function De(){var t,n,r;for(je++,t=he,n=[],pe.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(be));r!==i;)n.push(r),pe.test(e.charAt(he))?(r=e.charAt(he),he++):(r=i,0===je&&Te(be));return t=n!==i?e.substring(t,he):n,je--,t===i&&(n=i,0===je&&Te(de)),t}var Ue=[!1];if((n=a())!==i&&he===e.length)return n;throw n!==i&&he<e.length&&Te({type:"end"}),function(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}(Oe,ge<e.length?e.charAt(ge):null,ge<e.length?xe(ge,ge+1):xe(ge,ge))}}},function(e,t,n){var r,i,o=[{cardinal:["other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["one","other"]},{cardinal:["one","two","other"],ordinal:["other"]}];void 0===(i="function"==typeof(r={af:o[1],ak:o[1],am:o[1],ar:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},ars:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},as:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},asa:o[1],ast:o[1],az:{cardinal:["one","other"],ordinal:["one","few","many","other"]},be:{cardinal:["one","few","many","other"],ordinal:["few","other"]},bem:o[1],bez:o[1],bg:o[1],bh:o[1],bm:o[0],bn:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},bo:o[0],br:{cardinal:["one","two","few","many","other"],ordinal:["other"]},brx:o[1],bs:{cardinal:["one","few","other"],ordinal:["other"]},ca:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ce:o[1],cgg:o[1],chr:o[1],ckb:o[1],cs:{cardinal:["one","few","many","other"],ordinal:["other"]},cy:{cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]},da:o[1],de:o[1],dsb:{cardinal:["one","two","few","other"],ordinal:["other"]},dv:o[1],dz:o[0],ee:o[1],el:o[1],en:{cardinal:["one","other"],ordinal:["one","two","few","other"]},eo:o[1],es:o[1],et:o[1],eu:o[1],fa:o[1],ff:o[1],fi:o[1],fil:o[2],fo:o[1],fr:o[2],fur:o[1],fy:o[1],ga:{cardinal:["one","two","few","many","other"],ordinal:["one","other"]},gd:{cardinal:["one","two","few","other"],ordinal:["one","two","few","other"]},gl:o[1],gsw:o[1],gu:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},guw:o[1],gv:{cardinal:["one","two","few","many","other"],ordinal:["other"]},ha:o[1],haw:o[1],he:{cardinal:["one","two","many","other"],ordinal:["other"]},hi:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},hr:{cardinal:["one","few","other"],ordinal:["other"]},hsb:{cardinal:["one","two","few","other"],ordinal:["other"]},hu:o[2],hy:o[2],ia:o[1],id:o[0],ig:o[0],ii:o[0],in:o[0],io:o[1],is:o[1],it:{cardinal:["one","other"],ordinal:["many","other"]},iu:o[3],iw:{cardinal:["one","two","many","other"],ordinal:["other"]},ja:o[0],jbo:o[0],jgo:o[1],ji:o[1],jmc:o[1],jv:o[0],jw:o[0],ka:{cardinal:["one","other"],ordinal:["one","many","other"]},kab:o[1],kaj:o[1],kcg:o[1],kde:o[0],kea:o[0],kk:{cardinal:["one","other"],ordinal:["many","other"]},kkj:o[1],kl:o[1],km:o[0],kn:o[1],ko:o[0],ks:o[1],ksb:o[1],ksh:{cardinal:["zero","one","other"],ordinal:["other"]},ku:o[1],kw:o[3],ky:o[1],lag:{cardinal:["zero","one","other"],ordinal:["other"]},lb:o[1],lg:o[1],lkt:o[0],ln:o[1],lo:{cardinal:["other"],ordinal:["one","other"]},lt:{cardinal:["one","few","many","other"],ordinal:["other"]},lv:{cardinal:["zero","one","other"],ordinal:["other"]},mas:o[1],mg:o[1],mgo:o[1],mk:{cardinal:["one","other"],ordinal:["one","two","many","other"]},ml:o[1],mn:o[1],mo:{cardinal:["one","few","other"],ordinal:["one","other"]},mr:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ms:{cardinal:["other"],ordinal:["one","other"]},mt:{cardinal:["one","few","many","other"],ordinal:["other"]},my:o[0],nah:o[1],naq:o[3],nb:o[1],nd:o[1],ne:o[2],nl:o[1],nn:o[1],nnh:o[1],no:o[1],nqo:o[0],nr:o[1],nso:o[1],ny:o[1],nyn:o[1],om:o[1],or:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},os:o[1],pa:o[1],pap:o[1],pl:{cardinal:["one","few","many","other"],ordinal:["other"]},prg:{cardinal:["zero","one","other"],ordinal:["other"]},ps:o[1],pt:o[1],"pt-PT":o[1],rm:o[1],ro:{cardinal:["one","few","other"],ordinal:["one","other"]},rof:o[1],root:o[0],ru:{cardinal:["one","few","many","other"],ordinal:["other"]},rwk:o[1],sah:o[0],saq:o[1],sc:{cardinal:["one","other"],ordinal:["many","other"]},scn:{cardinal:["one","other"],ordinal:["many","other"]},sd:o[1],sdh:o[1],se:o[3],seh:o[1],ses:o[0],sg:o[0],sh:{cardinal:["one","few","other"],ordinal:["other"]},shi:{cardinal:["one","few","other"],ordinal:["other"]},si:o[1],sk:{cardinal:["one","few","many","other"],ordinal:["other"]},sl:{cardinal:["one","two","few","other"],ordinal:["other"]},sma:o[3],smi:o[3],smj:o[3],smn:o[3],sms:o[3],sn:o[1],so:o[1],sq:{cardinal:["one","other"],ordinal:["one","many","other"]},sr:{cardinal:["one","few","other"],ordinal:["other"]},ss:o[1],ssy:o[1],st:o[1],sv:o[2],sw:o[1],syr:o[1],ta:o[1],te:o[1],teo:o[1],th:o[0],ti:o[1],tig:o[1],tk:{cardinal:["one","other"],ordinal:["few","other"]},tl:o[2],tn:o[1],to:o[0],tr:o[1],ts:o[1],tzm:o[1],ug:o[1],uk:{cardinal:["one","few","many","other"],ordinal:["few","other"]},ur:o[1],uz:o[1],ve:o[1],vi:{cardinal:["other"],ordinal:["one","other"]},vo:o[1],vun:o[1],wa:o[1],wae:o[1],wo:o[0],xh:o[1],xog:o[1],yi:o[1],yo:o[0],yue:o[0],zh:o[0],zu:o[1]})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t){function n(e,t,n){var r={day:"numeric",month:"short",year:"numeric"};switch(n){case"full":r.weekday="long";case"long":r.month="long";break;case"short":r.month="numeric"}return new Date(e).toLocaleDateString(t,r)}e.exports=function(){return n}},function(e,t){function n(e){if(!isFinite(e))return String(e);var t="";e<0?(t="-",e=Math.abs(e)):e=Number(e);var n=e%60,r=[Math.round(n)===n?n:n.toFixed(3)];return e<60?r.unshift(0):(e=Math.round((e-r[0])/60),r.unshift(e%60),e>=60&&(e=Math.round((e-r[0])/60),r.unshift(e))),t+r.shift()+":"+r.map((function(e){return e<10?"0"+String(e):String(e)})).join(":")}e.exports=function(){return n}},function(e,t){e.exports=function(e){var t=function(e,t,n){var r=n&&n.split(":")||[],i={integer:{maximumFractionDigits:0},percent:{style:"percent"},currency:{style:"currency",currency:r[1]&&r[1].trim()||CURRENCY,minimumFractionDigits:2,maximumFractionDigits:2}};return new Intl.NumberFormat(t,i[r[0]]||{}).format(e)}.toString().replace("CURRENCY",JSON.stringify(e.currency||"USD")).match(/\(([^)]*)\)[^{]*{([\s\S]*)}/);return new Function(t[1],t[2])}},function(e,t){function n(e,t,n){var r={second:"numeric",minute:"numeric",hour:"numeric"};switch(n){case"full":case"long":r.timeZoneName="short";break;case"short":delete r.second}return new Date(e).toLocaleTimeString(t,r)}e.exports=function(){return n}},function(e,t,n){"use strict";n.r(t);var r=n(1),i=n.n(r),o=n(2),a={break:!0,continue:!0,delete:!0,else:!0,for:!0,function:!0,if:!0,in:!0,new:!0,return:!0,this:!0,typeof:!0,var:!0,void:!0,while:!0,with:!0,case:!0,catch:!0,default:!0,do:!0,finally:!0,instanceof:!0,switch:!0,throw:!0,try:!0},c={debugger:!0,class:!0,enum:!0,extends:!0,super:!0,const:!0,export:!0,import:!0,null:!0,true:!0,false:!0,implements:!0,let:!0,private:!0,public:!0,yield:!0,interface:!0,package:!0,protected:!0,static:!0};function s(e,t){if(/^[A-Z_$][0-9A-Z_$]*$/i.test(e)&&!a[e])return t?"".concat(t,".").concat(e):e;var n=JSON.stringify(e);return t?t+"[".concat(n,"]"):n}function u(e){var t=e.trim().replace(/\W+/g,"_");return a[t]||c[t]||/^\d/.test(t)?"_"+t:t}var l=new RegExp("^"+["ar","ckb","fa","he","ks($|[^bfh])","lrc","mzn","pa-Arab","ps","ug","ur","uz-Arab","yi"].join("|^"));function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mf=t,this.lc=null,this.locales={},this.runtime={},this.formatters={}}var t,n;return t=e,(n=[{key:"compile",value:function(e,t,n){var r=this;if("object"!=f(e)){this.lc=t;var i=n[t]||{cardinal:[],ordinal:[]};i.strict=!!this.mf.options.strictNumberSign;var a=Object(o.parse)(e,i).map((function(e){return r.token(e)}));return"function(d) { return ".concat(a.join(" + ")||'""',"; }")}var c={};for(var s in e){var u=n.hasOwnProperty(s)?s:t;c[s]=this.compile(e[s],u,n)}return c}},{key:"cases",value:function(e,t){var n=this,r="select"===e.type||!this.mf.hasCustomPluralFuncs,i=e.cases.map((function(e){var i=e.key,o=e.tokens;"other"===i&&(r=!1);var a=o.map((function(e){return n.token(e,t)}));return s(i)+": "+(a.join(" + ")||'""')}));if(r)throw new Error("No 'other' form found in "+JSON.stringify(e));return"{ ".concat(i.join(", ")," }")}},{key:"token",value:function(e,t){var n,r=this;if("string"==typeof e)return JSON.stringify(e);var i,o,a,c,f=[s(e.arg,"d")];switch(e.type){case"argument":return this.mf.options.biDiSupport?(i=f[0],o=this.lc,a=l.test(o),c=JSON.stringify(a?"":""),"".concat(c," + ").concat(i," + ").concat(c)):f[0];case"select":n="select",t&&this.mf.options.strictNumberSign&&(t=null),f.push(this.cases(e,t)),this.runtime.select=!0;break;case"selectordinal":n="plural",f.push(0,u(this.lc),this.cases(e,e),1),this.locales[this.lc]=!0,this.runtime.plural=!0;break;case"plural":n="plural",f.push(e.offset||0,u(this.lc),this.cases(e,e)),this.locales[this.lc]=!0,this.runtime.plural=!0;break;case"function":if(!(e.key in this.mf.fmt)&&e.key in this.mf.constructor.formatters){var d=this.mf.constructor.formatters[e.key];this.mf.fmt[e.key]=d(this.mf)}if(!this.mf.fmt[e.key])throw new Error("Formatting function ".concat(JSON.stringify(e.key)," not found!"));if(f.push(JSON.stringify(this.lc)),e.param){t&&this.mf.options.strictNumberSign&&(t=null);var p=e.param.tokens.map((function(e){return r.token(e,t)}));f.push("("+(p.join(" + ")||'""')+").trim()")}n=s(e.key,"fmt"),this.formatters[e.key]=!0;break;case"octothorpe":if(!t)return'"#"';n="number",f=[s(t.arg,"d"),JSON.stringify(t.arg)],t.offset&&f.push(t.offset),this.runtime.number=!0}if(!n)throw new Error("Parser error for token "+JSON.stringify(e));return"".concat(n,"(").concat(f.join(", "),")")}}])&&d(t.prototype,n),e}(),b=n(3),h=n.n(b),m=n(0),g=n.n(m);function O(e,t,n){var r=function(){return t.apply(this,arguments)};if(r.toString=function(){return t.toString()},n){var i=h.a[e]||{};r.cardinal=i.cardinal,r.ordinal=i.ordinal}else r.cardinal=[],r.ordinal=[];return r}function j(e,t){for(var n=t.pluralKeyChecks,r=String(e);r;r=r.replace(/[-_]?[^-_]*$/,"")){var i=g.a[r];if(i)return O(r,i,n)}throw new Error("Localisation function not found for locale "+JSON.stringify(e))}function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.plural=function(e,t,n,r,i){if({}.hasOwnProperty.call(r,e))return r[e];t&&(e-=t);var o=n(e,i);return o in r?r[o]:r.other},this.select=function(e,t){return{}.hasOwnProperty.call(t,e)?t[e]:t.other},this.mf=t,this.setStrictNumber(t.options.strictNumberSign)}var t,n;return t=e,(n=[{key:"setStrictNumber",value:function(t){this.number=t?e.strictNumber:e.defaultNumber}},{key:"toString",value:function(e,t){for(var n={},r=Object.keys(t.locales),i=0;i<r.length;++i){var o=r[i];n[u(o)]=e[o]}for(var a=Object.keys(t.runtime),c=0;c<a.length;++c){var l=a[c];n[l]=this[l]}var f=Object.keys(t.formatters);if(f.length>0){n.fmt={};for(var d=0;d<f.length;++d){var p=f[d];n.fmt[p]=this.mf.fmt[p]}}return function e(t,n){if("object"!=v(t)){var r=t.toString().replace(/^(function )\w*/,"$1"),i=/([ \t]*)\S.*$/.exec(r);return i?r.replace(new RegExp("^"+i[1],"mg"),""):r}var o=[];for(var a in t){var c=e(t[a],n+1);o.push(0===n?"var ".concat(a," = ").concat(c,";\n"):"".concat(s(a),": ").concat(c))}if(0===n)return o.join("");if(0===o.length)return"{}";for(var u=" ";--n;)u+=" ";var l=o.join(",\n").replace(/^/gm,u);return"{\n".concat(l,"\n}")}(n,0)}}])&&w(t.prototype,n),e}();function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),e}y.defaultNumber=function(e,t,n){if(!n)return e;if(isNaN(e))throw new Error("Can't apply offset:"+n+" to argument `"+t+"` with non-numerical value "+JSON.stringify(e)+".");return e-n},y.strictNumber=function(e,t,n){if(isNaN(e))throw new Error("Argument `"+t+"` has non-numerical value "+JSON.stringify(e)+".");return e-(n||0)},n.d(t,"default",(function(){return k}));var k=function(){function e(t,n){var r=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=Object.assign({biDiSupport:!1,customFormatters:null,pluralKeyChecks:!0,strictNumberSign:!1},n),this.pluralFuncs={},"string"==typeof t)this.pluralFuncs[t]=j(t,this.options),this.defaultLocale=t;else if(Array.isArray(t))t.forEach((function(e){r.pluralFuncs[e]=j(e,r.options)})),this.defaultLocale=t[0];else{if(t)for(var i=Object.keys(t),o=0;o<i.length;++o){var a=i[o];if("function"!=typeof t[a]){var c="Expected function value for locale "+String(a);throw new Error(c)}this.pluralFuncs[a]=t[a],this.defaultLocale||(this.defaultLocale=a)}this.defaultLocale?this.hasCustomPluralFuncs=!0:(this.defaultLocale=e.defaultLocale,this.hasCustomPluralFuncs=!1)}this.fmt=Object.assign({},this.options.customFormatters),this.runtime=new y(this)}return T(e,null,[{key:"escape",value:function(e,t){var n=t?/[#{}]/g:/[{}]/g;return String(e).replace(n,"'$&'")}}]),T(e,[{key:"addFormatters",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];this.fmt[r]=e[r]}return this}},{key:"disablePluralKeyChecks",value:function(){for(var e in this.options.pluralKeyChecks=!1,this.pluralFuncs){var t=this.pluralFuncs[e];t&&(t.cardinal=[],t.ordinal=[])}return this}},{key:"setBiDiSupport",value:function(e){return this.options.biDiSupport=!!e||void 0===e,this}},{key:"setStrictNumberSign",value:function(e){return this.options.strictNumberSign=!!e||void 0===e,this.runtime.setStrictNumber(this.options.strictNumberSign),this}},{key:"compile",value:function(e,t){var n={};if(0===Object.keys(this.pluralFuncs).length)if(t){var r=j(t,this.options);if(!r){var i=JSON.stringify(t);throw new Error("Locale ".concat(i," not found!"))}n[t]=r}else t=this.defaultLocale,n=function(e){for(var t=e.pluralKeyChecks,n={},r=Object.keys(g.a),i=0;i<r.length;++i){var o=r[i];n[o]=O(o,g.a[o],t)}return n}(this.options);else if(t){var o=this.pluralFuncs[t];if(!o){var a=JSON.stringify(t),c=JSON.stringify(this.pluralFuncs);throw new Error("Locale ".concat(a," not found in ").concat(c,"!"))}n[t]=o}else t=this.defaultLocale,n=this.pluralFuncs;var l=new p(this),f=l.compile(e,t,n);if("object"!=_(e)){var d=new Function("number, plural, select, fmt",u(t),"return "+f),b=this.runtime;return d(b.number,b.plural,b.select,this.fmt,n[t])}var h=this.runtime.toString(n,l)+"\n",m=function e(t,n){if(n||(n=0),"object"!=_(t))return t;for(var r="",i=0;i<n;++i)r+=" ";var o=[];for(var a in t){var c=e(t[a],n+1);o.push("\n".concat(r," ").concat(s(a),": ").concat(c))}return"{".concat(o.join(","),"\n").concat(r,"}")}(f),v=new Function(h+"return "+m)();if(v.hasOwnProperty("toString"))throw new Error("The top-level message key `toString` is reserved");return v.toString=function(e){return e&&"export default"!==e?e.indexOf(".")>-1?h+e+" = "+m:h+["(function (root, G) {",' if (typeof define === "function" && define.amd) { define(G); }',' else if (typeof exports === "object") { module.exports = G; }'," else { "+s(e,"root")+" = G; }","})(this, "+m+");"].join("\n"):h+"export default "+m},v}}]),e}();k.defaultLocale="en",k.formatters=i.a}]).default},function(e,t,n){var r;
|
|
2
2
|
/*!
|
|
3
3
|
* UAParser.js v0.7.22
|
|
4
4
|
* Lightweight JavaScript-based User-Agent string parser
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
|
|
8
8
|
* Licensed under MIT License
|
|
9
|
-
*/!function(i,o){"use strict";var a="model",c="name",s="type",u="vendor",l="version",f="mobile",d="tablet",p="smarttv",b={extend:function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var n,r,i,o,a,c,s=0;s<t.length&&!a;){var u=t[s],l=t[s+1];for(n=r=0;n<u.length&&!a;)if(a=u[n++].exec(e))for(i=0;i<l.length;i++)c=a[++r],"object"==typeof(o=l[i])&&o.length>0?2==o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:3==o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=c?c.replace(o[1],o[2]):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:4==o.length&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0):this[o]=c||void 0;s+=2}},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(b.has(t[n][r],e))return"?"===n?void 0:n}else if(b.has(t[n],e))return"?"===n?void 0:n;return e}},m={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},g={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[c,l],[/(opios)[\/\s]+([\w\.]+)/i],[[c,"Opera Mini"],l],[/\s(opr)\/([\w\.]+)/i],[[c,"Opera"],l],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[c,l],[/(konqueror)\/([\w\.]+)/i],[[c,"Konqueror"],l],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[c,"IE"],l],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[c,"Edge"],l],[/(yabrowser)\/([\w\.]+)/i],[[c,"Yandex"],l],[/(Avast)\/([\w\.]+)/i],[[c,"Avast Secure Browser"],l],[/(AVG)\/([\w\.]+)/i],[[c,"AVG Secure Browser"],l],[/(puffin)\/([\w\.]+)/i],[[c,"Puffin"],l],[/(focus)\/([\w\.]+)/i],[[c,"Firefox Focus"],l],[/(opt)\/([\w\.]+)/i],[[c,"Opera Touch"],l],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[c,"UCBrowser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],l],[/(windowswechat qbcore)\/([\w\.]+)/i],[[c,"WeChat(Win) Desktop"],l],[/(micromessenger)\/([\w\.]+)/i],[[c,"WeChat"],l],[/(brave)\/([\w\.]+)/i],[[c,"Brave"],l],[/(qqbrowserlite)\/([\w\.]+)/i],[c,l],[/(QQ)\/([\d\.]+)/i],[c,l],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[c,l],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[c,l],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[c,l],[/(MetaSr)[\/\s]?([\w\.]+)/i],[c],[/(LBBROWSER)/i],[c],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[c,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[l,[c,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[c,l],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[c,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[c,/(.+)/,"$1 WebView"],l],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[c,/(.+(?:g|us))(.+)/,"$1 $2"],l],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[l,[c,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[c,"Sailfish Browser"],l],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[c,l],[/(dolfin)\/([\w\.]+)/i],[[c,"Dolphin"],l],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[c,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[c,"Chrome"],l],[/(coast)\/([\w\.]+)/i],[[c,"Opera Coast"],l],[/fxios\/([\w\.-]+)/i],[l,[c,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[l,[c,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[l,c],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[c,"GSA"],l],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[c,[l,h.str,m.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[c,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[c,"Netscape"],l],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[c,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",b.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",b.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",b.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[a,u,[s,d]],[/applecoremedia\/[\w\.]+ \((ipad)/],[a,[u,"Apple"],[s,d]],[/(apple\s{0,1}tv)/i],[[a,"Apple TV"],[u,"Apple"],[s,p]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[u,a,[s,d]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[a,[u,"Amazon"],[s,d]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[a,h.str,m.device.amazon.model],[u,"Amazon"],[s,f]],[/android.+aft([bms])\sbuild/i],[a,[u,"Amazon"],[s,p]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[a,u,[s,f]],[/\((ip[honed|\s\w*]+);/i],[a,[u,"Apple"],[s,f]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[u,a,[s,f]],[/\(bb10;\s(\w+)/i],[a,[u,"BlackBerry"],[s,f]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[a,[u,"Asus"],[s,d]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[u,"Sony"],[a,"Xperia Tablet"],[s,d]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[u,"Sony"],[s,f]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[u,a,[s,"console"]],[/android.+;\s(shield)\sbuild/i],[a,[u,"Nvidia"],[s,"console"]],[/(playstation\s[34portablevi]+)/i],[a,[u,"Sony"],[s,"console"]],[/(sprint\s(\w+))/i],[[u,h.str,m.device.sprint.vendor],[a,h.str,m.device.sprint.model],[s,f]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[u,[a,/_/g," "],[s,f]],[/(nexus\s9)/i],[a,[u,"HTC"],[s,d]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29|ele-l29)/i],[a,[u,"Huawei"],[s,f]],[/android.+(bah2?-a?[lw]\d{2})/i],[a,[u,"Huawei"],[s,d]],[/(microsoft);\s(lumia[\s\w]+)/i],[u,a,[s,f]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[a,[u,"Microsoft"],[s,"console"]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,"Microsoft"],[s,f]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[a,[u,"Motorola"],[s,f]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[u,"Motorola"],[s,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[u,b.trim],[a,b.trim],[s,p]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,"Samsung"],[s,p]],[/\(dtv[\);].+(aquos)/i],[a,[u,"Sharp"],[s,p]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[u,"Samsung"],a,[s,d]],[/smart-tv.+(samsung)/i],[u,[s,p],a],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[u,"Samsung"],a,[s,f]],[/sie-(\w*)/i],[a,[u,"Siemens"],[s,f]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[u,"Nokia"],a,[s,f]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[a,[u,"Acer"],[s,d]],[/android.+([vl]k\-?\d{3})\s+build/i],[a,[u,"LG"],[s,d]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[u,"LG"],a,[s,d]],[/(lg) netcast\.tv/i],[u,a,[s,p]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[a,[u,"LG"],[s,f]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[u,a,[s,d]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[a,[u,"Lenovo"],[s,d]],[/(lenovo)[_\s-]?([\w-]+)/i],[u,a,[s,f]],[/linux;.+((jolla));/i],[u,a,[s,f]],[/((pebble))app\/[\d\.]+\s/i],[u,a,[s,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[u,a,[s,f]],[/crkey/i],[[a,"Chromecast"],[u,"Google"],[s,p]],[/android.+;\s(glass)\s\d/i],[a,[u,"Google"],[s,"wearable"]],[/android.+;\s(pixel c)[\s)]/i],[a,[u,"Google"],[s,d]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[a,[u,"Google"],[s,f]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]?[\w\s]+))\s+build/i],[[a,/_/g," "],[u,"Xiaomi"],[s,f]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]?[\w\s]+))\s+build/i],[[a,/_/g," "],[u,"Xiaomi"],[s,d]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[a,[u,"Meizu"],[s,f]],[/(mz)-([\w-]{2,})/i],[[u,"Meizu"],a,[s,f]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[a,[u,"OnePlus"],[s,f]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[a,[u,"RCA"],[s,d]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[a,[u,"Dell"],[s,d]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[a,[u,"Verizon"],[s,d]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[u,"Barnes & Noble"],a,[s,d]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[a,[u,"NuVision"],[s,d]],[/android.+;\s(k88)\sbuild/i],[a,[u,"ZTE"],[s,d]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[a,[u,"Swiss"],[s,f]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[a,[u,"Swiss"],[s,d]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[a,[u,"Zeki"],[s,d]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[u,"Dragon Touch"],a,[s,d]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[a,[u,"Insignia"],[s,d]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[a,[u,"NextBook"],[s,d]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[u,"Voice"],a,[s,f]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[u,"LvTel"],a,[s,f]],[/android.+;\s(PH-1)\s/i],[a,[u,"Essential"],[s,f]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[a,[u,"Envizen"],[s,d]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[u,a,[s,d]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[a,[u,"MachSpeed"],[s,d]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[u,a,[s,d]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[a,[u,"Rotor"],[s,d]],[/android.+(KS(.+))\s+build/i],[a,[u,"Amazon"],[s,d]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[u,a,[s,d]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[s,b.lowerize],u,a],[/[\s\/\(](smart-?tv)[;\)]/i],[[s,p]],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[u,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[c,l],[/rv\:([\w\.]{1,9}).+(gecko)/i],[l,c]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[c,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[c,[l,h.str,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[c,"Windows"],[l,h.str,m.os.windows.version]],[/\((bb)(10);/i],[[c,"BlackBerry"],l],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[c,l],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[c,"Symbian"],l],[/\((series40);/i],[c],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[c,"Firefox OS"],l],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[c,l],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[c,"Chromium OS"],l],[/(sunos)\s?([\w\.\d]*)/i],[[c,"Solaris"],l],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[c,l],[/(haiku)\s(\w+)/i],[c,l],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[l,/_/g,"."],[c,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[c,"Mac OS"],[l,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[c,l]]},O=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof O))return new O(e,t).getResult();var n=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=t?b.extend(g,t):g;return this.getBrowser=function(){var e={name:void 0,version:void 0};return h.rgx.call(e,n,r.browser),e.major=b.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return h.rgx.call(e,n,r.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return h.rgx.call(e,n,r.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return h.rgx.call(e,n,r.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return h.rgx.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};O.VERSION="0.7.22",O.BROWSER={NAME:c,MAJOR:"major",VERSION:l},O.CPU={ARCHITECTURE:"architecture"},O.DEVICE={MODEL:a,VENDOR:u,TYPE:s,CONSOLE:"console",MOBILE:f,SMARTTV:p,TABLET:d,WEARABLE:"wearable",EMBEDDED:"embedded"},O.ENGINE={NAME:c,VERSION:l},O.OS={NAME:c,VERSION:l},void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=O),t.UAParser=O):void 0===(r=function(){return O}.call(t,n,t,e))||(e.exports=r);var j=i&&(i.jQuery||i.Zepto);if(j&&!j.ua){var v=new O;j.ua=v.getResult(),j.ua.get=function(){return v.getUA()},j.ua.set=function(e){v.setUA(e);var t=v.getResult();for(var n in t)j.ua[n]=t[n]}}}("object"==typeof window?window:this)},,function(e,t,n){var r,i,o;i=[t],void 0===(o="function"==typeof(r=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o="undefined"!=typeof self?self:window,a=0,c=1,s=2,u=3,l="closed",f="errored",d="joined",p="joining",b="leaving",h="phx_close",m="phx_error",g="phx_join",O="phx_reply",j="phx_leave",v=[h,m,g,O,j],w="longpoll",y="websocket",_=function(e){return"function"==typeof e?e:function(){return e}},x=function(){function e(t,n,i,o){r(this,e),this.channel=t,this.event=n,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=o,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}return i(e,[{key:"resend",value:function(e){this.timeout=e,this.reset(),this.send()}},{key:"send",value:function(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}},{key:"receive",value:function(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}},{key:"reset",value:function(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}},{key:"matchReceive",value:function(e){var t=e.status,n=e.response;e.ref,this.recHooks.filter((function(e){return e.status===t})).forEach((function(e){return e.callback(n)}))}},{key:"cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}},{key:"startTimeout",value:function(){var e=this;this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(function(t){e.cancelRefEvent(),e.cancelTimeout(),e.receivedResp=t,e.matchReceive(t)})),this.timeoutTimer=setTimeout((function(){e.trigger("timeout",{})}),this.timeout)}},{key:"hasReceived",value:function(e){return this.receivedResp&&this.receivedResp.status===e}},{key:"trigger",value:function(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}}]),e}(),T=e.Channel=function(){function e(t,n,i){var o=this;r(this,e),this.state=l,this.topic=t,this.params=_(n||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,g,this.params,this.timeout),this.pushBuffer=[],this.rejoinTimer=new N((function(){return o.rejoinUntilConnected()}),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(function(){o.state=d,o.rejoinTimer.reset(),o.pushBuffer.forEach((function(e){return e.send()})),o.pushBuffer=[]})),this.onClose((function(){o.rejoinTimer.reset(),o.socket.log("channel","close "+o.topic+" "+o.joinRef()),o.state=l,o.socket.remove(o)})),this.onError((function(e){o.isLeaving()||o.isClosed()||(o.socket.log("channel","error "+o.topic,e),o.state=f,o.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(function(){o.isJoining()&&(o.socket.log("channel","timeout "+o.topic+" ("+o.joinRef()+")",o.joinPush.timeout),new x(o,j,_({}),o.timeout).send(),o.state=f,o.joinPush.reset(),o.rejoinTimer.scheduleTimeout())})),this.on(O,(function(e,t){o.trigger(o.replyEventName(t),e)}))}return i(e,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"join",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to join multiple times. 'join' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(e),this.joinPush}},{key:"onClose",value:function(e){this.on(h,e)}},{key:"onError",value:function(e){return this.on(m,(function(t){return e(t)}))}},{key:"on",value:function(e,t){var n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}},{key:"off",value:function(e,t){this.bindings=this.bindings.filter((function(n){return!(n.event===e&&(void 0===t||t===n.ref))}))}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '"+e+"' to '"+this.topic+"' before joining. Use channel.join() before pushing events";var r=new x(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}},{key:"leave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=b;var n=function(){e.socket.log("channel","leave "+e.topic),e.trigger(h,"leave")},r=new x(this,j,_({}),t);return r.receive("ok",(function(){return n()})).receive("timeout",(function(){return n()})),r.send(),this.canPush()||r.trigger("ok",{}),r}},{key:"onMessage",value:function(e,t,n){return t}},{key:"isMember",value:function(e,t,n,r){if(this.topic!==e)return!1;var i=v.indexOf(t)>=0;return!r||!i||r===this.joinRef()||(this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1)}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"sendJoin",value:function(e){this.state=p,this.joinPush.resend(e)}},{key:"rejoin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||this.sendJoin(e)}},{key:"trigger",value:function(e,t,n,r){var i=this,o=this.onMessage(e,t,n,r);if(t&&!o)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter((function(t){return t.event===e})).map((function(e){return e.callback(o,n,r||i.joinRef())}))}},{key:"replyEventName",value:function(e){return"chan_reply_"+e}},{key:"isClosed",value:function(){return this.state===l}},{key:"isErrored",value:function(){return this.state===f}},{key:"isJoined",value:function(){return this.state===d}},{key:"isJoining",value:function(){return this.state===p}},{key:"isLeaving",value:function(){return this.state===b}}]),e}(),k={encode:function(e,t){var n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))},decode:function(e,t){var r=JSON.parse(e),i=n(r,5);return t({join_ref:i[0],ref:i[1],topic:i[2],event:i[3],payload:i[4]})}},S=(e.Socket=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=i.timeout||1e4,this.transport=i.transport||o.WebSocket||S,this.defaultEncoder=k.encode,this.defaultDecoder=k.decode,this.transport!==S?(this.encode=i.encode||this.defaultEncoder,this.decode=i.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=i.heartbeatIntervalMs||3e4,this.reconnectAfterMs=i.reconnectAfterMs||function(e){return[1e3,2e3,5e3,1e4][e-1]||1e4},this.logger=i.logger||function(){},this.longpollerTimeout=i.longpollerTimeout||2e4,this.params=_(i.params||{}),this.endPoint=t+"/"+y,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new N((function(){n.teardown((function(){return n.connect()}))}),this.reconnectAfterMs)}return i(e,[{key:"protocol",value:function(){return location.protocol.match(/^https/)?"wss":"ws"}},{key:"endPointURL",value:function(){var e=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:"2.0.0"});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?this.protocol()+":"+e:this.protocol()+"://"+location.host+e}},{key:"disconnect",value:function(e,t,n){this.reconnectTimer.reset(),this.teardown(e,t,n)}},{key:"connect",value:function(e){var t=this;e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=_(e)),this.conn||(this.conn=new this.transport(this.endPointURL()),this.conn.timeout=this.longpollerTimeout,this.conn.onopen=function(){return t.onConnOpen()},this.conn.onerror=function(e){return t.onConnError(e)},this.conn.onmessage=function(e){return t.onConnMessage(e)},this.conn.onclose=function(e){return t.onConnClose(e)})}},{key:"log",value:function(e,t,n){this.logger(e,t,n)}},{key:"onOpen",value:function(e){this.stateChangeCallbacks.open.push(e)}},{key:"onClose",value:function(e){this.stateChangeCallbacks.close.push(e)}},{key:"onError",value:function(e){this.stateChangeCallbacks.error.push(e)}},{key:"onMessage",value:function(e){this.stateChangeCallbacks.message.push(e)}},{key:"onConnOpen",value:function(){var e=this;this.log("transport","connected to "+this.endPointURL()),this.flushSendBuffer(),this.reconnectTimer.reset(),this.conn.skipHeartbeat||(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((function(){return e.sendHeartbeat()}),this.heartbeatIntervalMs)),this.stateChangeCallbacks.open.forEach((function(e){return e()}))}},{key:"teardown",value:function(e,t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n||""):this.conn.close(),this.conn=null),e&&e()}},{key:"onConnClose",value:function(e){this.log("transport","close",e),this.triggerChanError(),clearInterval(this.heartbeatTimer),e&&1e3!==e.code&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((function(t){return t(e)}))}},{key:"onConnError",value:function(e){this.log("transport",e),this.triggerChanError(),this.stateChangeCallbacks.error.forEach((function(t){return t(e)}))}},{key:"triggerChanError",value:function(){this.channels.forEach((function(e){return e.trigger(m)}))}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case a:return"connecting";case c:return"open";case s:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(e){this.channels=this.channels.filter((function(t){return t.joinRef()!==e.joinRef()}))}},{key:"channel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new T(e,t,this);return this.channels.push(n),n}},{key:"push",value:function(e){var t=this,n=e.topic,r=e.event,i=e.payload,o=e.ref,a=e.join_ref,c=function(){t.encode(e,(function(e){t.conn.send(e)}))};this.log("push",n+" "+r+" ("+a+", "+o+")",i),this.isConnected()?c():this.sendBuffer.push(c)}},{key:"makeRef",value:function(){var e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}},{key:"sendHeartbeat",value:function(){if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void this.conn.close(1e3,"hearbeat timeout");this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef})}}},{key:"flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((function(e){return e()})),this.sendBuffer=[])}},{key:"onConnMessage",value:function(e){var t=this;this.decode(e.data,(function(e){var n=e.topic,r=e.event,i=e.payload,o=e.ref,a=e.join_ref;o&&o===t.pendingHeartbeatRef&&(t.pendingHeartbeatRef=null),t.log("receive",(i.status||"")+" "+n+" "+r+" "+(o&&"("+o+")"||""),i),t.channels.filter((function(e){return e.isMember(n,r,i,a)})).forEach((function(e){return e.trigger(r,i,o,a)})),t.stateChangeCallbacks.message.forEach((function(t){return t(e)}))}))}}]),e}(),e.LongPoll=function(){function e(t){r(this,e),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=a,this.poll()}return i(e,[{key:"normalizeEndpoint",value:function(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+y),"$1/"+w)}},{key:"endpointURL",value:function(){return E.appendParams(this.pollEndpoint,{token:this.token})}},{key:"closeAndRetry",value:function(){this.close(),this.readyState=a}},{key:"ontimeout",value:function(){this.onerror("timeout"),this.closeAndRetry()}},{key:"poll",value:function(){var e=this;this.readyState!==c&&this.readyState!==a||E.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(function(t){if(t){var n=t.status,r=t.token,i=t.messages;e.token=r}else n=0;switch(n){case 200:i.forEach((function(t){return e.onmessage({data:t})})),e.poll();break;case 204:e.poll();break;case 410:e.readyState=c,e.onopen(),e.poll();break;case 0:case 500:e.onerror(),e.closeAndRetry();break;default:throw"unhandled poll status "+n}}))}},{key:"send",value:function(e){var t=this;E.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(function(e){e&&200===e.status||(t.onerror(e&&e.status),t.closeAndRetry())}))}},{key:"close",value:function(e,t){this.readyState=u,this.onclose()}}]),e}()),E=e.Ajax=function(){function e(){r(this,e)}return i(e,null,[{key:"request",value:function(e,t,n,r,i,a,c){if(o.XDomainRequest){var s=new XDomainRequest;this.xdomainRequest(s,e,t,r,i,a,c)}else{var u=o.XMLHttpRequest?new o.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.xhrRequest(u,e,t,n,r,i,a,c)}}},{key:"xdomainRequest",value:function(e,t,n,r,i,o,a){var c=this;e.timeout=i,e.open(t,n),e.onload=function(){var t=c.parseJSON(e.responseText);a&&a(t)},o&&(e.ontimeout=o),e.onprogress=function(){},e.send(r)}},{key:"xhrRequest",value:function(e,t,n,r,i,o,a,c){var s=this;e.open(t,n,!0),e.timeout=o,e.setRequestHeader("Content-Type",r),e.onerror=function(){c&&c(null)},e.onreadystatechange=function(){if(e.readyState===s.states.complete&&c){var t=s.parseJSON(e.responseText);c(t)}},a&&(e.ontimeout=a),e.send(i)}},{key:"parseJSON",value:function(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}},{key:"serialize",value:function(e,n){var r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=n?n+"["+i+"]":i,a=e[i];"object"===(void 0===a?"undefined":t(a))?r.push(this.serialize(a,o)):r.push(encodeURIComponent(o)+"="+encodeURIComponent(a))}return r.join("&")}},{key:"appendParams",value:function(e,t){return 0===Object.keys(t).length?e:e+(e.match(/\?/)?"&":"?")+this.serialize(t)}}]),e}();E.states={complete:4},e.Presence=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e);var o=i.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(o.state,(function(t){var r=n.caller,i=r.onJoin,o=r.onLeave,a=r.onSync;n.joinRef=n.channel.joinRef(),n.state=e.syncState(n.state,t,i,o),n.pendingDiffs.forEach((function(t){n.state=e.syncDiff(n.state,t,i,o)})),n.pendingDiffs=[],a()})),this.channel.on(o.diff,(function(t){var r=n.caller,i=r.onJoin,o=r.onLeave,a=r.onSync;n.inPendingSyncState()?n.pendingDiffs.push(t):(n.state=e.syncDiff(n.state,t,i,o),a())}))}return i(e,[{key:"onJoin",value:function(e){this.caller.onJoin=e}},{key:"onLeave",value:function(e){this.caller.onLeave=e}},{key:"onSync",value:function(e){this.caller.onSync=e}},{key:"list",value:function(t){return e.list(this.state,t)}},{key:"inPendingSyncState",value:function(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}}],[{key:"syncState",value:function(e,t,n,r){var i=this,o=this.clone(e),a={},c={};return this.map(o,(function(e,n){t[e]||(c[e]=n)})),this.map(t,(function(e,t){var n=o[e];if(n){var r=t.metas.map((function(e){return e.phx_ref})),s=n.metas.map((function(e){return e.phx_ref})),u=t.metas.filter((function(e){return s.indexOf(e.phx_ref)<0})),l=n.metas.filter((function(e){return r.indexOf(e.phx_ref)<0}));u.length>0&&(a[e]=t,a[e].metas=u),l.length>0&&(c[e]=i.clone(n),c[e].metas=l)}else a[e]=t})),this.syncDiff(o,{joins:a,leaves:c},n,r)}},{key:"syncDiff",value:function(e,t,n,r){var i=t.joins,o=t.leaves,a=this.clone(e);return n||(n=function(){}),r||(r=function(){}),this.map(i,(function(e,t){var r=a[e];if(a[e]=t,r){var i,o=a[e].metas.map((function(e){return e.phx_ref})),c=r.metas.filter((function(e){return o.indexOf(e.phx_ref)<0}));(i=a[e].metas).unshift.apply(i,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(c))}n(e,r,t)})),this.map(o,(function(e,t){var n=a[e];if(n){var i=t.metas.map((function(e){return e.phx_ref}));n.metas=n.metas.filter((function(e){return i.indexOf(e.phx_ref)<0})),r(e,n,t),0===n.metas.length&&delete a[e]}})),a}},{key:"list",value:function(e,t){return t||(t=function(e,t){return t}),this.map(e,(function(e,n){return t(e,n)}))}},{key:"map",value:function(e,t){return Object.getOwnPropertyNames(e).map((function(n){return t(n,e[n])}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}}]),e}();var N=function(){function e(t,n){r(this,e),this.callback=t,this.timerCalc=n,this.timer=null,this.tries=0}return i(e,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var e=this;clearTimeout(this.timer),this.timer=setTimeout((function(){e.tries=e.tries+1,e.callback()}),this.timerCalc(this.tries+1))}}]),e}()})?r.apply(t,i):r)||(e.exports=o)},,,function(e,t,n){"use strict";n.r(t),n.d(t,"I18n",(function(){return o.I18n})),n.d(t,"Core",(function(){return o.Core})),n.d(t,"EventHub",(function(){return o.EventHub}));var r=n(76),i=n.n(r),o=n(53);function a(){return window.navigator.userAgent.toLowerCase().match(/micromessenger/i)?"wechat":"web"}var c=n(43),s=n(19),u=n(56),l=n(28),f=n(74),d=n(58),p=n(0),b=n(5),h=n(9),m=n(10);function g(e,t){return new Promise((n,r)=>{const i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",e),t&&Object.keys(t).forEach(e=>{i.setAttribute(e,t[e])}),i.onload=()=>{n()},i.onerror=t=>{r(new Error("failed to load:"+e))},document.head.appendChild(i)})}var O=n(1),j=n(6),v=n(7),w=n(21);function y(e){window.parent!==window&&window.parent.postMessage(e,"*")}const _=[],x={cached:!1,value:null};let T,k;function S(){return!T||0===T.length}async function E(e,t){const{markId:n}=e;if(13===n||16===n)return{type:"input",candidates:"",active:!0};if(14===n||15===n)return null;if(-1===n||-2===n)return{active:!0,type:"select",weight:-1===n?1:-1};{const r={type:"input",active:!0},{start:i}=await Object(w.e)(e,t);return 6===n||8===n||12===n||2===n?r.candidates="number"==typeof i?Object(v.a)(i-1):i.substring(0,i.length-1):1===n||5===n||11===n||4===n||7===n?r.candidates=Object(v.a)(i+1):3!==n&&9!==n||(r.candidates=Object(v.a)(i)),r}}function N(e){return"testcase"===e}window.CFPlugin=window.CFPlugin||{},window.CFPlugin.fakedServers={};const I=Object(m.e)(location.search),C={local:!!location.origin.match(/:\d+$/),realtime:!("/themes"!==location.pathname),debug:!!I.dev,autoRun:!!I.auto_path,infer:!!I.infer_id,parseRealUrl:function(e){const t=location.href.match(/real_port=(\d+)/);if(t){const n=e.substr(8).match(/\//);if(n){const r=e.substr(8+n.index+1);return`http://localhost:${t[1]}/${r}`}}return e},getCustomSummary:()=>N(I.infer_id)?Promise.resolve({langs:[]}):Object(O.n)(),getCustomSmallPayload:()=>N(I.infer_id)?new Promise(e=>{const t=n=>{const r=n.data;"testcase"===(r&&r.name||"")&&"payload"===r.type&&(window.removeEventListener("message",t),r.payload.langs=[],e(r.payload))};window.addEventListener("message",t),y({type:"initialize",name:"testcase"})}):Object(O.n)()};let L;const A=[];async function P(e,t){const{treeUrl:n,templatePath:r,dynamic:i}=Object(p.b)();if(!i||!e.dynamic||!t||C.autoRun||C.infer)return;if(window.CF_UI_COMS||(window.CF_UI_COMS={}),!L){const e=await Object(h.p)(n);L=[...e.partials,...e.standards]}const o=function(e){const t=[],n=[];for(;e.length>0;){const r=[],i=[];e.forEach(e=>{const n=L.find(t=>t.id===e);i.push({file:n.file,id:e}),t.push(e),n.dependencies.forEach(e=>{t.includes(e)||r.push(e)})}),n.unshift(i),e=r}return n}(t);for(const e of o){const t=[];e.forEach(e=>{A.includes(e.id)||(A.push(e.id),t.push(g(r+"/"+e.file,{crossorigin:"anonymous"})))}),await Promise.all(t)}}async function R(e,t,n){const{dynamic:r}=Object(p.b)();if(!r||!e||C.infer||C.autoRun)return;const i=window.CF_UI_COMS[e.id];if(!i)return;!function e(t,n){if(!t)return;const r=(i=t).style?i.style.toString().replace(/\n/g,"").replace(/\s+/," ").replace(/<br>/g,""):"";var i;if(r){if(!document.head.querySelector("#"+n)){const e=document.createElement("style");e.setAttribute("id",n),e.innerText=r,document.head.appendChild(e)}}L.find(e=>e.id===n).dependencies.forEach(t=>{e(window.CF_UI_COMS[t],t)})}(i,e.id);const o={};if(e.params)for(const n of e.params)o[n.name]=await Object(b.f)(n.value,{state:t});return{...e,component:i,param:o}}var M=n(2),D=n(12),U=n(33),B=n(59),q=n(18),F=n(44),V=n(24),z=n(30),$=n(4),H=n(8),X=n(45),G=n(64),K=n(3),J=n(29);let W,Y;let Z,Q;let ee=0,te=-1;function ne(){te=window.setInterval(()=>{ee+=10,W.onprogress(ee),ee>=90&&window.clearInterval(te)},200)}async function re(){if(W&&W.result.name&&W.result.value){let e=0;(Object(p.b)().preview||Object(p.b)().realTimePreview)&&(e=1e3),await Object(O.r)(e);const t=await function(e,t=50){return new Promise(n=>{const r=document.createElement("img"),i=document.createElement("canvas");r.onload=()=>{const o=r.naturalHeight,a=r.naturalWidth;o<=t&&a<=t&&n(e);const c=o/a;let s=0,u=0;o>a?(s=t,u=t/c):(u=t,s=t*c),i.width=u,i.height=s;i.getContext("2d").drawImage(r,0,0,u,s),n(i.toDataURL())},r.src=e})}(W.result.value);W.result.miniValue=t,window.clearInterval(te),ee=0,W.onprogress(100),W.resolve(W.result),W=null,(Q||Z).value=null,document.body.style.pointerEvents="all"}}function ie(e){return W.result.fileName=e.name,W.result.fileType=e.type,0===e.type.indexOf("image/")?(function(e){const t=new FileReader;t.onload=()=>{W.result.value=t.result,W.result.isImage=!0,re()},t.readAsDataURL(e)}(e),Object(O.n)()):function(e){const t=e.name,n=document.createElement("canvas");n.setAttribute("width","64"),n.setAttribute("height","64");const r=n.getContext("2d");r.fillStyle="white",r.fillRect(0,0,64,64),r.fillStyle="black",r.strokeStyle="black",r.font="bold 12px '字体','字体','微软雅黑','宋体'";let i=0;let o=0;let a=10;for(let e=0;e<t.length;e++)i+=r.measureText(t[e]).width,i>50&&(r.fillText(t.substring(o,e),5,a),a+=12,i=0,o=e),e===t.length-1&&r.fillText(t.substring(o,e+1),5,a);return W.result.value=n.toDataURL(),W.result.isImage=!1,re()}(e)}async function oe(e,t){const n=t[0].getNative();if(n)document.body.style.pointerEvents="none",await ie(n),ne();else try{e.removeFile(t[0])}catch(e){console.info(e)}}function ae(e,t,n){return"object"==typeof n&&(n=n.response||"{}"),n=JSON.parse(n),W.result.name=n.res_key,re()}function ce(e,t){const n=t.name.substr(t.name.lastIndexOf(".")).toLowerCase();return"os/client/"+t.id+n}function se(){Q||(Q=document.createElement("input"),Q.setAttribute("type","file"),Q.style.display="none",Q.addEventListener("change",(function(){const e=this.files[0];e&&(document.body.style.pointerEvents="none",ne(),W.result.name=e.name,ie(e))})),document.body.appendChild(Q))}var ue=n(72),le=n(63),fe=n(50),de=n(16),pe=n(75),be=n(73);const he={},me={data:{theme:null,eventHub:H.a}};async function ge(e,t){const n=function(e){return JSON.stringify({...e,x:void 0,y:void 0})}(e),r=he[e.nodeUuid];if(r&&r.raw===n)return Object(O.n)(r.value);{await Object(O.r)();const r=await Object(s.f)({...e,origin:e},t);return he[e.nodeUuid]={value:r,raw:n},r}}const Oe={...G.a,handleNextClick:()=>Object(O.n)(),handlePrevClick:()=>Object(O.n)(),handleCascadeInput(e,t,n,r){const i=Object(z.g)(e,t,n,r);return this.handleOptionInput(e,i,r)},async handleCascadeClick(e,t,n){const r=Object(z.f)(e,t,n);return r?(await Oe.handleOptionClick(r,n),r.result):t.list.filter(e=>e.selected).map(e=>e.text)},async handleMenuClick(e,t){await Oe.handleOptionClick(t.options[e],t);return t.options.filter(e=>e.selected).map(e=>e.text)},async handleOptionClick(e,t){const n=await Object(l.b)(e,t);return await Object(s.d)(t),Object(H.b)(t),n.result},handleOptionAssistInput:(e,t,n)=>(Object(p.g)(n.assistValue,{[t]:e}),Object(O.n)()),handleAutoCpltInput:(e,t,n)=>(Object(u.a)(e,t,n),Object(O.n)()),async handleOptionInput(e,t,n){const r=await Object(u.b)(e,t,n);return await Object(s.d)(n),Object(H.b)(n),r.result},async handleQuestionInput(e,t){const n=Object(d.b)(e,t);return await Object(s.d)(t),Object(H.b)(t),n.result},async handleOptionDrop(e,t,n){const r=Object(f.a)(e,t,n);return await Object(s.d)(n),Object(H.b)(n),r.result},handleLangChange:e=>e.id===xe?Object(O.n)():(xe=e.id,je=!0,_e.globalSetting.language=e.id,Se(_e).then(()=>{})),async handleMaxDiffInput(e,t,n,r){const i=Object(pe.a)(e,t,n,r);return await Object(s.d)(r),Object(H.b)(r),i.result},handleQuickAnswer:e=>Object(ue.b)(e)};let je=!1;const ve={};let we="",ye=null;ve.preview_theme=e=>{Object(J.d)(e.theme),Object(p.g)(me.data,{theme:e.theme}),ye&&H.a.trigger("UPDATE_THEME",e.theme),ye=e.theme};let _e=null,xe="zh_cn";function Te(e){const{globalSetting:t,content:n}=_e,{nodeList:r,variables:i,fullLangStore:o,autoCpltGroups:a}=t;let c=[...r];n.groupNodes?c=[...c,...n.groupNodes]:c.unshift(n);const s=n.group?[n.group]:[],u=o[e];Object(X.c)({nodes:c,groups:s,variables:i},u),Object(X.b)(a,e)}ve.preview_content=e=>(_e=e,Se(e));let ke=!1;async function Se(e){try{await async function(e){const t=Date.now(),{content:n,globalSetting:r,regionList:i}=e;r.language=xe;const{fakedServers:o,templates:a,theme:u}=r;await P(u,a),await Object(fe.b)({fakedServers:o}),await Object(M.g)(r.language),await async function(e){if(ke)return Object(M.e)(e),void Te(e);await Object(O.r)(50),Object(M.e)(e),Te(e),ke=!0}(r.language),je||(Object(F.e)(n),i&&Object(c.d)(i),Object(le.b)(r.embedApis),Object(de.f)({variables:Object(F.d)(r.variables),imageList:r.imageList,varStyles:r.varStyles}));we!==n.nodeUuid&&(window.scrollTo(0,0),we=n.nodeUuid);let l={first(){return this.nodes},eventHub:H.a,context:{},loopStack:[],randomList:[],preview:!0,themeMode:!0,...r,nodeList:r.nodeList.map(e=>(Object(F.c)(e),e)),handleEvents:Oe,nodes:[],theme:me.data.theme};if(await async function(e){let t;e.renderList=[];for(const n of e.nodeList){const r=n,i=await ge(r,e);i.prev=t,t=i,e.renderList.push(i)}}(l),n.noView){const e={...n,quesType:"no-view"};l.nodes=[e]}else if("start"===n.type){let e=[];n.images&&(e=n.images.map(e=>Object(V.b)(e)));const{imgScale:t,imgTransType:r,imgTransTime:i,imgPosition:o,welcomeUrl:a,startName:c,qsnrName:s,logoText:u,startBtnText:f,layout:d}=n;l={...l,imgScale:t,imgTransTime:i,imgTransType:r,imgPosition:o,layout:d,isStart:!0,title:c||s,welcomeUrl:a,images:e,customText:u||"",nextButton:f||Object(M.f)(K.a.global.start)},l.template=await R(n.template,l),l.summary=await Object(b.d)(n.questionText,{state:l}),l.description=await Object(b.d)(n.describe,{state:l})}else if("gift"===n.type){const e=Object(be.a)();l={...l,...n,isGift:!0,rewardName:n.activityName,title:n.blessings,wechatImage:e.headimgurl,wechatID:e.nickname,description:await Object(b.d)(n.describe,{state:l}),icon:"present-gift",quesType:"reward",rewardTime:Object(U.c)(),images:await Object(q.a)({},n),nextButton:n.linkUrl&&(n.endBtnText||Object(M.f)(K.a.global.go))},l.template=await R(n.template,l);const t=n;l.rewardType=t.giftType,"red_envelope"===l.rewardType?l.rewardValue=t.giftCount+" "+Object(M.f)(K.a.reward.yuan):(l.rewardToMessage=!0===t.needSendNote,l.qrCode=!0===t.needVerification?"123456789":"")}else{if(l={...l,progress:50,needProgressBar:r.progressBarRequired,inSingleGroup:null,nextBtnText:r.nextBtnText||Object(M.f)(K.a.global.next),prevBtnText:r.prevBtnText||Object(M.f)(K.a.global.previous)},n.groupNodes){l.inSingleGroup=n.group;const e=[];for(const t of n.groupNodes)Object(F.c)(t),e.push(await Object(s.f)({...t,origin:t},l));l.renderList=[...l.renderList,...e],l.nodes=e.filter(e=>(e.groupSingle=!0,-1===$.x.indexOf(e.type)&&!Object($.w)(e))),l.nodes[0].pageStart=!0,l.nodes[l.nodes.length-1].pageEnd=!0,l.current=l.first()}else{Object(F.c)(n);let e={origin:n,...n};if("lottery"===n.type){l.formalResult={reward:{},gift:{}};const t=await Object(B.b)(l,n,!0);e=await Object(s.e)(e,t,l)}else e=await Object(s.f)(e,l);l.renderList.push(e),l.nodes=[e],l.current=e}l.prevButton=Object(D.h)(l),l.nextButton=await Object(D.f)(l)}l.limitTime&&(l.restTime=Object(U.b)(l.limitTime));window.cfState=l,Object(p.g)(me,{data:l}),console.log("client full time:",Date.now()-t,"node count:",l.nodeList.length),y({name:"done_preview_realtime"}),H.a.trigger("REALTIME_CHANGE")}(e)}catch(e){y({name:"error_realtime_preview",error:e.stack||e.message})}}function Ee(e){if(!e.data)return;const{name:t}=e.data;if(!t||0!==t.indexOf("preview"))return;const n=ve[t];n&&n(e.data)}function Ne(){y({name:"mousedown_preview"})}function Ie(){y({name:"mouseup_preview"})}const Ce={start:"",survey:"/survey",reward:"/reward"};function Le(e,t){const n=Ce[e],r=Ae(e,t),i=Object(p.b)().switchRoute;if(i){let e=r.replace(location.origin,"");e.startsWith("/")||(e="/"+e),i({url:r,route:n,tail:e,params:t})}else location.replace(r)}function Ae(e,t){return location.origin+Object(m.a)(Ce[e],t)}function Pe(e){let t=location.origin+Ce.start+"?"+e.sid;const n=e.key20;return n&&(t=`${t}&key20=${n}`),t}const Re={canHandleReward:()=>"wechat"===a(),getParams:()=>function(e){if(!e.sid){const t=Object.keys(e).find(t=>!e[t]);e.sid=t,delete e[t]}return e}(Object(m.e)(location.search)),gotoStartPage(e){Le("start",e)},gotoSurveyPage(e){Le("survey",e)},getRewardUrl:e=>Ae("reward",e),openWebLink(e){location.replace(e)},reload(){location.reload()}};var Me=n(77),De=n.n(Me);De()();const Ue=new i.a,Be={device:De()(),decodeBase64:e=>atob(e),getReferer:()=>document.referrer,translate(e,t){if(t){return Ue.compile(e)(t)}return e},getLang:()=>(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage).replace(/-/g,"_").toLowerCase()};var qe=n(79);function Fe(e){return e.returnValue="1","1"}function Ve(){window.removeEventListener("beforeunload",Fe)}let ze;function $e(){try{ze.disconnect(),Ve()}catch(e){Object(O.c)("断开socke失败")}}const He={closeSocket:$e,connectSocket:function(e,t){try{ze=new qe.Socket(Object(p.b)().hostConfig.wsHost+"/q/socket",{params:{response_id:e}}),ze.connect(),location.href.match(/:\d+\//)||window.addEventListener("beforeunload",Fe);const n=ze.channel("client:"+t,{});n.on("collector_full",()=>{Object(p.b)().error(Object(h.e)("collector_full")),$e()}),n.join().receive("error",e=>{throw new Error("socket join failed: "+JSON.stringify(e))}).receive("timeout",()=>{throw new Error("socket join timeout")})}catch(e){Object(O.c)("加入socket失败")}},loadFakeFile:function(e,t){return g(function(e){const t=location.href.match(/fake_port=(\d+)/);if(t){let n=e;return["https://public.choiceform.com/fake-request-exploits/dist"].forEach(e=>{n=n.replace(e,"http://localhost:"+t[1])}),n}return e}(e),t)},getFakeHost:function(){return window.CFPlugin},upload:function(e){ee=0;const t=Object(p.b)().preview?Q:Z;return e.accept?t.setAttribute("accept",e.accept):t.removeAttribute("accept"),W={resolve:null,result:{name:"",value:"",miniValue:"",isImage:!1,fileName:"",fileType:""},...e},new Promise(e=>{t.click(),W.resolve=e})},initUploader:async function(e){if(Object(p.b)().preview)return void se();const{nodeList:t}=e;if(!t.some(e=>"upload"===e.type)||Y)return;const n=document.createElement("button");n.id="qn_image_upload",n.style.display="none",document.body.appendChild(n),await g(Object(p.b)().hostConfig.qStaticHost+"/qiniu.min.js",{crossorigin:"anonymous"}),function(){if(Y)return;const e=new window.QiniuJsSDK;Y=e.uploader({key:"imageUploader",runtimes:"html5,flash,html4",browse_button:"qn_image_upload",uptoken_url:Object(p.b)().hostConfig.qApiHost+"/media/uptoken/image",get_new_uptoken:!0,domain:Object(p.b)().hostConfig.cdnHost,max_file_size:"20mb",auto_start:!0,multiple:!1,init:{Init(){Z=document.querySelector(".moxie-shim>input"),Z.removeAttribute("multiple")},FilesAdded:oe,FileUploaded:ae,Key:ce,Error(e,t){"File size error."===t.message&&Object(p.b)().notify(Object(M.f)(K.a.upload.fileSizeLimit,{size:"20mb"}))}}})}()},request:function(e,t){let n=!0;return"GET"===t.type?(t.data&&(e=Object(m.b)(e,t.data)),n=!1):(t.contentType="application/json","object"==typeof t.data&&(t.data=JSON.stringify(t.data))),t.type=t.type||"GET",new Promise((r,i)=>{const o=new XMLHttpRequest;return o.onerror=e=>{i(e)},o.onload=()=>{r({status:o.status,response:o.response})},o.open(t.type,e),t.contentType&&o.setRequestHeader("content-type",t.contentType),t.jwt&&o.setRequestHeader("Authorization","bearer "+t.jwt),o.send(n?t.data:void 0),o})}};function Xe(){window.wxMenuForceShow||window.wx.hideOptionMenu()}function Ge(e){e.noWxShare||window.wx&&(window.wx.showOptionMenu(),window.wxMenuForceShow=!0)}function Ke(e){let t="";const n=e.images[0];return n&&n.url&&(t=n.url),t||Object(p.b)().hostConfig.qStaticHost+"/share.jpg"}async function Je(e){if(e.noWxShare||!Object(p.c)().app.canHandleReward()||!Object(p.b)().useWxSdk)return;const t=Object(m.c)(),n=Object(p.b)().sid,r=e,i=e.wxShareInfo||{sid:n,title:Object(b.k)(r.title),desc:Object(b.k)(r.summary),shareLink:Pe(t),imageUrl:Ke(r)},o=location.href.split("#")[0];!function(e,t){if(!window.wx)return;const{imageUrl:n,desc:r,shareLink:i}=t;let{title:o}=t;""===Object(v.a)(o).trim()&&(o="choiceform");const a=window.wx,{appid:c,timestamp:s,noncestr:u,signature:l}=e;a.config({debug:!1,appId:c,timestamp:s,nonceStr:u,signature:l,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ"]}),a.ready(()=>{a.onMenuShareTimeline({title:o,link:i,imgUrl:n}),a.onMenuShareAppMessage({title:o,desc:r,link:i,imgUrl:n,type:"",dataUrl:""}),a.onMenuShareQQ({title:o,desc:r,link:i,imgUrl:n})}),a.error(e=>{console.info("wx share err",e)})}(await function(e){const t=Object(p.b)().hostConfig.qApiHost+"/wechat/jsapi_sign";return Object(h.p)(t,{type:"GET",data:e})}({url:o}),i)}async function We(e,t=0){try{return Ge(e),window.cfState=e,await Object(O.r)(t),Je(e)}catch(e){Object(O.c)("微信分享初始化失败")}}function Ye(e,t,n,r){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${e}&redirect_uri=${encodeURIComponent(n)}&response_type=code&scope=snsapi_userinfo&state=${r}&component_appid=${t}#wechat_redirect`}let Ze;function Qe(){if(void 0!==Ze)return Ze;try{localStorage.setItem("test","test"),localStorage.removeItem("test")}catch(e){return Ze=!1,!1}return Ze=!0,!0}const et={getItem:e=>decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null,setItem(e,t,n,r,i,o){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;let a="";return n&&(a="number"==typeof n?n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n:"string"==typeof n?"; expires="+n:"; expires="+n.toUTCString()),document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(i?"; domain="+i:"")+(r?"; path="+r:"")+(o?"; secure":""),!0},removeItem(e,t,n){return!(!e||!this.hasItem(e))&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:e=>new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)};function tt(e,t){Qe()?localStorage.setItem(e,t):et.setItem(e,t)}function nt(e){return Qe()?localStorage.getItem(e):et.getItem(e)}const rt={set:tt,get:nt,remove:function(e){Qe()?localStorage.removeItem(e):et.removeItem(e)}},it="cached_meta_before_third_auth";const ot={userInfo:null,retrieveAuthMeta:function(){const{code:e,state:t}=Object(m.c)();if(e){const e=rt.get(it);if(e)return rt.remove(it),JSON.parse(e)}else t&&(Object(p.b)().error(Object(M.f)(K.a.global.authFailed)),rt.remove(it),Object(p.b)().customAbort());return null},async init(e){if(Object(p.b)().preview)return;const{channel:t}=e,{type:n,authorizer_id:r,app_id:i}=t;if(t&&"wechat"===n&&i){const t=Object(m.c)().code;t||(Object(p.b)().error(Object(M.f)(K.a.global.authFailed)),Object(p.b)().customAbort());const n=await function(e){const t=Object(p.b)().hostConfig.qApiHost+"/interviewees";return Object(h.q)(t,{type:"POST",data:e}).catch(e=>{throw Object(h.r)(e),e})}({code:t,authorizer_id:r});e.interviewee=n}},authorizeGift:function(e,t,n){const r=Ye(e,t,Ae("reward",n),"reward");Ve(),location.replace(r)},authorize(e){const{channel:t}=e;if("wechat"===t.type&&t.app_id&&!e.authorized){e.authorized=!0,n=e,rt.set(it,JSON.stringify(n));const{app_id:r,component_appid:i,authorizer_id:o}=t;!function(e,t,n){const r=Ye(e,t,Ae("start",Object(m.c)()),n);Ve(),location.replace(r)}(r,i,o),Object(p.b)().customAbort()}var n}};var at=n(48),ct=n(36),st=n(32);function ut(){const e=JSON.parse((t="session")&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null);var t;return e?e.jwt:""}var lt=n(15),ft=n(17);let dt;async function pt(e){const t=await async function(){if(!dt){const e=await He.request("https://core.choiceform.com/iplist.json",{type:"GET"}),t=JSON.parse(e.response);let n=[];const r=Object.keys(t);r.forEach(e=>{n=n.concat(t[e])}),dt={regionMap:t,fullList:n,keys:r}}return dt}(),n=e.address?e.address.city:"";let r=t.fullList;if(n){const e=t.keys.find(e=>e===n||e.startsWith(n)||n.startsWith(e));e&&(r=t.regionMap[e])}return Object(O.p)(r,1)[0]}function bt(e){const t=1e3*Number(e.minAnswerTime),n=1e3*Number(e.maxAnswerTime);if(t&&n){return Object(O.g)(t,n)}return function(e,t,n){const r=.5,i=t-e,o=n||Object(O.g)(1,99),a=Math.floor(Math.log(1-.5*o/50)/Math.log(r)),c=Math.max(7-a,0),s=o<50?e:Math.round(e+i*r*r**c),u=o>96.875?t:Math.round(e+i*r*r**(c-1));return Object(O.g)(s,u)}(t||1e3,12e5)}async function ht(e){const{infer_collector_id:t,infer_status:n}=Object(m.c)(),r=await Object(lt.b)(e);r.status=n||"test",r.collector_id=Number(t)||void 0;const i=function(){const{infer_time_range:e}=Object(m.c)();if(!e)return null;const t=e.split("-");let n=Number(t[0]),r=Number(t[1]);return n&&r?(n>r&&([n,r]=[r,n]),{start:n,end:r}):null}();if(!i)return r;const{start:o,end:a}=i,c=Object(O.g)(o,a),s=new Date(c).toISOString();r.created_at=s;let u=c;return r.answers.forEach(t=>{const n=Object(ft.c)(e,t);t.start_time=new Date(u).toISOString(),Object($.w)(n)||"end"===n.type?t.cost_time=0:(t.cost_time=bt(n),u+=t.cost_time)}),r.committed_at=new Date(u).toISOString(),r.ip_address=await pt(e),r}let mt=-1,gt=1,Ot=0,jt="",vt=null;let wt={index:0,fullLength:0,percent:0};async function yt(e,t){let n=!0;if(N(jt))n=await async function(e,t){if(S()||!k)return!1;if("END"===e.type||"CHECK_END"===e.type){const e=[k,...T.filter(e=>!e.when&&e!==k)];for(const n of e){n.done=!0;const{options:e,logicType:r}=n.should,i=await Object(w.c)(t,e,r);if(!i.value){const e={target:n.name,logicType:r,matches:i.details.filter(e=>!e.value)};_.push(e)}}if(T=T.filter(e=>!e.done),T.length>0)return k=T[0],!0;if(_.length>0){y({name:"testcase",type:"failed",results:_})}else{y({name:"testcase",type:"success"})}return!1}return y({name:"testcase",type:"error",target:k.name,message:e.message}),!1}(e,t);else{y({name:"infer_worker",type:e.type,data:e.data,message:e.message,round:gt++,id:jt,ended:!0,nodeName:t.current.nodeName})}if(clearTimeout(mt),H.a.off(),n){!function(e){const t=window.CFPlugin.fakedServers;Object.keys(t).filter(e=>{e.endsWith("/__reset_for_infer__")&&t[e]({},Object(p.b)())})}();const e=await Object(ct.b)();await Tt(e)}}async function _t(e,t){if(e.prev.checkMode){let n=e.prev;const r=n?n.nodeName:"";for(;n&&Object($.w)(n);)n=n.prev;return yt({type:"CHECK_END",message:(n?n.nodeName:"")+" => "+r+" :CHECK_END"},t)}if(e.abandonAnswer)return yt({type:"ABANDON",message:"Answer abandoned by: "+e.nodeName},t);{const e=function(e){return e.survey_id=Object(p.b)().sid,{result:e,url:Object(p.b)().hostConfig.host+"/d/v1/responses",jwt:ut()}}(await ht(t));return await async function(e){if(N(jt))return!0;const t=window.CFPlugin.fakedServers;for(const e of Object.keys(t))if(e.endsWith("/__check_for_infer__")){const n=await t[e]({},Object(p.b)());if(n.result)return H.a.trigger("ERROR",{message:"Infer Result Error: "+n.result}),!1}return!0}()?yt({type:"END",data:e},t):void 0}}function xt(e){let t=[...e.nodes],n=0;const r=async()=>{t=[...e.nodes];const i=t[n++];let o=!1;!function(e){const t=Date.now();if(t-Ot>1e3){let n=Object(at.b)(e);-1===n.index?n=wt:wt=n,y({name:"infer_progress",id:jt,progress:n,round:gt}),Ot=t}}(e),i?"end"===i.type?(N(jt)?await yt({type:"END"},e):await _t(i,e),o=!0):(H.a.one("STRETCH_OK",r),await Object(ue.a)(i,vt)):await e.handleEvents.handleNextClick(),o||(clearTimeout(mt),mt=window.setTimeout(()=>{yt({type:"TIMEOUT",message:(e.current&&e.current.nodeName)+":TIMEOUT"},e)},5e3))};return r()}function Tt(e){return H.a.one("NEXT_FAIL",t=>{yt(t,e)}),H.a.one("ERROR",t=>{yt(t,e)}),H.a.on("NEXT_OK",()=>{xt(e)}),xt(e)}async function kt(e){const t=Object(m.c)();if(jt=t.infer_id,jt&&e.preview)return H.a.trigger("START_MEMORY"),N(jt)&&(!function(e=[]){if(T=e.filter(e=>!e.disabled),S()){y({name:"testcase",type:"success"})}else{T=T.sort((e,t)=>!e.when&&t.when?1:-1);for(let e=T.length-1;e>=0;e--){const t=T[e],{when:n,should:r,name:i}=t;if(n&&"or"===n.logicType&&n.options.length>1){const t=n.options.map((e,t)=>({name:`${i}(${t})`,when:{logicType:"and",options:[e]},should:r}));T.splice(e,1,...t)}}k=T[0]}}(e.testCases),vt={beforeInfer:e=>async function(e){if(S()||!k||!k.when)return;x.value={};let t=!1;for(const n of k.when.options)if(n.relatedNodeId===e.nodeUuid){const r=Object(j.b)(e);t||(r.forEach(e=>{x.value[e.uuid]=e.inferList,e.inferList=[]}),t=!0);const i=r.find(e=>e.uuid===n.relatedOptionId),o=await E(n,e.parent);o&&i.inferList.push(o)}x.cached=t}(e),afterInfer:e=>(function(e){if(!x.cached)return;Object(j.b)(e).forEach(e=>{e.inferList=x.value[e.uuid]}),x.cached=!1,x.value={}}(e),Object(O.n)())}),await Object(st.g)(),Tt(e)}let St="",Et=!1;function Nt(){Et=!0}function It(e){const{nodeUuid:t}=e;St===t||Et||(y({name:"locate_preview",nodeUuid:t}),St=t)}function Ct(){C.autoRun||C.infer||!Object(p.b)().preview||(H.a.on("SWITCH_NODE",(e,t)=>{It(t)}),H.a.on("START_MEMORY",Nt),H.a.on("END_MEMORY",(e,t)=>{!function(e){Et=!1,e&&It(e)}(t)}))}var Lt=n(14);let At;function Pt(e){const t=nt("preview_bookmarks_"+e.surveyId);return At=t?JSON.parse(t):[],At}function Rt(e,t){At.some(t=>JSON.stringify(t.result)===JSON.stringify(e.result))?Object(p.b)().notify(Object(M.f)(K.a.previewBookmark.existed)):(At.push(e),tt("preview_bookmarks_"+t.surveyId,JSON.stringify(At)))}function Mt(e,t){Rt(function(e){return{result:Object(Lt.c)(!0),id:Object(O.s)(Object(O.i)()),name:e}}(e||Date.now().toString()),t)}class Dt{constructor(e,t){this.loading=!1,this.progress="",this.nodeList=[],this.bookmarks=[],this.parent=e,this.state=t}loadData(){var e;Object(p.g)(this,{bookmarks:Pt(this.state),nodeList:(e=this.state,e.renderList.filter(e=>e.reached&&!e.readonly))})}async jumpToNode(e){this.loading||(await function(e,t){return Object(H.c)(e),Object(p.g)(t,{current:e}),Object(at.a)(t),t.dynamicStateProps()}(e,this.state),this.parent.close())}applyBookmark(e){if(this.loading)return Object(O.n)();document.body.style.pointerEvents="none",Object(p.b)().notifySuspended=!0,Object(p.g)(this,{loading:!0});const t={onProgress:e=>{this.parent.opened||(this.parent.open(),document.body.style.pointerEvents="none"),Object(p.g)(this,{progress:e})},onEnd:e=>{document.body.style.pointerEvents=null,Object(p.b)().notifySuspended=!1,this.parent.close(),Object(p.g)(this,{loading:!1,progress:""});const t=e.failed?"导入失败":"导入成功";Object(p.b)().notify(t)},onSuspend:()=>{document.body.style.pointerEvents=null,Object(p.b)().notifySuspended=!1,this.parent.close()}};return function(e,t,n){return Object(Lt.g)(t.result,e,n)}(this.state,e,t)}deleteBookmark(e){var t,n;this.loading||(t=e,n=this.state,At=At.filter(e=>e!==t),tt("preview_bookmarks_"+n.surveyId,JSON.stringify(At)),Object(p.g)(this,{bookmarks:Pt(this.state)}))}saveBookmarks(e){this.loading||(Mt(e,this.state),Object(p.g)(this,{bookmarks:Pt(this.state)}))}async uploadBookmark(){var e;this.loading||(await(e=this.state,new Promise(t=>{const n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("accept",".cfbm"),n.onchange=n=>{const r=n.target.files,i=new FileReader;i.onload=()=>{const n=i.result;try{const r=JSON.parse(atob(n));if(!(r.id&&r.name&&r.result))throw new Error("not a valid bookmark");r.id=Object(O.s)(Object(O.i)()),Rt(r,e),t()}catch(e){Object(p.b)().notify(Object(M.f)(K.a.previewBookmark.importFailed)+e.message)}},i.readAsText(r[0])},n.click()})),Object(p.g)(this,{bookmarks:Pt(this.state)}))}downloadBookmark(e){this.loading||(!function(e){const t=btoa(JSON.stringify(e)),n=document.createElement("a"),r=new Blob([t],{type:"octet/stream"}),i=window.URL.createObjectURL(r);n.setAttribute("href",i),n.setAttribute("download",e.name+".cfbm"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e),Object(p.g)(this,{bookmarks:Pt(this.state)}))}}function Ut(e){const t=[],n=[];let r=0;return e.renderList.forEach(e=>{const i=e.costTime;!Object($.w)(e)&&i&&(t.push({ques_id:e.nodeUuid,time:i,inLoop:!!e.loop}),n.push({name:e.nodeName,title:e.title,time:i}),r+=i)}),{postList:t,displayList:n,surveyId:e.surveyId,allTime:r}}class Bt{constructor(e,t){this._submitted=!1,this.parent=e,this.state=t}loadData(){Object(p.g)(this,{timeInfo:Ut(this.state)})}async uploadTime(e){if(this._submitted)return;const t={dev_mode:"https://q.choiceform.com"!==location.origin,items:this.timeInfo.postList,other_info:{}};t.other_info.name=e;const n="https://icon.cform.io/api/v1/surveys/"+this.timeInfo.surveyId+"/preview_stat";try{await Object(h.q)(n,{type:"POST",data:t}),Object(p.b)().notify(Object(M.f)(K.a.previewTime.uploadSuccess)),this._submitted=!0}catch(e){Object(p.b)().notify(Object(M.f)(K.a.previewTime.uploadFailed)),this._submitted=!1}}}class qt{constructor(e){this.bookmark=new Dt(this,e),this.time=new Bt(this,e)}close(){this.opened&&Object(p.g)(this,{opened:!1})}open(){this.opened||Object(p.g)(this,{opened:!0})}handleToggleOpen(){this.bookmark.loading||(Object(p.g)(this,{opened:!this.opened}),this.opened&&(this.bookmark.loadData(),this.time.loadData()))}}const Ft={beforeForceLeave:Ve,onSwitchPage(){window.scrollTo(0,0)},onLangChange(e){document.querySelector("html").setAttribute("lang",e)},onTitleChange(e){document.title=e||"choiceform"},beforeSetupEnd:e=>e.useWxSdk?async function(){await g("https://res.wx.qq.com/open/js/jweixin-1.4.0.js"),void 0===window.WeixinJSBridge?document.addEventListener("WeixinJSBridgeReady",Xe,!1):Xe()}():Object(O.n)(),afterSetup:()=>(Ct(),Object(O.n)()),afterFetchStart:e=>We(e),async afterFetchSurvey(e){var t;await We(e,1e3),await kt(e),await async function(){const e=Object(m.c)().auto_path;if(e){const t="http://localhost:12345/tasks/"+e+".js";await g(t.replace(/tasks\/.+/,"chai.js")),await g(t,{type:"module"})}}(),Object(p.g)(e,{previewTool:(t=e,Object(p.b)().preview?new qt(t):void 0)})},afterFetchReward:e=>We(e)};function Vt(e,t){let n=document.getElementById(t);n||(n=document.createElement("style"),n.setAttribute("id",t),n.style.display="none",document.head.appendChild(n)),n.innerHTML=e}const zt={loadUiTemplates:P,initNodeTemplate:R,setGlobalStyle(e){Vt(e,"global-var-style")},setVarStyle(e){Vt(e,"common-var-style")},getImageSize:e=>e?new Promise(t=>{const n=new Image;n.onload=function(){t({width:this.width,height:this.height})},n.onerror=()=>{t({width:0,height:0})},n.src=e}):Promise.resolve({width:0,height:0})};window.addEventListener("error",e=>{o.EventHub.trigger("ERROR",{message:e.message})}),o.Core.realtime=me,o.Core.initRealtimePreview=()=>{location.href.includes("/themes")&&(se(),y({name:"init_preview"}),document.documentElement.setAttribute("class","ios iphone mobile portrait safari -9"),window.addEventListener("message",Ee),window.addEventListener("mousedown",Ne),window.addEventListener("mouseup",Ie))},o.Core.silentSetter=C.autoRun||C.infer,o.Core.registerEnv({name:a(),dev:C,app:Re,system:Be,network:He,auth:ot,storage:rt,hook:Ft,ui:zt}),o.I18n.MessageFormat=i.a,window.CFClient={I18n:o.I18n,Core:o.Core,EventHub:o.EventHub}}]));
|
|
9
|
+
*/!function(i,o){"use strict";var a="model",c="name",s="type",u="vendor",l="version",f="mobile",d="tablet",p="smarttv",b={extend:function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var n,r,i,o,a,c,s=0;s<t.length&&!a;){var u=t[s],l=t[s+1];for(n=r=0;n<u.length&&!a;)if(a=u[n++].exec(e))for(i=0;i<l.length;i++)c=a[++r],"object"==typeof(o=l[i])&&o.length>0?2==o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:3==o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=c?c.replace(o[1],o[2]):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:4==o.length&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0):this[o]=c||void 0;s+=2}},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(b.has(t[n][r],e))return"?"===n?void 0:n}else if(b.has(t[n],e))return"?"===n?void 0:n;return e}},m={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},g={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[c,l],[/(opios)[\/\s]+([\w\.]+)/i],[[c,"Opera Mini"],l],[/\s(opr)\/([\w\.]+)/i],[[c,"Opera"],l],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[c,l],[/(konqueror)\/([\w\.]+)/i],[[c,"Konqueror"],l],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[c,"IE"],l],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[c,"Edge"],l],[/(yabrowser)\/([\w\.]+)/i],[[c,"Yandex"],l],[/(Avast)\/([\w\.]+)/i],[[c,"Avast Secure Browser"],l],[/(AVG)\/([\w\.]+)/i],[[c,"AVG Secure Browser"],l],[/(puffin)\/([\w\.]+)/i],[[c,"Puffin"],l],[/(focus)\/([\w\.]+)/i],[[c,"Firefox Focus"],l],[/(opt)\/([\w\.]+)/i],[[c,"Opera Touch"],l],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[c,"UCBrowser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],l],[/(windowswechat qbcore)\/([\w\.]+)/i],[[c,"WeChat(Win) Desktop"],l],[/(micromessenger)\/([\w\.]+)/i],[[c,"WeChat"],l],[/(brave)\/([\w\.]+)/i],[[c,"Brave"],l],[/(qqbrowserlite)\/([\w\.]+)/i],[c,l],[/(QQ)\/([\d\.]+)/i],[c,l],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[c,l],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[c,l],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[c,l],[/(MetaSr)[\/\s]?([\w\.]+)/i],[c],[/(LBBROWSER)/i],[c],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[c,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[l,[c,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[c,l],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[c,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[c,/(.+)/,"$1 WebView"],l],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[c,/(.+(?:g|us))(.+)/,"$1 $2"],l],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[l,[c,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[c,"Sailfish Browser"],l],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[c,l],[/(dolfin)\/([\w\.]+)/i],[[c,"Dolphin"],l],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[c,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[c,"Chrome"],l],[/(coast)\/([\w\.]+)/i],[[c,"Opera Coast"],l],[/fxios\/([\w\.-]+)/i],[l,[c,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[l,[c,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[l,c],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[c,"GSA"],l],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[c,[l,h.str,m.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[c,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[c,"Netscape"],l],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[c,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",b.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",b.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",b.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[a,u,[s,d]],[/applecoremedia\/[\w\.]+ \((ipad)/],[a,[u,"Apple"],[s,d]],[/(apple\s{0,1}tv)/i],[[a,"Apple TV"],[u,"Apple"],[s,p]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[u,a,[s,d]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[a,[u,"Amazon"],[s,d]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[a,h.str,m.device.amazon.model],[u,"Amazon"],[s,f]],[/android.+aft([bms])\sbuild/i],[a,[u,"Amazon"],[s,p]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[a,u,[s,f]],[/\((ip[honed|\s\w*]+);/i],[a,[u,"Apple"],[s,f]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[u,a,[s,f]],[/\(bb10;\s(\w+)/i],[a,[u,"BlackBerry"],[s,f]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[a,[u,"Asus"],[s,d]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[u,"Sony"],[a,"Xperia Tablet"],[s,d]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[u,"Sony"],[s,f]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[u,a,[s,"console"]],[/android.+;\s(shield)\sbuild/i],[a,[u,"Nvidia"],[s,"console"]],[/(playstation\s[34portablevi]+)/i],[a,[u,"Sony"],[s,"console"]],[/(sprint\s(\w+))/i],[[u,h.str,m.device.sprint.vendor],[a,h.str,m.device.sprint.model],[s,f]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[u,[a,/_/g," "],[s,f]],[/(nexus\s9)/i],[a,[u,"HTC"],[s,d]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29|ele-l29)/i],[a,[u,"Huawei"],[s,f]],[/android.+(bah2?-a?[lw]\d{2})/i],[a,[u,"Huawei"],[s,d]],[/(microsoft);\s(lumia[\s\w]+)/i],[u,a,[s,f]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[a,[u,"Microsoft"],[s,"console"]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,"Microsoft"],[s,f]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[a,[u,"Motorola"],[s,f]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[u,"Motorola"],[s,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[u,b.trim],[a,b.trim],[s,p]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,"Samsung"],[s,p]],[/\(dtv[\);].+(aquos)/i],[a,[u,"Sharp"],[s,p]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[u,"Samsung"],a,[s,d]],[/smart-tv.+(samsung)/i],[u,[s,p],a],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[u,"Samsung"],a,[s,f]],[/sie-(\w*)/i],[a,[u,"Siemens"],[s,f]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[u,"Nokia"],a,[s,f]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[a,[u,"Acer"],[s,d]],[/android.+([vl]k\-?\d{3})\s+build/i],[a,[u,"LG"],[s,d]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[u,"LG"],a,[s,d]],[/(lg) netcast\.tv/i],[u,a,[s,p]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[a,[u,"LG"],[s,f]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[u,a,[s,d]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[a,[u,"Lenovo"],[s,d]],[/(lenovo)[_\s-]?([\w-]+)/i],[u,a,[s,f]],[/linux;.+((jolla));/i],[u,a,[s,f]],[/((pebble))app\/[\d\.]+\s/i],[u,a,[s,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[u,a,[s,f]],[/crkey/i],[[a,"Chromecast"],[u,"Google"],[s,p]],[/android.+;\s(glass)\s\d/i],[a,[u,"Google"],[s,"wearable"]],[/android.+;\s(pixel c)[\s)]/i],[a,[u,"Google"],[s,d]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[a,[u,"Google"],[s,f]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]?[\w\s]+))\s+build/i],[[a,/_/g," "],[u,"Xiaomi"],[s,f]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]?[\w\s]+))\s+build/i],[[a,/_/g," "],[u,"Xiaomi"],[s,d]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[a,[u,"Meizu"],[s,f]],[/(mz)-([\w-]{2,})/i],[[u,"Meizu"],a,[s,f]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[a,[u,"OnePlus"],[s,f]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[a,[u,"RCA"],[s,d]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[a,[u,"Dell"],[s,d]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[a,[u,"Verizon"],[s,d]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[u,"Barnes & Noble"],a,[s,d]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[a,[u,"NuVision"],[s,d]],[/android.+;\s(k88)\sbuild/i],[a,[u,"ZTE"],[s,d]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[a,[u,"Swiss"],[s,f]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[a,[u,"Swiss"],[s,d]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[a,[u,"Zeki"],[s,d]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[u,"Dragon Touch"],a,[s,d]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[a,[u,"Insignia"],[s,d]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[a,[u,"NextBook"],[s,d]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[u,"Voice"],a,[s,f]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[u,"LvTel"],a,[s,f]],[/android.+;\s(PH-1)\s/i],[a,[u,"Essential"],[s,f]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[a,[u,"Envizen"],[s,d]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[u,a,[s,d]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[a,[u,"MachSpeed"],[s,d]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[u,a,[s,d]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[a,[u,"Rotor"],[s,d]],[/android.+(KS(.+))\s+build/i],[a,[u,"Amazon"],[s,d]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[u,a,[s,d]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[s,b.lowerize],u,a],[/[\s\/\(](smart-?tv)[;\)]/i],[[s,p]],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[u,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[c,l],[/rv\:([\w\.]{1,9}).+(gecko)/i],[l,c]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[c,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[c,[l,h.str,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[c,"Windows"],[l,h.str,m.os.windows.version]],[/\((bb)(10);/i],[[c,"BlackBerry"],l],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[c,l],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[c,"Symbian"],l],[/\((series40);/i],[c],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[c,"Firefox OS"],l],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[c,l],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[c,"Chromium OS"],l],[/(sunos)\s?([\w\.\d]*)/i],[[c,"Solaris"],l],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[c,l],[/(haiku)\s(\w+)/i],[c,l],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[l,/_/g,"."],[c,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[c,"Mac OS"],[l,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[c,l]]},O=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof O))return new O(e,t).getResult();var n=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=t?b.extend(g,t):g;return this.getBrowser=function(){var e={name:void 0,version:void 0};return h.rgx.call(e,n,r.browser),e.major=b.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return h.rgx.call(e,n,r.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return h.rgx.call(e,n,r.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return h.rgx.call(e,n,r.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return h.rgx.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};O.VERSION="0.7.22",O.BROWSER={NAME:c,MAJOR:"major",VERSION:l},O.CPU={ARCHITECTURE:"architecture"},O.DEVICE={MODEL:a,VENDOR:u,TYPE:s,CONSOLE:"console",MOBILE:f,SMARTTV:p,TABLET:d,WEARABLE:"wearable",EMBEDDED:"embedded"},O.ENGINE={NAME:c,VERSION:l},O.OS={NAME:c,VERSION:l},void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=O),t.UAParser=O):void 0===(r=function(){return O}.call(t,n,t,e))||(e.exports=r);var j=i&&(i.jQuery||i.Zepto);if(j&&!j.ua){var v=new O;j.ua=v.getResult(),j.ua.get=function(){return v.getUA()},j.ua.set=function(e){v.setUA(e);var t=v.getResult();for(var n in t)j.ua[n]=t[n]}}}("object"==typeof window?window:this)},,function(e,t,n){var r,i,o;i=[t],void 0===(o="function"==typeof(r=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o="undefined"!=typeof self?self:window,a=0,c=1,s=2,u=3,l="closed",f="errored",d="joined",p="joining",b="leaving",h="phx_close",m="phx_error",g="phx_join",O="phx_reply",j="phx_leave",v=[h,m,g,O,j],w="longpoll",y="websocket",_=function(e){return"function"==typeof e?e:function(){return e}},x=function(){function e(t,n,i,o){r(this,e),this.channel=t,this.event=n,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=o,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}return i(e,[{key:"resend",value:function(e){this.timeout=e,this.reset(),this.send()}},{key:"send",value:function(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}},{key:"receive",value:function(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}},{key:"reset",value:function(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}},{key:"matchReceive",value:function(e){var t=e.status,n=e.response;e.ref,this.recHooks.filter((function(e){return e.status===t})).forEach((function(e){return e.callback(n)}))}},{key:"cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}},{key:"startTimeout",value:function(){var e=this;this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(function(t){e.cancelRefEvent(),e.cancelTimeout(),e.receivedResp=t,e.matchReceive(t)})),this.timeoutTimer=setTimeout((function(){e.trigger("timeout",{})}),this.timeout)}},{key:"hasReceived",value:function(e){return this.receivedResp&&this.receivedResp.status===e}},{key:"trigger",value:function(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}}]),e}(),T=e.Channel=function(){function e(t,n,i){var o=this;r(this,e),this.state=l,this.topic=t,this.params=_(n||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,g,this.params,this.timeout),this.pushBuffer=[],this.rejoinTimer=new N((function(){return o.rejoinUntilConnected()}),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(function(){o.state=d,o.rejoinTimer.reset(),o.pushBuffer.forEach((function(e){return e.send()})),o.pushBuffer=[]})),this.onClose((function(){o.rejoinTimer.reset(),o.socket.log("channel","close "+o.topic+" "+o.joinRef()),o.state=l,o.socket.remove(o)})),this.onError((function(e){o.isLeaving()||o.isClosed()||(o.socket.log("channel","error "+o.topic,e),o.state=f,o.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(function(){o.isJoining()&&(o.socket.log("channel","timeout "+o.topic+" ("+o.joinRef()+")",o.joinPush.timeout),new x(o,j,_({}),o.timeout).send(),o.state=f,o.joinPush.reset(),o.rejoinTimer.scheduleTimeout())})),this.on(O,(function(e,t){o.trigger(o.replyEventName(t),e)}))}return i(e,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"join",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to join multiple times. 'join' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(e),this.joinPush}},{key:"onClose",value:function(e){this.on(h,e)}},{key:"onError",value:function(e){return this.on(m,(function(t){return e(t)}))}},{key:"on",value:function(e,t){var n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}},{key:"off",value:function(e,t){this.bindings=this.bindings.filter((function(n){return!(n.event===e&&(void 0===t||t===n.ref))}))}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '"+e+"' to '"+this.topic+"' before joining. Use channel.join() before pushing events";var r=new x(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}},{key:"leave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=b;var n=function(){e.socket.log("channel","leave "+e.topic),e.trigger(h,"leave")},r=new x(this,j,_({}),t);return r.receive("ok",(function(){return n()})).receive("timeout",(function(){return n()})),r.send(),this.canPush()||r.trigger("ok",{}),r}},{key:"onMessage",value:function(e,t,n){return t}},{key:"isMember",value:function(e,t,n,r){if(this.topic!==e)return!1;var i=v.indexOf(t)>=0;return!r||!i||r===this.joinRef()||(this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1)}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"sendJoin",value:function(e){this.state=p,this.joinPush.resend(e)}},{key:"rejoin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||this.sendJoin(e)}},{key:"trigger",value:function(e,t,n,r){var i=this,o=this.onMessage(e,t,n,r);if(t&&!o)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter((function(t){return t.event===e})).map((function(e){return e.callback(o,n,r||i.joinRef())}))}},{key:"replyEventName",value:function(e){return"chan_reply_"+e}},{key:"isClosed",value:function(){return this.state===l}},{key:"isErrored",value:function(){return this.state===f}},{key:"isJoined",value:function(){return this.state===d}},{key:"isJoining",value:function(){return this.state===p}},{key:"isLeaving",value:function(){return this.state===b}}]),e}(),k={encode:function(e,t){var n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))},decode:function(e,t){var r=JSON.parse(e),i=n(r,5);return t({join_ref:i[0],ref:i[1],topic:i[2],event:i[3],payload:i[4]})}},S=(e.Socket=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=i.timeout||1e4,this.transport=i.transport||o.WebSocket||S,this.defaultEncoder=k.encode,this.defaultDecoder=k.decode,this.transport!==S?(this.encode=i.encode||this.defaultEncoder,this.decode=i.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=i.heartbeatIntervalMs||3e4,this.reconnectAfterMs=i.reconnectAfterMs||function(e){return[1e3,2e3,5e3,1e4][e-1]||1e4},this.logger=i.logger||function(){},this.longpollerTimeout=i.longpollerTimeout||2e4,this.params=_(i.params||{}),this.endPoint=t+"/"+y,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new N((function(){n.teardown((function(){return n.connect()}))}),this.reconnectAfterMs)}return i(e,[{key:"protocol",value:function(){return location.protocol.match(/^https/)?"wss":"ws"}},{key:"endPointURL",value:function(){var e=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:"2.0.0"});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?this.protocol()+":"+e:this.protocol()+"://"+location.host+e}},{key:"disconnect",value:function(e,t,n){this.reconnectTimer.reset(),this.teardown(e,t,n)}},{key:"connect",value:function(e){var t=this;e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=_(e)),this.conn||(this.conn=new this.transport(this.endPointURL()),this.conn.timeout=this.longpollerTimeout,this.conn.onopen=function(){return t.onConnOpen()},this.conn.onerror=function(e){return t.onConnError(e)},this.conn.onmessage=function(e){return t.onConnMessage(e)},this.conn.onclose=function(e){return t.onConnClose(e)})}},{key:"log",value:function(e,t,n){this.logger(e,t,n)}},{key:"onOpen",value:function(e){this.stateChangeCallbacks.open.push(e)}},{key:"onClose",value:function(e){this.stateChangeCallbacks.close.push(e)}},{key:"onError",value:function(e){this.stateChangeCallbacks.error.push(e)}},{key:"onMessage",value:function(e){this.stateChangeCallbacks.message.push(e)}},{key:"onConnOpen",value:function(){var e=this;this.log("transport","connected to "+this.endPointURL()),this.flushSendBuffer(),this.reconnectTimer.reset(),this.conn.skipHeartbeat||(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((function(){return e.sendHeartbeat()}),this.heartbeatIntervalMs)),this.stateChangeCallbacks.open.forEach((function(e){return e()}))}},{key:"teardown",value:function(e,t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n||""):this.conn.close(),this.conn=null),e&&e()}},{key:"onConnClose",value:function(e){this.log("transport","close",e),this.triggerChanError(),clearInterval(this.heartbeatTimer),e&&1e3!==e.code&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((function(t){return t(e)}))}},{key:"onConnError",value:function(e){this.log("transport",e),this.triggerChanError(),this.stateChangeCallbacks.error.forEach((function(t){return t(e)}))}},{key:"triggerChanError",value:function(){this.channels.forEach((function(e){return e.trigger(m)}))}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case a:return"connecting";case c:return"open";case s:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(e){this.channels=this.channels.filter((function(t){return t.joinRef()!==e.joinRef()}))}},{key:"channel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new T(e,t,this);return this.channels.push(n),n}},{key:"push",value:function(e){var t=this,n=e.topic,r=e.event,i=e.payload,o=e.ref,a=e.join_ref,c=function(){t.encode(e,(function(e){t.conn.send(e)}))};this.log("push",n+" "+r+" ("+a+", "+o+")",i),this.isConnected()?c():this.sendBuffer.push(c)}},{key:"makeRef",value:function(){var e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}},{key:"sendHeartbeat",value:function(){if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void this.conn.close(1e3,"hearbeat timeout");this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef})}}},{key:"flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((function(e){return e()})),this.sendBuffer=[])}},{key:"onConnMessage",value:function(e){var t=this;this.decode(e.data,(function(e){var n=e.topic,r=e.event,i=e.payload,o=e.ref,a=e.join_ref;o&&o===t.pendingHeartbeatRef&&(t.pendingHeartbeatRef=null),t.log("receive",(i.status||"")+" "+n+" "+r+" "+(o&&"("+o+")"||""),i),t.channels.filter((function(e){return e.isMember(n,r,i,a)})).forEach((function(e){return e.trigger(r,i,o,a)})),t.stateChangeCallbacks.message.forEach((function(t){return t(e)}))}))}}]),e}(),e.LongPoll=function(){function e(t){r(this,e),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=a,this.poll()}return i(e,[{key:"normalizeEndpoint",value:function(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+y),"$1/"+w)}},{key:"endpointURL",value:function(){return E.appendParams(this.pollEndpoint,{token:this.token})}},{key:"closeAndRetry",value:function(){this.close(),this.readyState=a}},{key:"ontimeout",value:function(){this.onerror("timeout"),this.closeAndRetry()}},{key:"poll",value:function(){var e=this;this.readyState!==c&&this.readyState!==a||E.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(function(t){if(t){var n=t.status,r=t.token,i=t.messages;e.token=r}else n=0;switch(n){case 200:i.forEach((function(t){return e.onmessage({data:t})})),e.poll();break;case 204:e.poll();break;case 410:e.readyState=c,e.onopen(),e.poll();break;case 0:case 500:e.onerror(),e.closeAndRetry();break;default:throw"unhandled poll status "+n}}))}},{key:"send",value:function(e){var t=this;E.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(function(e){e&&200===e.status||(t.onerror(e&&e.status),t.closeAndRetry())}))}},{key:"close",value:function(e,t){this.readyState=u,this.onclose()}}]),e}()),E=e.Ajax=function(){function e(){r(this,e)}return i(e,null,[{key:"request",value:function(e,t,n,r,i,a,c){if(o.XDomainRequest){var s=new XDomainRequest;this.xdomainRequest(s,e,t,r,i,a,c)}else{var u=o.XMLHttpRequest?new o.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.xhrRequest(u,e,t,n,r,i,a,c)}}},{key:"xdomainRequest",value:function(e,t,n,r,i,o,a){var c=this;e.timeout=i,e.open(t,n),e.onload=function(){var t=c.parseJSON(e.responseText);a&&a(t)},o&&(e.ontimeout=o),e.onprogress=function(){},e.send(r)}},{key:"xhrRequest",value:function(e,t,n,r,i,o,a,c){var s=this;e.open(t,n,!0),e.timeout=o,e.setRequestHeader("Content-Type",r),e.onerror=function(){c&&c(null)},e.onreadystatechange=function(){if(e.readyState===s.states.complete&&c){var t=s.parseJSON(e.responseText);c(t)}},a&&(e.ontimeout=a),e.send(i)}},{key:"parseJSON",value:function(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}},{key:"serialize",value:function(e,n){var r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=n?n+"["+i+"]":i,a=e[i];"object"===(void 0===a?"undefined":t(a))?r.push(this.serialize(a,o)):r.push(encodeURIComponent(o)+"="+encodeURIComponent(a))}return r.join("&")}},{key:"appendParams",value:function(e,t){return 0===Object.keys(t).length?e:e+(e.match(/\?/)?"&":"?")+this.serialize(t)}}]),e}();E.states={complete:4},e.Presence=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e);var o=i.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(o.state,(function(t){var r=n.caller,i=r.onJoin,o=r.onLeave,a=r.onSync;n.joinRef=n.channel.joinRef(),n.state=e.syncState(n.state,t,i,o),n.pendingDiffs.forEach((function(t){n.state=e.syncDiff(n.state,t,i,o)})),n.pendingDiffs=[],a()})),this.channel.on(o.diff,(function(t){var r=n.caller,i=r.onJoin,o=r.onLeave,a=r.onSync;n.inPendingSyncState()?n.pendingDiffs.push(t):(n.state=e.syncDiff(n.state,t,i,o),a())}))}return i(e,[{key:"onJoin",value:function(e){this.caller.onJoin=e}},{key:"onLeave",value:function(e){this.caller.onLeave=e}},{key:"onSync",value:function(e){this.caller.onSync=e}},{key:"list",value:function(t){return e.list(this.state,t)}},{key:"inPendingSyncState",value:function(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}}],[{key:"syncState",value:function(e,t,n,r){var i=this,o=this.clone(e),a={},c={};return this.map(o,(function(e,n){t[e]||(c[e]=n)})),this.map(t,(function(e,t){var n=o[e];if(n){var r=t.metas.map((function(e){return e.phx_ref})),s=n.metas.map((function(e){return e.phx_ref})),u=t.metas.filter((function(e){return s.indexOf(e.phx_ref)<0})),l=n.metas.filter((function(e){return r.indexOf(e.phx_ref)<0}));u.length>0&&(a[e]=t,a[e].metas=u),l.length>0&&(c[e]=i.clone(n),c[e].metas=l)}else a[e]=t})),this.syncDiff(o,{joins:a,leaves:c},n,r)}},{key:"syncDiff",value:function(e,t,n,r){var i=t.joins,o=t.leaves,a=this.clone(e);return n||(n=function(){}),r||(r=function(){}),this.map(i,(function(e,t){var r=a[e];if(a[e]=t,r){var i,o=a[e].metas.map((function(e){return e.phx_ref})),c=r.metas.filter((function(e){return o.indexOf(e.phx_ref)<0}));(i=a[e].metas).unshift.apply(i,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(c))}n(e,r,t)})),this.map(o,(function(e,t){var n=a[e];if(n){var i=t.metas.map((function(e){return e.phx_ref}));n.metas=n.metas.filter((function(e){return i.indexOf(e.phx_ref)<0})),r(e,n,t),0===n.metas.length&&delete a[e]}})),a}},{key:"list",value:function(e,t){return t||(t=function(e,t){return t}),this.map(e,(function(e,n){return t(e,n)}))}},{key:"map",value:function(e,t){return Object.getOwnPropertyNames(e).map((function(n){return t(n,e[n])}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}}]),e}();var N=function(){function e(t,n){r(this,e),this.callback=t,this.timerCalc=n,this.timer=null,this.tries=0}return i(e,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var e=this;clearTimeout(this.timer),this.timer=setTimeout((function(){e.tries=e.tries+1,e.callback()}),this.timerCalc(this.tries+1))}}]),e}()})?r.apply(t,i):r)||(e.exports=o)},,,function(e,t,n){"use strict";n.r(t),n.d(t,"I18n",(function(){return o.I18n})),n.d(t,"Core",(function(){return o.Core})),n.d(t,"EventHub",(function(){return o.EventHub}));var r=n(76),i=n.n(r),o=n(53);function a(){return window.navigator.userAgent.toLowerCase().match(/micromessenger/i)?"wechat":"web"}var c=n(43),s=n(19),u=n(56),l=n(28),f=n(74),d=n(58),p=n(0),b=n(5),h=n(9),m=n(10);function g(e,t){return new Promise((n,r)=>{const i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",e),t&&Object.keys(t).forEach(e=>{i.setAttribute(e,t[e])}),i.onload=()=>{n()},i.onerror=t=>{r(new Error("failed to load:"+e))},document.head.appendChild(i)})}var O=n(1),j=n(6),v=n(7),w=n(21);function y(e){window.parent!==window&&window.parent.postMessage(e,"*")}const _=[],x={cached:!1,value:null};let T,k;function S(){return!T||0===T.length}async function E(e,t){const{markId:n}=e;if(13===n||16===n)return{type:"input",candidates:"",active:!0};if(14===n||15===n)return null;if(-1===n||-2===n)return{active:!0,type:"select",weight:-1===n?1:-1};{const r={type:"input",active:!0},{start:i}=await Object(w.e)(e,t);return 6===n||8===n||12===n||2===n?r.candidates="number"==typeof i?Object(v.a)(i-1):i.substring(0,i.length-1):1===n||5===n||11===n||4===n||7===n?r.candidates=Object(v.a)(i+1):3!==n&&9!==n||(r.candidates=Object(v.a)(i)),r}}function N(e){return"testcase"===e}window.CFPlugin=window.CFPlugin||{},window.CFPlugin.fakedServers={};const I=Object(m.e)(location.search),C={local:!!location.origin.match(/:\d+$/),realtime:!("/themes"!==location.pathname),debug:!!I.dev,autoRun:!!I.auto_path,infer:!!I.infer_id,parseRealUrl:function(e){const t=location.href.match(/real_port=(\d+)/);if(t){const n=e.substr(8).match(/\//);if(n){const r=e.substr(8+n.index+1);return`http://localhost:${t[1]}/${r}`}}return e},getCustomSummary:()=>N(I.infer_id)?Promise.resolve({langs:[]}):Object(O.n)(),getCustomSmallPayload:()=>N(I.infer_id)?new Promise(e=>{const t=n=>{const r=n.data;"testcase"===(r&&r.name||"")&&"payload"===r.type&&(window.removeEventListener("message",t),r.payload.langs=[],e(r.payload))};window.addEventListener("message",t),y({type:"initialize",name:"testcase"})}):Object(O.n)()};let L;const A=[];async function P(e,t){const{treeUrl:n,templatePath:r,dynamic:i}=Object(p.b)();if(!i||!e.dynamic||!t||C.autoRun||C.infer)return;if(window.CF_UI_COMS||(window.CF_UI_COMS={}),!L){const e=await Object(h.p)(n);L=[...e.partials,...e.standards]}const o=function(e){const t=[],n=[];for(;e.length>0;){const r=[],i=[];e.forEach(e=>{const n=L.find(t=>t.id===e);i.push({file:n.file,id:e}),t.push(e),n.dependencies.forEach(e=>{t.includes(e)||r.push(e)})}),n.unshift(i),e=r}return n}(t);for(const e of o){const t=[];e.forEach(e=>{A.includes(e.id)||(A.push(e.id),t.push(g(r+"/"+e.file,{crossorigin:"anonymous"})))}),await Promise.all(t)}}async function R(e,t,n){const{dynamic:r}=Object(p.b)();if(!r||!e||C.infer||C.autoRun)return;const i=window.CF_UI_COMS[e.id];if(!i)return;!function e(t,n){if(!t)return;const r=(i=t).style?i.style.toString().replace(/\n/g,"").replace(/\s+/," ").replace(/<br>/g,""):"";var i;if(r){if(!document.head.querySelector("#"+n)){const e=document.createElement("style");e.setAttribute("id",n),e.innerText=r,document.head.appendChild(e)}}L.find(e=>e.id===n).dependencies.forEach(t=>{e(window.CF_UI_COMS[t],t)})}(i,e.id);const o={};if(e.params)for(const n of e.params)o[n.name]=await Object(b.f)(n.value,{state:t});return{...e,component:i,param:o}}var M=n(2),D=n(12),U=n(33),B=n(59),q=n(18),F=n(44),V=n(24),z=n(30),$=n(4),H=n(8),X=n(45),G=n(64),K=n(3),J=n(29);let W,Y;let Z,Q;let ee=0,te=-1;function ne(){te=window.setInterval(()=>{ee+=10,W.onprogress(ee),ee>=90&&window.clearInterval(te)},200)}async function re(){if(W&&W.result.name&&W.result.value){let e=0;(Object(p.b)().preview||Object(p.b)().realTimePreview)&&(e=1e3),await Object(O.r)(e);const t=await function(e,t=50){return new Promise(n=>{const r=document.createElement("img"),i=document.createElement("canvas");r.onload=()=>{const o=r.naturalHeight,a=r.naturalWidth;o<=t&&a<=t&&n(e);const c=o/a;let s=0,u=0;o>a?(s=t,u=t/c):(u=t,s=t*c),i.width=u,i.height=s;i.getContext("2d").drawImage(r,0,0,u,s),n(i.toDataURL())},r.src=e})}(W.result.value);W.result.miniValue=t,window.clearInterval(te),ee=0,W.onprogress(100),W.resolve(W.result),W=null,(Q||Z).value=null,document.body.style.pointerEvents="all"}}function ie(e){return W.result.fileName=e.name,W.result.fileType=e.type,0===e.type.indexOf("image/")?(function(e){const t=new FileReader;t.onload=()=>{W.result.value=t.result,W.result.isImage=!0,re()},t.readAsDataURL(e)}(e),Object(O.n)()):function(e){const t=e.name,n=document.createElement("canvas");n.setAttribute("width","64"),n.setAttribute("height","64");const r=n.getContext("2d");r.fillStyle="white",r.fillRect(0,0,64,64),r.fillStyle="black",r.strokeStyle="black",r.font="bold 12px '字体','字体','微软雅黑','宋体'";let i=0;let o=0;let a=10;for(let e=0;e<t.length;e++)i+=r.measureText(t[e]).width,i>50&&(r.fillText(t.substring(o,e),5,a),a+=12,i=0,o=e),e===t.length-1&&r.fillText(t.substring(o,e+1),5,a);return W.result.value=n.toDataURL(),W.result.isImage=!1,re()}(e)}async function oe(e,t){const n=t[0].getNative();if(n)document.body.style.pointerEvents="none",await ie(n),ne();else try{e.removeFile(t[0])}catch(e){console.info(e)}}function ae(e,t,n){return"object"==typeof n&&(n=n.response||"{}"),n=JSON.parse(n),W.result.name=n.res_key,re()}function ce(e,t){const n=t.name.substr(t.name.lastIndexOf(".")).toLowerCase();return"os/client/"+t.id+n}function se(){Q||(Q=document.createElement("input"),Q.setAttribute("type","file"),Q.style.display="none",Q.addEventListener("change",(function(){const e=this.files[0];e&&(document.body.style.pointerEvents="none",ne(),W.result.name=e.name,ie(e))})),document.body.appendChild(Q))}var ue=n(72),le=n(63),fe=n(50),de=n(16),pe=n(75),be=n(73);const he={},me={data:{theme:null,eventHub:H.a}};async function ge(e,t){const n=function(e){return JSON.stringify({...e,x:void 0,y:void 0})}(e),r=he[e.nodeUuid];if(r&&r.raw===n)return Object(O.n)(r.value);{await Object(O.r)();const r=await Object(s.f)({...e,origin:e},t);return he[e.nodeUuid]={value:r,raw:n},r}}const Oe={...G.a,handleNextClick:()=>Object(O.n)(),handlePrevClick:()=>Object(O.n)(),handleCascadeInput(e,t,n,r){const i=Object(z.g)(e,t,n,r);return this.handleOptionInput(e,i,r)},async handleCascadeClick(e,t,n){const r=Object(z.f)(e,t,n);return r?(await Oe.handleOptionClick(r,n),r.result):t.list.filter(e=>e.selected).map(e=>e.text)},async handleMenuClick(e,t){await Oe.handleOptionClick(t.options[e],t);return t.options.filter(e=>e.selected).map(e=>e.text)},async handleOptionClick(e,t){const n=await Object(l.b)(e,t);return await Object(s.d)(t),Object(H.b)(t),n.result},handleOptionAssistInput:(e,t,n)=>(Object(p.g)(n.assistValue,{[t]:e}),Object(O.n)()),handleAutoCpltInput:(e,t,n)=>(Object(u.a)(e,t,n),Object(O.n)()),async handleOptionInput(e,t,n){const r=await Object(u.b)(e,t,n);return await Object(s.d)(n),Object(H.b)(n),r.result},async handleQuestionInput(e,t){const n=Object(d.b)(e,t);return await Object(s.d)(t),Object(H.b)(t),n.result},async handleOptionDrop(e,t,n){const r=Object(f.a)(e,t,n);return await Object(s.d)(n),Object(H.b)(n),r.result},handleLangChange:e=>e.id===xe?Object(O.n)():(xe=e.id,je=!0,_e.globalSetting.language=e.id,Se(_e).then(()=>{})),async handleMaxDiffInput(e,t,n,r){const i=Object(pe.a)(e,t,n,r);return await Object(s.d)(r),Object(H.b)(r),i.result},handleQuickAnswer:e=>Object(ue.b)(e)};let je=!1;const ve={};let we="",ye=null;ve.preview_theme=e=>{Object(J.d)(e.theme),Object(p.g)(me.data,{theme:e.theme}),ye&&H.a.trigger("UPDATE_THEME",e.theme),ye=e.theme};let _e=null,xe="zh_cn";function Te(e){const{globalSetting:t,content:n}=_e,{nodeList:r,variables:i,fullLangStore:o,autoCpltGroups:a}=t;let c=[...r];n.groupNodes?c=[...c,...n.groupNodes]:c.unshift(n);const s=n.group?[n.group]:[],u=o[e];Object(X.c)({nodes:c,groups:s,variables:i},u),Object(X.b)(a,e)}ve.preview_content=e=>(_e=e,Se(e));let ke=!1;async function Se(e){try{await async function(e){const t=Date.now(),{content:n,globalSetting:r,regionList:i}=e;r.language=xe;const{fakedServers:o,templates:a,theme:u}=r;await P(u,a),await Object(fe.b)({fakedServers:o}),await Object(M.g)(r.language),await async function(e){if(ke)return Object(M.e)(e),void Te(e);await Object(O.r)(50),Object(M.e)(e),Te(e),ke=!0}(r.language),je||(Object(F.e)(n),i&&Object(c.d)(i),Object(le.b)(r.embedApis),Object(de.f)({variables:Object(F.d)(r.variables),imageList:r.imageList,varStyles:r.varStyles}));we!==n.nodeUuid&&(window.scrollTo(0,0),we=n.nodeUuid);let l={first(){return this.nodes},eventHub:H.a,context:{},loopStack:[],randomList:[],preview:!0,themeMode:!0,...r,nodeList:r.nodeList.map(e=>(Object(F.c)(e),e)),handleEvents:Oe,nodes:[],theme:me.data.theme};if(await async function(e){let t;e.renderList=[];for(const n of e.nodeList){const r=n,i=await ge(r,e);i.prev=t,t=i,e.renderList.push(i)}}(l),n.noView){const e={...n,quesType:"no-view"};l.nodes=[e]}else if("start"===n.type){let e=[];n.images&&(e=n.images.map(e=>Object(V.b)(e)));const{imgScale:t,imgTransType:r,imgTransTime:i,imgPosition:o,welcomeUrl:a,startName:c,qsnrName:s,logoText:u,startBtnText:f,layout:d}=n;l={...l,imgScale:t,imgTransTime:i,imgTransType:r,imgPosition:o,layout:d,isStart:!0,title:c||s,welcomeUrl:a,images:e,customText:u||"",nextButton:f||Object(M.f)(K.a.global.start)},l.template=await R(n.template,l),l.summary=await Object(b.d)(n.questionText,{state:l}),l.description=await Object(b.d)(n.describe,{state:l})}else if("gift"===n.type){const e=Object(be.a)();l={...l,...n,isGift:!0,rewardName:n.activityName,title:n.blessings,wechatImage:e.headimgurl,wechatID:e.nickname,description:await Object(b.d)(n.describe,{state:l}),icon:"present-gift",quesType:"reward",rewardTime:Object(U.c)(),images:await Object(q.a)({},n),nextButton:n.linkUrl&&(n.endBtnText||Object(M.f)(K.a.global.go))},l.template=await R(n.template,l);const t=n;l.rewardType=t.giftType,"red_envelope"===l.rewardType?l.rewardValue=t.giftCount+" "+Object(M.f)(K.a.reward.yuan):(l.rewardToMessage=!0===t.needSendNote,l.qrCode=!0===t.needVerification?"123456789":"")}else{if(l={...l,progress:50,needProgressBar:r.progressBarRequired,inSingleGroup:null,nextBtnText:r.nextBtnText||Object(M.f)(K.a.global.next),prevBtnText:r.prevBtnText||Object(M.f)(K.a.global.previous)},n.groupNodes){l.inSingleGroup=n.group;const e=[];for(const t of n.groupNodes)Object(F.c)(t),e.push(await Object(s.f)({...t,origin:t},l));l.renderList=[...l.renderList,...e],l.nodes=e.filter(e=>(e.groupSingle=!0,-1===$.x.indexOf(e.type)&&!Object($.w)(e))),l.nodes[0].pageStart=!0,l.nodes[l.nodes.length-1].pageEnd=!0,l.current=l.first()}else{Object(F.c)(n);let e={origin:n,...n};if("lottery"===n.type){l.formalResult={reward:{},gift:{}};const t=await Object(B.b)(l,n,!0);e=await Object(s.e)(e,t,l)}else e=await Object(s.f)(e,l);l.renderList.push(e),l.nodes=[e],l.current=e}l.prevButton=Object(D.h)(l),l.nextButton=await Object(D.f)(l)}l.limitTime&&(l.restTime=Object(U.b)(l.limitTime));window.cfState=l,Object(p.g)(me,{data:l}),console.log("client full time:",Date.now()-t,"node count:",l.nodeList.length),y({name:"done_preview_realtime"}),H.a.trigger("REALTIME_CHANGE")}(e)}catch(e){y({name:"error_realtime_preview",error:e.stack||e.message})}}function Ee(e){if(!e.data)return;const{name:t}=e.data;if(!t||0!==t.indexOf("preview"))return;const n=ve[t];n&&n(e.data)}function Ne(){y({name:"mousedown_preview"})}function Ie(){y({name:"mouseup_preview"})}const Ce={start:"",survey:"/survey",reward:"/reward"};function Le(e,t){const n=Ce[e],r=Ae(e,t),i=Object(p.b)().switchRoute;if(i){let e=r.replace(location.origin,"");e.startsWith("/")||(e="/"+e),i({url:r,route:n,tail:e,params:t})}else location.replace(r)}function Ae(e,t){return location.origin+Object(m.a)(Ce[e],t)}function Pe(e){let t=location.origin+Ce.start+"?"+e.sid;const n=e.key20;return n&&(t=`${t}&key20=${n}`),t}const Re={canHandleReward:()=>"wechat"===a(),getParams:()=>function(e){if(!e.sid){const t=Object.keys(e).find(t=>!e[t]);e.sid=t,delete e[t]}return e}(Object(m.e)(location.search)),gotoStartPage(e){Le("start",e)},gotoSurveyPage(e){Le("survey",e)},getRewardUrl:e=>Ae("reward",e),openWebLink(e){location.replace(e)},reload(){location.reload()}};var Me=n(77),De=n.n(Me);De()();const Ue=new i.a,Be={device:De()(),decodeBase64:e=>atob(e),getReferer:()=>document.referrer,translate(e,t){if(t){return Ue.compile(e)(t)}return e},getLang:()=>(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage).replace(/-/g,"_").toLowerCase()};var qe=n(79);function Fe(e){return e.returnValue="1","1"}function Ve(){window.removeEventListener("beforeunload",Fe)}let ze;function $e(){try{ze.disconnect(),Ve()}catch(e){Object(O.c)("断开socke失败")}}const He={closeSocket:$e,connectSocket:function(e,t){try{ze=new qe.Socket(Object(p.b)().hostConfig.wsHost+"/q/socket",{params:{response_id:e}}),ze.connect(),location.href.match(/:\d+\//)||window.addEventListener("beforeunload",Fe);const n=ze.channel("client:"+t,{});n.on("collector_full",()=>{Object(p.b)().error(Object(h.e)("collector_full")),$e()}),n.join().receive("error",e=>{throw new Error("socket join failed: "+JSON.stringify(e))}).receive("timeout",()=>{throw new Error("socket join timeout")})}catch(e){Object(O.c)("加入socket失败")}},loadFakeFile:function(e,t){return g(function(e){const t=location.href.match(/fake_port=(\d+)/);if(t){let n=e;return["https://public.choiceform.com/fake-request-exploits/dist"].forEach(e=>{n=n.replace(e,"http://localhost:"+t[1])}),n}return e}(e),t)},getFakeHost:function(){return window.CFPlugin},upload:function(e){ee=0;const t=Object(p.b)().preview?Q:Z;return e.accept?t.setAttribute("accept",e.accept):t.removeAttribute("accept"),W={resolve:null,result:{name:"",value:"",miniValue:"",isImage:!1,fileName:"",fileType:""},...e},new Promise(e=>{t.click(),W.resolve=e})},initUploader:async function(e){if(Object(p.b)().preview)return void se();const{nodeList:t}=e;if(!t.some(e=>"upload"===e.type)||Y)return;const n=document.createElement("button");n.id="qn_image_upload",n.style.display="none",document.body.appendChild(n),await g(Object(p.b)().hostConfig.qStaticHost+"/qiniu.min.js",{crossorigin:"anonymous"}),function(){if(Y)return;const e=new window.QiniuJsSDK;Y=e.uploader({key:"imageUploader",runtimes:"html5,flash,html4",browse_button:"qn_image_upload",uptoken_url:Object(p.b)().hostConfig.qApiHost+"/media/uptoken/image",get_new_uptoken:!0,domain:Object(p.b)().hostConfig.cdnHost,max_file_size:"20mb",auto_start:!0,multiple:!1,init:{Init(){Z=document.querySelector(".moxie-shim>input"),Z.removeAttribute("multiple")},FilesAdded:oe,FileUploaded:ae,Key:ce,Error(e,t){"File size error."===t.message&&Object(p.b)().notify(Object(M.f)(K.a.upload.fileSizeLimit,{size:"20mb"}))}}})}()},request:function(e,t){let n=!0;return"GET"===t.type?(t.data&&(e=Object(m.b)(e,t.data)),n=!1):(t.contentType="application/json","object"==typeof t.data&&(t.data=JSON.stringify(t.data))),t.type=t.type||"GET",new Promise((r,i)=>{const o=new XMLHttpRequest;return o.onerror=e=>{i(e)},o.onload=()=>{r({status:o.status,response:o.response})},o.open(t.type,e),t.contentType&&o.setRequestHeader("content-type",t.contentType),t.jwt&&o.setRequestHeader("Authorization","bearer "+t.jwt),o.send(n?t.data:void 0),o})}};function Xe(){window.wxMenuForceShow||window.wx.hideOptionMenu()}function Ge(e){e.noWxShare||window.wx&&(window.wx.showOptionMenu(),window.wxMenuForceShow=!0)}function Ke(e){let t="";const n=e.images[0];return n&&n.url&&(t=n.url),t||Object(p.b)().hostConfig.qStaticHost+"/share.jpg"}async function Je(e){if(e.noWxShare||!Object(p.c)().app.canHandleReward()||!Object(p.b)().useWxSdk)return;const t=Object(m.c)(),n=Object(p.b)().sid,r=e,i=e.wxShareInfo||{sid:n,title:Object(b.k)(r.title),desc:Object(b.k)(r.summary),shareLink:Pe(t),imageUrl:Ke(r)},o=location.href.split("#")[0];!function(e,t){if(!window.wx)return;const{imageUrl:n,desc:r,shareLink:i}=t;let{title:o}=t;""===Object(v.a)(o).trim()&&(o="choiceform");const a=window.wx,{appid:c,timestamp:s,noncestr:u,signature:l}=e;a.config({debug:!1,appId:c,timestamp:s,nonceStr:u,signature:l,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ"]}),a.ready(()=>{a.onMenuShareTimeline({title:o,link:i,imgUrl:n}),a.onMenuShareAppMessage({title:o,desc:r,link:i,imgUrl:n,type:"",dataUrl:""}),a.onMenuShareQQ({title:o,desc:r,link:i,imgUrl:n})}),a.error(e=>{console.info("wx share err",e)})}(await function(e){const t=Object(p.b)().hostConfig.qApiHost+"/wechat/jsapi_sign";return Object(h.p)(t,{type:"GET",data:e})}({url:o}),i)}async function We(e,t=0){if("wechat"===Object(p.c)().name)try{return Ge(e),window.cfState=e,await Object(O.r)(t),Je(e)}catch(e){Object(O.c)("微信分享初始化失败")}}function Ye(e,t,n,r){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${e}&redirect_uri=${encodeURIComponent(n)}&response_type=code&scope=snsapi_userinfo&state=${r}&component_appid=${t}#wechat_redirect`}let Ze;function Qe(){if(void 0!==Ze)return Ze;try{localStorage.setItem("test","test"),localStorage.removeItem("test")}catch(e){return Ze=!1,!1}return Ze=!0,!0}const et={getItem:e=>decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null,setItem(e,t,n,r,i,o){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;let a="";return n&&(a="number"==typeof n?n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n:"string"==typeof n?"; expires="+n:"; expires="+n.toUTCString()),document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(i?"; domain="+i:"")+(r?"; path="+r:"")+(o?"; secure":""),!0},removeItem(e,t,n){return!(!e||!this.hasItem(e))&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:e=>new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)};function tt(e,t){Qe()?localStorage.setItem(e,t):et.setItem(e,t)}function nt(e){return Qe()?localStorage.getItem(e):et.getItem(e)}const rt={set:tt,get:nt,remove:function(e){Qe()?localStorage.removeItem(e):et.removeItem(e)}},it="cached_meta_before_third_auth";const ot={userInfo:null,retrieveAuthMeta:function(){const{code:e,state:t}=Object(m.c)();if(e){const e=rt.get(it);if(e)return rt.remove(it),JSON.parse(e)}else t&&(Object(p.b)().error(Object(M.f)(K.a.global.authFailed)),rt.remove(it),Object(p.b)().customAbort());return null},async init(e){if(Object(p.b)().preview)return;const{channel:t}=e,{type:n,authorizer_id:r,app_id:i}=t;if(t&&"wechat"===n&&i){const t=Object(m.c)().code;t||(Object(p.b)().error(Object(M.f)(K.a.global.authFailed)),Object(p.b)().customAbort());const n=await function(e){const t=Object(p.b)().hostConfig.qApiHost+"/interviewees";return Object(h.q)(t,{type:"POST",data:e}).catch(e=>{throw Object(h.r)(e),e})}({code:t,authorizer_id:r});e.interviewee=n}},authorizeGift:function(e,t,n){if("wechat"!==Object(p.c)().name)return;const r=Ye(e,t,Ae("reward",n),"reward");Ve(),location.replace(r)},authorize(e){const{channel:t}=e;if("wechat"===t.type&&t.app_id&&!e.authorized){e.authorized=!0,n=e,rt.set(it,JSON.stringify(n));const{app_id:r,component_appid:i,authorizer_id:o}=t;!function(e,t,n){if("wechat"!==Object(p.c)().name)return;const r=Ye(e,t,Ae("start",Object(m.c)()),n);Ve(),location.replace(r)}(r,i,o),Object(p.b)().customAbort()}var n}};var at=n(48),ct=n(36),st=n(32);function ut(){const e=JSON.parse((t="session")&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null);var t;return e?e.jwt:""}var lt=n(15),ft=n(17);let dt;async function pt(e){const t=await async function(){if(!dt){const e=await He.request("https://core.choiceform.com/iplist.json",{type:"GET"}),t=JSON.parse(e.response);let n=[];const r=Object.keys(t);r.forEach(e=>{n=n.concat(t[e])}),dt={regionMap:t,fullList:n,keys:r}}return dt}(),n=e.address?e.address.city:"";let r=t.fullList;if(n){const e=t.keys.find(e=>e===n||e.startsWith(n)||n.startsWith(e));e&&(r=t.regionMap[e])}return Object(O.p)(r,1)[0]}function bt(e){const t=1e3*Number(e.minAnswerTime),n=1e3*Number(e.maxAnswerTime);if(t&&n){return Object(O.g)(t,n)}return function(e,t,n){const r=.5,i=t-e,o=n||Object(O.g)(1,99),a=Math.floor(Math.log(1-.5*o/50)/Math.log(r)),c=Math.max(7-a,0),s=o<50?e:Math.round(e+i*r*r**c),u=o>96.875?t:Math.round(e+i*r*r**(c-1));return Object(O.g)(s,u)}(t||1e3,12e5)}async function ht(e){const{infer_collector_id:t,infer_status:n}=Object(m.c)(),r=await Object(lt.b)(e);r.status=n||"test",r.collector_id=Number(t)||void 0;const i=function(){const{infer_time_range:e}=Object(m.c)();if(!e)return null;const t=e.split("-");let n=Number(t[0]),r=Number(t[1]);return n&&r?(n>r&&([n,r]=[r,n]),{start:n,end:r}):null}();if(!i)return r;const{start:o,end:a}=i,c=Object(O.g)(o,a),s=new Date(c).toISOString();r.created_at=s;let u=c;return r.answers.forEach(t=>{const n=Object(ft.c)(e,t);t.start_time=new Date(u).toISOString(),Object($.w)(n)||"end"===n.type?t.cost_time=0:(t.cost_time=bt(n),u+=t.cost_time)}),r.committed_at=new Date(u).toISOString(),r.ip_address=await pt(e),r}let mt=-1,gt=1,Ot=0,jt="",vt=null;let wt={index:0,fullLength:0,percent:0};async function yt(e,t){let n=!0;if(N(jt))n=await async function(e,t){if(S()||!k)return!1;if("END"===e.type||"CHECK_END"===e.type){const e=[k,...T.filter(e=>!e.when&&e!==k)];for(const n of e){n.done=!0;const{options:e,logicType:r}=n.should,i=await Object(w.c)(t,e,r);if(!i.value){const e={target:n.name,logicType:r,matches:i.details.filter(e=>!e.value)};_.push(e)}}if(T=T.filter(e=>!e.done),T.length>0)return k=T[0],!0;if(_.length>0){y({name:"testcase",type:"failed",results:_})}else{y({name:"testcase",type:"success"})}return!1}return y({name:"testcase",type:"error",target:k.name,message:e.message}),!1}(e,t);else{y({name:"infer_worker",type:e.type,data:e.data,message:e.message,round:gt++,id:jt,ended:!0,nodeName:t.current.nodeName})}if(clearTimeout(mt),H.a.off(),n){!function(e){const t=window.CFPlugin.fakedServers;Object.keys(t).filter(e=>{e.endsWith("/__reset_for_infer__")&&t[e]({},Object(p.b)())})}();const e=await Object(ct.b)();await Tt(e)}}async function _t(e,t){if(e.prev.checkMode){let n=e.prev;const r=n?n.nodeName:"";for(;n&&Object($.w)(n);)n=n.prev;return yt({type:"CHECK_END",message:(n?n.nodeName:"")+" => "+r+" :CHECK_END"},t)}if(e.abandonAnswer)return yt({type:"ABANDON",message:"Answer abandoned by: "+e.nodeName},t);{const e=function(e){return e.survey_id=Object(p.b)().sid,{result:e,url:Object(p.b)().hostConfig.host+"/d/v1/responses",jwt:ut()}}(await ht(t));return await async function(e){if(N(jt))return!0;const t=window.CFPlugin.fakedServers;for(const e of Object.keys(t))if(e.endsWith("/__check_for_infer__")){const n=await t[e]({},Object(p.b)());if(n.result)return H.a.trigger("ERROR",{message:"Infer Result Error: "+n.result}),!1}return!0}()?yt({type:"END",data:e},t):void 0}}function xt(e){let t=[...e.nodes],n=0;const r=async()=>{t=[...e.nodes];const i=t[n++];let o=!1;!function(e){const t=Date.now();if(t-Ot>1e3){let n=Object(at.b)(e);-1===n.index?n=wt:wt=n,y({name:"infer_progress",id:jt,progress:n,round:gt}),Ot=t}}(e),i?"end"===i.type?(N(jt)?await yt({type:"END"},e):await _t(i,e),o=!0):(H.a.one("STRETCH_OK",r),await Object(ue.a)(i,vt)):await e.handleEvents.handleNextClick(),o||(clearTimeout(mt),mt=window.setTimeout(()=>{yt({type:"TIMEOUT",message:(e.current&&e.current.nodeName)+":TIMEOUT"},e)},5e3))};return r()}function Tt(e){return H.a.one("NEXT_FAIL",t=>{yt(t,e)}),H.a.one("ERROR",t=>{yt(t,e)}),H.a.on("NEXT_OK",()=>{xt(e)}),xt(e)}async function kt(e){const t=Object(m.c)();if(jt=t.infer_id,jt&&e.preview)return H.a.trigger("START_MEMORY"),N(jt)&&(!function(e=[]){if(T=e.filter(e=>!e.disabled),S()){y({name:"testcase",type:"success"})}else{T=T.sort((e,t)=>!e.when&&t.when?1:-1);for(let e=T.length-1;e>=0;e--){const t=T[e],{when:n,should:r,name:i}=t;if(n&&"or"===n.logicType&&n.options.length>1){const t=n.options.map((e,t)=>({name:`${i}(${t})`,when:{logicType:"and",options:[e]},should:r}));T.splice(e,1,...t)}}k=T[0]}}(e.testCases),vt={beforeInfer:e=>async function(e){if(S()||!k||!k.when)return;x.value={};let t=!1;for(const n of k.when.options)if(n.relatedNodeId===e.nodeUuid){const r=Object(j.b)(e);t||(r.forEach(e=>{x.value[e.uuid]=e.inferList,e.inferList=[]}),t=!0);const i=r.find(e=>e.uuid===n.relatedOptionId),o=await E(n,e.parent);o&&i.inferList.push(o)}x.cached=t}(e),afterInfer:e=>(function(e){if(!x.cached)return;Object(j.b)(e).forEach(e=>{e.inferList=x.value[e.uuid]}),x.cached=!1,x.value={}}(e),Object(O.n)())}),await Object(st.g)(),Tt(e)}let St="",Et=!1;function Nt(){Et=!0}function It(e){const{nodeUuid:t}=e;St===t||Et||(y({name:"locate_preview",nodeUuid:t}),St=t)}function Ct(){C.autoRun||C.infer||!Object(p.b)().preview||(H.a.on("SWITCH_NODE",(e,t)=>{It(t)}),H.a.on("START_MEMORY",Nt),H.a.on("END_MEMORY",(e,t)=>{!function(e){Et=!1,e&&It(e)}(t)}))}var Lt=n(14);let At;function Pt(e){const t=nt("preview_bookmarks_"+e.surveyId);return At=t?JSON.parse(t):[],At}function Rt(e,t){At.some(t=>JSON.stringify(t.result)===JSON.stringify(e.result))?Object(p.b)().notify(Object(M.f)(K.a.previewBookmark.existed)):(At.push(e),tt("preview_bookmarks_"+t.surveyId,JSON.stringify(At)))}function Mt(e,t){Rt(function(e){return{result:Object(Lt.c)(!0),id:Object(O.s)(Object(O.i)()),name:e}}(e||Date.now().toString()),t)}class Dt{constructor(e,t){this.loading=!1,this.progress="",this.nodeList=[],this.bookmarks=[],this.parent=e,this.state=t}loadData(){var e;Object(p.g)(this,{bookmarks:Pt(this.state),nodeList:(e=this.state,e.renderList.filter(e=>e.reached&&!e.readonly))})}async jumpToNode(e){this.loading||(await function(e,t){return Object(H.c)(e),Object(p.g)(t,{current:e}),Object(at.a)(t),t.dynamicStateProps()}(e,this.state),this.parent.close())}applyBookmark(e){if(this.loading)return Object(O.n)();document.body.style.pointerEvents="none",Object(p.b)().notifySuspended=!0,Object(p.g)(this,{loading:!0});const t={onProgress:e=>{this.parent.opened||(this.parent.open(),document.body.style.pointerEvents="none"),Object(p.g)(this,{progress:e})},onEnd:e=>{document.body.style.pointerEvents=null,Object(p.b)().notifySuspended=!1,this.parent.close(),Object(p.g)(this,{loading:!1,progress:""});const t=e.failed?"导入失败":"导入成功";Object(p.b)().notify(t)},onSuspend:()=>{document.body.style.pointerEvents=null,Object(p.b)().notifySuspended=!1,this.parent.close()}};return function(e,t,n){return Object(Lt.g)(t.result,e,n)}(this.state,e,t)}deleteBookmark(e){var t,n;this.loading||(t=e,n=this.state,At=At.filter(e=>e!==t),tt("preview_bookmarks_"+n.surveyId,JSON.stringify(At)),Object(p.g)(this,{bookmarks:Pt(this.state)}))}saveBookmarks(e){this.loading||(Mt(e,this.state),Object(p.g)(this,{bookmarks:Pt(this.state)}))}async uploadBookmark(){var e;this.loading||(await(e=this.state,new Promise(t=>{const n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("accept",".cfbm"),n.onchange=n=>{const r=n.target.files,i=new FileReader;i.onload=()=>{const n=i.result;try{const r=JSON.parse(atob(n));if(!(r.id&&r.name&&r.result))throw new Error("not a valid bookmark");r.id=Object(O.s)(Object(O.i)()),Rt(r,e),t()}catch(e){Object(p.b)().notify(Object(M.f)(K.a.previewBookmark.importFailed)+e.message)}},i.readAsText(r[0])},n.click()})),Object(p.g)(this,{bookmarks:Pt(this.state)}))}downloadBookmark(e){this.loading||(!function(e){const t=btoa(JSON.stringify(e)),n=document.createElement("a"),r=new Blob([t],{type:"octet/stream"}),i=window.URL.createObjectURL(r);n.setAttribute("href",i),n.setAttribute("download",e.name+".cfbm"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e),Object(p.g)(this,{bookmarks:Pt(this.state)}))}}function Ut(e){const t=[],n=[];let r=0;return e.renderList.forEach(e=>{const i=e.costTime;!Object($.w)(e)&&i&&(t.push({ques_id:e.nodeUuid,time:i,inLoop:!!e.loop}),n.push({name:e.nodeName,title:e.title,time:i}),r+=i)}),{postList:t,displayList:n,surveyId:e.surveyId,allTime:r}}class Bt{constructor(e,t){this._submitted=!1,this.parent=e,this.state=t}loadData(){Object(p.g)(this,{timeInfo:Ut(this.state)})}async uploadTime(e){if(this._submitted)return;const t={dev_mode:"https://q.choiceform.com"!==location.origin,items:this.timeInfo.postList,other_info:{}};t.other_info.name=e;const n="https://icon.cform.io/api/v1/surveys/"+this.timeInfo.surveyId+"/preview_stat";try{await Object(h.q)(n,{type:"POST",data:t}),Object(p.b)().notify(Object(M.f)(K.a.previewTime.uploadSuccess)),this._submitted=!0}catch(e){Object(p.b)().notify(Object(M.f)(K.a.previewTime.uploadFailed)),this._submitted=!1}}}class qt{constructor(e){this.bookmark=new Dt(this,e),this.time=new Bt(this,e)}close(){this.opened&&Object(p.g)(this,{opened:!1})}open(){this.opened||Object(p.g)(this,{opened:!0})}handleToggleOpen(){this.bookmark.loading||(Object(p.g)(this,{opened:!this.opened}),this.opened&&(this.bookmark.loadData(),this.time.loadData()))}}const Ft={beforeForceLeave:Ve,onSwitchPage(){window.scrollTo(0,0)},onLangChange(e){document.querySelector("html").setAttribute("lang",e)},onTitleChange(e){document.title=e||"choiceform"},beforeSetupEnd:e=>e.useWxSdk?async function(){if("wechat"===Object(p.c)().name){try{await g("https://res.wx.qq.com/open/js/jweixin-1.4.0.js")}catch(e){return}void 0===window.WeixinJSBridge?document.addEventListener("WeixinJSBridgeReady",Xe,!1):Xe()}}():Object(O.n)(),afterSetup:()=>(Ct(),Object(O.n)()),afterFetchStart:e=>We(e),async afterFetchSurvey(e){var t;await We(e,1e3),await kt(e),await async function(){const e=Object(m.c)().auto_path;if(e){const t="http://localhost:12345/tasks/"+e+".js";await g(t.replace(/tasks\/.+/,"chai.js")),await g(t,{type:"module"})}}(),Object(p.g)(e,{previewTool:(t=e,Object(p.b)().preview?new qt(t):void 0)})},afterFetchReward:e=>We(e)};function Vt(e,t){let n=document.getElementById(t);n||(n=document.createElement("style"),n.setAttribute("id",t),n.style.display="none",document.head.appendChild(n)),n.innerHTML=e}const zt={loadUiTemplates:P,initNodeTemplate:R,setGlobalStyle(e){Vt(e,"global-var-style")},setVarStyle(e){Vt(e,"common-var-style")},getImageSize:e=>e?new Promise(t=>{const n=new Image;n.onload=function(){t({width:this.width,height:this.height})},n.onerror=()=>{t({width:0,height:0})},n.src=e}):Promise.resolve({width:0,height:0})};window.addEventListener("error",e=>{o.EventHub.trigger("ERROR",{message:e.message})}),o.Core.realtime=me,o.Core.initRealtimePreview=()=>{location.href.includes("/themes")&&(se(),y({name:"init_preview"}),document.documentElement.setAttribute("class","ios iphone mobile portrait safari -9"),window.addEventListener("message",Ee),window.addEventListener("mousedown",Ne),window.addEventListener("mouseup",Ie))},o.Core.silentSetter=C.autoRun||C.infer,o.Core.registerEnv({name:a(),dev:C,app:Re,system:Be,network:He,auth:ot,storage:rt,hook:Ft,ui:zt}),o.I18n.MessageFormat=i.a,window.CFClient={I18n:o.I18n,Core:o.Core,EventHub:o.EventHub}}]));
|